Version Description
- Tweak: Added Returning Visitor option in Display Conditions.
- Tweak: Size option improved in Lottie Animation widget.
- Tweak: Improved Time Range Display Condition to get the current timezone properly.
- Tweak: Get the absolute value of product sale using [sale] keyword in WooCommerce Products Listing widget.
- Fixed: Load More button not working for Skin #10 in WooCommerce Products Listing widget.
- Fixed: ACF Text not detecting empty value in Display Conditions addon.
- Fixed: Countdown widget not properly on Safari browser.
Download this release
Release Info
Developer | leap13 |
Plugin | Premium Addons for Elementor |
Version | 4.9.21 |
Comparing to | |
See all releases |
Code changes from version 4.9.20 to 4.9.21
- admin/assets/css/admin-rtl.css +4 -0
- admin/assets/css/admin.css +4 -0
- assets/editor/templates/js/editor.js +43 -33
- assets/frontend/css/premium-addons-rtl.css +467 -455
- assets/frontend/css/premium-addons.css +13 -4
- assets/frontend/css/premium-img-gallery-rtl.css +456 -452
- assets/frontend/css/premium-img-gallery.css +4 -2
- assets/frontend/css/premium-nav-menu-rtl.css +11 -3
- assets/frontend/css/premium-nav-menu.css +9 -2
- assets/frontend/js/lottie.js +6939 -15581
admin/assets/css/admin-rtl.css
CHANGED
@@ -2251,6 +2251,10 @@
|
|
2251 |
max-width: 400px;
|
2252 |
}
|
2253 |
|
|
|
|
|
|
|
|
|
2254 |
.premium-setting-container {
|
2255 |
-js-display: flex;
|
2256 |
display: -webkit-box;
|
2251 |
max-width: 400px;
|
2252 |
}
|
2253 |
|
2254 |
+
#elementor-template-nav-menu-modal-container.dialog-type-lightbox {
|
2255 |
+
z-index: 100000;
|
2256 |
+
}
|
2257 |
+
|
2258 |
.premium-setting-container {
|
2259 |
-js-display: flex;
|
2260 |
display: -webkit-box;
|
admin/assets/css/admin.css
CHANGED
@@ -2510,4 +2510,8 @@
|
|
2510 |
border: 1px solid #dcdcdc;
|
2511 |
-webkit-border-radius: 0;
|
2512 |
border-radius: 0;
|
|
|
|
|
|
|
|
|
2513 |
}
|
2510 |
border: 1px solid #dcdcdc;
|
2511 |
-webkit-border-radius: 0;
|
2512 |
border-radius: 0;
|
2513 |
+
}
|
2514 |
+
|
2515 |
+
#elementor-template-nav-menu-modal-container.dialog-type-lightbox {
|
2516 |
+
z-index: 100000;
|
2517 |
}
|
assets/editor/templates/js/editor.js
CHANGED
@@ -233,7 +233,7 @@
|
|
233 |
options = {},
|
234 |
insertMedia = !$(event.currentTarget).hasClass("premium-template-insert-no-media");
|
235 |
|
236 |
-
console.log(insertMedia);
|
237 |
|
238 |
PremiumEditor.layout.showLoadingView();
|
239 |
if (innerTemplatesLength > 0) {
|
@@ -273,7 +273,6 @@
|
|
273 |
|
274 |
PremiumEditor.closeModal();
|
275 |
|
276 |
-
console.log(data.content);
|
277 |
elementor.channels.data.trigger('template:before:insert', templateModel);
|
278 |
|
279 |
if (null !== PremiumEditor.atIndex) {
|
@@ -834,6 +833,10 @@
|
|
834 |
|
835 |
init: function () {
|
836 |
|
|
|
|
|
|
|
|
|
837 |
window.elementor.on(
|
838 |
'document:loaded',
|
839 |
window._.bind(PremiumEditor.onPreviewLoaded, PremiumEditor)
|
@@ -847,8 +850,6 @@
|
|
847 |
|
848 |
onPreviewLoaded: function () {
|
849 |
|
850 |
-
this.initPremTempsButton();
|
851 |
-
|
852 |
window.elementor.$previewContents.on(
|
853 |
'click.addPremiumTemplate',
|
854 |
'.pa-add-section-btn',
|
@@ -868,40 +869,49 @@
|
|
868 |
|
869 |
initPremTempsButton: function () {
|
870 |
|
871 |
-
var
|
872 |
-
|
873 |
-
$addPremiumTemplate;
|
874 |
|
875 |
-
if (
|
876 |
-
|
877 |
-
}
|
878 |
|
879 |
-
|
880 |
-
'click.addPremiumTemplate',
|
881 |
-
'.elementor-editor-section-settings .elementor-editor-element-add',
|
882 |
-
function () {
|
883 |
|
884 |
-
|
885 |
-
$section = $this.closest('.elementor-top-section'),
|
886 |
-
modelID = $section.data('model-cid');
|
887 |
|
888 |
-
|
889 |
-
$.each(elementor.previewView.collection.models, function (index, model) {
|
890 |
-
if (modelID === model.cid) {
|
891 |
-
PremiumEditor.atIndex = index;
|
892 |
-
}
|
893 |
-
});
|
894 |
-
}
|
895 |
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
$addNew.prepend(addPremiumTemplate);
|
900 |
-
}, 100);
|
901 |
-
}
|
902 |
|
903 |
-
|
904 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
905 |
|
906 |
},
|
907 |
|
@@ -1005,7 +1015,7 @@
|
|
1005 |
},
|
1006 |
success: function (response) {
|
1007 |
|
1008 |
-
console.log("%cTemplates Retrieved Successfully!!", "color: #7a7a7a; background-color: #eee;");
|
1009 |
|
1010 |
var templates = new PremiumEditorViews.LibraryCollection(response.data.templates),
|
1011 |
categories = new PremiumEditorViews.CategoriesCollection(response.data.categories);
|
233 |
options = {},
|
234 |
insertMedia = !$(event.currentTarget).hasClass("premium-template-insert-no-media");
|
235 |
|
236 |
+
// console.log(insertMedia);
|
237 |
|
238 |
PremiumEditor.layout.showLoadingView();
|
239 |
if (innerTemplatesLength > 0) {
|
273 |
|
274 |
PremiumEditor.closeModal();
|
275 |
|
|
|
276 |
elementor.channels.data.trigger('template:before:insert', templateModel);
|
277 |
|
278 |
if (null !== PremiumEditor.atIndex) {
|
833 |
|
834 |
init: function () {
|
835 |
|
836 |
+
$(document).ready(function () {
|
837 |
+
PremiumEditor.initPremTempsButton();
|
838 |
+
});
|
839 |
+
|
840 |
window.elementor.on(
|
841 |
'document:loaded',
|
842 |
window._.bind(PremiumEditor.onPreviewLoaded, PremiumEditor)
|
850 |
|
851 |
onPreviewLoaded: function () {
|
852 |
|
|
|
|
|
853 |
window.elementor.$previewContents.on(
|
854 |
'click.addPremiumTemplate',
|
855 |
'.pa-add-section-btn',
|
869 |
|
870 |
initPremTempsButton: function () {
|
871 |
|
872 |
+
var addPremiumTemplate = '<div class="elementor-add-section-area-button pa-add-section-btn" title="Add Premium Template"><i class="eicon-star"></i></div>',
|
873 |
+
addSectionTmpl = $("#tmpl-elementor-add-section");
|
|
|
874 |
|
875 |
+
if (addSectionTmpl.length < 1)
|
876 |
+
return;
|
|
|
877 |
|
878 |
+
var addSectionTmplHTML = addSectionTmpl.html();
|
|
|
|
|
|
|
879 |
|
880 |
+
addSectionTmplHTML = addSectionTmplHTML.replace('<div class="elementor-add-section-area-button', addPremiumTemplate + '<div class="elementor-add-section-area-button');
|
|
|
|
|
881 |
|
882 |
+
addSectionTmpl.html(addSectionTmplHTML);
|
|
|
|
|
|
|
|
|
|
|
|
|
883 |
|
884 |
+
// if ($addNewSection.length && PremiumTempsData.PremiumTemplatesBtn) {
|
885 |
+
// $addPremiumTemplate = $(addPremiumTemplate).prependTo($addNewSection);
|
886 |
+
// }
|
|
|
|
|
|
|
887 |
|
888 |
+
|
889 |
+
// window.elementor.$previewContents.on(
|
890 |
+
// 'click.addPremiumTemplate',
|
891 |
+
// '.elementor-editor-section-settings .elementor-editor-element-add',
|
892 |
+
// function () {
|
893 |
+
|
894 |
+
// var $this = $(this),
|
895 |
+
// $section = $this.closest('.elementor-top-section'),
|
896 |
+
// modelID = $section.data('model-cid');
|
897 |
+
|
898 |
+
// if (elementor.previewView.collection.length) {
|
899 |
+
// $.each(elementor.previewView.collection.models, function (index, model) {
|
900 |
+
// if (modelID === model.cid) {
|
901 |
+
// PremiumEditor.atIndex = index;
|
902 |
+
// }
|
903 |
+
// });
|
904 |
+
// }
|
905 |
+
|
906 |
+
// if (PremiumTempsData.PremiumTemplatesBtn) {
|
907 |
+
// setTimeout(function () {
|
908 |
+
// var $addNew = $section.prev('.elementor-add-section').find('.elementor-add-new-section');
|
909 |
+
// $addNew.prepend(addPremiumTemplate);
|
910 |
+
// }, 100);
|
911 |
+
// }
|
912 |
+
|
913 |
+
// }
|
914 |
+
// );
|
915 |
|
916 |
},
|
917 |
|
1015 |
},
|
1016 |
success: function (response) {
|
1017 |
|
1018 |
+
console.log("% cTemplates Retrieved Successfully!!", "color: #7a7a7a; background - color: #eee; ");
|
1019 |
|
1020 |
var templates = new PremiumEditorViews.LibraryCollection(response.data.templates),
|
1021 |
categories = new PremiumEditorViews.CategoriesCollection(response.data.categories);
|
assets/frontend/css/premium-addons-rtl.css
CHANGED
@@ -4879,458 +4879,462 @@ a.premium-image-separator-link:active {
|
|
4879 |
-webkit-transition: all 0.3s ease-in-out;
|
4880 |
transition: all 0.3s ease-in-out;
|
4881 |
}
|
4882 |
-
/******** Premium Media Grid ********/
|
4883 |
-
/************************************/
|
4884 |
-
.premium-img-gallery-filter,
|
4885 |
-
.premium-blog-filter {
|
4886 |
-
display: -webkit-box;
|
4887 |
-
display: -webkit-flex;
|
4888 |
-
display: -ms-flexbox;
|
4889 |
-
-js-display: flex;
|
4890 |
-
display: -moz-box;
|
4891 |
-
display: flex;
|
4892 |
-
-webkit-box-align: center;
|
4893 |
-
-webkit-align-items: center;
|
4894 |
-
-moz-box-align: center;
|
4895 |
-
-ms-flex-align: center;
|
4896 |
-
align-items: center;
|
4897 |
-
-webkit-box-pack: center;
|
4898 |
-
-webkit-justify-content: center;
|
4899 |
-
-moz-box-pack: center;
|
4900 |
-
-ms-flex-pack: center;
|
4901 |
-
justify-content: center;
|
4902 |
-
}
|
4903 |
-
|
4904 |
-
.premium-img-gallery {
|
4905 |
-
clear: both;
|
4906 |
-
overflow: hidden;
|
4907 |
-
}
|
4908 |
-
|
4909 |
-
.premium-gallery-container .premium-gallery-item {
|
4910 |
-
padding: 10px;
|
4911 |
-
float: right;
|
4912 |
-
/* Google Chrome isotope issue */
|
4913 |
-
}
|
4914 |
-
|
4915 |
-
.premium-gallery-container .grid-sizer {
|
4916 |
-
width: 33.33%;
|
4917 |
-
}
|
4918 |
-
|
4919 |
-
.premium-img-gallery-filter .premium-gallery-cats-container li a.category,
|
4920 |
-
.premium-blog-filter .premium-blog-filters-container li a.category {
|
4921 |
-
outline: none;
|
4922 |
-
text-decoration: none;
|
4923 |
-
-webkit-border-radius: 75px;
|
4924 |
-
border-radius: 75px;
|
4925 |
-
margin: 15px 5px 20px;
|
4926 |
-
padding: 7px 20px;
|
4927 |
-
-webkit-transition: all 0.3s ease-in-out;
|
4928 |
-
transition: all 0.3s ease-in-out;
|
4929 |
-
}
|
4930 |
-
|
4931 |
-
/* .premium-img-gallery-filter .premium-gallery-cats-container li a.category span {
|
4932 |
-
-webkit-transition: all 0.3s ease-in-out;
|
4933 |
-
transition: all 0.3s ease-in-out;
|
4934 |
-
} */
|
4935 |
-
|
4936 |
-
.pa-gallery-img {
|
4937 |
-
position: relative;
|
4938 |
-
}
|
4939 |
-
|
4940 |
-
.pa-gallery-img .pa-gallery-whole-link {
|
4941 |
-
position: absolute;
|
4942 |
-
top: 0;
|
4943 |
-
right: 0;
|
4944 |
-
width: 100%;
|
4945 |
-
height: 100%;
|
4946 |
-
z-index: 2;
|
4947 |
-
}
|
4948 |
-
|
4949 |
-
.pa-gallery-img
|
4950 |
-
|
4951 |
-
|
4952 |
-
|
4953 |
-
|
4954 |
-
.pa-gallery-img-
|
4955 |
-
|
4956 |
-
|
4957 |
-
|
4958 |
-
|
4959 |
-
|
4960 |
-
|
4961 |
-
|
4962 |
-
|
4963 |
-
|
4964 |
-
|
4965 |
-
|
4966 |
-
|
4967 |
-
|
4968 |
-
|
4969 |
-
|
4970 |
-
-
|
4971 |
-
|
4972 |
-
|
4973 |
-
|
4974 |
-
|
4975 |
-
|
4976 |
-
|
4977 |
-
|
4978 |
-
|
4979 |
-
|
4980 |
-
|
4981 |
-
|
4982 |
-
|
4983 |
-
|
4984 |
-
|
4985 |
-
|
4986 |
-
|
4987 |
-
|
4988 |
-
|
4989 |
-
|
4990 |
-
|
4991 |
-
|
4992 |
-
|
4993 |
-
|
4994 |
-
|
4995 |
-
|
4996 |
-
|
4997 |
-
|
4998 |
-
|
4999 |
-
|
5000 |
-
|
5001 |
-
|
5002 |
-
.pa-gallery-img .pa-gallery-
|
5003 |
-
|
5004 |
-
|
5005 |
-
|
5006 |
-
|
5007 |
-
|
5008 |
-
|
5009 |
-
|
5010 |
-
|
5011 |
-
.
|
5012 |
-
|
5013 |
-
|
5014 |
-
|
5015 |
-
|
5016 |
-
|
5017 |
-
|
5018 |
-
|
5019 |
-
|
5020 |
-
|
5021 |
-
|
5022 |
-
|
5023 |
-
|
5024 |
-
|
5025 |
-
|
5026 |
-
.pa-gallery-img
|
5027 |
-
|
5028 |
-
|
5029 |
-
|
5030 |
-
|
5031 |
-
|
5032 |
-
|
5033 |
-
|
5034 |
-
|
5035 |
-
|
5036 |
-
|
5037 |
-
.
|
5038 |
-
|
5039 |
-
|
5040 |
-
|
5041 |
-
|
5042 |
-
.premium-
|
5043 |
-
|
5044 |
-
|
5045 |
-
|
5046 |
-
|
5047 |
-
|
5048 |
-
|
5049 |
-
|
5050 |
-
|
5051 |
-
|
5052 |
-
|
5053 |
-
|
5054 |
-
|
5055 |
-
-
|
5056 |
-
display: -
|
5057 |
-
display: inline-flex;
|
5058 |
-
|
5059 |
-
|
5060 |
-
|
5061 |
-
|
5062 |
-
|
5063 |
-
|
5064 |
-
|
5065 |
-
|
5066 |
-
|
5067 |
-
|
5068 |
-
|
5069 |
-
|
5070 |
-
|
5071 |
-
|
5072 |
-
|
5073 |
-
|
5074 |
-
|
5075 |
-
|
5076 |
-
|
5077 |
-
|
5078 |
-
|
5079 |
-
|
5080 |
-
|
5081 |
-
|
5082 |
-
|
5083 |
-
|
5084 |
-
|
5085 |
-
|
5086 |
-
|
5087 |
-
|
5088 |
-
|
5089 |
-
|
5090 |
-
|
5091 |
-
|
5092 |
-
|
5093 |
-
|
5094 |
-
|
5095 |
-
|
5096 |
-
|
5097 |
-
|
5098 |
-
|
5099 |
-
|
5100 |
-
|
5101 |
-
|
5102 |
-
|
5103 |
-
|
5104 |
-
|
5105 |
-
|
5106 |
-
}
|
5107 |
-
|
5108 |
-
.pa-gallery-img .premium-gallery-caption
|
5109 |
-
|
5110 |
-
}
|
5111 |
-
|
5112 |
-
.pa-gallery-img.
|
5113 |
-
|
5114 |
-
}
|
5115 |
-
|
5116 |
-
.pa-gallery-img
|
5117 |
-
|
5118 |
-
|
5119 |
-
|
5120 |
-
|
5121 |
-
|
5122 |
-
|
5123 |
-
|
5124 |
-
|
5125 |
-
|
5126 |
-
|
5127 |
-
|
5128 |
-
|
5129 |
-
|
5130 |
-
|
5131 |
-
|
5132 |
-
|
5133 |
-
|
5134 |
-
|
5135 |
-
|
5136 |
-
|
5137 |
-
|
5138 |
-
|
5139 |
-
|
5140 |
-
|
5141 |
-
|
5142 |
-
|
5143 |
-
|
5144 |
-
|
5145 |
-
|
5146 |
-
|
5147 |
-
|
5148 |
-
|
5149 |
-
|
5150 |
-
|
5151 |
-
|
5152 |
-
|
5153 |
-
|
5154 |
-
|
5155 |
-
|
5156 |
-
|
5157 |
-
|
5158 |
-
|
5159 |
-
|
5160 |
-
|
5161 |
-
|
5162 |
-
|
5163 |
-
|
5164 |
-
|
5165 |
-
|
5166 |
-
|
5167 |
-
|
5168 |
-
|
5169 |
-
|
5170 |
-
|
5171 |
-
|
5172 |
-
|
5173 |
-
|
5174 |
-
|
5175 |
-
|
5176 |
-
|
5177 |
-
|
5178 |
-
|
5179 |
-
transition: transform 0.3s, opacity 0.3s
|
5180 |
-
|
5181 |
-
|
5182 |
-
|
5183 |
-
|
5184 |
-
|
5185 |
-
-
|
5186 |
-
display: -
|
5187 |
-
display: flex;
|
5188 |
-
|
5189 |
-
-
|
5190 |
-
-
|
5191 |
-
|
5192 |
-
-
|
5193 |
-
align
|
5194 |
-
|
5195 |
-
|
5196 |
-
|
5197 |
-
|
5198 |
-
}
|
5199 |
-
|
5200 |
-
.pa-gallery-img.style2
|
5201 |
-
|
5202 |
-
|
5203 |
-
|
5204 |
-
|
5205 |
-
|
5206 |
-
|
5207 |
-
|
5208 |
-
|
5209 |
-
}
|
5210 |
-
|
5211 |
-
.premium-
|
5212 |
-
|
5213 |
-
}
|
5214 |
-
|
5215 |
-
|
5216 |
-
|
5217 |
-
|
5218 |
-
|
5219 |
-
|
5220 |
-
|
5221 |
-
|
5222 |
-
.premium-img-gallery-metro .
|
5223 |
-
|
5224 |
-
}
|
5225 |
-
|
5226 |
-
.premium-img-gallery-metro .pa-gallery-img
|
5227 |
-
height: 100%;
|
5228 |
-
}
|
5229 |
-
|
5230 |
-
.premium-img-gallery-metro .pa-gallery-img-container
|
5231 |
-
|
5232 |
-
|
5233 |
-
|
5234 |
-
|
5235 |
-
|
5236 |
-
|
5237 |
-
|
5238 |
-
|
5239 |
-
|
5240 |
-
|
5241 |
-
|
5242 |
-
|
5243 |
-
|
5244 |
-
|
5245 |
-
|
5246 |
-
|
5247 |
-
|
5248 |
-
|
5249 |
-
|
5250 |
-
|
5251 |
-
|
5252 |
-
-
|
5253 |
-
|
5254 |
-
|
5255 |
-
align
|
5256 |
-
|
5257 |
-
|
5258 |
-
|
5259 |
-
|
5260 |
-
|
5261 |
-
|
5262 |
-
|
5263 |
-
-
|
5264 |
-
|
5265 |
-
|
5266 |
-
|
5267 |
-
|
5268 |
-
|
5269 |
-
|
5270 |
-
|
5271 |
-
|
5272 |
-
display: -
|
5273 |
-
display: inline-flex;
|
5274 |
-
-
|
5275 |
-
-
|
5276 |
-
-moz-box
|
5277 |
-
-
|
5278 |
-
align
|
5279 |
-
|
5280 |
-
|
5281 |
-
|
5282 |
-
|
5283 |
-
}
|
5284 |
-
|
5285 |
-
.premium-gallery-load-more-btn
|
5286 |
-
|
5287 |
-
|
5288 |
-
|
5289 |
-
|
5290 |
-
|
5291 |
-
|
5292 |
-
|
5293 |
-
|
5294 |
-
|
5295 |
-
|
5296 |
-
.
|
5297 |
-
|
5298 |
-
|
5299 |
-
|
5300 |
-
|
5301 |
-
.pa-gallery-img-
|
5302 |
-
|
5303 |
-
|
5304 |
-
|
5305 |
-
|
5306 |
-
|
5307 |
-
|
5308 |
-
|
5309 |
-
|
5310 |
-
|
5311 |
-
|
5312 |
-
|
5313 |
-
|
5314 |
-
|
5315 |
-
|
5316 |
-
|
5317 |
-
|
5318 |
-
|
5319 |
-
|
5320 |
-
|
5321 |
-
|
5322 |
-
|
5323 |
-
|
5324 |
-
|
5325 |
-
|
5326 |
-
|
5327 |
-
|
5328 |
-
|
5329 |
-
|
5330 |
-
|
5331 |
-
|
5332 |
-
|
5333 |
-
|
|
|
|
|
|
|
|
|
5334 |
}
|
5335 |
/********* Premium Lottie Animations **********/
|
5336 |
/**********************************************/
|
@@ -5939,6 +5943,13 @@ button.premium-modal-box-modal-close {
|
|
5939 |
transform: translateY(-50%);
|
5940 |
}
|
5941 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5942 |
/**Vertical Hamburger Menu*/
|
5943 |
.premium-mobile-menu-outer-container {
|
5944 |
opacity: 0;
|
@@ -6251,9 +6262,10 @@ button.premium-modal-box-modal-close {
|
|
6251 |
transform: translateY(-100%);
|
6252 |
}
|
6253 |
|
6254 |
-
.premium-nav-sticky-yes.premium-ham-dropdown .premium-mobile-menu-container
|
6255 |
-
|
6256 |
-
|
|
|
6257 |
}
|
6258 |
|
6259 |
/**Common*/
|
4879 |
-webkit-transition: all 0.3s ease-in-out;
|
4880 |
transition: all 0.3s ease-in-out;
|
4881 |
}
|
4882 |
+
/******** Premium Media Grid ********/
|
4883 |
+
/************************************/
|
4884 |
+
.premium-img-gallery-filter,
|
4885 |
+
.premium-blog-filter {
|
4886 |
+
display: -webkit-box;
|
4887 |
+
display: -webkit-flex;
|
4888 |
+
display: -ms-flexbox;
|
4889 |
+
-js-display: flex;
|
4890 |
+
display: -moz-box;
|
4891 |
+
display: flex;
|
4892 |
+
-webkit-box-align: center;
|
4893 |
+
-webkit-align-items: center;
|
4894 |
+
-moz-box-align: center;
|
4895 |
+
-ms-flex-align: center;
|
4896 |
+
align-items: center;
|
4897 |
+
-webkit-box-pack: center;
|
4898 |
+
-webkit-justify-content: center;
|
4899 |
+
-moz-box-pack: center;
|
4900 |
+
-ms-flex-pack: center;
|
4901 |
+
justify-content: center;
|
4902 |
+
}
|
4903 |
+
|
4904 |
+
.premium-img-gallery {
|
4905 |
+
clear: both;
|
4906 |
+
overflow: hidden;
|
4907 |
+
}
|
4908 |
+
|
4909 |
+
.premium-gallery-container .premium-gallery-item {
|
4910 |
+
padding: 10px;
|
4911 |
+
float: right;
|
4912 |
+
/* Google Chrome isotope issue */
|
4913 |
+
}
|
4914 |
+
|
4915 |
+
.premium-gallery-container .grid-sizer {
|
4916 |
+
width: 33.33%;
|
4917 |
+
}
|
4918 |
+
|
4919 |
+
.premium-img-gallery-filter .premium-gallery-cats-container li a.category,
|
4920 |
+
.premium-blog-filter .premium-blog-filters-container li a.category {
|
4921 |
+
outline: none;
|
4922 |
+
text-decoration: none;
|
4923 |
+
-webkit-border-radius: 75px;
|
4924 |
+
border-radius: 75px;
|
4925 |
+
margin: 15px 5px 20px;
|
4926 |
+
padding: 7px 20px;
|
4927 |
+
-webkit-transition: all 0.3s ease-in-out;
|
4928 |
+
transition: all 0.3s ease-in-out;
|
4929 |
+
}
|
4930 |
+
|
4931 |
+
/* .premium-img-gallery-filter .premium-gallery-cats-container li a.category span {
|
4932 |
+
-webkit-transition: all 0.3s ease-in-out;
|
4933 |
+
transition: all 0.3s ease-in-out;
|
4934 |
+
} */
|
4935 |
+
|
4936 |
+
.pa-gallery-img {
|
4937 |
+
position: relative;
|
4938 |
+
}
|
4939 |
+
|
4940 |
+
.pa-gallery-img .pa-gallery-whole-link {
|
4941 |
+
position: absolute;
|
4942 |
+
top: 0;
|
4943 |
+
right: 0;
|
4944 |
+
width: 100%;
|
4945 |
+
height: 100%;
|
4946 |
+
z-index: 2;
|
4947 |
+
}
|
4948 |
+
|
4949 |
+
.pa-gallery-img .pa-gallery-whole-link span {
|
4950 |
+
display: none;
|
4951 |
+
}
|
4952 |
+
|
4953 |
+
.pa-gallery-img.style2 .pa-gallery-whole-link,
|
4954 |
+
.pa-gallery-img.style3 .pa-gallery-whole-link {
|
4955 |
+
z-index: 99;
|
4956 |
+
}
|
4957 |
+
|
4958 |
+
.pa-gallery-img-container {
|
4959 |
+
overflow: hidden;
|
4960 |
+
-webkit-backface-visibility: hidden;
|
4961 |
+
-moz-backface-visibility: hidden;
|
4962 |
+
-webkit-transform: translate3d(0, 0, 0);
|
4963 |
+
transform: translate3d(0, 0, 0);
|
4964 |
+
}
|
4965 |
+
|
4966 |
+
.pa-gallery-img-container img {
|
4967 |
+
display: block;
|
4968 |
+
width: 100%;
|
4969 |
+
-webkit-transition: all 0.3s ease-in-out;
|
4970 |
+
transition: all 0.3s ease-in-out;
|
4971 |
+
}
|
4972 |
+
|
4973 |
+
.premium-img-gallery.gray img {
|
4974 |
+
-webkit-filter: grayscale(100%);
|
4975 |
+
filter: grayscale(100%);
|
4976 |
+
}
|
4977 |
+
|
4978 |
+
.premium-img-gallery.zoomout img,
|
4979 |
+
.premium-img-gallery.scale img {
|
4980 |
+
-webkit-transform: scale(1.2);
|
4981 |
+
-ms-transform: scale(1.2);
|
4982 |
+
transform: scale(1.2);
|
4983 |
+
}
|
4984 |
+
|
4985 |
+
.premium-img-gallery.sepia img {
|
4986 |
+
-webkit-filter: sepia(30%);
|
4987 |
+
filter: sepia(30%);
|
4988 |
+
}
|
4989 |
+
|
4990 |
+
.premium-img-gallery.bright img {
|
4991 |
+
-webkit-filter: brightness(1);
|
4992 |
+
filter: brightness(1);
|
4993 |
+
}
|
4994 |
+
|
4995 |
+
.premium-img-gallery.trans img {
|
4996 |
+
-webkit-transform: translateX(15px) scale(1.1);
|
4997 |
+
-ms-transform: translateX(15px) scale(1.1);
|
4998 |
+
transform: translateX(15px) scale(1.1);
|
4999 |
+
}
|
5000 |
+
|
5001 |
+
.pa-gallery-img .pa-gallery-magnific-image,
|
5002 |
+
.pa-gallery-img .pa-gallery-img-link {
|
5003 |
+
outline: none;
|
5004 |
+
}
|
5005 |
+
|
5006 |
+
.pa-gallery-img .pa-gallery-magnific-image i,
|
5007 |
+
.pa-gallery-img .pa-gallery-magnific-image svg,
|
5008 |
+
.pa-gallery-img .pa-gallery-img-link i,
|
5009 |
+
.pa-gallery-img .pa-gallery-img-link svg {
|
5010 |
+
-webkit-transition: all 0.3s ease-in-out;
|
5011 |
+
transition: all 0.3s ease-in-out;
|
5012 |
+
}
|
5013 |
+
|
5014 |
+
.pa-gallery-img .pa-gallery-magnific-image span,
|
5015 |
+
.pa-gallery-img .pa-gallery-img-link span {
|
5016 |
+
line-height: 1;
|
5017 |
+
display: inline-block;
|
5018 |
+
opacity: 0;
|
5019 |
+
margin: 0 5px;
|
5020 |
+
padding: 15px;
|
5021 |
+
-webkit-border-radius: 50%;
|
5022 |
+
border-radius: 50%;
|
5023 |
+
}
|
5024 |
+
|
5025 |
+
.pa-gallery-img.style2 .pa-gallery-magnific-image span,
|
5026 |
+
.pa-gallery-img.style2 .pa-gallery-img-link span {
|
5027 |
+
margin: 0 5px 20px;
|
5028 |
+
}
|
5029 |
+
|
5030 |
+
.pa-gallery-img:hover .pa-gallery-magnific-image span {
|
5031 |
+
-webkit-transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out 0.3s;
|
5032 |
+
transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out 0.3s;
|
5033 |
+
}
|
5034 |
+
|
5035 |
+
.pa-gallery-img:hover .pa-gallery-img-link span {
|
5036 |
+
-webkit-transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out 0.6s;
|
5037 |
+
transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out 0.6s;
|
5038 |
+
}
|
5039 |
+
|
5040 |
+
.pa-gallery-img:hover .pa-gallery-magnific-image span,
|
5041 |
+
.pa-gallery-img:hover .pa-gallery-img-link span,
|
5042 |
+
.premium-gallery-icon-show a.pa-gallery-video-icon span {
|
5043 |
+
opacity: 1;
|
5044 |
+
}
|
5045 |
+
|
5046 |
+
.premium-img-gallery-filter ul.premium-gallery-cats-container,
|
5047 |
+
.premium-blog-filter ul.premium-blog-filters-container {
|
5048 |
+
text-align: center;
|
5049 |
+
margin: 0;
|
5050 |
+
padding: 0;
|
5051 |
+
}
|
5052 |
+
|
5053 |
+
.premium-img-gallery-filter .premium-gallery-cats-container li,
|
5054 |
+
.premium-blog-filter .premium-blog-filters-container li {
|
5055 |
+
list-style: none;
|
5056 |
+
display: -webkit-inline-box;
|
5057 |
+
display: -webkit-inline-flex;
|
5058 |
+
display: -ms-inline-flexbox;
|
5059 |
+
-js-display: inline-flex;
|
5060 |
+
display: -moz-inline-box;
|
5061 |
+
display: inline-flex;
|
5062 |
+
}
|
5063 |
+
|
5064 |
+
.premium-img-gallery.zoomin .pa-gallery-img:hover img {
|
5065 |
+
-webkit-transform: scale(1.1);
|
5066 |
+
-ms-transform: scale(1.1);
|
5067 |
+
transform: scale(1.1);
|
5068 |
+
}
|
5069 |
+
|
5070 |
+
.premium-img-gallery.zoomout .pa-gallery-img:hover img {
|
5071 |
+
-webkit-transform: scale(1);
|
5072 |
+
-ms-transform: scale(1);
|
5073 |
+
transform: scale(1);
|
5074 |
+
}
|
5075 |
+
|
5076 |
+
.premium-img-gallery.scale .pa-gallery-img:hover img {
|
5077 |
+
-webkit-transform: scale(1.3) rotate(-5deg);
|
5078 |
+
-ms-transform: scale(1.3) rotate(-5deg);
|
5079 |
+
transform: scale(1.3) rotate(-5deg);
|
5080 |
+
}
|
5081 |
+
|
5082 |
+
.premium-img-gallery.gray .pa-gallery-img:hover img {
|
5083 |
+
-webkit-filter: grayscale(0%);
|
5084 |
+
filter: grayscale(0%);
|
5085 |
+
}
|
5086 |
+
|
5087 |
+
.premium-img-gallery.blur .pa-gallery-img:hover img {
|
5088 |
+
-webkit-filter: blur(3px);
|
5089 |
+
filter: blur(3px);
|
5090 |
+
}
|
5091 |
+
|
5092 |
+
.premium-img-gallery.sepia .pa-gallery-img:hover img {
|
5093 |
+
-webkit-filter: sepia(0%);
|
5094 |
+
filter: sepia(0%);
|
5095 |
+
}
|
5096 |
+
|
5097 |
+
.premium-img-gallery.trans .pa-gallery-img:hover img {
|
5098 |
+
-webkit-transform: translateX(0px) scale(1.1);
|
5099 |
+
-ms-transform: translateX(0px) scale(1.1);
|
5100 |
+
transform: translateX(0px) scale(1.1);
|
5101 |
+
}
|
5102 |
+
|
5103 |
+
.premium-img-gallery.bright .pa-gallery-img:hover img {
|
5104 |
+
-webkit-filter: brightness(1.2);
|
5105 |
+
filter: brightness(1.2);
|
5106 |
+
}
|
5107 |
+
|
5108 |
+
.pa-gallery-img .premium-gallery-caption {
|
5109 |
+
padding: 10px;
|
5110 |
+
}
|
5111 |
+
|
5112 |
+
.pa-gallery-img .premium-gallery-caption .premium-gallery-img-name {
|
5113 |
+
margin-bottom: 0;
|
5114 |
+
}
|
5115 |
+
|
5116 |
+
.pa-gallery-img.style1 {
|
5117 |
+
overflow: hidden;
|
5118 |
+
}
|
5119 |
+
|
5120 |
+
.pa-gallery-img:not(.style2) .pa-gallery-icons-wrapper {
|
5121 |
+
position: absolute;
|
5122 |
+
top: 0;
|
5123 |
+
right: 0;
|
5124 |
+
width: 100%;
|
5125 |
+
height: 100%;
|
5126 |
+
-webkit-transition: all 0.3s ease-in-out;
|
5127 |
+
transition: all 0.3s ease-in-out;
|
5128 |
+
}
|
5129 |
+
|
5130 |
+
.pa-gallery-img:not(.style2) .pa-gallery-icons-inner-container {
|
5131 |
+
position: absolute;
|
5132 |
+
top: 33.33%;
|
5133 |
+
width: 100%;
|
5134 |
+
text-align: center;
|
5135 |
+
-webkit-transform: translateY(-50%);
|
5136 |
+
-ms-transform: translateY(-50%);
|
5137 |
+
transform: translateY(-50%);
|
5138 |
+
z-index: 3;
|
5139 |
+
}
|
5140 |
+
|
5141 |
+
.pa-gallery-img.style1 .premium-gallery-caption {
|
5142 |
+
position: absolute;
|
5143 |
+
top: auto;
|
5144 |
+
left: 0;
|
5145 |
+
right: 0;
|
5146 |
+
width: 100%;
|
5147 |
+
-webkit-transition: all 500ms ease 0s;
|
5148 |
+
transition: all 500ms ease 0s;
|
5149 |
+
-webkit-transform: translate3d(0, 100%, 0);
|
5150 |
+
-ms-transform: translate3d(0, 100%, 0);
|
5151 |
+
transform: translate3d(0, 100%, 0);
|
5152 |
+
}
|
5153 |
+
|
5154 |
+
.pa-gallery-img.default .premium-gallery-caption {
|
5155 |
+
position: absolute;
|
5156 |
+
top: auto;
|
5157 |
+
left: 0;
|
5158 |
+
right: 0;
|
5159 |
+
width: 100%;
|
5160 |
+
bottom: 0;
|
5161 |
+
}
|
5162 |
+
|
5163 |
+
.pa-gallery-img.style1:hover .premium-gallery-caption {
|
5164 |
+
-webkit-transform: translate3d(0, 0, 0);
|
5165 |
+
-ms-transform: translate3d(0, 0, 0);
|
5166 |
+
transform: translate3d(0, 0, 0);
|
5167 |
+
bottom: -1px !important;
|
5168 |
+
}
|
5169 |
+
|
5170 |
+
.pa-gallery-img.style2 .pa-gallery-icons-caption-container {
|
5171 |
+
position: absolute;
|
5172 |
+
top: 0;
|
5173 |
+
right: 0;
|
5174 |
+
width: 100%;
|
5175 |
+
height: 100%;
|
5176 |
+
opacity: 0;
|
5177 |
+
-webkit-backface-visibility: hidden;
|
5178 |
+
backface-visibility: hidden;
|
5179 |
+
-webkit-transition: -webkit-transform 0.3s, opacity 0.3s;
|
5180 |
+
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
|
5181 |
+
transition: opacity 0.3s, -webkit-transform 0.3s;
|
5182 |
+
transition: transform 0.3s, opacity 0.3s;
|
5183 |
+
transition: transform 0.3s, opacity 0.3s, -webkit-transform 0.3s;
|
5184 |
+
z-index: 1;
|
5185 |
+
background-color: rgba(108, 191, 226, 0.68);
|
5186 |
+
display: -webkit-box;
|
5187 |
+
display: -webkit-flex;
|
5188 |
+
display: -ms-flexbox;
|
5189 |
+
-js-display: flex;
|
5190 |
+
display: -moz-box;
|
5191 |
+
display: flex;
|
5192 |
+
text-align: center;
|
5193 |
+
-webkit-box-align: center;
|
5194 |
+
-webkit-align-items: center;
|
5195 |
+
-moz-box-align: center;
|
5196 |
+
-ms-flex-align: center;
|
5197 |
+
align-items: center;
|
5198 |
+
}
|
5199 |
+
|
5200 |
+
.pa-gallery-img.style2 .pa-gallery-icons-caption-cell {
|
5201 |
+
width: 100%;
|
5202 |
+
}
|
5203 |
+
|
5204 |
+
.pa-gallery-img.style2:hover .pa-gallery-icons-caption-container {
|
5205 |
+
opacity: 1;
|
5206 |
+
-webkit-transform: translate(-15px, 15px);
|
5207 |
+
-ms-transform: translate(-15px, 15px);
|
5208 |
+
transform: translate(-15px, 15px);
|
5209 |
+
}
|
5210 |
+
|
5211 |
+
.premium-clearfix {
|
5212 |
+
clear: both;
|
5213 |
+
}
|
5214 |
+
|
5215 |
+
.premium-gallery-container .pa-gallery-item {
|
5216 |
+
padding: 10px;
|
5217 |
+
}
|
5218 |
+
|
5219 |
+
/**
|
5220 |
+
* Metro Layout
|
5221 |
+
*/
|
5222 |
+
.premium-img-gallery-metro .premium-gallery-item {
|
5223 |
+
overflow: hidden;
|
5224 |
+
}
|
5225 |
+
|
5226 |
+
.premium-img-gallery-metro .pa-gallery-img {
|
5227 |
+
height: 100%;
|
5228 |
+
}
|
5229 |
+
|
5230 |
+
.premium-img-gallery-metro .pa-gallery-img-container {
|
5231 |
+
height: 100%;
|
5232 |
+
}
|
5233 |
+
|
5234 |
+
.premium-img-gallery-metro .pa-gallery-img-container img {
|
5235 |
+
min-height: 100%;
|
5236 |
+
width: 100%;
|
5237 |
+
-o-object-fit: fill;
|
5238 |
+
object-fit: fill;
|
5239 |
+
}
|
5240 |
+
|
5241 |
+
.premium-img-gallery .premium-gallery-item-hidden {
|
5242 |
+
visibility: hidden;
|
5243 |
+
width: 0 !important;
|
5244 |
+
height: 0 !important;
|
5245 |
+
margin: 0 !important;
|
5246 |
+
padding: 0 !important;
|
5247 |
+
}
|
5248 |
+
|
5249 |
+
.premium-gallery-load-more .premium-gallery-load-more-btn {
|
5250 |
+
-webkit-box-shadow: none;
|
5251 |
+
box-shadow: none;
|
5252 |
+
text-shadow: none;
|
5253 |
+
border: none;
|
5254 |
+
outline: none;
|
5255 |
+
-webkit-box-align: center;
|
5256 |
+
-ms-flex-align: center;
|
5257 |
+
-webkit-align-items: center;
|
5258 |
+
-moz-box-align: center;
|
5259 |
+
align-items: center;
|
5260 |
+
vertical-align: bottom;
|
5261 |
+
cursor: pointer;
|
5262 |
+
line-height: 1;
|
5263 |
+
font-style: normal;
|
5264 |
+
font-weight: normal;
|
5265 |
+
background-image: none;
|
5266 |
+
color: #fff;
|
5267 |
+
-webkit-transition: all 0.3s ease-in-out;
|
5268 |
+
transition: all 0.3s ease-in-out;
|
5269 |
+
}
|
5270 |
+
|
5271 |
+
.premium-gallery-load-more-btn {
|
5272 |
+
display: -webkit-inline-box;
|
5273 |
+
display: -webkit-inline-flex;
|
5274 |
+
display: -ms-inline-flexbox;
|
5275 |
+
-js-display: inline-flex;
|
5276 |
+
display: -moz-inline-box;
|
5277 |
+
display: inline-flex;
|
5278 |
+
-webkit-box-align: center;
|
5279 |
+
-webkit-align-items: center;
|
5280 |
+
-moz-box-align: center;
|
5281 |
+
-ms-flex-align: center;
|
5282 |
+
align-items: center;
|
5283 |
+
}
|
5284 |
+
|
5285 |
+
.premium-gallery-load-more-btn div {
|
5286 |
+
margin-right: 3px;
|
5287 |
+
}
|
5288 |
+
|
5289 |
+
.premium-gallery-load-more-btn .premium-loader {
|
5290 |
+
display: inline-block;
|
5291 |
+
width: 20px;
|
5292 |
+
height: 20px;
|
5293 |
+
}
|
5294 |
+
|
5295 |
+
/** * Video */
|
5296 |
+
.pa-gallery-img .pa-gallery-lightbox-wrap {
|
5297 |
+
display: inline-block;
|
5298 |
+
}
|
5299 |
+
|
5300 |
+
.premium-img-gallery-no-lightbox .premium-gallery-video-item .pa-gallery-img,
|
5301 |
+
.pa-gallery-img .pa-gallery-video-icon {
|
5302 |
+
cursor: pointer;
|
5303 |
+
}
|
5304 |
+
|
5305 |
+
.pa-gallery-img-container iframe,
|
5306 |
+
.pa-gallery-img-container video {
|
5307 |
+
position: absolute;
|
5308 |
+
visibility: hidden;
|
5309 |
+
top: 0;
|
5310 |
+
right: 0;
|
5311 |
+
max-width: 100%;
|
5312 |
+
width: 100%;
|
5313 |
+
height: 100%;
|
5314 |
+
margin: 0;
|
5315 |
+
line-height: 1;
|
5316 |
+
border: none;
|
5317 |
+
}
|
5318 |
+
|
5319 |
+
.pa-gallery-img-container video {
|
5320 |
+
-o-object-fit: contain;
|
5321 |
+
object-fit: contain;
|
5322 |
+
}
|
5323 |
+
|
5324 |
+
.pa-gallery-icons-inner-container svg,
|
5325 |
+
.pa-gallery-icons-caption-cell svg {
|
5326 |
+
width: 14px;
|
5327 |
+
height: 14px;
|
5328 |
+
}
|
5329 |
+
|
5330 |
+
.premium-gallery-gradient-layer {
|
5331 |
+
position: absolute;
|
5332 |
+
bottom: 40px;
|
5333 |
+
width: 100%;
|
5334 |
+
height: 20px;
|
5335 |
+
background: -webkit-gradient(linear, left bottom, left top, from(#17181f), to(rgba(255, 255, 255, 0)));
|
5336 |
+
background: -webkit-linear-gradient(bottom, #17181f 0%, rgba(255, 255, 255, 0) 100%);
|
5337 |
+
background: linear-gradient(to top, #17181f 0%, rgba(255, 255, 255, 0) 100%);
|
5338 |
}
|
5339 |
/********* Premium Lottie Animations **********/
|
5340 |
/**********************************************/
|
5943 |
transform: translateY(-50%);
|
5944 |
}
|
5945 |
|
5946 |
+
.premium-nav-hor .premium-mobile-menu-container .premium-item-badge {
|
5947 |
+
top: 0;
|
5948 |
+
-webkit-transform: translateY(0);
|
5949 |
+
-ms-transform: translateY(0);
|
5950 |
+
transform: translateY(0);
|
5951 |
+
}
|
5952 |
+
|
5953 |
/**Vertical Hamburger Menu*/
|
5954 |
.premium-mobile-menu-outer-container {
|
5955 |
opacity: 0;
|
6262 |
transform: translateY(-100%);
|
6263 |
}
|
6264 |
|
6265 |
+
.premium-nav-sticky-yes.premium-sticky-active.premium-ham-dropdown .premium-mobile-menu-container,
|
6266 |
+
.premium-ham-dropdown .premium-stretch-dropdown .premium-mobile-menu-container {
|
6267 |
+
max-height: 400px;
|
6268 |
+
overflow-y: auto;
|
6269 |
}
|
6270 |
|
6271 |
/**Common*/
|
assets/frontend/css/premium-addons.css
CHANGED
@@ -4089,6 +4089,8 @@ ul[data-list-animation*="animated-"] .premium-bullet-list-divider-inline {
|
|
4089 |
width: 100%;
|
4090 |
height: 100%;
|
4091 |
z-index: 2; }
|
|
|
|
|
4092 |
.pa-gallery-img.style2 .pa-gallery-whole-link, .pa-gallery-img.style3 .pa-gallery-whole-link {
|
4093 |
z-index: 99; }
|
4094 |
|
@@ -4310,8 +4312,8 @@ ul[data-list-animation*="animated-"] .premium-bullet-list-divider-inline {
|
|
4310 |
.premium-clearfix {
|
4311 |
clear: both; }
|
4312 |
|
4313 |
-
/**
|
4314 |
-
* Metro Layout
|
4315 |
*/
|
4316 |
.premium-img-gallery-metro .premium-gallery-item {
|
4317 |
overflow: hidden; }
|
@@ -4925,6 +4927,12 @@ button.premium-modal-box-modal-close {
|
|
4925 |
-ms-transform: translateY(-50%);
|
4926 |
transform: translateY(-50%); }
|
4927 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4928 |
/**Vertical Hamburger Menu*/
|
4929 |
.premium-mobile-menu-outer-container {
|
4930 |
opacity: 0; }
|
@@ -5182,8 +5190,9 @@ button.premium-modal-box-modal-close {
|
|
5182 |
-ms-transform: translateY(-100%);
|
5183 |
transform: translateY(-100%); }
|
5184 |
|
5185 |
-
.premium-nav-sticky-yes.premium-ham-dropdown .premium-mobile-menu-container
|
5186 |
-
|
|
|
5187 |
overflow-y: auto; }
|
5188 |
|
5189 |
/**Common*/
|
4089 |
width: 100%;
|
4090 |
height: 100%;
|
4091 |
z-index: 2; }
|
4092 |
+
.pa-gallery-img .pa-gallery-whole-link span {
|
4093 |
+
display: none; }
|
4094 |
.pa-gallery-img.style2 .pa-gallery-whole-link, .pa-gallery-img.style3 .pa-gallery-whole-link {
|
4095 |
z-index: 99; }
|
4096 |
|
4312 |
.premium-clearfix {
|
4313 |
clear: both; }
|
4314 |
|
4315 |
+
/**
|
4316 |
+
* Metro Layout
|
4317 |
*/
|
4318 |
.premium-img-gallery-metro .premium-gallery-item {
|
4319 |
overflow: hidden; }
|
4927 |
-ms-transform: translateY(-50%);
|
4928 |
transform: translateY(-50%); }
|
4929 |
|
4930 |
+
.premium-nav-hor .premium-mobile-menu-container .premium-item-badge {
|
4931 |
+
top: 0;
|
4932 |
+
-webkit-transform: translateY(0);
|
4933 |
+
-ms-transform: translateY(0);
|
4934 |
+
transform: translateY(0); }
|
4935 |
+
|
4936 |
/**Vertical Hamburger Menu*/
|
4937 |
.premium-mobile-menu-outer-container {
|
4938 |
opacity: 0; }
|
5190 |
-ms-transform: translateY(-100%);
|
5191 |
transform: translateY(-100%); }
|
5192 |
|
5193 |
+
.premium-nav-sticky-yes.premium-sticky-active.premium-ham-dropdown .premium-mobile-menu-container,
|
5194 |
+
.premium-ham-dropdown .premium-stretch-dropdown .premium-mobile-menu-container {
|
5195 |
+
max-height: 400px;
|
5196 |
overflow-y: auto; }
|
5197 |
|
5198 |
/**Common*/
|
assets/frontend/css/premium-img-gallery-rtl.css
CHANGED
@@ -1,453 +1,457 @@
|
|
1 |
-
/******** Premium Media Grid ********/
|
2 |
-
/************************************/
|
3 |
-
.premium-img-gallery-filter,
|
4 |
-
.premium-blog-filter {
|
5 |
-
display: -webkit-box;
|
6 |
-
display: -webkit-flex;
|
7 |
-
display: -ms-flexbox;
|
8 |
-
-js-display: flex;
|
9 |
-
display: -moz-box;
|
10 |
-
display: flex;
|
11 |
-
-webkit-box-align: center;
|
12 |
-
-webkit-align-items: center;
|
13 |
-
-moz-box-align: center;
|
14 |
-
-ms-flex-align: center;
|
15 |
-
align-items: center;
|
16 |
-
-webkit-box-pack: center;
|
17 |
-
-webkit-justify-content: center;
|
18 |
-
-moz-box-pack: center;
|
19 |
-
-ms-flex-pack: center;
|
20 |
-
justify-content: center;
|
21 |
-
}
|
22 |
-
|
23 |
-
.premium-img-gallery {
|
24 |
-
clear: both;
|
25 |
-
overflow: hidden;
|
26 |
-
}
|
27 |
-
|
28 |
-
.premium-gallery-container .premium-gallery-item {
|
29 |
-
padding: 10px;
|
30 |
-
float: right;
|
31 |
-
/* Google Chrome isotope issue */
|
32 |
-
}
|
33 |
-
|
34 |
-
.premium-gallery-container .grid-sizer {
|
35 |
-
width: 33.33%;
|
36 |
-
}
|
37 |
-
|
38 |
-
.premium-img-gallery-filter .premium-gallery-cats-container li a.category,
|
39 |
-
.premium-blog-filter .premium-blog-filters-container li a.category {
|
40 |
-
outline: none;
|
41 |
-
text-decoration: none;
|
42 |
-
-webkit-border-radius: 75px;
|
43 |
-
border-radius: 75px;
|
44 |
-
margin: 15px 5px 20px;
|
45 |
-
padding: 7px 20px;
|
46 |
-
-webkit-transition: all 0.3s ease-in-out;
|
47 |
-
transition: all 0.3s ease-in-out;
|
48 |
-
}
|
49 |
-
|
50 |
-
/* .premium-img-gallery-filter .premium-gallery-cats-container li a.category span {
|
51 |
-
-webkit-transition: all 0.3s ease-in-out;
|
52 |
-
transition: all 0.3s ease-in-out;
|
53 |
-
} */
|
54 |
-
|
55 |
-
.pa-gallery-img {
|
56 |
-
position: relative;
|
57 |
-
}
|
58 |
-
|
59 |
-
.pa-gallery-img .pa-gallery-whole-link {
|
60 |
-
position: absolute;
|
61 |
-
top: 0;
|
62 |
-
right: 0;
|
63 |
-
width: 100%;
|
64 |
-
height: 100%;
|
65 |
-
z-index: 2;
|
66 |
-
}
|
67 |
-
|
68 |
-
.pa-gallery-img
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
.pa-gallery-img-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
.pa-gallery-img .pa-gallery-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
.
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
.pa-gallery-img
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
.
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
.premium-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
-
|
175 |
-
display: -
|
176 |
-
display: inline-flex;
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
}
|
226 |
-
|
227 |
-
.pa-gallery-img .premium-gallery-caption
|
228 |
-
|
229 |
-
}
|
230 |
-
|
231 |
-
.pa-gallery-img.
|
232 |
-
|
233 |
-
}
|
234 |
-
|
235 |
-
.pa-gallery-img
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
transition: transform 0.3s, opacity 0.3s
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
-
|
305 |
-
display: -
|
306 |
-
display: flex;
|
307 |
-
|
308 |
-
-
|
309 |
-
-
|
310 |
-
|
311 |
-
-
|
312 |
-
align
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
}
|
318 |
-
|
319 |
-
.pa-gallery-img.style2
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
}
|
329 |
-
|
330 |
-
.premium-
|
331 |
-
|
332 |
-
}
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
.premium-img-gallery-metro .
|
342 |
-
|
343 |
-
}
|
344 |
-
|
345 |
-
.premium-img-gallery-metro .pa-gallery-img
|
346 |
-
height: 100%;
|
347 |
-
}
|
348 |
-
|
349 |
-
.premium-img-gallery-metro .pa-gallery-img-container
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
-
|
372 |
-
|
373 |
-
|
374 |
-
align
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
display: -
|
392 |
-
display: inline-flex;
|
393 |
-
-
|
394 |
-
-
|
395 |
-
-moz-box
|
396 |
-
-
|
397 |
-
align
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
}
|
403 |
-
|
404 |
-
.premium-gallery-load-more-btn
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
.
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
.pa-gallery-img-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
|
|
|
|
|
|
|
|
453 |
}
|
1 |
+
/******** Premium Media Grid ********/
|
2 |
+
/************************************/
|
3 |
+
.premium-img-gallery-filter,
|
4 |
+
.premium-blog-filter {
|
5 |
+
display: -webkit-box;
|
6 |
+
display: -webkit-flex;
|
7 |
+
display: -ms-flexbox;
|
8 |
+
-js-display: flex;
|
9 |
+
display: -moz-box;
|
10 |
+
display: flex;
|
11 |
+
-webkit-box-align: center;
|
12 |
+
-webkit-align-items: center;
|
13 |
+
-moz-box-align: center;
|
14 |
+
-ms-flex-align: center;
|
15 |
+
align-items: center;
|
16 |
+
-webkit-box-pack: center;
|
17 |
+
-webkit-justify-content: center;
|
18 |
+
-moz-box-pack: center;
|
19 |
+
-ms-flex-pack: center;
|
20 |
+
justify-content: center;
|
21 |
+
}
|
22 |
+
|
23 |
+
.premium-img-gallery {
|
24 |
+
clear: both;
|
25 |
+
overflow: hidden;
|
26 |
+
}
|
27 |
+
|
28 |
+
.premium-gallery-container .premium-gallery-item {
|
29 |
+
padding: 10px;
|
30 |
+
float: right;
|
31 |
+
/* Google Chrome isotope issue */
|
32 |
+
}
|
33 |
+
|
34 |
+
.premium-gallery-container .grid-sizer {
|
35 |
+
width: 33.33%;
|
36 |
+
}
|
37 |
+
|
38 |
+
.premium-img-gallery-filter .premium-gallery-cats-container li a.category,
|
39 |
+
.premium-blog-filter .premium-blog-filters-container li a.category {
|
40 |
+
outline: none;
|
41 |
+
text-decoration: none;
|
42 |
+
-webkit-border-radius: 75px;
|
43 |
+
border-radius: 75px;
|
44 |
+
margin: 15px 5px 20px;
|
45 |
+
padding: 7px 20px;
|
46 |
+
-webkit-transition: all 0.3s ease-in-out;
|
47 |
+
transition: all 0.3s ease-in-out;
|
48 |
+
}
|
49 |
+
|
50 |
+
/* .premium-img-gallery-filter .premium-gallery-cats-container li a.category span {
|
51 |
+
-webkit-transition: all 0.3s ease-in-out;
|
52 |
+
transition: all 0.3s ease-in-out;
|
53 |
+
} */
|
54 |
+
|
55 |
+
.pa-gallery-img {
|
56 |
+
position: relative;
|
57 |
+
}
|
58 |
+
|
59 |
+
.pa-gallery-img .pa-gallery-whole-link {
|
60 |
+
position: absolute;
|
61 |
+
top: 0;
|
62 |
+
right: 0;
|
63 |
+
width: 100%;
|
64 |
+
height: 100%;
|
65 |
+
z-index: 2;
|
66 |
+
}
|
67 |
+
|
68 |
+
.pa-gallery-img .pa-gallery-whole-link span {
|
69 |
+
display: none;
|
70 |
+
}
|
71 |
+
|
72 |
+
.pa-gallery-img.style2 .pa-gallery-whole-link,
|
73 |
+
.pa-gallery-img.style3 .pa-gallery-whole-link {
|
74 |
+
z-index: 99;
|
75 |
+
}
|
76 |
+
|
77 |
+
.pa-gallery-img-container {
|
78 |
+
overflow: hidden;
|
79 |
+
-webkit-backface-visibility: hidden;
|
80 |
+
-moz-backface-visibility: hidden;
|
81 |
+
-webkit-transform: translate3d(0, 0, 0);
|
82 |
+
transform: translate3d(0, 0, 0);
|
83 |
+
}
|
84 |
+
|
85 |
+
.pa-gallery-img-container img {
|
86 |
+
display: block;
|
87 |
+
width: 100%;
|
88 |
+
-webkit-transition: all 0.3s ease-in-out;
|
89 |
+
transition: all 0.3s ease-in-out;
|
90 |
+
}
|
91 |
+
|
92 |
+
.premium-img-gallery.gray img {
|
93 |
+
-webkit-filter: grayscale(100%);
|
94 |
+
filter: grayscale(100%);
|
95 |
+
}
|
96 |
+
|
97 |
+
.premium-img-gallery.zoomout img,
|
98 |
+
.premium-img-gallery.scale img {
|
99 |
+
-webkit-transform: scale(1.2);
|
100 |
+
-ms-transform: scale(1.2);
|
101 |
+
transform: scale(1.2);
|
102 |
+
}
|
103 |
+
|
104 |
+
.premium-img-gallery.sepia img {
|
105 |
+
-webkit-filter: sepia(30%);
|
106 |
+
filter: sepia(30%);
|
107 |
+
}
|
108 |
+
|
109 |
+
.premium-img-gallery.bright img {
|
110 |
+
-webkit-filter: brightness(1);
|
111 |
+
filter: brightness(1);
|
112 |
+
}
|
113 |
+
|
114 |
+
.premium-img-gallery.trans img {
|
115 |
+
-webkit-transform: translateX(15px) scale(1.1);
|
116 |
+
-ms-transform: translateX(15px) scale(1.1);
|
117 |
+
transform: translateX(15px) scale(1.1);
|
118 |
+
}
|
119 |
+
|
120 |
+
.pa-gallery-img .pa-gallery-magnific-image,
|
121 |
+
.pa-gallery-img .pa-gallery-img-link {
|
122 |
+
outline: none;
|
123 |
+
}
|
124 |
+
|
125 |
+
.pa-gallery-img .pa-gallery-magnific-image i,
|
126 |
+
.pa-gallery-img .pa-gallery-magnific-image svg,
|
127 |
+
.pa-gallery-img .pa-gallery-img-link i,
|
128 |
+
.pa-gallery-img .pa-gallery-img-link svg {
|
129 |
+
-webkit-transition: all 0.3s ease-in-out;
|
130 |
+
transition: all 0.3s ease-in-out;
|
131 |
+
}
|
132 |
+
|
133 |
+
.pa-gallery-img .pa-gallery-magnific-image span,
|
134 |
+
.pa-gallery-img .pa-gallery-img-link span {
|
135 |
+
line-height: 1;
|
136 |
+
display: inline-block;
|
137 |
+
opacity: 0;
|
138 |
+
margin: 0 5px;
|
139 |
+
padding: 15px;
|
140 |
+
-webkit-border-radius: 50%;
|
141 |
+
border-radius: 50%;
|
142 |
+
}
|
143 |
+
|
144 |
+
.pa-gallery-img.style2 .pa-gallery-magnific-image span,
|
145 |
+
.pa-gallery-img.style2 .pa-gallery-img-link span {
|
146 |
+
margin: 0 5px 20px;
|
147 |
+
}
|
148 |
+
|
149 |
+
.pa-gallery-img:hover .pa-gallery-magnific-image span {
|
150 |
+
-webkit-transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out 0.3s;
|
151 |
+
transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out 0.3s;
|
152 |
+
}
|
153 |
+
|
154 |
+
.pa-gallery-img:hover .pa-gallery-img-link span {
|
155 |
+
-webkit-transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out 0.6s;
|
156 |
+
transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out 0.6s;
|
157 |
+
}
|
158 |
+
|
159 |
+
.pa-gallery-img:hover .pa-gallery-magnific-image span,
|
160 |
+
.pa-gallery-img:hover .pa-gallery-img-link span,
|
161 |
+
.premium-gallery-icon-show a.pa-gallery-video-icon span {
|
162 |
+
opacity: 1;
|
163 |
+
}
|
164 |
+
|
165 |
+
.premium-img-gallery-filter ul.premium-gallery-cats-container,
|
166 |
+
.premium-blog-filter ul.premium-blog-filters-container {
|
167 |
+
text-align: center;
|
168 |
+
margin: 0;
|
169 |
+
padding: 0;
|
170 |
+
}
|
171 |
+
|
172 |
+
.premium-img-gallery-filter .premium-gallery-cats-container li,
|
173 |
+
.premium-blog-filter .premium-blog-filters-container li {
|
174 |
+
list-style: none;
|
175 |
+
display: -webkit-inline-box;
|
176 |
+
display: -webkit-inline-flex;
|
177 |
+
display: -ms-inline-flexbox;
|
178 |
+
-js-display: inline-flex;
|
179 |
+
display: -moz-inline-box;
|
180 |
+
display: inline-flex;
|
181 |
+
}
|
182 |
+
|
183 |
+
.premium-img-gallery.zoomin .pa-gallery-img:hover img {
|
184 |
+
-webkit-transform: scale(1.1);
|
185 |
+
-ms-transform: scale(1.1);
|
186 |
+
transform: scale(1.1);
|
187 |
+
}
|
188 |
+
|
189 |
+
.premium-img-gallery.zoomout .pa-gallery-img:hover img {
|
190 |
+
-webkit-transform: scale(1);
|
191 |
+
-ms-transform: scale(1);
|
192 |
+
transform: scale(1);
|
193 |
+
}
|
194 |
+
|
195 |
+
.premium-img-gallery.scale .pa-gallery-img:hover img {
|
196 |
+
-webkit-transform: scale(1.3) rotate(-5deg);
|
197 |
+
-ms-transform: scale(1.3) rotate(-5deg);
|
198 |
+
transform: scale(1.3) rotate(-5deg);
|
199 |
+
}
|
200 |
+
|
201 |
+
.premium-img-gallery.gray .pa-gallery-img:hover img {
|
202 |
+
-webkit-filter: grayscale(0%);
|
203 |
+
filter: grayscale(0%);
|
204 |
+
}
|
205 |
+
|
206 |
+
.premium-img-gallery.blur .pa-gallery-img:hover img {
|
207 |
+
-webkit-filter: blur(3px);
|
208 |
+
filter: blur(3px);
|
209 |
+
}
|
210 |
+
|
211 |
+
.premium-img-gallery.sepia .pa-gallery-img:hover img {
|
212 |
+
-webkit-filter: sepia(0%);
|
213 |
+
filter: sepia(0%);
|
214 |
+
}
|
215 |
+
|
216 |
+
.premium-img-gallery.trans .pa-gallery-img:hover img {
|
217 |
+
-webkit-transform: translateX(0px) scale(1.1);
|
218 |
+
-ms-transform: translateX(0px) scale(1.1);
|
219 |
+
transform: translateX(0px) scale(1.1);
|
220 |
+
}
|
221 |
+
|
222 |
+
.premium-img-gallery.bright .pa-gallery-img:hover img {
|
223 |
+
-webkit-filter: brightness(1.2);
|
224 |
+
filter: brightness(1.2);
|
225 |
+
}
|
226 |
+
|
227 |
+
.pa-gallery-img .premium-gallery-caption {
|
228 |
+
padding: 10px;
|
229 |
+
}
|
230 |
+
|
231 |
+
.pa-gallery-img .premium-gallery-caption .premium-gallery-img-name {
|
232 |
+
margin-bottom: 0;
|
233 |
+
}
|
234 |
+
|
235 |
+
.pa-gallery-img.style1 {
|
236 |
+
overflow: hidden;
|
237 |
+
}
|
238 |
+
|
239 |
+
.pa-gallery-img:not(.style2) .pa-gallery-icons-wrapper {
|
240 |
+
position: absolute;
|
241 |
+
top: 0;
|
242 |
+
right: 0;
|
243 |
+
width: 100%;
|
244 |
+
height: 100%;
|
245 |
+
-webkit-transition: all 0.3s ease-in-out;
|
246 |
+
transition: all 0.3s ease-in-out;
|
247 |
+
}
|
248 |
+
|
249 |
+
.pa-gallery-img:not(.style2) .pa-gallery-icons-inner-container {
|
250 |
+
position: absolute;
|
251 |
+
top: 33.33%;
|
252 |
+
width: 100%;
|
253 |
+
text-align: center;
|
254 |
+
-webkit-transform: translateY(-50%);
|
255 |
+
-ms-transform: translateY(-50%);
|
256 |
+
transform: translateY(-50%);
|
257 |
+
z-index: 3;
|
258 |
+
}
|
259 |
+
|
260 |
+
.pa-gallery-img.style1 .premium-gallery-caption {
|
261 |
+
position: absolute;
|
262 |
+
top: auto;
|
263 |
+
left: 0;
|
264 |
+
right: 0;
|
265 |
+
width: 100%;
|
266 |
+
-webkit-transition: all 500ms ease 0s;
|
267 |
+
transition: all 500ms ease 0s;
|
268 |
+
-webkit-transform: translate3d(0, 100%, 0);
|
269 |
+
-ms-transform: translate3d(0, 100%, 0);
|
270 |
+
transform: translate3d(0, 100%, 0);
|
271 |
+
}
|
272 |
+
|
273 |
+
.pa-gallery-img.default .premium-gallery-caption {
|
274 |
+
position: absolute;
|
275 |
+
top: auto;
|
276 |
+
left: 0;
|
277 |
+
right: 0;
|
278 |
+
width: 100%;
|
279 |
+
bottom: 0;
|
280 |
+
}
|
281 |
+
|
282 |
+
.pa-gallery-img.style1:hover .premium-gallery-caption {
|
283 |
+
-webkit-transform: translate3d(0, 0, 0);
|
284 |
+
-ms-transform: translate3d(0, 0, 0);
|
285 |
+
transform: translate3d(0, 0, 0);
|
286 |
+
bottom: -1px !important;
|
287 |
+
}
|
288 |
+
|
289 |
+
.pa-gallery-img.style2 .pa-gallery-icons-caption-container {
|
290 |
+
position: absolute;
|
291 |
+
top: 0;
|
292 |
+
right: 0;
|
293 |
+
width: 100%;
|
294 |
+
height: 100%;
|
295 |
+
opacity: 0;
|
296 |
+
-webkit-backface-visibility: hidden;
|
297 |
+
backface-visibility: hidden;
|
298 |
+
-webkit-transition: -webkit-transform 0.3s, opacity 0.3s;
|
299 |
+
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
|
300 |
+
transition: opacity 0.3s, -webkit-transform 0.3s;
|
301 |
+
transition: transform 0.3s, opacity 0.3s;
|
302 |
+
transition: transform 0.3s, opacity 0.3s, -webkit-transform 0.3s;
|
303 |
+
z-index: 1;
|
304 |
+
background-color: rgba(108, 191, 226, 0.68);
|
305 |
+
display: -webkit-box;
|
306 |
+
display: -webkit-flex;
|
307 |
+
display: -ms-flexbox;
|
308 |
+
-js-display: flex;
|
309 |
+
display: -moz-box;
|
310 |
+
display: flex;
|
311 |
+
text-align: center;
|
312 |
+
-webkit-box-align: center;
|
313 |
+
-webkit-align-items: center;
|
314 |
+
-moz-box-align: center;
|
315 |
+
-ms-flex-align: center;
|
316 |
+
align-items: center;
|
317 |
+
}
|
318 |
+
|
319 |
+
.pa-gallery-img.style2 .pa-gallery-icons-caption-cell {
|
320 |
+
width: 100%;
|
321 |
+
}
|
322 |
+
|
323 |
+
.pa-gallery-img.style2:hover .pa-gallery-icons-caption-container {
|
324 |
+
opacity: 1;
|
325 |
+
-webkit-transform: translate(-15px, 15px);
|
326 |
+
-ms-transform: translate(-15px, 15px);
|
327 |
+
transform: translate(-15px, 15px);
|
328 |
+
}
|
329 |
+
|
330 |
+
.premium-clearfix {
|
331 |
+
clear: both;
|
332 |
+
}
|
333 |
+
|
334 |
+
.premium-gallery-container .pa-gallery-item {
|
335 |
+
padding: 10px;
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Metro Layout
|
340 |
+
*/
|
341 |
+
.premium-img-gallery-metro .premium-gallery-item {
|
342 |
+
overflow: hidden;
|
343 |
+
}
|
344 |
+
|
345 |
+
.premium-img-gallery-metro .pa-gallery-img {
|
346 |
+
height: 100%;
|
347 |
+
}
|
348 |
+
|
349 |
+
.premium-img-gallery-metro .pa-gallery-img-container {
|
350 |
+
height: 100%;
|
351 |
+
}
|
352 |
+
|
353 |
+
.premium-img-gallery-metro .pa-gallery-img-container img {
|
354 |
+
min-height: 100%;
|
355 |
+
width: 100%;
|
356 |
+
-o-object-fit: fill;
|
357 |
+
object-fit: fill;
|
358 |
+
}
|
359 |
+
|
360 |
+
.premium-img-gallery .premium-gallery-item-hidden {
|
361 |
+
visibility: hidden;
|
362 |
+
width: 0 !important;
|
363 |
+
height: 0 !important;
|
364 |
+
margin: 0 !important;
|
365 |
+
padding: 0 !important;
|
366 |
+
}
|
367 |
+
|
368 |
+
.premium-gallery-load-more .premium-gallery-load-more-btn {
|
369 |
+
-webkit-box-shadow: none;
|
370 |
+
box-shadow: none;
|
371 |
+
text-shadow: none;
|
372 |
+
border: none;
|
373 |
+
outline: none;
|
374 |
+
-webkit-box-align: center;
|
375 |
+
-ms-flex-align: center;
|
376 |
+
-webkit-align-items: center;
|
377 |
+
-moz-box-align: center;
|
378 |
+
align-items: center;
|
379 |
+
vertical-align: bottom;
|
380 |
+
cursor: pointer;
|
381 |
+
line-height: 1;
|
382 |
+
font-style: normal;
|
383 |
+
font-weight: normal;
|
384 |
+
background-image: none;
|
385 |
+
color: #fff;
|
386 |
+
-webkit-transition: all 0.3s ease-in-out;
|
387 |
+
transition: all 0.3s ease-in-out;
|
388 |
+
}
|
389 |
+
|
390 |
+
.premium-gallery-load-more-btn {
|
391 |
+
display: -webkit-inline-box;
|
392 |
+
display: -webkit-inline-flex;
|
393 |
+
display: -ms-inline-flexbox;
|
394 |
+
-js-display: inline-flex;
|
395 |
+
display: -moz-inline-box;
|
396 |
+
display: inline-flex;
|
397 |
+
-webkit-box-align: center;
|
398 |
+
-webkit-align-items: center;
|
399 |
+
-moz-box-align: center;
|
400 |
+
-ms-flex-align: center;
|
401 |
+
align-items: center;
|
402 |
+
}
|
403 |
+
|
404 |
+
.premium-gallery-load-more-btn div {
|
405 |
+
margin-right: 3px;
|
406 |
+
}
|
407 |
+
|
408 |
+
.premium-gallery-load-more-btn .premium-loader {
|
409 |
+
display: inline-block;
|
410 |
+
width: 20px;
|
411 |
+
height: 20px;
|
412 |
+
}
|
413 |
+
|
414 |
+
/** * Video */
|
415 |
+
.pa-gallery-img .pa-gallery-lightbox-wrap {
|
416 |
+
display: inline-block;
|
417 |
+
}
|
418 |
+
|
419 |
+
.premium-img-gallery-no-lightbox .premium-gallery-video-item .pa-gallery-img,
|
420 |
+
.pa-gallery-img .pa-gallery-video-icon {
|
421 |
+
cursor: pointer;
|
422 |
+
}
|
423 |
+
|
424 |
+
.pa-gallery-img-container iframe,
|
425 |
+
.pa-gallery-img-container video {
|
426 |
+
position: absolute;
|
427 |
+
visibility: hidden;
|
428 |
+
top: 0;
|
429 |
+
right: 0;
|
430 |
+
max-width: 100%;
|
431 |
+
width: 100%;
|
432 |
+
height: 100%;
|
433 |
+
margin: 0;
|
434 |
+
line-height: 1;
|
435 |
+
border: none;
|
436 |
+
}
|
437 |
+
|
438 |
+
.pa-gallery-img-container video {
|
439 |
+
-o-object-fit: contain;
|
440 |
+
object-fit: contain;
|
441 |
+
}
|
442 |
+
|
443 |
+
.pa-gallery-icons-inner-container svg,
|
444 |
+
.pa-gallery-icons-caption-cell svg {
|
445 |
+
width: 14px;
|
446 |
+
height: 14px;
|
447 |
+
}
|
448 |
+
|
449 |
+
.premium-gallery-gradient-layer {
|
450 |
+
position: absolute;
|
451 |
+
bottom: 40px;
|
452 |
+
width: 100%;
|
453 |
+
height: 20px;
|
454 |
+
background: -webkit-gradient(linear, left bottom, left top, from(#17181f), to(rgba(255, 255, 255, 0)));
|
455 |
+
background: -webkit-linear-gradient(bottom, #17181f 0%, rgba(255, 255, 255, 0) 100%);
|
456 |
+
background: linear-gradient(to top, #17181f 0%, rgba(255, 255, 255, 0) 100%);
|
457 |
}
|
assets/frontend/css/premium-img-gallery.css
CHANGED
@@ -53,6 +53,8 @@
|
|
53 |
width: 100%;
|
54 |
height: 100%;
|
55 |
z-index: 2; }
|
|
|
|
|
56 |
.pa-gallery-img.style2 .pa-gallery-whole-link, .pa-gallery-img.style3 .pa-gallery-whole-link {
|
57 |
z-index: 99; }
|
58 |
|
@@ -274,8 +276,8 @@
|
|
274 |
.premium-clearfix {
|
275 |
clear: both; }
|
276 |
|
277 |
-
/**
|
278 |
-
* Metro Layout
|
279 |
*/
|
280 |
.premium-img-gallery-metro .premium-gallery-item {
|
281 |
overflow: hidden; }
|
53 |
width: 100%;
|
54 |
height: 100%;
|
55 |
z-index: 2; }
|
56 |
+
.pa-gallery-img .pa-gallery-whole-link span {
|
57 |
+
display: none; }
|
58 |
.pa-gallery-img.style2 .pa-gallery-whole-link, .pa-gallery-img.style3 .pa-gallery-whole-link {
|
59 |
z-index: 99; }
|
60 |
|
276 |
.premium-clearfix {
|
277 |
clear: both; }
|
278 |
|
279 |
+
/**
|
280 |
+
* Metro Layout
|
281 |
*/
|
282 |
.premium-img-gallery-metro .premium-gallery-item {
|
283 |
overflow: hidden; }
|
assets/frontend/css/premium-nav-menu-rtl.css
CHANGED
@@ -255,6 +255,13 @@
|
|
255 |
transform: translateY(-50%);
|
256 |
}
|
257 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
/**Vertical Hamburger Menu*/
|
259 |
.premium-mobile-menu-outer-container {
|
260 |
opacity: 0;
|
@@ -567,9 +574,10 @@
|
|
567 |
transform: translateY(-100%);
|
568 |
}
|
569 |
|
570 |
-
.premium-nav-sticky-yes.premium-ham-dropdown .premium-mobile-menu-container
|
571 |
-
|
572 |
-
|
|
|
573 |
}
|
574 |
|
575 |
/**Common*/
|
255 |
transform: translateY(-50%);
|
256 |
}
|
257 |
|
258 |
+
.premium-nav-hor .premium-mobile-menu-container .premium-item-badge {
|
259 |
+
top: 0;
|
260 |
+
-webkit-transform: translateY(0);
|
261 |
+
-ms-transform: translateY(0);
|
262 |
+
transform: translateY(0);
|
263 |
+
}
|
264 |
+
|
265 |
/**Vertical Hamburger Menu*/
|
266 |
.premium-mobile-menu-outer-container {
|
267 |
opacity: 0;
|
574 |
transform: translateY(-100%);
|
575 |
}
|
576 |
|
577 |
+
.premium-nav-sticky-yes.premium-sticky-active.premium-ham-dropdown .premium-mobile-menu-container,
|
578 |
+
.premium-ham-dropdown .premium-stretch-dropdown .premium-mobile-menu-container {
|
579 |
+
max-height: 400px;
|
580 |
+
overflow-y: auto;
|
581 |
}
|
582 |
|
583 |
/**Common*/
|
assets/frontend/css/premium-nav-menu.css
CHANGED
@@ -204,6 +204,12 @@
|
|
204 |
-ms-transform: translateY(-50%);
|
205 |
transform: translateY(-50%); }
|
206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
/**Vertical Hamburger Menu*/
|
208 |
.premium-mobile-menu-outer-container {
|
209 |
opacity: 0; }
|
@@ -461,8 +467,9 @@
|
|
461 |
-ms-transform: translateY(-100%);
|
462 |
transform: translateY(-100%); }
|
463 |
|
464 |
-
.premium-nav-sticky-yes.premium-ham-dropdown .premium-mobile-menu-container
|
465 |
-
|
|
|
466 |
overflow-y: auto; }
|
467 |
|
468 |
/**Common*/
|
204 |
-ms-transform: translateY(-50%);
|
205 |
transform: translateY(-50%); }
|
206 |
|
207 |
+
.premium-nav-hor .premium-mobile-menu-container .premium-item-badge {
|
208 |
+
top: 0;
|
209 |
+
-webkit-transform: translateY(0);
|
210 |
+
-ms-transform: translateY(0);
|
211 |
+
transform: translateY(0); }
|
212 |
+
|
213 |
/**Vertical Hamburger Menu*/
|
214 |
.premium-mobile-menu-outer-container {
|
215 |
opacity: 0; }
|
467 |
-ms-transform: translateY(-100%);
|
468 |
transform: translateY(-100%); }
|
469 |
|
470 |
+
.premium-nav-sticky-yes.premium-sticky-active.premium-ham-dropdown .premium-mobile-menu-container,
|
471 |
+
.premium-ham-dropdown .premium-stretch-dropdown .premium-mobile-menu-container {
|
472 |
+
max-height: 400px;
|
473 |
overflow-y: auto; }
|
474 |
|
475 |
/**Common*/
|
assets/frontend/js/lottie.js
CHANGED
@@ -1,15582 +1,19242 @@
|
|
1 |
-
(function ($) {
|
2 |
-
|
3 |
-
(typeof navigator !== "undefined") && (function (
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
var
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
var
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
var
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
var
|
40 |
-
|
41 |
-
for (i = 0; i < len; i += 1) {
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
};
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
}
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
return
|
1319 |
-
}
|
1320 |
-
|
1321 |
-
function
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
var
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
}
|
1373 |
-
|
1374 |
-
|
1375 |
-
};
|
1376 |
-
}
|
1377 |
-
|
1378 |
-
function
|
1379 |
-
var
|
1380 |
-
var
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
}
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
}
|
1488 |
-
|
1489 |
-
function
|
1490 |
-
|
1491 |
-
}
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
var
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
}
|
1628 |
-
}
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
2140 |
-
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
}
|
2168 |
-
}
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
this.
|
2194 |
-
this.
|
2195 |
-
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
|
2346 |
-
|
2347 |
-
|
2348 |
-
|
2349 |
-
|
2350 |
-
|
2351 |
-
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
2358 |
-
|
2359 |
-
|
2360 |
-
|
2361 |
-
|
2362 |
-
|
2363 |
-
|
2364 |
-
|
2365 |
-
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
-
|
2370 |
-
|
2371 |
-
|
2372 |
-
|
2373 |
-
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
}
|
2378 |
-
|
2379 |
-
|
2380 |
-
}
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
2386 |
-
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
|
2392 |
-
|
2393 |
-
|
2394 |
-
|
2395 |
-
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
|
2400 |
-
|
2401 |
-
|
2402 |
-
|
2403 |
-
|
2404 |
-
|
2405 |
-
|
2406 |
-
|
2407 |
-
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
|
2423 |
-
|
2424 |
-
|
2425 |
-
|
2426 |
-
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
2430 |
-
|
2431 |
-
|
2432 |
-
|
2433 |
-
|
2434 |
-
|
2435 |
-
|
2436 |
-
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
|
2444 |
-
|
2445 |
-
|
2446 |
-
|
2447 |
-
|
2448 |
-
|
2449 |
-
|
2450 |
-
|
2451 |
-
|
2452 |
-
|
2453 |
-
|
2454 |
-
|
2455 |
-
|
2456 |
-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
2465 |
-
|
2466 |
-
|
2467 |
-
|
2468 |
-
|
2469 |
-
|
2470 |
-
|
2471 |
-
|
2472 |
-
|
2473 |
-
|
2474 |
-
|
2475 |
-
|
2476 |
-
|
2477 |
-
|
2478 |
-
|
2479 |
-
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
|
2484 |
-
|
2485 |
-
|
2486 |
-
|
2487 |
-
|
2488 |
-
|
2489 |
-
|
2490 |
-
|
2491 |
-
|
2492 |
-
|
2493 |
-
|
2494 |
-
|
2495 |
-
|
2496 |
-
|
2497 |
-
|
2498 |
-
|
2499 |
-
|
2500 |
-
|
2501 |
-
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
|
2506 |
-
|
2507 |
-
|
2508 |
-
|
2509 |
-
|
2510 |
-
|
2511 |
-
|
2512 |
-
|
2513 |
-
|
2514 |
-
|
2515 |
-
|
2516 |
-
|
2517 |
-
|
2518 |
-
|
2519 |
-
|
2520 |
-
|
2521 |
-
|
2522 |
-
|
2523 |
-
|
2524 |
-
|
2525 |
-
|
2526 |
-
|
2527 |
-
|
2528 |
-
|
2529 |
-
|
2530 |
-
|
2531 |
-
|
2532 |
-
|
2533 |
-
|
2534 |
-
|
2535 |
-
|
2536 |
-
|
2537 |
-
|
2538 |
-
|
2539 |
-
|
2540 |
-
|
2541 |
-
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
|
2546 |
-
|
2547 |
-
|
2548 |
-
|
2549 |
-
var
|
2550 |
-
|
2551 |
-
|
2552 |
-
|
2553 |
-
|
2554 |
-
|
2555 |
-
|
2556 |
-
|
2557 |
-
|
2558 |
-
|
2559 |
-
|
2560 |
-
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
-
|
2567 |
-
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
2571 |
-
|
2572 |
-
|
2573 |
-
|
2574 |
-
|
2575 |
-
};
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
2579 |
-
|
2580 |
-
|
2581 |
-
|
2582 |
-
|
2583 |
-
|
2584 |
-
|
2585 |
-
|
2586 |
-
|
2587 |
-
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
var i
|
2596 |
-
|
2597 |
-
for (i = 0; i < len
|
2598 |
-
|
2599 |
-
|
2600 |
-
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
2611 |
-
|
2612 |
-
|
2613 |
-
|
2614 |
-
|
2615 |
-
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
|
2630 |
-
|
2631 |
-
|
2632 |
-
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
2639 |
-
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
|
2646 |
-
|
2647 |
-
|
2648 |
-
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
2671 |
-
|
2672 |
-
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
|
2677 |
-
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
if (
|
2686 |
-
|
2687 |
-
|
2688 |
-
|
2689 |
-
|
2690 |
-
|
2691 |
-
|
2692 |
-
|
2693 |
-
|
2694 |
-
|
2695 |
-
|
2696 |
-
|
2697 |
-
|
2698 |
-
|
2699 |
-
|
2700 |
-
|
2701 |
-
|
2702 |
-
|
2703 |
-
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
|
2709 |
-
|
2710 |
-
|
2711 |
-
|
2712 |
-
|
2713 |
-
|
2714 |
-
|
2715 |
-
|
2716 |
-
|
2717 |
-
|
2718 |
-
|
2719 |
-
|
2720 |
-
|
2721 |
-
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
2733 |
-
|
2734 |
-
|
2735 |
-
|
2736 |
-
|
2737 |
-
|
2738 |
-
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
|
2743 |
-
|
2744 |
-
|
2745 |
-
|
2746 |
-
|
2747 |
-
|
2748 |
-
|
2749 |
-
|
2750 |
-
|
2751 |
-
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
2757 |
-
|
2758 |
-
|
2759 |
-
|
2760 |
-
|
2761 |
-
|
2762 |
-
|
2763 |
-
|
2764 |
-
|
2765 |
-
|
2766 |
-
|
2767 |
-
|
2768 |
-
|
2769 |
-
|
2770 |
-
|
2771 |
-
|
2772 |
-
|
2773 |
-
|
2774 |
-
|
2775 |
-
|
2776 |
-
|
2777 |
-
|
2778 |
-
|
2779 |
-
|
2780 |
-
|
2781 |
-
|
2782 |
-
|
2783 |
-
|
2784 |
-
|
2785 |
-
|
2786 |
-
|
2787 |
-
|
2788 |
-
|
2789 |
-
|
2790 |
-
|
2791 |
-
|
2792 |
-
|
2793 |
-
|
2794 |
-
|
2795 |
-
|
2796 |
-
|
2797 |
-
|
2798 |
-
|
2799 |
-
|
2800 |
-
|
2801 |
-
|
2802 |
-
|
2803 |
-
|
2804 |
-
|
2805 |
-
|
2806 |
-
|
2807 |
-
|
2808 |
-
|
2809 |
-
|
2810 |
-
|
2811 |
-
|
2812 |
-
|
2813 |
-
|
2814 |
-
|
2815 |
-
|
2816 |
-
|
2817 |
-
|
2818 |
-
|
2819 |
-
|
2820 |
-
}
|
2821 |
-
|
2822 |
-
|
2823 |
-
|
2824 |
-
|
2825 |
-
|
2826 |
-
|
2827 |
-
|
2828 |
-
function
|
2829 |
-
|
2830 |
-
|
2831 |
-
|
2832 |
-
|
2833 |
-
|
2834 |
-
|
2835 |
-
|
2836 |
-
|
2837 |
-
|
2838 |
-
|
2839 |
-
|
2840 |
-
|
2841 |
-
if (
|
2842 |
-
|
2843 |
-
}
|
2844 |
-
|
2845 |
-
|
2846 |
-
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
-
|
2853 |
-
|
2854 |
-
|
2855 |
-
|
2856 |
-
|
2857 |
-
|
2858 |
-
|
2859 |
-
|
2860 |
-
|
2861 |
-
|
2862 |
-
|
2863 |
-
|
2864 |
-
|
2865 |
-
|
2866 |
-
|
2867 |
-
|
2868 |
-
|
2869 |
-
|
2870 |
-
|
2871 |
-
|
2872 |
-
|
2873 |
-
|
2874 |
-
|
2875 |
-
|
2876 |
-
|
2877 |
-
|
2878 |
-
|
2879 |
-
this.
|
2880 |
-
|
2881 |
-
|
2882 |
-
|
2883 |
-
|
2884 |
-
|
2885 |
-
|
2886 |
-
|
2887 |
-
|
2888 |
-
|
2889 |
-
|
2890 |
-
|
2891 |
-
|
2892 |
-
|
2893 |
-
|
2894 |
-
|
2895 |
-
|
2896 |
-
|
2897 |
-
|
2898 |
-
|
2899 |
-
|
2900 |
-
|
2901 |
-
|
2902 |
-
|
2903 |
-
|
2904 |
-
|
2905 |
-
|
2906 |
-
|
2907 |
-
|
2908 |
-
|
2909 |
-
|
2910 |
-
|
2911 |
-
|
2912 |
-
|
2913 |
-
|
2914 |
-
|
2915 |
-
|
2916 |
-
|
2917 |
-
|
2918 |
-
|
2919 |
-
|
2920 |
-
|
2921 |
-
|
2922 |
-
|
2923 |
-
|
2924 |
-
|
2925 |
-
|
2926 |
-
|
2927 |
-
|
2928 |
-
|
2929 |
-
|
2930 |
-
|
2931 |
-
|
2932 |
-
|
2933 |
-
|
2934 |
-
|
2935 |
-
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
2939 |
-
|
2940 |
-
|
2941 |
-
|
2942 |
-
|
2943 |
-
|
2944 |
-
|
2945 |
-
|
2946 |
-
|
2947 |
-
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
-
|
2952 |
-
|
2953 |
-
|
2954 |
-
|
2955 |
-
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
|
2964 |
-
|
2965 |
-
|
2966 |
-
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
2974 |
-
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
|
2981 |
-
|
2982 |
-
|
2983 |
-
|
2984 |
-
|
2985 |
-
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
-
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
2993 |
-
|
2994 |
-
|
2995 |
-
|
2996 |
-
|
2997 |
-
|
2998 |
-
|
2999 |
-
|
3000 |
-
|
3001 |
-
|
3002 |
-
|
3003 |
-
|
3004 |
-
|
3005 |
-
|
3006 |
-
|
3007 |
-
|
3008 |
-
|
3009 |
-
|
3010 |
-
|
3011 |
-
}
|
3012 |
-
|
3013 |
-
|
3014 |
-
|
3015 |
-
|
3016 |
-
|
3017 |
-
|
3018 |
-
|
3019 |
-
|
3020 |
-
|
3021 |
-
|
3022 |
-
|
3023 |
-
|
3024 |
-
|
3025 |
-
|
3026 |
-
|
3027 |
-
|
3028 |
-
|
3029 |
-
|
3030 |
-
|
3031 |
-
|
3032 |
-
|
3033 |
-
|
3034 |
-
|
3035 |
-
|
3036 |
-
|
3037 |
-
|
3038 |
-
|
3039 |
-
|
3040 |
-
|
3041 |
-
|
3042 |
-
|
3043 |
-
|
3044 |
-
|
3045 |
-
|
3046 |
-
|
3047 |
-
|
3048 |
-
|
3049 |
-
|
3050 |
-
|
3051 |
-
|
3052 |
-
|
3053 |
-
|
3054 |
-
|
3055 |
-
|
3056 |
-
}
|
3057 |
-
|
3058 |
-
|
3059 |
-
|
3060 |
-
|
3061 |
-
|
3062 |
-
|
3063 |
-
|
3064 |
-
|
3065 |
-
|
3066 |
-
|
3067 |
-
|
3068 |
-
|
3069 |
-
|
3070 |
-
|
3071 |
-
|
3072 |
-
|
3073 |
-
|
3074 |
-
|
3075 |
-
|
3076 |
-
|
3077 |
-
|
3078 |
-
|
3079 |
-
|
3080 |
-
|
3081 |
-
|
3082 |
-
|
3083 |
-
|
3084 |
-
|
3085 |
-
|
3086 |
-
|
3087 |
-
|
3088 |
-
|
3089 |
-
|
3090 |
-
|
3091 |
-
|
3092 |
-
|
3093 |
-
|
3094 |
-
|
3095 |
-
|
3096 |
-
|
3097 |
-
|
3098 |
-
|
3099 |
-
|
3100 |
-
|
3101 |
-
|
3102 |
-
|
3103 |
-
|
3104 |
-
|
3105 |
-
|
3106 |
-
|
3107 |
-
|
3108 |
-
|
3109 |
-
|
3110 |
-
|
3111 |
-
|
3112 |
-
|
3113 |
-
|
3114 |
-
|
3115 |
-
|
3116 |
-
|
3117 |
-
|
3118 |
-
|
3119 |
-
|
3120 |
-
|
3121 |
-
if (
|
3122 |
-
|
3123 |
-
|
3124 |
-
|
3125 |
-
|
3126 |
-
|
3127 |
-
|
3128 |
-
|
3129 |
-
|
3130 |
-
|
3131 |
-
this.
|
3132 |
-
this.
|
3133 |
-
|
3134 |
-
|
3135 |
-
|
3136 |
-
|
3137 |
-
|
3138 |
-
|
3139 |
-
|
3140 |
-
|
3141 |
-
|
3142 |
-
|
3143 |
-
|
3144 |
-
|
3145 |
-
|
3146 |
-
|
3147 |
-
|
3148 |
-
|
3149 |
-
|
3150 |
-
|
3151 |
-
|
3152 |
-
|
3153 |
-
|
3154 |
-
|
3155 |
-
|
3156 |
-
|
3157 |
-
|
3158 |
-
|
3159 |
-
|
3160 |
-
|
3161 |
-
|
3162 |
-
|
3163 |
-
|
3164 |
-
|
3165 |
-
|
3166 |
-
|
3167 |
-
|
3168 |
-
|
3169 |
-
|
3170 |
-
|
3171 |
-
|
3172 |
-
|
3173 |
-
|
3174 |
-
|
3175 |
-
|
3176 |
-
|
3177 |
-
|
3178 |
-
|
3179 |
-
|
3180 |
-
|
3181 |
-
|
3182 |
-
|
3183 |
-
|
3184 |
-
|
3185 |
-
|
3186 |
-
|
3187 |
-
|
3188 |
-
|
3189 |
-
|
3190 |
-
|
3191 |
-
|
3192 |
-
|
3193 |
-
|
3194 |
-
|
3195 |
-
|
3196 |
-
|
3197 |
-
|
3198 |
-
|
3199 |
-
|
3200 |
-
|
3201 |
-
|
3202 |
-
|
3203 |
-
|
3204 |
-
var
|
3205 |
-
|
3206 |
-
|
3207 |
-
|
3208 |
-
|
3209 |
-
|
3210 |
-
|
3211 |
-
|
3212 |
-
|
3213 |
-
|
3214 |
-
|
3215 |
-
|
3216 |
-
|
3217 |
-
|
3218 |
-
|
3219 |
-
|
3220 |
-
|
3221 |
-
|
3222 |
-
|
3223 |
-
|
3224 |
-
|
3225 |
-
|
3226 |
-
|
3227 |
-
|
3228 |
-
|
3229 |
-
|
3230 |
-
|
3231 |
-
|
3232 |
-
|
3233 |
-
|
3234 |
-
|
3235 |
-
|
3236 |
-
|
3237 |
-
|
3238 |
-
|
3239 |
-
|
3240 |
-
|
3241 |
-
|
3242 |
-
|
3243 |
-
|
3244 |
-
|
3245 |
-
|
3246 |
-
|
3247 |
-
|
3248 |
-
|
3249 |
-
|
3250 |
-
|
3251 |
-
|
3252 |
-
|
3253 |
-
|
3254 |
-
|
3255 |
-
|
3256 |
-
|
3257 |
-
|
3258 |
-
|
3259 |
-
|
3260 |
-
|
3261 |
-
|
3262 |
-
|
3263 |
-
|
3264 |
-
|
3265 |
-
|
3266 |
-
|
3267 |
-
|
3268 |
-
|
3269 |
-
|
3270 |
-
|
3271 |
-
|
3272 |
-
|
3273 |
-
|
3274 |
-
|
3275 |
-
|
3276 |
-
|
3277 |
-
|
3278 |
-
|
3279 |
-
|
3280 |
-
|
3281 |
-
|
3282 |
-
|
3283 |
-
|
3284 |
-
|
3285 |
-
|
3286 |
-
|
3287 |
-
|
3288 |
-
|
3289 |
-
|
3290 |
-
|
3291 |
-
|
3292 |
-
|
3293 |
-
|
3294 |
-
|
3295 |
-
|
3296 |
-
|
3297 |
-
|
3298 |
-
|
3299 |
-
|
3300 |
-
|
3301 |
-
|
3302 |
-
|
3303 |
-
|
3304 |
-
|
3305 |
-
|
3306 |
-
|
3307 |
-
|
3308 |
-
|
3309 |
-
|
3310 |
-
|
3311 |
-
|
3312 |
-
|
3313 |
-
|
3314 |
-
|
3315 |
-
|
3316 |
-
|
3317 |
-
|
3318 |
-
|
3319 |
-
|
3320 |
-
|
3321 |
-
|
3322 |
-
|
3323 |
-
|
3324 |
-
|
3325 |
-
|
3326 |
-
|
3327 |
-
|
3328 |
-
|
3329 |
-
|
3330 |
-
|
3331 |
-
|
3332 |
-
|
3333 |
-
|
3334 |
-
|
3335 |
-
|
3336 |
-
|
3337 |
-
|
3338 |
-
|
3339 |
-
|
3340 |
-
|
3341 |
-
|
3342 |
-
|
3343 |
-
|
3344 |
-
|
3345 |
-
|
3346 |
-
|
3347 |
-
|
3348 |
-
|
3349 |
-
|
3350 |
-
|
3351 |
-
|
3352 |
-
|
3353 |
-
|
3354 |
-
|
3355 |
-
|
3356 |
-
|
3357 |
-
|
3358 |
-
|
3359 |
-
|
3360 |
-
|
3361 |
-
|
3362 |
-
|
3363 |
-
|
3364 |
-
|
3365 |
-
|
3366 |
-
|
3367 |
-
|
3368 |
-
|
3369 |
-
|
3370 |
-
var
|
3371 |
-
|
3372 |
-
|
3373 |
-
|
3374 |
-
|
3375 |
-
|
3376 |
-
|
3377 |
-
|
3378 |
-
|
3379 |
-
|
3380 |
-
|
3381 |
-
|
3382 |
-
|
3383 |
-
|
3384 |
-
|
3385 |
-
|
3386 |
-
|
3387 |
-
|
3388 |
-
|
3389 |
-
|
3390 |
-
|
3391 |
-
|
3392 |
-
|
3393 |
-
|
3394 |
-
|
3395 |
-
|
3396 |
-
|
3397 |
-
|
3398 |
-
|
3399 |
-
|
3400 |
-
|
3401 |
-
|
3402 |
-
|
3403 |
-
|
3404 |
-
|
3405 |
-
|
3406 |
-
|
3407 |
-
|
3408 |
-
|
3409 |
-
|
3410 |
-
|
3411 |
-
|
3412 |
-
|
3413 |
-
|
3414 |
-
|
3415 |
-
|
3416 |
-
|
3417 |
-
|
3418 |
-
|
3419 |
-
|
3420 |
-
|
3421 |
-
|
3422 |
-
|
3423 |
-
|
3424 |
-
|
3425 |
-
|
3426 |
-
|
3427 |
-
|
3428 |
-
|
3429 |
-
|
3430 |
-
|
3431 |
-
|
3432 |
-
|
3433 |
-
|
3434 |
-
|
3435 |
-
|
3436 |
-
|
3437 |
-
|
3438 |
-
|
3439 |
-
|
3440 |
-
|
3441 |
-
|
3442 |
-
|
3443 |
-
|
3444 |
-
|
3445 |
-
|
3446 |
-
|
3447 |
-
|
3448 |
-
|
3449 |
-
|
3450 |
-
|
3451 |
-
|
3452 |
-
|
3453 |
-
|
3454 |
-
|
3455 |
-
|
3456 |
-
|
3457 |
-
|
3458 |
-
|
3459 |
-
|
3460 |
-
|
3461 |
-
|
3462 |
-
|
3463 |
-
|
3464 |
-
|
3465 |
-
|
3466 |
-
|
3467 |
-
|
3468 |
-
|
3469 |
-
|
3470 |
-
|
3471 |
-
|
3472 |
-
|
3473 |
-
|
3474 |
-
|
3475 |
-
|
3476 |
-
|
3477 |
-
|
3478 |
-
|
3479 |
-
|
3480 |
-
|
3481 |
-
|
3482 |
-
|
3483 |
-
|
3484 |
-
|
3485 |
-
|
3486 |
-
|
3487 |
-
|
3488 |
-
|
3489 |
-
|
3490 |
-
|
3491 |
-
|
3492 |
-
|
3493 |
-
|
3494 |
-
|
3495 |
-
|
3496 |
-
|
3497 |
-
|
3498 |
-
}
|
3499 |
-
|
3500 |
-
|
3501 |
-
|
3502 |
-
|
3503 |
-
|
3504 |
-
|
3505 |
-
function
|
3506 |
-
|
3507 |
-
|
3508 |
-
|
3509 |
-
|
3510 |
-
|
3511 |
-
|
3512 |
-
|
3513 |
-
|
3514 |
-
|
3515 |
-
|
3516 |
-
|
3517 |
-
|
3518 |
-
|
3519 |
-
|
3520 |
-
|
3521 |
-
|
3522 |
-
|
3523 |
-
|
3524 |
-
|
3525 |
-
|
3526 |
-
|
3527 |
-
|
3528 |
-
}
|
3529 |
-
|
3530 |
-
|
3531 |
-
|
3532 |
-
|
3533 |
-
|
3534 |
-
|
3535 |
-
|
3536 |
-
|
3537 |
-
|
3538 |
-
|
3539 |
-
|
3540 |
-
|
3541 |
-
|
3542 |
-
|
3543 |
-
|
3544 |
-
|
3545 |
-
|
3546 |
-
|
3547 |
-
|
3548 |
-
|
3549 |
-
|
3550 |
-
|
3551 |
-
|
3552 |
-
|
3553 |
-
|
3554 |
-
|
3555 |
-
|
3556 |
-
|
3557 |
-
|
3558 |
-
|
3559 |
-
|
3560 |
-
|
3561 |
-
|
3562 |
-
|
3563 |
-
|
3564 |
-
|
3565 |
-
|
3566 |
-
|
3567 |
-
|
3568 |
-
|
3569 |
-
|
3570 |
-
|
3571 |
-
|
3572 |
-
|
3573 |
-
|
3574 |
-
|
3575 |
-
|
3576 |
-
|
3577 |
-
|
3578 |
-
|
3579 |
-
|
3580 |
-
|
3581 |
-
|
3582 |
-
|
3583 |
-
|
3584 |
-
|
3585 |
-
|
3586 |
-
|
3587 |
-
|
3588 |
-
|
3589 |
-
|
3590 |
-
|
3591 |
-
|
3592 |
-
|
3593 |
-
|
3594 |
-
|
3595 |
-
|
3596 |
-
|
3597 |
-
|
3598 |
-
|
3599 |
-
|
3600 |
-
|
3601 |
-
|
3602 |
-
|
3603 |
-
|
3604 |
-
|
3605 |
-
|
3606 |
-
|
3607 |
-
|
3608 |
-
|
3609 |
-
|
3610 |
-
|
3611 |
-
|
3612 |
-
|
3613 |
-
|
3614 |
-
|
3615 |
-
|
3616 |
-
|
3617 |
-
|
3618 |
-
|
3619 |
-
|
3620 |
-
|
3621 |
-
|
3622 |
-
|
3623 |
-
|
3624 |
-
|
3625 |
-
|
3626 |
-
|
3627 |
-
|
3628 |
-
|
3629 |
-
|
3630 |
-
|
3631 |
-
|
3632 |
-
|
3633 |
-
|
3634 |
-
|
3635 |
-
|
3636 |
-
|
3637 |
-
|
3638 |
-
|
3639 |
-
|
3640 |
-
|
3641 |
-
|
3642 |
-
|
3643 |
-
|
3644 |
-
|
3645 |
-
|
3646 |
-
|
3647 |
-
|
3648 |
-
|
3649 |
-
|
3650 |
-
|
3651 |
-
|
3652 |
-
}
|
3653 |
-
|
3654 |
-
|
3655 |
-
|
3656 |
-
|
3657 |
-
|
3658 |
-
|
3659 |
-
|
3660 |
-
|
3661 |
-
|
3662 |
-
|
3663 |
-
|
3664 |
-
|
3665 |
-
|
3666 |
-
|
3667 |
-
|
3668 |
-
|
3669 |
-
|
3670 |
-
|
3671 |
-
|
3672 |
-
|
3673 |
-
|
3674 |
-
|
3675 |
-
|
3676 |
-
this.
|
3677 |
-
this.
|
3678 |
-
|
3679 |
-
|
3680 |
-
|
3681 |
-
|
3682 |
-
|
3683 |
-
|
3684 |
-
|
3685 |
-
|
3686 |
-
|
3687 |
-
|
3688 |
-
|
3689 |
-
|
3690 |
-
|
3691 |
-
|
3692 |
-
|
3693 |
-
|
3694 |
-
|
3695 |
-
|
3696 |
-
|
3697 |
-
|
3698 |
-
|
3699 |
-
|
3700 |
-
|
3701 |
-
|
3702 |
-
|
3703 |
-
|
3704 |
-
|
3705 |
-
|
3706 |
-
|
3707 |
-
|
3708 |
-
|
3709 |
-
|
3710 |
-
|
3711 |
-
|
3712 |
-
|
3713 |
-
|
3714 |
-
|
3715 |
-
|
3716 |
-
|
3717 |
-
|
3718 |
-
|
3719 |
-
|
3720 |
-
|
3721 |
-
|
3722 |
-
|
3723 |
-
|
3724 |
-
|
3725 |
-
|
3726 |
-
|
3727 |
-
|
3728 |
-
|
3729 |
-
|
3730 |
-
|
3731 |
-
|
3732 |
-
|
3733 |
-
|
3734 |
-
|
3735 |
-
|
3736 |
-
|
3737 |
-
|
3738 |
-
|
3739 |
-
|
3740 |
-
|
3741 |
-
|
3742 |
-
|
3743 |
-
|
3744 |
-
|
3745 |
-
|
3746 |
-
|
3747 |
-
|
3748 |
-
|
3749 |
-
|
3750 |
-
|
3751 |
-
|
3752 |
-
|
3753 |
-
|
3754 |
-
|
3755 |
-
|
3756 |
-
|
3757 |
-
|
3758 |
-
|
3759 |
-
|
3760 |
-
|
3761 |
-
|
3762 |
-
|
3763 |
-
|
3764 |
-
|
3765 |
-
|
3766 |
-
|
3767 |
-
|
3768 |
-
|
3769 |
-
|
3770 |
-
|
3771 |
-
|
3772 |
-
|
3773 |
-
|
3774 |
-
|
3775 |
-
|
3776 |
-
|
3777 |
-
|
3778 |
-
|
3779 |
-
|
3780 |
-
|
3781 |
-
|
3782 |
-
|
3783 |
-
|
3784 |
-
|
3785 |
-
|
3786 |
-
|
3787 |
-
|
3788 |
-
|
3789 |
-
|
3790 |
-
|
3791 |
-
}
|
3792 |
-
|
3793 |
-
|
3794 |
-
|
3795 |
-
|
3796 |
-
|
3797 |
-
|
3798 |
-
|
3799 |
-
|
3800 |
-
|
3801 |
-
|
3802 |
-
|
3803 |
-
|
3804 |
-
|
3805 |
-
|
3806 |
-
|
3807 |
-
|
3808 |
-
|
3809 |
-
|
3810 |
-
|
3811 |
-
|
3812 |
-
|
3813 |
-
|
3814 |
-
|
3815 |
-
|
3816 |
-
|
3817 |
-
|
3818 |
-
|
3819 |
-
|
3820 |
-
|
3821 |
-
|
3822 |
-
|
3823 |
-
|
3824 |
-
|
3825 |
-
|
3826 |
-
|
3827 |
-
|
3828 |
-
|
3829 |
-
|
3830 |
-
|
3831 |
-
|
3832 |
-
|
3833 |
-
|
3834 |
-
|
3835 |
-
|
3836 |
-
|
3837 |
-
|
3838 |
-
|
3839 |
-
}
|
3840 |
-
|
3841 |
-
|
3842 |
-
|
3843 |
-
|
3844 |
-
|
3845 |
-
for (
|
3846 |
-
|
3847 |
-
|
3848 |
-
|
3849 |
-
|
3850 |
-
}
|
3851 |
-
|
3852 |
-
|
3853 |
-
|
3854 |
-
|
3855 |
-
|
3856 |
-
|
3857 |
-
|
3858 |
-
|
3859 |
-
|
3860 |
-
|
3861 |
-
|
3862 |
-
|
3863 |
-
|
3864 |
-
|
3865 |
-
|
3866 |
-
|
3867 |
-
|
3868 |
-
|
3869 |
-
|
3870 |
-
|
3871 |
-
|
3872 |
-
|
3873 |
-
|
3874 |
-
|
3875 |
-
|
3876 |
-
|
3877 |
-
|
3878 |
-
|
3879 |
-
|
3880 |
-
|
3881 |
-
|
3882 |
-
|
3883 |
-
|
3884 |
-
|
3885 |
-
|
3886 |
-
|
3887 |
-
|
3888 |
-
|
3889 |
-
|
3890 |
-
|
3891 |
-
|
3892 |
-
|
3893 |
-
|
3894 |
-
|
3895 |
-
|
3896 |
-
|
3897 |
-
|
3898 |
-
|
3899 |
-
|
3900 |
-
|
3901 |
-
|
3902 |
-
|
3903 |
-
|
3904 |
-
|
3905 |
-
|
3906 |
-
|
3907 |
-
|
3908 |
-
|
3909 |
-
|
3910 |
-
|
3911 |
-
|
3912 |
-
|
3913 |
-
|
3914 |
-
|
3915 |
-
|
3916 |
-
|
3917 |
-
|
3918 |
-
|
3919 |
-
|
3920 |
-
|
3921 |
-
|
3922 |
-
|
3923 |
-
|
3924 |
-
|
3925 |
-
|
3926 |
-
|
3927 |
-
|
3928 |
-
|
3929 |
-
|
3930 |
-
|
3931 |
-
|
3932 |
-
|
3933 |
-
|
3934 |
-
|
3935 |
-
|
3936 |
-
|
3937 |
-
|
3938 |
-
|
3939 |
-
|
3940 |
-
|
3941 |
-
|
3942 |
-
|
3943 |
-
|
3944 |
-
|
3945 |
-
|
3946 |
-
|
3947 |
-
|
3948 |
-
|
3949 |
-
|
3950 |
-
|
3951 |
-
|
3952 |
-
|
3953 |
-
|
3954 |
-
|
3955 |
-
|
3956 |
-
|
3957 |
-
|
3958 |
-
|
3959 |
-
|
3960 |
-
|
3961 |
-
|
3962 |
-
|
3963 |
-
|
3964 |
-
|
3965 |
-
|
3966 |
-
}
|
3967 |
-
|
3968 |
-
|
3969 |
-
|
3970 |
-
|
3971 |
-
|
3972 |
-
|
3973 |
-
|
3974 |
-
|
3975 |
-
|
3976 |
-
|
3977 |
-
var
|
3978 |
-
|
3979 |
-
|
3980 |
-
|
3981 |
-
|
3982 |
-
|
3983 |
-
|
3984 |
-
|
3985 |
-
|
3986 |
-
|
3987 |
-
|
3988 |
-
|
3989 |
-
|
3990 |
-
|
3991 |
-
|
3992 |
-
|
3993 |
-
|
3994 |
-
|
3995 |
-
|
3996 |
-
|
3997 |
-
|
3998 |
-
|
3999 |
-
|
4000 |
-
|
4001 |
-
|
4002 |
-
|
4003 |
-
|
4004 |
-
|
4005 |
-
|
4006 |
-
|
4007 |
-
|
4008 |
-
|
4009 |
-
|
4010 |
-
|
4011 |
-
|
4012 |
-
|
4013 |
-
|
4014 |
-
|
4015 |
-
|
4016 |
-
|
4017 |
-
|
4018 |
-
|
4019 |
-
this.
|
4020 |
-
|
4021 |
-
|
4022 |
-
|
4023 |
-
|
4024 |
-
|
4025 |
-
|
4026 |
-
|
4027 |
-
|
4028 |
-
|
4029 |
-
|
4030 |
-
|
4031 |
-
|
4032 |
-
|
4033 |
-
|
4034 |
-
|
4035 |
-
|
4036 |
-
|
4037 |
-
|
4038 |
-
|
4039 |
-
|
4040 |
-
|
4041 |
-
|
4042 |
-
|
4043 |
-
|
4044 |
-
|
4045 |
-
|
4046 |
-
|
4047 |
-
|
4048 |
-
|
4049 |
-
|
4050 |
-
|
4051 |
-
|
4052 |
-
|
4053 |
-
|
4054 |
-
|
4055 |
-
|
4056 |
-
|
4057 |
-
|
4058 |
-
|
4059 |
-
|
4060 |
-
|
4061 |
-
|
4062 |
-
|
4063 |
-
|
4064 |
-
|
4065 |
-
|
4066 |
-
|
4067 |
-
|
4068 |
-
|
4069 |
-
|
4070 |
-
|
4071 |
-
|
4072 |
-
|
4073 |
-
|
4074 |
-
|
4075 |
-
|
4076 |
-
|
4077 |
-
|
4078 |
-
|
4079 |
-
|
4080 |
-
|
4081 |
-
|
4082 |
-
|
4083 |
-
|
4084 |
-
|
4085 |
-
|
4086 |
-
|
4087 |
-
|
4088 |
-
|
4089 |
-
|
4090 |
-
|
4091 |
-
|
4092 |
-
var
|
4093 |
-
|
4094 |
-
|
4095 |
-
|
4096 |
-
|
4097 |
-
|
4098 |
-
|
4099 |
-
|
4100 |
-
|
4101 |
-
|
4102 |
-
|
4103 |
-
|
4104 |
-
|
4105 |
-
|
4106 |
-
|
4107 |
-
|
4108 |
-
|
4109 |
-
|
4110 |
-
|
4111 |
-
|
4112 |
-
|
4113 |
-
|
4114 |
-
|
4115 |
-
|
4116 |
-
|
4117 |
-
|
4118 |
-
|
4119 |
-
|
4120 |
-
|
4121 |
-
|
4122 |
-
|
4123 |
-
|
4124 |
-
|
4125 |
-
|
4126 |
-
|
4127 |
-
|
4128 |
-
|
4129 |
-
|
4130 |
-
|
4131 |
-
|
4132 |
-
|
4133 |
-
|
4134 |
-
|
4135 |
-
|
4136 |
-
|
4137 |
-
|
4138 |
-
|
4139 |
-
|
4140 |
-
|
4141 |
-
|
4142 |
-
|
4143 |
-
|
4144 |
-
|
4145 |
-
|
4146 |
-
|
4147 |
-
|
4148 |
-
|
4149 |
-
|
4150 |
-
|
4151 |
-
|
4152 |
-
|
4153 |
-
|
4154 |
-
|
4155 |
-
|
4156 |
-
|
4157 |
-
|
4158 |
-
|
4159 |
-
|
4160 |
-
}
|
4161 |
-
|
4162 |
-
|
4163 |
-
|
4164 |
-
|
4165 |
-
|
4166 |
-
|
4167 |
-
|
4168 |
-
|
4169 |
-
|
4170 |
-
|
4171 |
-
|
4172 |
-
|
4173 |
-
|
4174 |
-
|
4175 |
-
|
4176 |
-
|
4177 |
-
|
4178 |
-
|
4179 |
-
|
4180 |
-
|
4181 |
-
|
4182 |
-
|
4183 |
-
|
4184 |
-
|
4185 |
-
|
4186 |
-
|
4187 |
-
|
4188 |
-
|
4189 |
-
|
4190 |
-
|
4191 |
-
|
4192 |
-
|
4193 |
-
|
4194 |
-
|
4195 |
-
|
4196 |
-
|
4197 |
-
|
4198 |
-
|
4199 |
-
|
4200 |
-
|
4201 |
-
|
4202 |
-
|
4203 |
-
|
4204 |
-
|
4205 |
-
|
4206 |
-
|
4207 |
-
|
4208 |
-
|
4209 |
-
|
4210 |
-
|
4211 |
-
|
4212 |
-
|
4213 |
-
|
4214 |
-
|
4215 |
-
|
4216 |
-
|
4217 |
-
|
4218 |
-
|
4219 |
-
|
4220 |
-
|
4221 |
-
|
4222 |
-
|
4223 |
-
|
4224 |
-
|
4225 |
-
|
4226 |
-
|
4227 |
-
|
4228 |
-
|
4229 |
-
|
4230 |
-
|
4231 |
-
|
4232 |
-
|
4233 |
-
|
4234 |
-
|
4235 |
-
|
4236 |
-
|
4237 |
-
|
4238 |
-
|
4239 |
-
|
4240 |
-
|
4241 |
-
|
4242 |
-
|
4243 |
-
|
4244 |
-
|
4245 |
-
|
4246 |
-
|
4247 |
-
|
4248 |
-
|
4249 |
-
|
4250 |
-
|
4251 |
-
|
4252 |
-
|
4253 |
-
|
4254 |
-
|
4255 |
-
|
4256 |
-
|
4257 |
-
|
4258 |
-
|
4259 |
-
this.
|
4260 |
-
this.
|
4261 |
-
|
4262 |
-
|
4263 |
-
|
4264 |
-
|
4265 |
-
|
4266 |
-
|
4267 |
-
|
4268 |
-
|
4269 |
-
|
4270 |
-
|
4271 |
-
|
4272 |
-
|
4273 |
-
|
4274 |
-
|
4275 |
-
|
4276 |
-
|
4277 |
-
|
4278 |
-
|
4279 |
-
|
4280 |
-
|
4281 |
-
|
4282 |
-
|
4283 |
-
|
4284 |
-
|
4285 |
-
|
4286 |
-
|
4287 |
-
|
4288 |
-
|
4289 |
-
|
4290 |
-
|
4291 |
-
|
4292 |
-
|
4293 |
-
|
4294 |
-
|
4295 |
-
this.
|
4296 |
-
|
4297 |
-
|
4298 |
-
|
4299 |
-
|
4300 |
-
|
4301 |
-
|
4302 |
-
|
4303 |
-
|
4304 |
-
|
4305 |
-
|
4306 |
-
|
4307 |
-
|
4308 |
-
|
4309 |
-
|
4310 |
-
|
4311 |
-
|
4312 |
-
|
4313 |
-
|
4314 |
-
|
4315 |
-
|
4316 |
-
|
4317 |
-
|
4318 |
-
|
4319 |
-
|
4320 |
-
|
4321 |
-
|
4322 |
-
|
4323 |
-
|
4324 |
-
|
4325 |
-
|
4326 |
-
|
4327 |
-
|
4328 |
-
|
4329 |
-
|
4330 |
-
|
4331 |
-
|
4332 |
-
|
4333 |
-
|
4334 |
-
|
4335 |
-
|
4336 |
-
|
4337 |
-
|
4338 |
-
|
4339 |
-
|
4340 |
-
|
4341 |
-
|
4342 |
-
|
4343 |
-
|
4344 |
-
|
4345 |
-
|
4346 |
-
|
4347 |
-
|
4348 |
-
|
4349 |
-
|
4350 |
-
|
4351 |
-
|
4352 |
-
|
4353 |
-
|
4354 |
-
|
4355 |
-
|
4356 |
-
|
4357 |
-
|
4358 |
-
|
4359 |
-
|
4360 |
-
|
4361 |
-
|
4362 |
-
|
4363 |
-
|
4364 |
-
|
4365 |
-
|
4366 |
-
|
4367 |
-
|
4368 |
-
|
4369 |
-
|
4370 |
-
|
4371 |
-
|
4372 |
-
|
4373 |
-
|
4374 |
-
|
4375 |
-
|
4376 |
-
|
4377 |
-
|
4378 |
-
|
4379 |
-
|
4380 |
-
|
4381 |
-
|
4382 |
-
|
4383 |
-
|
4384 |
-
|
4385 |
-
|
4386 |
-
|
4387 |
-
|
4388 |
-
|
4389 |
-
|
4390 |
-
|
4391 |
-
|
4392 |
-
|
4393 |
-
|
4394 |
-
|
4395 |
-
|
4396 |
-
|
4397 |
-
|
4398 |
-
|
4399 |
-
|
4400 |
-
|
4401 |
-
|
4402 |
-
|
4403 |
-
|
4404 |
-
|
4405 |
-
|
4406 |
-
|
4407 |
-
|
4408 |
-
|
4409 |
-
|
4410 |
-
|
4411 |
-
|
4412 |
-
|
4413 |
-
|
4414 |
-
|
4415 |
-
|
4416 |
-
|
4417 |
-
|
4418 |
-
|
4419 |
-
|
4420 |
-
|
4421 |
-
|
4422 |
-
|
4423 |
-
|
4424 |
-
|
4425 |
-
|
4426 |
-
|
4427 |
-
|
4428 |
-
|
4429 |
-
|
4430 |
-
|
4431 |
-
|
4432 |
-
|
4433 |
-
|
4434 |
-
|
4435 |
-
|
4436 |
-
|
4437 |
-
|
4438 |
-
|
4439 |
-
|
4440 |
-
|
4441 |
-
this.
|
4442 |
-
|
4443 |
-
|
4444 |
-
|
4445 |
-
|
4446 |
-
|
4447 |
-
|
4448 |
-
|
4449 |
-
|
4450 |
-
|
4451 |
-
|
4452 |
-
|
4453 |
-
|
4454 |
-
|
4455 |
-
|
4456 |
-
|
4457 |
-
|
4458 |
-
|
4459 |
-
|
4460 |
-
|
4461 |
-
|
4462 |
-
|
4463 |
-
|
4464 |
-
|
4465 |
-
|
4466 |
-
|
4467 |
-
|
4468 |
-
|
4469 |
-
|
4470 |
-
|
4471 |
-
|
4472 |
-
|
4473 |
-
|
4474 |
-
|
4475 |
-
|
4476 |
-
|
4477 |
-
|
4478 |
-
|
4479 |
-
|
4480 |
-
|
4481 |
-
|
4482 |
-
|
4483 |
-
|
4484 |
-
|
4485 |
-
|
4486 |
-
|
4487 |
-
|
4488 |
-
|
4489 |
-
|
4490 |
-
|
4491 |
-
|
4492 |
-
|
4493 |
-
|
4494 |
-
|
4495 |
-
|
4496 |
-
|
4497 |
-
|
4498 |
-
|
4499 |
-
|
4500 |
-
|
4501 |
-
|
4502 |
-
|
4503 |
-
|
4504 |
-
|
4505 |
-
|
4506 |
-
|
4507 |
-
|
4508 |
-
|
4509 |
-
|
4510 |
-
|
4511 |
-
|
4512 |
-
|
4513 |
-
|
4514 |
-
|
4515 |
-
|
4516 |
-
|
4517 |
-
|
4518 |
-
|
4519 |
-
|
4520 |
-
|
4521 |
-
|
4522 |
-
|
4523 |
-
|
4524 |
-
|
4525 |
-
|
4526 |
-
|
4527 |
-
|
4528 |
-
|
4529 |
-
|
4530 |
-
|
4531 |
-
|
4532 |
-
|
4533 |
-
|
4534 |
-
|
4535 |
-
|
4536 |
-
|
4537 |
-
|
4538 |
-
|
4539 |
-
|
4540 |
-
|
4541 |
-
|
4542 |
-
|
4543 |
-
|
4544 |
-
|
4545 |
-
|
4546 |
-
|
4547 |
-
|
4548 |
-
|
4549 |
-
|
4550 |
-
|
4551 |
-
|
4552 |
-
|
4553 |
-
|
4554 |
-
|
4555 |
-
|
4556 |
-
|
4557 |
-
|
4558 |
-
|
4559 |
-
|
4560 |
-
|
4561 |
-
|
4562 |
-
|
4563 |
-
|
4564 |
-
|
4565 |
-
|
4566 |
-
|
4567 |
-
|
4568 |
-
|
4569 |
-
|
4570 |
-
|
4571 |
-
|
4572 |
-
|
4573 |
-
|
4574 |
-
|
4575 |
-
|
4576 |
-
|
4577 |
-
|
4578 |
-
|
4579 |
-
|
4580 |
-
|
4581 |
-
|
4582 |
-
|
4583 |
-
|
4584 |
-
|
4585 |
-
|
4586 |
-
|
4587 |
-
|
4588 |
-
|
4589 |
-
|
4590 |
-
|
4591 |
-
|
4592 |
-
|
4593 |
-
|
4594 |
-
|
4595 |
-
|
4596 |
-
|
4597 |
-
|
4598 |
-
|
4599 |
-
|
4600 |
-
|
4601 |
-
|
4602 |
-
|
4603 |
-
|
4604 |
-
|
4605 |
-
|
4606 |
-
|
4607 |
-
|
4608 |
-
|
4609 |
-
|
4610 |
-
|
4611 |
-
|
4612 |
-
|
4613 |
-
|
4614 |
-
|
4615 |
-
|
4616 |
-
|
4617 |
-
|
4618 |
-
|
4619 |
-
|
4620 |
-
|
4621 |
-
|
4622 |
-
|
4623 |
-
|
4624 |
-
|
4625 |
-
|
4626 |
-
|
4627 |
-
|
4628 |
-
|
4629 |
-
|
4630 |
-
|
4631 |
-
|
4632 |
-
|
4633 |
-
|
4634 |
-
|
4635 |
-
|
4636 |
-
|
4637 |
-
|
4638 |
-
|
4639 |
-
|
4640 |
-
|
4641 |
-
|
4642 |
-
|
4643 |
-
|
4644 |
-
|
4645 |
-
|
4646 |
-
|
4647 |
-
|
4648 |
-
|
4649 |
-
|
4650 |
-
|
4651 |
-
|
4652 |
-
|
4653 |
-
|
4654 |
-
|
4655 |
-
|
4656 |
-
|
4657 |
-
|
4658 |
-
|
4659 |
-
|
4660 |
-
|
4661 |
-
|
4662 |
-
|
4663 |
-
|
4664 |
-
|
4665 |
-
|
4666 |
-
|
4667 |
-
|
4668 |
-
|
4669 |
-
|
4670 |
-
|
4671 |
-
|
4672 |
-
|
4673 |
-
|
4674 |
-
|
4675 |
-
|
4676 |
-
|
4677 |
-
|
4678 |
-
|
4679 |
-
|
4680 |
-
|
4681 |
-
|
4682 |
-
|
4683 |
-
|
4684 |
-
|
4685 |
-
|
4686 |
-
|
4687 |
-
|
4688 |
-
|
4689 |
-
|
4690 |
-
|
4691 |
-
|
4692 |
-
|
4693 |
-
|
4694 |
-
|
4695 |
-
|
4696 |
-
|
4697 |
-
|
4698 |
-
|
4699 |
-
|
4700 |
-
|
4701 |
-
|
4702 |
-
|
4703 |
-
|
4704 |
-
|
4705 |
-
|
4706 |
-
|
4707 |
-
|
4708 |
-
|
4709 |
-
|
4710 |
-
|
4711 |
-
|
4712 |
-
|
4713 |
-
|
4714 |
-
|
4715 |
-
|
4716 |
-
|
4717 |
-
|
4718 |
-
|
4719 |
-
|
4720 |
-
|
4721 |
-
|
4722 |
-
|
4723 |
-
|
4724 |
-
|
4725 |
-
|
4726 |
-
|
4727 |
-
|
4728 |
-
|
4729 |
-
|
4730 |
-
|
4731 |
-
|
4732 |
-
|
4733 |
-
|
4734 |
-
|
4735 |
-
|
4736 |
-
|
4737 |
-
|
4738 |
-
|
4739 |
-
|
4740 |
-
|
4741 |
-
|
4742 |
-
|
4743 |
-
|
4744 |
-
|
4745 |
-
|
4746 |
-
|
4747 |
-
|
4748 |
-
|
4749 |
-
|
4750 |
-
|
4751 |
-
|
4752 |
-
|
4753 |
-
|
4754 |
-
|
4755 |
-
|
4756 |
-
|
4757 |
-
|
4758 |
-
|
4759 |
-
|
4760 |
-
|
4761 |
-
|
4762 |
-
|
4763 |
-
|
4764 |
-
|
4765 |
-
var
|
4766 |
-
|
4767 |
-
var
|
4768 |
-
|
4769 |
-
|
4770 |
-
|
4771 |
-
|
4772 |
-
|
4773 |
-
|
4774 |
-
|
4775 |
-
|
4776 |
-
|
4777 |
-
|
4778 |
-
|
4779 |
-
|
4780 |
-
|
4781 |
-
|
4782 |
-
|
4783 |
-
|
4784 |
-
|
4785 |
-
|
4786 |
-
|
4787 |
-
|
4788 |
-
|
4789 |
-
|
4790 |
-
|
4791 |
-
|
4792 |
-
|
4793 |
-
|
4794 |
-
|
4795 |
-
|
4796 |
-
|
4797 |
-
|
4798 |
-
|
4799 |
-
|
4800 |
-
|
4801 |
-
|
4802 |
-
|
4803 |
-
|
4804 |
-
|
4805 |
-
|
4806 |
-
|
4807 |
-
|
4808 |
-
|
4809 |
-
|
4810 |
-
|
4811 |
-
|
4812 |
-
|
4813 |
-
|
4814 |
-
|
4815 |
-
|
4816 |
-
|
4817 |
-
|
4818 |
-
|
4819 |
-
|
4820 |
-
|
4821 |
-
|
4822 |
-
|
4823 |
-
|
4824 |
-
|
4825 |
-
|
4826 |
-
|
4827 |
-
|
4828 |
-
|
4829 |
-
|
4830 |
-
|
4831 |
-
|
4832 |
-
|
4833 |
-
|
4834 |
-
|
4835 |
-
|
4836 |
-
|
4837 |
-
|
4838 |
-
|
4839 |
-
|
4840 |
-
|
4841 |
-
|
4842 |
-
|
4843 |
-
|
4844 |
-
|
4845 |
-
|
4846 |
-
|
4847 |
-
|
4848 |
-
|
4849 |
-
|
4850 |
-
|
4851 |
-
|
4852 |
-
|
4853 |
-
|
4854 |
-
|
4855 |
-
|
4856 |
-
|
4857 |
-
|
4858 |
-
|
4859 |
-
|
4860 |
-
|
4861 |
-
|
4862 |
-
|
4863 |
-
|
4864 |
-
|
4865 |
-
|
4866 |
-
|
4867 |
-
|
4868 |
-
|
4869 |
-
|
4870 |
-
|
4871 |
-
|
4872 |
-
|
4873 |
-
|
4874 |
-
|
4875 |
-
|
4876 |
-
|
4877 |
-
|
4878 |
-
|
4879 |
-
|
4880 |
-
|
4881 |
-
|
4882 |
-
|
4883 |
-
|
4884 |
-
|
4885 |
-
|
4886 |
-
|
4887 |
-
|
4888 |
-
|
4889 |
-
|
4890 |
-
|
4891 |
-
|
4892 |
-
|
4893 |
-
|
4894 |
-
|
4895 |
-
|
4896 |
-
|
4897 |
-
|
4898 |
-
|
4899 |
-
|
4900 |
-
|
4901 |
-
|
4902 |
-
|
4903 |
-
|
4904 |
-
|
4905 |
-
|
4906 |
-
|
4907 |
-
|
4908 |
-
|
4909 |
-
|
4910 |
-
|
4911 |
-
|
4912 |
-
|
4913 |
-
|
4914 |
-
|
4915 |
-
|
4916 |
-
|
4917 |
-
|
4918 |
-
|
4919 |
-
|
4920 |
-
|
4921 |
-
|
4922 |
-
|
4923 |
-
|
4924 |
-
|
4925 |
-
|
4926 |
-
|
4927 |
-
|
4928 |
-
|
4929 |
-
|
4930 |
-
|
4931 |
-
|
4932 |
-
|
4933 |
-
|
4934 |
-
|
4935 |
-
|
4936 |
-
|
4937 |
-
|
4938 |
-
|
4939 |
-
|
4940 |
-
|
4941 |
-
|
4942 |
-
|
4943 |
-
|
4944 |
-
|
4945 |
-
|
4946 |
-
|
4947 |
-
|
4948 |
-
|
4949 |
-
|
4950 |
-
|
4951 |
-
|
4952 |
-
|
4953 |
-
|
4954 |
-
|
4955 |
-
|
4956 |
-
|
4957 |
-
|
4958 |
-
|
4959 |
-
|
4960 |
-
|
4961 |
-
|
4962 |
-
|
4963 |
-
|
4964 |
-
|
4965 |
-
|
4966 |
-
|
4967 |
-
|
4968 |
-
|
4969 |
-
|
4970 |
-
|
4971 |
-
|
4972 |
-
|
4973 |
-
|
4974 |
-
|
4975 |
-
|
4976 |
-
|
4977 |
-
|
4978 |
-
|
4979 |
-
|
4980 |
-
|
4981 |
-
|
4982 |
-
|
4983 |
-
|
4984 |
-
|
4985 |
-
|
4986 |
-
|
4987 |
-
|
4988 |
-
|
4989 |
-
|
4990 |
-
|
4991 |
-
|
4992 |
-
|
4993 |
-
|
4994 |
-
|
4995 |
-
|
4996 |
-
|
4997 |
-
|
4998 |
-
|
4999 |
-
|
5000 |
-
|
5001 |
-
|
5002 |
-
|
5003 |
-
|
5004 |
-
|
5005 |
-
|
5006 |
-
|
5007 |
-
|
5008 |
-
|
5009 |
-
|
5010 |
-
|
5011 |
-
|
5012 |
-
|
5013 |
-
|
5014 |
-
|
5015 |
-
|
5016 |
-
|
5017 |
-
|
5018 |
-
|
5019 |
-
|
5020 |
-
|
5021 |
-
|
5022 |
-
|
5023 |
-
|
5024 |
-
|
5025 |
-
|
5026 |
-
|
5027 |
-
|
5028 |
-
|
5029 |
-
|
5030 |
-
|
5031 |
-
|
5032 |
-
|
5033 |
-
|
5034 |
-
|
5035 |
-
|
5036 |
-
|
5037 |
-
|
5038 |
-
|
5039 |
-
|
5040 |
-
|
5041 |
-
|
5042 |
-
|
5043 |
-
|
5044 |
-
|
5045 |
-
|
5046 |
-
|
5047 |
-
|
5048 |
-
|
5049 |
-
|
5050 |
-
|
5051 |
-
|
5052 |
-
|
5053 |
-
|
5054 |
-
|
5055 |
-
|
5056 |
-
|
5057 |
-
|
5058 |
-
|
5059 |
-
|
5060 |
-
|
5061 |
-
|
5062 |
-
|
5063 |
-
|
5064 |
-
|
5065 |
-
|
5066 |
-
|
5067 |
-
|
5068 |
-
|
5069 |
-
|
5070 |
-
|
5071 |
-
|
5072 |
-
|
5073 |
-
|
5074 |
-
|
5075 |
-
|
5076 |
-
|
5077 |
-
|
5078 |
-
|
5079 |
-
|
5080 |
-
|
5081 |
-
|
5082 |
-
|
5083 |
-
|
5084 |
-
|
5085 |
-
|
5086 |
-
|
5087 |
-
|
5088 |
-
|
5089 |
-
|
5090 |
-
|
5091 |
-
|
5092 |
-
|
5093 |
-
|
5094 |
-
|
5095 |
-
|
5096 |
-
|
5097 |
-
|
5098 |
-
|
5099 |
-
|
5100 |
-
|
5101 |
-
|
5102 |
-
|
5103 |
-
|
5104 |
-
|
5105 |
-
|
5106 |
-
|
5107 |
-
|
5108 |
-
|
5109 |
-
|
5110 |
-
|
5111 |
-
|
5112 |
-
|
5113 |
-
|
5114 |
-
|
5115 |
-
|
5116 |
-
|
5117 |
-
|
5118 |
-
|
5119 |
-
|
5120 |
-
|
5121 |
-
|
5122 |
-
|
5123 |
-
|
5124 |
-
|
5125 |
-
|
5126 |
-
|
5127 |
-
|
5128 |
-
|
5129 |
-
|
5130 |
-
|
5131 |
-
|
5132 |
-
|
5133 |
-
|
5134 |
-
|
5135 |
-
|
5136 |
-
|
5137 |
-
|
5138 |
-
|
5139 |
-
|
5140 |
-
|
5141 |
-
|
5142 |
-
|
5143 |
-
|
5144 |
-
|
5145 |
-
|
5146 |
-
|
5147 |
-
|
5148 |
-
|
5149 |
-
|
5150 |
-
|
5151 |
-
|
5152 |
-
|
5153 |
-
|
5154 |
-
|
5155 |
-
|
5156 |
-
|
5157 |
-
|
5158 |
-
|
5159 |
-
|
5160 |
-
|
5161 |
-
|
5162 |
-
|
5163 |
-
|
5164 |
-
|
5165 |
-
|
5166 |
-
|
5167 |
-
|
5168 |
-
|
5169 |
-
|
5170 |
-
|
5171 |
-
|
5172 |
-
|
5173 |
-
}
|
5174 |
-
|
5175 |
-
|
5176 |
-
|
5177 |
-
|
5178 |
-
|
5179 |
-
|
5180 |
-
|
5181 |
-
|
5182 |
-
|
5183 |
-
|
5184 |
-
|
5185 |
-
|
5186 |
-
|
5187 |
-
|
5188 |
-
|
5189 |
-
|
5190 |
-
|
5191 |
-
|
5192 |
-
|
5193 |
-
|
5194 |
-
|
5195 |
-
|
5196 |
-
|
5197 |
-
|
5198 |
-
|
5199 |
-
|
5200 |
-
|
5201 |
-
|
5202 |
-
|
5203 |
-
|
5204 |
-
|
5205 |
-
|
5206 |
-
|
5207 |
-
|
5208 |
-
|
5209 |
-
|
5210 |
-
|
5211 |
-
|
5212 |
-
|
5213 |
-
|
5214 |
-
|
5215 |
-
|
5216 |
-
|
5217 |
-
|
5218 |
-
|
5219 |
-
|
5220 |
-
|
5221 |
-
|
5222 |
-
|
5223 |
-
|
5224 |
-
|
5225 |
-
|
5226 |
-
|
5227 |
-
|
5228 |
-
|
5229 |
-
|
5230 |
-
|
5231 |
-
|
5232 |
-
|
5233 |
-
|
5234 |
-
|
5235 |
-
|
5236 |
-
|
5237 |
-
|
5238 |
-
|
5239 |
-
|
5240 |
-
|
5241 |
-
|
5242 |
-
|
5243 |
-
}
|
5244 |
-
|
5245 |
-
|
5246 |
-
|
5247 |
-
|
5248 |
-
|
5249 |
-
|
5250 |
-
|
5251 |
-
|
5252 |
-
|
5253 |
-
|
5254 |
-
|
5255 |
-
|
5256 |
-
|
5257 |
-
|
5258 |
-
|
5259 |
-
|
5260 |
-
|
5261 |
-
|
5262 |
-
|
5263 |
-
|
5264 |
-
|
5265 |
-
|
5266 |
-
|
5267 |
-
|
5268 |
-
|
5269 |
-
|
5270 |
-
|
5271 |
-
|
5272 |
-
|
5273 |
-
|
5274 |
-
|
5275 |
-
|
5276 |
-
|
5277 |
-
|
5278 |
-
|
5279 |
-
|
5280 |
-
|
5281 |
-
|
5282 |
-
|
5283 |
-
|
5284 |
-
|
5285 |
-
|
5286 |
-
|
5287 |
-
|
5288 |
-
|
5289 |
-
|
5290 |
-
|
5291 |
-
|
5292 |
-
|
5293 |
-
|
5294 |
-
|
5295 |
-
|
5296 |
-
|
5297 |
-
|
5298 |
-
|
5299 |
-
|
5300 |
-
|
5301 |
-
|
5302 |
-
|
5303 |
-
|
5304 |
-
|
5305 |
-
|
5306 |
-
|
5307 |
-
|
5308 |
-
|
5309 |
-
|
5310 |
-
|
5311 |
-
}
|
5312 |
-
|
5313 |
-
|
5314 |
-
|
5315 |
-
|
5316 |
-
|
5317 |
-
|
5318 |
-
|
5319 |
-
|
5320 |
-
|
5321 |
-
|
5322 |
-
|
5323 |
-
|
5324 |
-
|
5325 |
-
|
5326 |
-
|
5327 |
-
|
5328 |
-
}
|
5329 |
-
|
5330 |
-
|
5331 |
-
if (
|
5332 |
-
|
5333 |
-
}
|
5334 |
-
|
5335 |
-
this.
|
5336 |
-
this.
|
5337 |
-
};
|
5338 |
-
|
5339 |
-
|
5340 |
-
|
5341 |
-
}
|
5342 |
-
|
5343 |
-
|
5344 |
-
|
5345 |
-
|
5346 |
-
|
5347 |
-
|
5348 |
-
|
5349 |
-
|
5350 |
-
|
5351 |
-
|
5352 |
-
this.
|
5353 |
-
this.
|
5354 |
-
};
|
5355 |
-
|
5356 |
-
|
5357 |
-
|
5358 |
-
|
5359 |
-
|
5360 |
-
|
5361 |
-
var
|
5362 |
-
|
5363 |
-
if (
|
5364 |
-
|
5365 |
-
|
5366 |
-
|
5367 |
-
|
5368 |
-
|
5369 |
-
|
5370 |
-
|
5371 |
-
|
5372 |
-
|
5373 |
-
|
5374 |
-
|
5375 |
-
|
5376 |
-
|
5377 |
-
|
5378 |
-
|
5379 |
-
|
5380 |
-
|
5381 |
-
|
5382 |
-
}
|
5383 |
-
|
5384 |
-
|
5385 |
-
|
5386 |
-
|
5387 |
-
|
5388 |
-
|
5389 |
-
|
5390 |
-
|
5391 |
-
|
5392 |
-
|
5393 |
-
|
5394 |
-
|
5395 |
-
|
5396 |
-
|
5397 |
-
|
5398 |
-
|
5399 |
-
|
5400 |
-
|
5401 |
-
|
5402 |
-
|
5403 |
-
|
5404 |
-
|
5405 |
-
|
5406 |
-
|
5407 |
-
|
5408 |
-
|
5409 |
-
|
5410 |
-
|
5411 |
-
|
5412 |
-
|
5413 |
-
|
5414 |
-
|
5415 |
-
|
5416 |
-
|
5417 |
-
|
5418 |
-
|
5419 |
-
|
5420 |
-
|
5421 |
-
|
5422 |
-
|
5423 |
-
|
5424 |
-
|
5425 |
-
|
5426 |
-
|
5427 |
-
|
5428 |
-
|
5429 |
-
|
5430 |
-
|
5431 |
-
|
5432 |
-
|
5433 |
-
|
5434 |
-
|
5435 |
-
|
5436 |
-
|
5437 |
-
|
5438 |
-
|
5439 |
-
|
5440 |
-
|
5441 |
-
|
5442 |
-
|
5443 |
-
|
5444 |
-
|
5445 |
-
|
5446 |
-
|
5447 |
-
|
5448 |
-
|
5449 |
-
|
5450 |
-
|
5451 |
-
|
5452 |
-
|
5453 |
-
|
5454 |
-
|
5455 |
-
|
5456 |
-
|
5457 |
-
|
5458 |
-
|
5459 |
-
|
5460 |
-
|
5461 |
-
|
5462 |
-
|
5463 |
-
|
5464 |
-
|
5465 |
-
|
5466 |
-
|
5467 |
-
|
5468 |
-
|
5469 |
-
|
5470 |
-
|
5471 |
-
|
5472 |
-
|
5473 |
-
|
5474 |
-
|
5475 |
-
|
5476 |
-
|
5477 |
-
|
5478 |
-
|
5479 |
-
|
5480 |
-
|
5481 |
-
|
5482 |
-
|
5483 |
-
|
5484 |
-
|
5485 |
-
|
5486 |
-
|
5487 |
-
|
5488 |
-
|
5489 |
-
|
5490 |
-
|
5491 |
-
|
5492 |
-
|
5493 |
-
|
5494 |
-
var
|
5495 |
-
var
|
5496 |
-
var
|
5497 |
-
|
5498 |
-
|
5499 |
-
|
5500 |
-
|
5501 |
-
|
5502 |
-
|
5503 |
-
|
5504 |
-
|
5505 |
-
|
5506 |
-
|
5507 |
-
|
5508 |
-
|
5509 |
-
|
5510 |
-
|
5511 |
-
|
5512 |
-
|
5513 |
-
|
5514 |
-
|
5515 |
-
|
5516 |
-
|
5517 |
-
|
5518 |
-
|
5519 |
-
|
5520 |
-
|
5521 |
-
|
5522 |
-
|
5523 |
-
|
5524 |
-
|
5525 |
-
|
5526 |
-
|
5527 |
-
|
5528 |
-
|
5529 |
-
|
5530 |
-
|
5531 |
-
|
5532 |
-
|
5533 |
-
|
5534 |
-
|
5535 |
-
|
5536 |
-
|
5537 |
-
|
5538 |
-
|
5539 |
-
|
5540 |
-
|
5541 |
-
|
5542 |
-
|
5543 |
-
|
5544 |
-
|
5545 |
-
|
5546 |
-
|
5547 |
-
|
5548 |
-
|
5549 |
-
|
5550 |
-
|
5551 |
-
|
5552 |
-
|
5553 |
-
|
5554 |
-
|
5555 |
-
|
5556 |
-
|
5557 |
-
|
5558 |
-
|
5559 |
-
|
5560 |
-
|
5561 |
-
|
5562 |
-
|
5563 |
-
|
5564 |
-
|
5565 |
-
|
5566 |
-
|
5567 |
-
|
5568 |
-
|
5569 |
-
|
5570 |
-
|
5571 |
-
|
5572 |
-
|
5573 |
-
|
5574 |
-
|
5575 |
-
|
5576 |
-
|
5577 |
-
|
5578 |
-
|
5579 |
-
|
5580 |
-
|
5581 |
-
|
5582 |
-
|
5583 |
-
|
5584 |
-
|
5585 |
-
|
5586 |
-
|
5587 |
-
|
5588 |
-
|
5589 |
-
|
5590 |
-
|
5591 |
-
|
5592 |
-
|
5593 |
-
|
5594 |
-
|
5595 |
-
|
5596 |
-
|
5597 |
-
|
5598 |
-
|
5599 |
-
|
5600 |
-
|
5601 |
-
|
5602 |
-
|
5603 |
-
|
5604 |
-
|
5605 |
-
|
5606 |
-
|
5607 |
-
|
5608 |
-
|
5609 |
-
|
5610 |
-
|
5611 |
-
|
5612 |
-
|
5613 |
-
|
5614 |
-
|
5615 |
-
|
5616 |
-
|
5617 |
-
|
5618 |
-
|
5619 |
-
|
5620 |
-
|
5621 |
-
|
5622 |
-
|
5623 |
-
|
5624 |
-
|
5625 |
-
|
5626 |
-
|
5627 |
-
|
5628 |
-
|
5629 |
-
|
5630 |
-
|
5631 |
-
|
5632 |
-
|
5633 |
-
|
5634 |
-
|
5635 |
-
|
5636 |
-
|
5637 |
-
|
5638 |
-
|
5639 |
-
|
5640 |
-
|
5641 |
-
|
5642 |
-
|
5643 |
-
|
5644 |
-
|
5645 |
-
|
5646 |
-
|
5647 |
-
|
5648 |
-
|
5649 |
-
|
5650 |
-
|
5651 |
-
|
5652 |
-
|
5653 |
-
var
|
5654 |
-
|
5655 |
-
|
5656 |
-
|
5657 |
-
|
5658 |
-
|
5659 |
-
|
5660 |
-
|
5661 |
-
|
5662 |
-
|
5663 |
-
|
5664 |
-
|
5665 |
-
|
5666 |
-
|
5667 |
-
|
5668 |
-
|
5669 |
-
|
5670 |
-
|
5671 |
-
|
5672 |
-
|
5673 |
-
|
5674 |
-
|
5675 |
-
|
5676 |
-
|
5677 |
-
|
5678 |
-
|
5679 |
-
|
5680 |
-
|
5681 |
-
|
5682 |
-
|
5683 |
-
|
5684 |
-
|
5685 |
-
|
5686 |
-
|
5687 |
-
|
5688 |
-
|
5689 |
-
|
5690 |
-
|
5691 |
-
|
5692 |
-
|
5693 |
-
|
5694 |
-
|
5695 |
-
|
5696 |
-
|
5697 |
-
|
5698 |
-
|
5699 |
-
|
5700 |
-
|
5701 |
-
|
5702 |
-
|
5703 |
-
|
5704 |
-
|
5705 |
-
|
5706 |
-
|
5707 |
-
|
5708 |
-
|
5709 |
-
|
5710 |
-
|
5711 |
-
|
5712 |
-
|
5713 |
-
|
5714 |
-
|
5715 |
-
|
5716 |
-
|
5717 |
-
|
5718 |
-
|
5719 |
-
|
5720 |
-
|
5721 |
-
|
5722 |
-
|
5723 |
-
|
5724 |
-
|
5725 |
-
|
5726 |
-
|
5727 |
-
|
5728 |
-
|
5729 |
-
|
5730 |
-
|
5731 |
-
|
5732 |
-
|
5733 |
-
|
5734 |
-
|
5735 |
-
|
5736 |
-
|
5737 |
-
|
5738 |
-
|
5739 |
-
|
5740 |
-
|
5741 |
-
|
5742 |
-
|
5743 |
-
|
5744 |
-
|
5745 |
-
|
5746 |
-
|
5747 |
-
|
5748 |
-
|
5749 |
-
|
5750 |
-
|
5751 |
-
|
5752 |
-
|
5753 |
-
|
5754 |
-
|
5755 |
-
|
5756 |
-
|
5757 |
-
|
5758 |
-
|
5759 |
-
|
5760 |
-
|
5761 |
-
|
5762 |
-
|
5763 |
-
|
5764 |
-
|
5765 |
-
|
5766 |
-
|
5767 |
-
|
5768 |
-
|
5769 |
-
|
5770 |
-
|
5771 |
-
|
5772 |
-
|
5773 |
-
|
5774 |
-
|
5775 |
-
|
5776 |
-
|
5777 |
-
|
5778 |
-
|
5779 |
-
|
5780 |
-
|
5781 |
-
|
5782 |
-
|
5783 |
-
|
5784 |
-
|
5785 |
-
|
5786 |
-
|
5787 |
-
|
5788 |
-
|
5789 |
-
|
5790 |
-
|
5791 |
-
|
5792 |
-
|
5793 |
-
|
5794 |
-
|
5795 |
-
|
5796 |
-
|
5797 |
-
|
5798 |
-
|
5799 |
-
|
5800 |
-
|
5801 |
-
|
5802 |
-
|
5803 |
-
|
5804 |
-
|
5805 |
-
|
5806 |
-
|
5807 |
-
|
5808 |
-
|
5809 |
-
|
5810 |
-
|
5811 |
-
|
5812 |
-
|
5813 |
-
|
5814 |
-
|
5815 |
-
|
5816 |
-
|
5817 |
-
|
5818 |
-
|
5819 |
-
|
5820 |
-
|
5821 |
-
|
5822 |
-
|
5823 |
-
|
5824 |
-
|
5825 |
-
|
5826 |
-
|
5827 |
-
|
5828 |
-
|
5829 |
-
|
5830 |
-
|
5831 |
-
|
5832 |
-
|
5833 |
-
|
5834 |
-
|
5835 |
-
|
5836 |
-
|
5837 |
-
|
5838 |
-
|
5839 |
-
|
5840 |
-
|
5841 |
-
|
5842 |
-
|
5843 |
-
|
5844 |
-
|
5845 |
-
|
5846 |
-
|
5847 |
-
|
5848 |
-
|
5849 |
-
|
5850 |
-
|
5851 |
-
|
5852 |
-
|
5853 |
-
|
5854 |
-
|
5855 |
-
this.
|
5856 |
-
|
5857 |
-
|
5858 |
-
|
5859 |
-
|
5860 |
-
|
5861 |
-
|
5862 |
-
|
5863 |
-
|
5864 |
-
|
5865 |
-
|
5866 |
-
|
5867 |
-
|
5868 |
-
|
5869 |
-
|
5870 |
-
|
5871 |
-
|
5872 |
-
|
5873 |
-
|
5874 |
-
|
5875 |
-
|
5876 |
-
|
5877 |
-
|
5878 |
-
|
5879 |
-
|
5880 |
-
|
5881 |
-
|
5882 |
-
|
5883 |
-
|
5884 |
-
|
5885 |
-
|
5886 |
-
|
5887 |
-
|
5888 |
-
|
5889 |
-
|
5890 |
-
|
5891 |
-
|
5892 |
-
|
5893 |
-
|
5894 |
-
|
5895 |
-
|
5896 |
-
|
5897 |
-
|
5898 |
-
|
5899 |
-
|
5900 |
-
|
5901 |
-
|
5902 |
-
|
5903 |
-
|
5904 |
-
|
5905 |
-
|
5906 |
-
|
5907 |
-
|
5908 |
-
|
5909 |
-
|
5910 |
-
|
5911 |
-
|
5912 |
-
|
5913 |
-
|
5914 |
-
|
5915 |
-
|
5916 |
-
|
5917 |
-
|
5918 |
-
|
5919 |
-
|
5920 |
-
|
5921 |
-
|
5922 |
-
|
5923 |
-
|
5924 |
-
|
5925 |
-
|
5926 |
-
|
5927 |
-
|
5928 |
-
|
5929 |
-
|
5930 |
-
|
5931 |
-
|
5932 |
-
|
5933 |
-
|
5934 |
-
|
5935 |
-
|
5936 |
-
|
5937 |
-
|
5938 |
-
|
5939 |
-
|
5940 |
-
|
5941 |
-
|
5942 |
-
|
5943 |
-
|
5944 |
-
|
5945 |
-
|
5946 |
-
|
5947 |
-
|
5948 |
-
|
5949 |
-
|
5950 |
-
}
|
5951 |
-
|
5952 |
-
function
|
5953 |
-
|
5954 |
-
|
5955 |
-
|
5956 |
-
|
5957 |
-
|
5958 |
-
|
5959 |
-
|
5960 |
-
|
5961 |
-
|
5962 |
-
|
5963 |
-
|
5964 |
-
|
5965 |
-
|
5966 |
-
|
5967 |
-
|
5968 |
-
|
5969 |
-
|
5970 |
-
|
5971 |
-
|
5972 |
-
|
5973 |
-
|
5974 |
-
|
5975 |
-
|
5976 |
-
|
5977 |
-
|
5978 |
-
|
5979 |
-
|
5980 |
-
|
5981 |
-
|
5982 |
-
|
5983 |
-
|
5984 |
-
|
5985 |
-
|
5986 |
-
|
5987 |
-
|
5988 |
-
|
5989 |
-
}
|
5990 |
-
|
5991 |
-
|
5992 |
-
|
5993 |
-
|
5994 |
-
|
5995 |
-
|
5996 |
-
|
5997 |
-
|
5998 |
-
|
5999 |
-
|
6000 |
-
|
6001 |
-
|
6002 |
-
|
6003 |
-
|
6004 |
-
|
6005 |
-
|
6006 |
-
|
6007 |
-
|
6008 |
-
|
6009 |
-
|
6010 |
-
|
6011 |
-
|
6012 |
-
|
6013 |
-
|
6014 |
-
|
6015 |
-
|
6016 |
-
}
|
6017 |
-
|
6018 |
-
|
6019 |
-
|
6020 |
-
|
6021 |
-
|
6022 |
-
|
6023 |
-
|
6024 |
-
|
6025 |
-
|
6026 |
-
|
6027 |
-
|
6028 |
-
|
6029 |
-
|
6030 |
-
|
6031 |
-
|
6032 |
-
|
6033 |
-
|
6034 |
-
|
6035 |
-
|
6036 |
-
|
6037 |
-
|
6038 |
-
|
6039 |
-
|
6040 |
-
|
6041 |
-
|
6042 |
-
|
6043 |
-
|
6044 |
-
|
6045 |
-
|
6046 |
-
|
6047 |
-
|
6048 |
-
|
6049 |
-
}
|
6050 |
-
|
6051 |
-
|
6052 |
-
|
6053 |
-
|
6054 |
-
|
6055 |
-
|
6056 |
-
|
6057 |
-
|
6058 |
-
|
6059 |
-
|
6060 |
-
|
6061 |
-
|
6062 |
-
|
6063 |
-
|
6064 |
-
}
|
6065 |
-
}
|
6066 |
-
|
6067 |
-
|
6068 |
-
|
6069 |
-
|
6070 |
-
|
6071 |
-
|
6072 |
-
|
6073 |
-
|
6074 |
-
|
6075 |
-
|
6076 |
-
|
6077 |
-
|
6078 |
-
|
6079 |
-
|
6080 |
-
|
6081 |
-
|
6082 |
-
|
6083 |
-
|
6084 |
-
|
6085 |
-
|
6086 |
-
|
6087 |
-
|
6088 |
-
return
|
6089 |
-
|
6090 |
-
|
6091 |
-
|
6092 |
-
|
6093 |
-
}
|
6094 |
-
|
6095 |
-
|
6096 |
-
|
6097 |
-
|
6098 |
-
|
6099 |
-
|
6100 |
-
this.
|
6101 |
-
|
6102 |
-
|
6103 |
-
|
6104 |
-
this.
|
6105 |
-
|
6106 |
-
|
6107 |
-
|
6108 |
-
|
6109 |
-
|
6110 |
-
|
6111 |
-
|
6112 |
-
|
6113 |
-
|
6114 |
-
|
6115 |
-
|
6116 |
-
|
6117 |
-
|
6118 |
-
|
6119 |
-
|
6120 |
-
|
6121 |
-
|
6122 |
-
|
6123 |
-
|
6124 |
-
|
6125 |
-
|
6126 |
-
|
6127 |
-
|
6128 |
-
|
6129 |
-
|
6130 |
-
|
6131 |
-
|
6132 |
-
|
6133 |
-
|
6134 |
-
|
6135 |
-
|
6136 |
-
|
6137 |
-
|
6138 |
-
|
6139 |
-
|
6140 |
-
|
6141 |
-
|
6142 |
-
|
6143 |
-
|
6144 |
-
|
6145 |
-
|
6146 |
-
|
6147 |
-
|
6148 |
-
|
6149 |
-
|
6150 |
-
|
6151 |
-
|
6152 |
-
|
6153 |
-
|
6154 |
-
};
|
6155 |
-
|
6156 |
-
|
6157 |
-
var i
|
6158 |
-
|
6159 |
-
|
6160 |
-
|
6161 |
-
|
6162 |
-
|
6163 |
-
|
6164 |
-
|
6165 |
-
|
6166 |
-
|
6167 |
-
|
6168 |
-
|
6169 |
-
|
6170 |
-
|
6171 |
-
this.
|
6172 |
-
|
6173 |
-
|
6174 |
-
|
6175 |
-
|
6176 |
-
|
6177 |
-
|
6178 |
-
|
6179 |
-
|
6180 |
-
|
6181 |
-
|
6182 |
-
|
6183 |
-
|
6184 |
-
|
6185 |
-
|
6186 |
-
|
6187 |
-
|
6188 |
-
|
6189 |
-
|
6190 |
-
|
6191 |
-
|
6192 |
-
|
6193 |
-
|
6194 |
-
|
6195 |
-
|
6196 |
-
|
6197 |
-
|
6198 |
-
|
6199 |
-
|
6200 |
-
|
6201 |
-
|
6202 |
-
|
6203 |
-
|
6204 |
-
|
6205 |
-
|
6206 |
-
|
6207 |
-
|
6208 |
-
|
6209 |
-
|
6210 |
-
|
6211 |
-
|
6212 |
-
|
6213 |
-
|
6214 |
-
|
6215 |
-
|
6216 |
-
|
6217 |
-
|
6218 |
-
|
6219 |
-
|
6220 |
-
|
6221 |
-
|
6222 |
-
|
6223 |
-
|
6224 |
-
|
6225 |
-
|
6226 |
-
|
6227 |
-
|
6228 |
-
|
6229 |
-
|
6230 |
-
|
6231 |
-
|
6232 |
-
|
6233 |
-
|
6234 |
-
|
6235 |
-
|
6236 |
-
|
6237 |
-
|
6238 |
-
|
6239 |
-
|
6240 |
-
|
6241 |
-
|
6242 |
-
|
6243 |
-
|
6244 |
-
|
6245 |
-
|
6246 |
-
|
6247 |
-
|
6248 |
-
|
6249 |
-
|
6250 |
-
|
6251 |
-
|
6252 |
-
|
6253 |
-
|
6254 |
-
|
6255 |
-
|
6256 |
-
|
6257 |
-
|
6258 |
-
|
6259 |
-
|
6260 |
-
|
6261 |
-
|
6262 |
-
|
6263 |
-
|
6264 |
-
|
6265 |
-
|
6266 |
-
|
6267 |
-
|
6268 |
-
|
6269 |
-
|
6270 |
-
|
6271 |
-
|
6272 |
-
|
6273 |
-
|
6274 |
-
|
6275 |
-
|
6276 |
-
|
6277 |
-
|
6278 |
-
|
6279 |
-
|
6280 |
-
|
6281 |
-
|
6282 |
-
|
6283 |
-
|
6284 |
-
|
6285 |
-
|
6286 |
-
|
6287 |
-
|
6288 |
-
|
6289 |
-
|
6290 |
-
|
6291 |
-
|
6292 |
-
|
6293 |
-
|
6294 |
-
this.
|
6295 |
-
|
6296 |
-
|
6297 |
-
|
6298 |
-
|
6299 |
-
|
6300 |
-
|
6301 |
-
|
6302 |
-
|
6303 |
-
|
6304 |
-
|
6305 |
-
|
6306 |
-
|
6307 |
-
|
6308 |
-
|
6309 |
-
|
6310 |
-
|
6311 |
-
|
6312 |
-
|
6313 |
-
|
6314 |
-
|
6315 |
-
|
6316 |
-
|
6317 |
-
|
6318 |
-
|
6319 |
-
|
6320 |
-
|
6321 |
-
|
6322 |
-
|
6323 |
-
|
6324 |
-
|
6325 |
-
|
6326 |
-
|
6327 |
-
|
6328 |
-
|
6329 |
-
|
6330 |
-
|
6331 |
-
|
6332 |
-
|
6333 |
-
|
6334 |
-
|
6335 |
-
|
6336 |
-
|
6337 |
-
|
6338 |
-
|
6339 |
-
|
6340 |
-
|
6341 |
-
|
6342 |
-
|
6343 |
-
|
6344 |
-
|
6345 |
-
|
6346 |
-
|
6347 |
-
|
6348 |
-
|
6349 |
-
|
6350 |
-
|
6351 |
-
|
6352 |
-
|
6353 |
-
|
6354 |
-
|
6355 |
-
|
6356 |
-
|
6357 |
-
|
6358 |
-
|
6359 |
-
|
6360 |
-
|
6361 |
-
|
6362 |
-
|
6363 |
-
|
6364 |
-
|
6365 |
-
|
6366 |
-
|
6367 |
-
|
6368 |
-
|
6369 |
-
|
6370 |
-
|
6371 |
-
|
6372 |
-
|
6373 |
-
|
6374 |
-
|
6375 |
-
|
6376 |
-
|
6377 |
-
|
6378 |
-
|
6379 |
-
|
6380 |
-
|
6381 |
-
|
6382 |
-
|
6383 |
-
}
|
6384 |
-
|
6385 |
-
|
6386 |
-
|
6387 |
-
|
6388 |
-
|
6389 |
-
|
6390 |
-
|
6391 |
-
|
6392 |
-
|
6393 |
-
|
6394 |
-
|
6395 |
-
|
6396 |
-
|
6397 |
-
|
6398 |
-
|
6399 |
-
|
6400 |
-
var
|
6401 |
-
|
6402 |
-
|
6403 |
-
|
6404 |
-
|
6405 |
-
|
6406 |
-
|
6407 |
-
|
6408 |
-
|
6409 |
-
|
6410 |
-
|
6411 |
-
|
6412 |
-
|
6413 |
-
|
6414 |
-
|
6415 |
-
|
6416 |
-
|
6417 |
-
|
6418 |
-
|
6419 |
-
|
6420 |
-
|
6421 |
-
|
6422 |
-
|
6423 |
-
|
6424 |
-
|
6425 |
-
|
6426 |
-
|
6427 |
-
|
6428 |
-
|
6429 |
-
|
6430 |
-
|
6431 |
-
|
6432 |
-
|
6433 |
-
|
6434 |
-
|
6435 |
-
|
6436 |
-
|
6437 |
-
|
6438 |
-
|
6439 |
-
|
6440 |
-
|
6441 |
-
|
6442 |
-
|
6443 |
-
|
6444 |
-
|
6445 |
-
|
6446 |
-
|
6447 |
-
|
6448 |
-
|
6449 |
-
|
6450 |
-
|
6451 |
-
|
6452 |
-
|
6453 |
-
|
6454 |
-
|
6455 |
-
|
6456 |
-
|
6457 |
-
|
6458 |
-
|
6459 |
-
|
6460 |
-
|
6461 |
-
|
6462 |
-
|
6463 |
-
|
6464 |
-
|
6465 |
-
|
6466 |
-
|
6467 |
-
|
6468 |
-
|
6469 |
-
|
6470 |
-
|
6471 |
-
|
6472 |
-
|
6473 |
-
|
6474 |
-
|
6475 |
-
|
6476 |
-
|
6477 |
-
|
6478 |
-
|
6479 |
-
|
6480 |
-
|
6481 |
-
|
6482 |
-
|
6483 |
-
|
6484 |
-
|
6485 |
-
|
6486 |
-
|
6487 |
-
|
6488 |
-
|
6489 |
-
|
6490 |
-
|
6491 |
-
|
6492 |
-
|
6493 |
-
|
6494 |
-
|
6495 |
-
|
6496 |
-
|
6497 |
-
|
6498 |
-
|
6499 |
-
|
6500 |
-
if (
|
6501 |
-
|
6502 |
-
}
|
6503 |
-
|
6504 |
-
|
6505 |
-
|
6506 |
-
|
6507 |
-
|
6508 |
-
var
|
6509 |
-
|
6510 |
-
|
6511 |
-
|
6512 |
-
var
|
6513 |
-
|
6514 |
-
|
6515 |
-
|
6516 |
-
|
6517 |
-
|
6518 |
-
|
6519 |
-
|
6520 |
-
|
6521 |
-
|
6522 |
-
|
6523 |
-
|
6524 |
-
|
6525 |
-
|
6526 |
-
|
6527 |
-
|
6528 |
-
|
6529 |
-
|
6530 |
-
|
6531 |
-
|
6532 |
-
|
6533 |
-
|
6534 |
-
|
6535 |
-
|
6536 |
-
|
6537 |
-
|
6538 |
-
|
6539 |
-
|
6540 |
-
|
6541 |
-
|
6542 |
-
|
6543 |
-
|
6544 |
-
|
6545 |
-
|
6546 |
-
|
6547 |
-
|
6548 |
-
|
6549 |
-
|
6550 |
-
|
6551 |
-
|
6552 |
-
|
6553 |
-
|
6554 |
-
|
6555 |
-
|
6556 |
-
|
6557 |
-
|
6558 |
-
|
6559 |
-
|
6560 |
-
|
6561 |
-
|
6562 |
-
|
6563 |
-
|
6564 |
-
|
6565 |
-
|
6566 |
-
|
6567 |
-
|
6568 |
-
|
6569 |
-
|
6570 |
-
|
6571 |
-
|
6572 |
-
|
6573 |
-
|
6574 |
-
|
6575 |
-
|
6576 |
-
|
6577 |
-
|
6578 |
-
|
6579 |
-
|
6580 |
-
|
6581 |
-
|
6582 |
-
|
6583 |
-
|
6584 |
-
|
6585 |
-
|
6586 |
-
|
6587 |
-
|
6588 |
-
|
6589 |
-
|
6590 |
-
|
6591 |
-
|
6592 |
-
|
6593 |
-
|
6594 |
-
|
6595 |
-
|
6596 |
-
|
6597 |
-
|
6598 |
-
|
6599 |
-
|
6600 |
-
|
6601 |
-
|
6602 |
-
|
6603 |
-
|
6604 |
-
|
6605 |
-
|
6606 |
-
|
6607 |
-
|
6608 |
-
|
6609 |
-
|
6610 |
-
|
6611 |
-
|
6612 |
-
|
6613 |
-
|
6614 |
-
|
6615 |
-
|
6616 |
-
|
6617 |
-
|
6618 |
-
|
6619 |
-
|
6620 |
-
|
6621 |
-
|
6622 |
-
|
6623 |
-
|
6624 |
-
|
6625 |
-
|
6626 |
-
|
6627 |
-
|
6628 |
-
|
6629 |
-
|
6630 |
-
|
6631 |
-
|
6632 |
-
|
6633 |
-
|
6634 |
-
|
6635 |
-
|
6636 |
-
|
6637 |
-
|
6638 |
-
|
6639 |
-
|
6640 |
-
|
6641 |
-
|
6642 |
-
|
6643 |
-
|
6644 |
-
|
6645 |
-
|
6646 |
-
|
6647 |
-
|
6648 |
-
|
6649 |
-
|
6650 |
-
|
6651 |
-
|
6652 |
-
|
6653 |
-
|
6654 |
-
|
6655 |
-
}
|
6656 |
-
|
6657 |
-
|
6658 |
-
|
6659 |
-
|
6660 |
-
|
6661 |
-
|
6662 |
-
|
6663 |
-
|
6664 |
-
|
6665 |
-
|
6666 |
-
|
6667 |
-
|
6668 |
-
|
6669 |
-
|
6670 |
-
|
6671 |
-
|
6672 |
-
|
6673 |
-
|
6674 |
-
|
6675 |
-
|
6676 |
-
|
6677 |
-
|
6678 |
-
|
6679 |
-
|
6680 |
-
|
6681 |
-
|
6682 |
-
|
6683 |
-
|
6684 |
-
|
6685 |
-
|
6686 |
-
|
6687 |
-
|
6688 |
-
|
6689 |
-
|
6690 |
-
|
6691 |
-
|
6692 |
-
|
6693 |
-
|
6694 |
-
|
6695 |
-
|
6696 |
-
|
6697 |
-
|
6698 |
-
|
6699 |
-
|
6700 |
-
|
6701 |
-
|
6702 |
-
|
6703 |
-
|
6704 |
-
|
6705 |
-
|
6706 |
-
|
6707 |
-
|
6708 |
-
|
6709 |
-
|
6710 |
-
|
6711 |
-
|
6712 |
-
|
6713 |
-
|
6714 |
-
|
6715 |
-
|
6716 |
-
|
6717 |
-
|
6718 |
-
|
6719 |
-
|
6720 |
-
|
6721 |
-
|
6722 |
-
|
6723 |
-
|
6724 |
-
|
6725 |
-
|
6726 |
-
|
6727 |
-
|
6728 |
-
|
6729 |
-
|
6730 |
-
|
6731 |
-
|
6732 |
-
|
6733 |
-
|
6734 |
-
|
6735 |
-
|
6736 |
-
|
6737 |
-
|
6738 |
-
|
6739 |
-
|
6740 |
-
|
6741 |
-
|
6742 |
-
|
6743 |
-
|
6744 |
-
|
6745 |
-
|
6746 |
-
|
6747 |
-
|
6748 |
-
|
6749 |
-
|
6750 |
-
|
6751 |
-
|
6752 |
-
|
6753 |
-
|
6754 |
-
|
6755 |
-
|
6756 |
-
|
6757 |
-
|
6758 |
-
|
6759 |
-
|
6760 |
-
|
6761 |
-
|
6762 |
-
|
6763 |
-
|
6764 |
-
|
6765 |
-
|
6766 |
-
|
6767 |
-
|
6768 |
-
|
6769 |
-
|
6770 |
-
|
6771 |
-
|
6772 |
-
|
6773 |
-
|
6774 |
-
|
6775 |
-
|
6776 |
-
|
6777 |
-
|
6778 |
-
|
6779 |
-
|
6780 |
-
|
6781 |
-
|
6782 |
-
|
6783 |
-
|
6784 |
-
|
6785 |
-
|
6786 |
-
|
6787 |
-
|
6788 |
-
|
6789 |
-
|
6790 |
-
|
6791 |
-
|
6792 |
-
|
6793 |
-
|
6794 |
-
|
6795 |
-
|
6796 |
-
|
6797 |
-
|
6798 |
-
|
6799 |
-
|
6800 |
-
|
6801 |
-
|
6802 |
-
|
6803 |
-
|
6804 |
-
|
6805 |
-
|
6806 |
-
|
6807 |
-
|
6808 |
-
|
6809 |
-
|
6810 |
-
|
6811 |
-
|
6812 |
-
|
6813 |
-
|
6814 |
-
|
6815 |
-
|
6816 |
-
|
6817 |
-
|
6818 |
-
|
6819 |
-
|
6820 |
-
|
6821 |
-
|
6822 |
-
|
6823 |
-
|
6824 |
-
|
6825 |
-
|
6826 |
-
|
6827 |
-
|
6828 |
-
|
6829 |
-
|
6830 |
-
|
6831 |
-
|
6832 |
-
|
6833 |
-
|
6834 |
-
|
6835 |
-
|
6836 |
-
|
6837 |
-
|
6838 |
-
}
|
6839 |
-
|
6840 |
-
|
6841 |
-
|
6842 |
-
|
6843 |
-
|
6844 |
-
|
6845 |
-
|
6846 |
-
|
6847 |
-
|
6848 |
-
|
6849 |
-
|
6850 |
-
|
6851 |
-
|
6852 |
-
|
6853 |
-
|
6854 |
-
|
6855 |
-
|
6856 |
-
|
6857 |
-
|
6858 |
-
|
6859 |
-
|
6860 |
-
|
6861 |
-
|
6862 |
-
|
6863 |
-
|
6864 |
-
|
6865 |
-
|
6866 |
-
|
6867 |
-
|
6868 |
-
|
6869 |
-
|
6870 |
-
|
6871 |
-
|
6872 |
-
|
6873 |
-
|
6874 |
-
|
6875 |
-
|
6876 |
-
|
6877 |
-
|
6878 |
-
|
6879 |
-
|
6880 |
-
|
6881 |
-
|
6882 |
-
|
6883 |
-
|
6884 |
-
|
6885 |
-
|
6886 |
-
|
6887 |
-
|
6888 |
-
|
6889 |
-
|
6890 |
-
|
6891 |
-
|
6892 |
-
|
6893 |
-
|
6894 |
-
|
6895 |
-
|
6896 |
-
|
6897 |
-
|
6898 |
-
|
6899 |
-
|
6900 |
-
|
6901 |
-
|
6902 |
-
|
6903 |
-
|
6904 |
-
|
6905 |
-
|
6906 |
-
|
6907 |
-
|
6908 |
-
|
6909 |
-
|
6910 |
-
|
6911 |
-
|
6912 |
-
|
6913 |
-
|
6914 |
-
|
6915 |
-
|
6916 |
-
|
6917 |
-
|
6918 |
-
|
6919 |
-
|
6920 |
-
|
6921 |
-
|
6922 |
-
|
6923 |
-
|
6924 |
-
|
6925 |
-
|
6926 |
-
|
6927 |
-
|
6928 |
-
|
6929 |
-
|
6930 |
-
|
6931 |
-
|
6932 |
-
|
6933 |
-
|
6934 |
-
|
6935 |
-
|
6936 |
-
|
6937 |
-
|
6938 |
-
|
6939 |
-
|
6940 |
-
if (currentContainer !== '3d') {
|
6941 |
-
currentContainer = '3d';
|
6942 |
-
lastThreeDContainerData = this.createThreeDContainer(i, '3d');
|
6943 |
-
}
|
6944 |
-
lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
|
6945 |
-
} else {
|
6946 |
-
if (currentContainer !== '2d') {
|
6947 |
-
currentContainer = '2d';
|
6948 |
-
lastThreeDContainerData = this.createThreeDContainer(i, '2d');
|
6949 |
-
}
|
6950 |
-
lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
|
6951 |
-
}
|
6952 |
-
}
|
6953 |
-
len = this.threeDElements.length;
|
6954 |
-
for (i = len - 1; i >= 0; i--) {
|
6955 |
-
this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
|
6956 |
-
}
|
6957 |
-
};
|
6958 |
-
|
6959 |
-
HybridRenderer.prototype.addTo3dContainer = function (elem, pos) {
|
6960 |
-
var i = 0,
|
6961 |
-
len = this.threeDElements.length;
|
6962 |
-
while (i < len) {
|
6963 |
-
if (pos <= this.threeDElements[i].endPos) {
|
6964 |
-
var j = this.threeDElements[i].startPos;
|
6965 |
-
var nextElement;
|
6966 |
-
while (j < pos) {
|
6967 |
-
if (this.elements[j] && this.elements[j].getBaseElement) {
|
6968 |
-
nextElement = this.elements[j].getBaseElement();
|
6969 |
-
}
|
6970 |
-
j += 1;
|
6971 |
-
}
|
6972 |
-
if (nextElement) {
|
6973 |
-
this.threeDElements[i].container.insertBefore(elem, nextElement);
|
6974 |
-
} else {
|
6975 |
-
this.threeDElements[i].container.appendChild(elem);
|
6976 |
-
}
|
6977 |
-
break;
|
6978 |
-
}
|
6979 |
-
i += 1;
|
6980 |
-
}
|
6981 |
-
};
|
6982 |
-
|
6983 |
-
HybridRenderer.prototype.configAnimation = function (animData) {
|
6984 |
-
var resizerElem = createTag('div');
|
6985 |
-
var wrapper = this.animationItem.wrapper;
|
6986 |
-
resizerElem.style.width = animData.w + 'px';
|
6987 |
-
resizerElem.style.height = animData.h + 'px';
|
6988 |
-
this.resizerElem = resizerElem;
|
6989 |
-
styleDiv(resizerElem);
|
6990 |
-
resizerElem.style.transformStyle = resizerElem.style.webkitTransformStyle = resizerElem.style.mozTransformStyle = "flat";
|
6991 |
-
if (this.renderConfig.className) {
|
6992 |
-
resizerElem.setAttribute('class', this.renderConfig.className);
|
6993 |
-
}
|
6994 |
-
wrapper.appendChild(resizerElem);
|
6995 |
-
|
6996 |
-
resizerElem.style.overflow = 'hidden';
|
6997 |
-
var svg = createNS('svg');
|
6998 |
-
svg.setAttribute('width', '1');
|
6999 |
-
svg.setAttribute('height', '1');
|
7000 |
-
styleDiv(svg);
|
7001 |
-
this.resizerElem.appendChild(svg);
|
7002 |
-
var defs = createNS('defs');
|
7003 |
-
svg.appendChild(defs);
|
7004 |
-
this.data = animData;
|
7005 |
-
//Mask animation
|
7006 |
-
this.setupGlobalData(animData, svg);
|
7007 |
-
this.globalData.defs = defs;
|
7008 |
-
this.layers = animData.layers;
|
7009 |
-
this.layerElement = this.resizerElem;
|
7010 |
-
this.build3dContainers();
|
7011 |
-
this.updateContainerSize();
|
7012 |
-
};
|
7013 |
-
|
7014 |
-
HybridRenderer.prototype.destroy = function () {
|
7015 |
-
this.animationItem.wrapper.innerHTML = '';
|
7016 |
-
this.animationItem.container = null;
|
7017 |
-
this.globalData.defs = null;
|
7018 |
-
var i, len = this.layers ? this.layers.length : 0;
|
7019 |
-
for (i = 0; i < len; i++) {
|
7020 |
-
this.elements[i].destroy();
|
7021 |
-
}
|
7022 |
-
this.elements.length = 0;
|
7023 |
-
this.destroyed = true;
|
7024 |
-
this.animationItem = null;
|
7025 |
-
};
|
7026 |
-
|
7027 |
-
HybridRenderer.prototype.updateContainerSize = function () {
|
7028 |
-
var elementWidth = this.animationItem.wrapper.offsetWidth;
|
7029 |
-
var elementHeight = this.animationItem.wrapper.offsetHeight;
|
7030 |
-
var elementRel = elementWidth / elementHeight;
|
7031 |
-
var animationRel = this.globalData.compSize.w / this.globalData.compSize.h;
|
7032 |
-
var sx, sy, tx, ty;
|
7033 |
-
if (animationRel > elementRel) {
|
7034 |
-
sx = elementWidth / (this.globalData.compSize.w);
|
7035 |
-
sy = elementWidth / (this.globalData.compSize.w);
|
7036 |
-
tx = 0;
|
7037 |
-
ty = ((elementHeight - this.globalData.compSize.h * (elementWidth / this.globalData.compSize.w)) / 2);
|
7038 |
-
} else {
|
7039 |
-
sx = elementHeight / (this.globalData.compSize.h);
|
7040 |
-
sy = elementHeight / (this.globalData.compSize.h);
|
7041 |
-
tx = (elementWidth - this.globalData.compSize.w * (elementHeight / this.globalData.compSize.h)) / 2;
|
7042 |
-
ty = 0;
|
7043 |
-
}
|
7044 |
-
this.resizerElem.style.transform = this.resizerElem.style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,' + sy + ',0,0,0,0,1,0,' + tx + ',' + ty + ',0,1)';
|
7045 |
-
};
|
7046 |
-
|
7047 |
-
HybridRenderer.prototype.renderFrame = SVGRenderer.prototype.renderFrame;
|
7048 |
-
|
7049 |
-
HybridRenderer.prototype.hide = function () {
|
7050 |
-
this.resizerElem.style.display = 'none';
|
7051 |
-
};
|
7052 |
-
|
7053 |
-
HybridRenderer.prototype.show = function () {
|
7054 |
-
this.resizerElem.style.display = 'block';
|
7055 |
-
};
|
7056 |
-
|
7057 |
-
HybridRenderer.prototype.initItems = function () {
|
7058 |
-
this.buildAllItems();
|
7059 |
-
if (this.camera) {
|
7060 |
-
this.camera.setup();
|
7061 |
-
} else {
|
7062 |
-
var cWidth = this.globalData.compSize.w;
|
7063 |
-
var cHeight = this.globalData.compSize.h;
|
7064 |
-
var i, len = this.threeDElements.length;
|
7065 |
-
for (i = 0; i < len; i += 1) {
|
7066 |
-
this.threeDElements[i].perspectiveElem.style.perspective = this.threeDElements[i].perspectiveElem.style.webkitPerspective = Math.sqrt(Math.pow(cWidth, 2) + Math.pow(cHeight, 2)) + 'px';
|
7067 |
-
}
|
7068 |
-
}
|
7069 |
-
};
|
7070 |
-
|
7071 |
-
HybridRenderer.prototype.searchExtraCompositions = function (assets) {
|
7072 |
-
var i, len = assets.length;
|
7073 |
-
var floatingContainer = createTag('div');
|
7074 |
-
for (i = 0; i < len; i += 1) {
|
7075 |
-
if (assets[i].xt) {
|
7076 |
-
var comp = this.createComp(assets[i], floatingContainer, this.globalData.comp, null);
|
7077 |
-
comp.initExpressions();
|
7078 |
-
this.globalData.projectInterface.registerComposition(comp);
|
7079 |
-
}
|
7080 |
-
}
|
7081 |
-
};
|
7082 |
-
|
7083 |
-
function MaskElement(data, element, globalData) {
|
7084 |
-
this.data = data;
|
7085 |
-
this.element = element;
|
7086 |
-
this.globalData = globalData;
|
7087 |
-
this.storedData = [];
|
7088 |
-
this.masksProperties = this.data.masksProperties || [];
|
7089 |
-
this.maskElement = null;
|
7090 |
-
var defs = this.globalData.defs;
|
7091 |
-
var i, len = this.masksProperties ? this.masksProperties.length : 0;
|
7092 |
-
this.viewData = createSizedArray(len);
|
7093 |
-
this.solidPath = '';
|
7094 |
-
|
7095 |
-
|
7096 |
-
var path, properties = this.masksProperties;
|
7097 |
-
var count = 0;
|
7098 |
-
var currentMasks = [];
|
7099 |
-
var j, jLen;
|
7100 |
-
var layerId = createElementID();
|
7101 |
-
var rect, expansor, feMorph, x;
|
7102 |
-
var maskType = 'clipPath',
|
7103 |
-
maskRef = 'clip-path';
|
7104 |
-
for (i = 0; i < len; i++) {
|
7105 |
-
if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
|
7106 |
-
maskType = 'mask';
|
7107 |
-
maskRef = 'mask';
|
7108 |
-
}
|
7109 |
-
|
7110 |
-
if ((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0) {
|
7111 |
-
rect = createNS('rect');
|
7112 |
-
rect.setAttribute('fill', '#ffffff');
|
7113 |
-
rect.setAttribute('width', this.element.comp.data.w || 0);
|
7114 |
-
rect.setAttribute('height', this.element.comp.data.h || 0);
|
7115 |
-
currentMasks.push(rect);
|
7116 |
-
} else {
|
7117 |
-
rect = null;
|
7118 |
-
}
|
7119 |
-
|
7120 |
-
path = createNS('path');
|
7121 |
-
if (properties[i].mode == 'n') {
|
7122 |
-
// TODO move this to a factory or to a constructor
|
7123 |
-
this.viewData[i] = {
|
7124 |
-
op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
|
7125 |
-
prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
|
7126 |
-
elem: path,
|
7127 |
-
lastPath: ''
|
7128 |
-
};
|
7129 |
-
defs.appendChild(path);
|
7130 |
-
continue;
|
7131 |
-
}
|
7132 |
-
count += 1;
|
7133 |
-
|
7134 |
-
path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
|
7135 |
-
path.setAttribute('clip-rule', 'nonzero');
|
7136 |
-
var filterID;
|
7137 |
-
|
7138 |
-
if (properties[i].x.k !== 0) {
|
7139 |
-
maskType = 'mask';
|
7140 |
-
maskRef = 'mask';
|
7141 |
-
x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
|
7142 |
-
filterID = createElementID();
|
7143 |
-
expansor = createNS('filter');
|
7144 |
-
expansor.setAttribute('id', filterID);
|
7145 |
-
feMorph = createNS('feMorphology');
|
7146 |
-
feMorph.setAttribute('operator', 'erode');
|
7147 |
-
feMorph.setAttribute('in', 'SourceGraphic');
|
7148 |
-
feMorph.setAttribute('radius', '0');
|
7149 |
-
expansor.appendChild(feMorph);
|
7150 |
-
defs.appendChild(expansor);
|
7151 |
-
path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
|
7152 |
-
} else {
|
7153 |
-
feMorph = null;
|
7154 |
-
x = null;
|
7155 |
-
}
|
7156 |
-
|
7157 |
-
// TODO move this to a factory or to a constructor
|
7158 |
-
this.storedData[i] = {
|
7159 |
-
elem: path,
|
7160 |
-
x: x,
|
7161 |
-
expan: feMorph,
|
7162 |
-
lastPath: '',
|
7163 |
-
lastOperator: '',
|
7164 |
-
filterId: filterID,
|
7165 |
-
lastRadius: 0
|
7166 |
-
};
|
7167 |
-
if (properties[i].mode == 'i') {
|
7168 |
-
jLen = currentMasks.length;
|
7169 |
-
var g = createNS('g');
|
7170 |
-
for (j = 0; j < jLen; j += 1) {
|
7171 |
-
g.appendChild(currentMasks[j]);
|
7172 |
-
}
|
7173 |
-
var mask = createNS('mask');
|
7174 |
-
mask.setAttribute('mask-type', 'alpha');
|
7175 |
-
mask.setAttribute('id', layerId + '_' + count);
|
7176 |
-
mask.appendChild(path);
|
7177 |
-
defs.appendChild(mask);
|
7178 |
-
g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
|
7179 |
-
|
7180 |
-
currentMasks.length = 0;
|
7181 |
-
currentMasks.push(g);
|
7182 |
-
} else {
|
7183 |
-
currentMasks.push(path);
|
7184 |
-
}
|
7185 |
-
if (properties[i].inv && !this.solidPath) {
|
7186 |
-
this.solidPath = this.createLayerSolidPath();
|
7187 |
-
}
|
7188 |
-
// TODO move this to a factory or to a constructor
|
7189 |
-
this.viewData[i] = {
|
7190 |
-
elem: path,
|
7191 |
-
lastPath: '',
|
7192 |
-
op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
|
7193 |
-
prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
|
7194 |
-
invRect: rect
|
7195 |
-
};
|
7196 |
-
if (!this.viewData[i].prop.k) {
|
7197 |
-
this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
|
7198 |
-
}
|
7199 |
-
}
|
7200 |
-
|
7201 |
-
this.maskElement = createNS(maskType);
|
7202 |
-
|
7203 |
-
len = currentMasks.length;
|
7204 |
-
for (i = 0; i < len; i += 1) {
|
7205 |
-
this.maskElement.appendChild(currentMasks[i]);
|
7206 |
-
}
|
7207 |
-
|
7208 |
-
if (count > 0) {
|
7209 |
-
this.maskElement.setAttribute('id', layerId);
|
7210 |
-
this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
|
7211 |
-
defs.appendChild(this.maskElement);
|
7212 |
-
}
|
7213 |
-
if (this.viewData.length) {
|
7214 |
-
this.element.addRenderableComponent(this);
|
7215 |
-
}
|
7216 |
-
|
7217 |
-
}
|
7218 |
-
|
7219 |
-
MaskElement.prototype.getMaskProperty = function (pos) {
|
7220 |
-
return this.viewData[pos].prop;
|
7221 |
-
};
|
7222 |
-
|
7223 |
-
MaskElement.prototype.renderFrame = function (isFirstFrame) {
|
7224 |
-
var finalMat = this.element.finalTransform.mat;
|
7225 |
-
var i, len = this.masksProperties.length;
|
7226 |
-
for (i = 0; i < len; i++) {
|
7227 |
-
if (this.viewData[i].prop._mdf || isFirstFrame) {
|
7228 |
-
this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
|
7229 |
-
}
|
7230 |
-
if (this.viewData[i].op._mdf || isFirstFrame) {
|
7231 |
-
this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
|
7232 |
-
}
|
7233 |
-
if (this.masksProperties[i].mode !== 'n') {
|
7234 |
-
if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
|
7235 |
-
this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
|
7236 |
-
}
|
7237 |
-
if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
|
7238 |
-
var feMorph = this.storedData[i].expan;
|
7239 |
-
if (this.storedData[i].x.v < 0) {
|
7240 |
-
if (this.storedData[i].lastOperator !== 'erode') {
|
7241 |
-
this.storedData[i].lastOperator = 'erode';
|
7242 |
-
this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
|
7243 |
-
}
|
7244 |
-
feMorph.setAttribute('radius', -this.storedData[i].x.v);
|
7245 |
-
} else {
|
7246 |
-
if (this.storedData[i].lastOperator !== 'dilate') {
|
7247 |
-
this.storedData[i].lastOperator = 'dilate';
|
7248 |
-
this.storedData[i].elem.setAttribute('filter', null);
|
7249 |
-
}
|
7250 |
-
this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
|
7251 |
-
|
7252 |
-
}
|
7253 |
-
}
|
7254 |
-
}
|
7255 |
-
}
|
7256 |
-
};
|
7257 |
-
|
7258 |
-
MaskElement.prototype.getMaskelement = function () {
|
7259 |
-
return this.maskElement;
|
7260 |
-
};
|
7261 |
-
|
7262 |
-
MaskElement.prototype.createLayerSolidPath = function () {
|
7263 |
-
var path = 'M0,0 ';
|
7264 |
-
path += ' h' + this.globalData.compSize.w;
|
7265 |
-
path += ' v' + this.globalData.compSize.h;
|
7266 |
-
path += ' h-' + this.globalData.compSize.w;
|
7267 |
-
path += ' v-' + this.globalData.compSize.h + ' ';
|
7268 |
-
return path;
|
7269 |
-
};
|
7270 |
-
|
7271 |
-
MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
|
7272 |
-
var pathString = " M" + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
|
7273 |
-
var i, len;
|
7274 |
-
len = pathNodes._length;
|
7275 |
-
for (i = 1; i < len; i += 1) {
|
7276 |
-
//pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[i][0]+','+pathNodes.i[i][1] + " "+pathNodes.v[i][0]+','+pathNodes.v[i][1];
|
7277 |
-
pathString += " C" + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + " " + pathNodes.i[i][0] + ',' + pathNodes.i[i][1] + " " + pathNodes.v[i][0] + ',' + pathNodes.v[i][1];
|
7278 |
-
}
|
7279 |
-
//pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[0][0]+','+pathNodes.i[0][1] + " "+pathNodes.v[0][0]+','+pathNodes.v[0][1];
|
7280 |
-
if (pathNodes.c && len > 1) {
|
7281 |
-
pathString += " C" + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + " " + pathNodes.i[0][0] + ',' + pathNodes.i[0][1] + " " + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
|
7282 |
-
}
|
7283 |
-
//pathNodes.__renderedString = pathString;
|
7284 |
-
|
7285 |
-
if (viewData.lastPath !== pathString) {
|
7286 |
-
var pathShapeValue = '';
|
7287 |
-
if (viewData.elem) {
|
7288 |
-
if (pathNodes.c) {
|
7289 |
-
pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
|
7290 |
-
}
|
7291 |
-
viewData.elem.setAttribute('d', pathShapeValue);
|
7292 |
-
}
|
7293 |
-
viewData.lastPath = pathString;
|
7294 |
-
}
|
7295 |
-
};
|
7296 |
-
|
7297 |
-
MaskElement.prototype.destroy = function () {
|
7298 |
-
this.element = null;
|
7299 |
-
this.globalData = null;
|
7300 |
-
this.maskElement = null;
|
7301 |
-
this.data = null;
|
7302 |
-
this.masksProperties = null;
|
7303 |
-
};
|
7304 |
-
|
7305 |
-
/**
|
7306 |
-
* @file
|
7307 |
-
* Handles AE's layer parenting property.
|
7308 |
-
*
|
7309 |
-
*/
|
7310 |
-
|
7311 |
-
function HierarchyElement() { }
|
7312 |
-
|
7313 |
-
HierarchyElement.prototype = {
|
7314 |
-
/**
|
7315 |
-
* @function
|
7316 |
-
* Initializes hierarchy properties
|
7317 |
-
*
|
7318 |
-
*/
|
7319 |
-
initHierarchy: function () {
|
7320 |
-
//element's parent list
|
7321 |
-
this.hierarchy = [];
|
7322 |
-
//if element is parent of another layer _isParent will be true
|
7323 |
-
this._isParent = false;
|
7324 |
-
this.checkParenting();
|
7325 |
-
},
|
7326 |
-
/**
|
7327 |
-
* @function
|
7328 |
-
* Sets layer's hierarchy.
|
7329 |
-
* @param {array} hierarch
|
7330 |
-
* layer's parent list
|
7331 |
-
*
|
7332 |
-
*/
|
7333 |
-
setHierarchy: function (hierarchy) {
|
7334 |
-
this.hierarchy = hierarchy;
|
7335 |
-
},
|
7336 |
-
/**
|
7337 |
-
* @function
|
7338 |
-
* Sets layer as parent.
|
7339 |
-
*
|
7340 |
-
*/
|
7341 |
-
setAsParent: function () {
|
7342 |
-
this._isParent = true;
|
7343 |
-
},
|
7344 |
-
/**
|
7345 |
-
* @function
|
7346 |
-
* Searches layer's parenting chain
|
7347 |
-
*
|
7348 |
-
*/
|
7349 |
-
checkParenting: function () {
|
7350 |
-
if (this.data.parent !== undefined) {
|
7351 |
-
this.comp.buildElementParenting(this, this.data.parent, []);
|
7352 |
-
}
|
7353 |
-
}
|
7354 |
-
};
|
7355 |
-
/**
|
7356 |
-
* @file
|
7357 |
-
* Handles element's layer frame update.
|
7358 |
-
* Checks layer in point and out point
|
7359 |
-
*
|
7360 |
-
*/
|
7361 |
-
|
7362 |
-
function FrameElement() { }
|
7363 |
-
|
7364 |
-
FrameElement.prototype = {
|
7365 |
-
/**
|
7366 |
-
* @function
|
7367 |
-
* Initializes frame related properties.
|
7368 |
-
*
|
7369 |
-
*/
|
7370 |
-
initFrame: function () {
|
7371 |
-
//set to true when inpoint is rendered
|
7372 |
-
this._isFirstFrame = false;
|
7373 |
-
//list of animated properties
|
7374 |
-
this.dynamicProperties = [];
|
7375 |
-
// If layer has been modified in current tick this will be true
|
7376 |
-
this._mdf = false;
|
7377 |
-
},
|
7378 |
-
/**
|
7379 |
-
* @function
|
7380 |
-
* Calculates all dynamic values
|
7381 |
-
*
|
7382 |
-
* @param {number} num
|
7383 |
-
* current frame number in Layer's time
|
7384 |
-
* @param {boolean} isVisible
|
7385 |
-
* if layers is currently in range
|
7386 |
-
*
|
7387 |
-
*/
|
7388 |
-
prepareProperties: function (num, isVisible) {
|
7389 |
-
var i, len = this.dynamicProperties.length;
|
7390 |
-
for (i = 0; i < len; i += 1) {
|
7391 |
-
if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
|
7392 |
-
this.dynamicProperties[i].getValue();
|
7393 |
-
if (this.dynamicProperties[i]._mdf) {
|
7394 |
-
this.globalData._mdf = true;
|
7395 |
-
this._mdf = true;
|
7396 |
-
}
|
7397 |
-
}
|
7398 |
-
}
|
7399 |
-
},
|
7400 |
-
addDynamicProperty: function (prop) {
|
7401 |
-
if (this.dynamicProperties.indexOf(prop) === -1) {
|
7402 |
-
this.dynamicProperties.push(prop);
|
7403 |
-
}
|
7404 |
-
}
|
7405 |
-
};
|
7406 |
-
|
7407 |
-
function TransformElement() { }
|
7408 |
-
|
7409 |
-
TransformElement.prototype = {
|
7410 |
-
initTransform: function () {
|
7411 |
-
this.finalTransform = {
|
7412 |
-
mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {
|
7413 |
-
o: 0
|
7414 |
-
},
|
7415 |
-
_matMdf: false,
|
7416 |
-
_opMdf: false,
|
7417 |
-
mat: new Matrix()
|
7418 |
-
};
|
7419 |
-
if (this.data.ao) {
|
7420 |
-
this.finalTransform.mProp.autoOriented = true;
|
7421 |
-
}
|
7422 |
-
|
7423 |
-
//TODO: check TYPE 11: Guided elements
|
7424 |
-
if (this.data.ty !== 11) {
|
7425 |
-
//this.createElements();
|
7426 |
-
}
|
7427 |
-
},
|
7428 |
-
renderTransform: function () {
|
7429 |
-
|
7430 |
-
this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
|
7431 |
-
this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
|
7432 |
-
|
7433 |
-
if (this.hierarchy) {
|
7434 |
-
var mat;
|
7435 |
-
var finalMat = this.finalTransform.mat;
|
7436 |
-
var i = 0,
|
7437 |
-
len = this.hierarchy.length;
|
7438 |
-
//Checking if any of the transformation matrices in the hierarchy chain has changed.
|
7439 |
-
if (!this.finalTransform._matMdf) {
|
7440 |
-
while (i < len) {
|
7441 |
-
if (this.hierarchy[i].finalTransform.mProp._mdf) {
|
7442 |
-
this.finalTransform._matMdf = true;
|
7443 |
-
break;
|
7444 |
-
}
|
7445 |
-
i += 1;
|
7446 |
-
}
|
7447 |
-
}
|
7448 |
-
|
7449 |
-
if (this.finalTransform._matMdf) {
|
7450 |
-
mat = this.finalTransform.mProp.v.props;
|
7451 |
-
finalMat.cloneFromProps(mat);
|
7452 |
-
for (i = 0; i < len; i += 1) {
|
7453 |
-
mat = this.hierarchy[i].finalTransform.mProp.v.props;
|
7454 |
-
finalMat.transform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5], mat[6], mat[7], mat[8], mat[9], mat[10], mat[11], mat[12], mat[13], mat[14], mat[15]);
|
7455 |
-
}
|
7456 |
-
}
|
7457 |
-
}
|
7458 |
-
},
|
7459 |
-
globalToLocal: function (pt) {
|
7460 |
-
var transforms = [];
|
7461 |
-
transforms.push(this.finalTransform);
|
7462 |
-
var flag = true;
|
7463 |
-
var comp = this.comp;
|
7464 |
-
while (flag) {
|
7465 |
-
if (comp.finalTransform) {
|
7466 |
-
if (comp.data.hasMask) {
|
7467 |
-
transforms.splice(0, 0, comp.finalTransform);
|
7468 |
-
}
|
7469 |
-
comp = comp.comp;
|
7470 |
-
} else {
|
7471 |
-
flag = false;
|
7472 |
-
}
|
7473 |
-
}
|
7474 |
-
var i, len = transforms.length,
|
7475 |
-
ptNew;
|
7476 |
-
for (i = 0; i < len; i += 1) {
|
7477 |
-
ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
|
7478 |
-
//ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
|
7479 |
-
pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
|
7480 |
-
}
|
7481 |
-
return pt;
|
7482 |
-
},
|
7483 |
-
mHelper: new Matrix()
|
7484 |
-
};
|
7485 |
-
|
7486 |
-
function RenderableElement() {
|
7487 |
-
|
7488 |
-
}
|
7489 |
-
|
7490 |
-
RenderableElement.prototype = {
|
7491 |
-
initRenderable: function () {
|
7492 |
-
//layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
|
7493 |
-
this.isInRange = false;
|
7494 |
-
//layer's display state
|
7495 |
-
this.hidden = false;
|
7496 |
-
// If layer's transparency equals 0, it can be hidden
|
7497 |
-
this.isTransparent = false;
|
7498 |
-
//list of animated components
|
7499 |
-
this.renderableComponents = [];
|
7500 |
-
},
|
7501 |
-
addRenderableComponent: function (component) {
|
7502 |
-
if (this.renderableComponents.indexOf(component) === -1) {
|
7503 |
-
this.renderableComponents.push(component);
|
7504 |
-
}
|
7505 |
-
},
|
7506 |
-
removeRenderableComponent: function (component) {
|
7507 |
-
if (this.renderableComponents.indexOf(component) !== -1) {
|
7508 |
-
this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
|
7509 |
-
}
|
7510 |
-
},
|
7511 |
-
prepareRenderableFrame: function (num) {
|
7512 |
-
this.checkLayerLimits(num);
|
7513 |
-
},
|
7514 |
-
checkTransparency: function () {
|
7515 |
-
if (this.finalTransform.mProp.o.v <= 0) {
|
7516 |
-
if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
|
7517 |
-
this.isTransparent = true;
|
7518 |
-
this.hide();
|
7519 |
-
}
|
7520 |
-
} else if (this.isTransparent) {
|
7521 |
-
this.isTransparent = false;
|
7522 |
-
this.show();
|
7523 |
-
}
|
7524 |
-
},
|
7525 |
-
/**
|
7526 |
-
* @function
|
7527 |
-
* Initializes frame related properties.
|
7528 |
-
*
|
7529 |
-
* @param {number} num
|
7530 |
-
* current frame number in Layer's time
|
7531 |
-
*
|
7532 |
-
*/
|
7533 |
-
checkLayerLimits: function (num) {
|
7534 |
-
if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
|
7535 |
-
if (this.isInRange !== true) {
|
7536 |
-
this.globalData._mdf = true;
|
7537 |
-
this._mdf = true;
|
7538 |
-
this.isInRange = true;
|
7539 |
-
this.show();
|
7540 |
-
}
|
7541 |
-
} else {
|
7542 |
-
if (this.isInRange !== false) {
|
7543 |
-
this.globalData._mdf = true;
|
7544 |
-
this.isInRange = false;
|
7545 |
-
this.hide();
|
7546 |
-
}
|
7547 |
-
}
|
7548 |
-
},
|
7549 |
-
renderRenderable: function () {
|
7550 |
-
var i, len = this.renderableComponents.length;
|
7551 |
-
for (i = 0; i < len; i += 1) {
|
7552 |
-
this.renderableComponents[i].renderFrame(this._isFirstFrame);
|
7553 |
-
}
|
7554 |
-
/*this.maskManager.renderFrame(this.finalTransform.mat);
|
7555 |
-
this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
|
7556 |
-
},
|
7557 |
-
sourceRectAtTime: function () {
|
7558 |
-
return {
|
7559 |
-
top: 0,
|
7560 |
-
left: 0,
|
7561 |
-
width: 100,
|
7562 |
-
height: 100
|
7563 |
-
};
|
7564 |
-
},
|
7565 |
-
getLayerSize: function () {
|
7566 |
-
if (this.data.ty === 5) {
|
7567 |
-
return {
|
7568 |
-
w: this.data.textData.width,
|
7569 |
-
h: this.data.textData.height
|
7570 |
-
};
|
7571 |
-
} else {
|
7572 |
-
return {
|
7573 |
-
w: this.data.width,
|
7574 |
-
h: this.data.height
|
7575 |
-
};
|
7576 |
-
}
|
7577 |
-
}
|
7578 |
-
};
|
7579 |
-
|
7580 |
-
function RenderableDOMElement() { }
|
7581 |
-
|
7582 |
-
(function () {
|
7583 |
-
var _prototype = {
|
7584 |
-
initElement: function (data, globalData, comp) {
|
7585 |
-
this.initFrame();
|
7586 |
-
this.initBaseData(data, globalData, comp);
|
7587 |
-
this.initTransform(data, globalData, comp);
|
7588 |
-
this.initHierarchy();
|
7589 |
-
this.initRenderable();
|
7590 |
-
this.initRendererElement();
|
7591 |
-
this.createContainerElements();
|
7592 |
-
this.createRenderableComponents();
|
7593 |
-
this.createContent();
|
7594 |
-
this.hide();
|
7595 |
-
},
|
7596 |
-
hide: function () {
|
7597 |
-
if (!this.hidden && (!this.isInRange || this.isTransparent)) {
|
7598 |
-
var elem = this.baseElement || this.layerElement;
|
7599 |
-
elem.style.display = 'none';
|
7600 |
-
this.hidden = true;
|
7601 |
-
}
|
7602 |
-
},
|
7603 |
-
show: function () {
|
7604 |
-
if (this.isInRange && !this.isTransparent) {
|
7605 |
-
if (!this.data.hd) {
|
7606 |
-
var elem = this.baseElement || this.layerElement;
|
7607 |
-
elem.style.display = 'block';
|
7608 |
-
}
|
7609 |
-
this.hidden = false;
|
7610 |
-
this._isFirstFrame = true;
|
7611 |
-
}
|
7612 |
-
},
|
7613 |
-
renderFrame: function () {
|
7614 |
-
//If it is exported as hidden (data.hd === true) no need to render
|
7615 |
-
//If it is not visible no need to render
|
7616 |
-
if (this.data.hd || this.hidden) {
|
7617 |
-
return;
|
7618 |
-
}
|
7619 |
-
this.renderTransform();
|
7620 |
-
this.renderRenderable();
|
7621 |
-
this.renderElement();
|
7622 |
-
this.renderInnerContent();
|
7623 |
-
if (this._isFirstFrame) {
|
7624 |
-
this._isFirstFrame = false;
|
7625 |
-
}
|
7626 |
-
},
|
7627 |
-
renderInnerContent: function () { },
|
7628 |
-
prepareFrame: function (num) {
|
7629 |
-
this._mdf = false;
|
7630 |
-
this.prepareRenderableFrame(num);
|
7631 |
-
this.prepareProperties(num, this.isInRange);
|
7632 |
-
this.checkTransparency();
|
7633 |
-
},
|
7634 |
-
destroy: function () {
|
7635 |
-
this.innerElem = null;
|
7636 |
-
this.destroyBaseElement();
|
7637 |
-
}
|
7638 |
-
};
|
7639 |
-
extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
|
7640 |
-
}());
|
7641 |
-
|
7642 |
-
function ProcessedElement(element, position) {
|
7643 |
-
this.elem = element;
|
7644 |
-
this.pos = position;
|
7645 |
-
}
|
7646 |
-
|
7647 |
-
function SVGStyleData(data, level) {
|
7648 |
-
this.data = data;
|
7649 |
-
this.type = data.ty;
|
7650 |
-
this.d = '';
|
7651 |
-
this.lvl = level;
|
7652 |
-
this._mdf = false;
|
7653 |
-
this.closed = data.hd === true;
|
7654 |
-
this.pElem = createNS('path');
|
7655 |
-
this.msElem = null;
|
7656 |
-
}
|
7657 |
-
|
7658 |
-
SVGStyleData.prototype.reset = function () {
|
7659 |
-
this.d = '';
|
7660 |
-
this._mdf = false;
|
7661 |
-
};
|
7662 |
-
|
7663 |
-
function SVGShapeData(transformers, level, shape) {
|
7664 |
-
this.caches = [];
|
7665 |
-
this.styles = [];
|
7666 |
-
this.transformers = transformers;
|
7667 |
-
this.lStr = '';
|
7668 |
-
this.sh = shape;
|
7669 |
-
this.lvl = level;
|
7670 |
-
//TODO find if there are some cases where _isAnimated can be false.
|
7671 |
-
// For now, since shapes add up with other shapes. They have to be calculated every time.
|
7672 |
-
// One way of finding out is checking if all styles associated to this shape depend only of this shape
|
7673 |
-
this._isAnimated = !!shape.k;
|
7674 |
-
// TODO: commenting this for now since all shapes are animated
|
7675 |
-
var i = 0,
|
7676 |
-
len = transformers.length;
|
7677 |
-
while (i < len) {
|
7678 |
-
if (transformers[i].mProps.dynamicProperties.length) {
|
7679 |
-
this._isAnimated = true;
|
7680 |
-
break;
|
7681 |
-
}
|
7682 |
-
i += 1;
|
7683 |
-
}
|
7684 |
-
}
|
7685 |
-
|
7686 |
-
SVGShapeData.prototype.setAsAnimated = function () {
|
7687 |
-
this._isAnimated = true;
|
7688 |
-
}
|
7689 |
-
|
7690 |
-
function SVGTransformData(mProps, op, container) {
|
7691 |
-
this.transform = {
|
7692 |
-
mProps: mProps,
|
7693 |
-
op: op,
|
7694 |
-
container: container
|
7695 |
-
};
|
7696 |
-
this.elements = [];
|
7697 |
-
this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
|
7698 |
-
}
|
7699 |
-
|
7700 |
-
function SVGStrokeStyleData(elem, data, styleOb) {
|
7701 |
-
this.initDynamicPropertyContainer(elem);
|
7702 |
-
this.getValue = this.iterateDynamicProperties;
|
7703 |
-
this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
|
7704 |
-
this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
|
7705 |
-
this.d = new DashProperty(elem, data.d || {}, 'svg', this);
|
7706 |
-
this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
|
7707 |
-
this.style = styleOb;
|
7708 |
-
this._isAnimated = !!this._isAnimated;
|
7709 |
-
}
|
7710 |
-
|
7711 |
-
extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
|
7712 |
-
|
7713 |
-
function SVGFillStyleData(elem, data, styleOb) {
|
7714 |
-
this.initDynamicPropertyContainer(elem);
|
7715 |
-
this.getValue = this.iterateDynamicProperties;
|
7716 |
-
this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
|
7717 |
-
this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
|
7718 |
-
this.style = styleOb;
|
7719 |
-
}
|
7720 |
-
|
7721 |
-
extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
|
7722 |
-
|
7723 |
-
function SVGGradientFillStyleData(elem, data, styleOb) {
|
7724 |
-
this.initDynamicPropertyContainer(elem);
|
7725 |
-
this.getValue = this.iterateDynamicProperties;
|
7726 |
-
this.initGradientData(elem, data, styleOb);
|
7727 |
-
}
|
7728 |
-
|
7729 |
-
SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) {
|
7730 |
-
this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
|
7731 |
-
this.s = PropertyFactory.getProp(elem, data.s, 1, null, this);
|
7732 |
-
this.e = PropertyFactory.getProp(elem, data.e, 1, null, this);
|
7733 |
-
this.h = PropertyFactory.getProp(elem, data.h || {
|
7734 |
-
k: 0
|
7735 |
-
}, 0, 0.01, this);
|
7736 |
-
this.a = PropertyFactory.getProp(elem, data.a || {
|
7737 |
-
k: 0
|
7738 |
-
}, 0, degToRads, this);
|
7739 |
-
this.g = new GradientProperty(elem, data.g, this);
|
7740 |
-
this.style = styleOb;
|
7741 |
-
this.stops = [];
|
7742 |
-
this.setGradientData(styleOb.pElem, data);
|
7743 |
-
this.setGradientOpacity(data, styleOb);
|
7744 |
-
this._isAnimated = !!this._isAnimated;
|
7745 |
-
|
7746 |
-
};
|
7747 |
-
|
7748 |
-
SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) {
|
7749 |
-
|
7750 |
-
var gradientId = createElementID();
|
7751 |
-
var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
|
7752 |
-
gfill.setAttribute('id', gradientId);
|
7753 |
-
gfill.setAttribute('spreadMethod', 'pad');
|
7754 |
-
gfill.setAttribute('gradientUnits', 'userSpaceOnUse');
|
7755 |
-
var stops = [];
|
7756 |
-
var stop, j, jLen;
|
7757 |
-
jLen = data.g.p * 4;
|
7758 |
-
for (j = 0; j < jLen; j += 4) {
|
7759 |
-
stop = createNS('stop');
|
7760 |
-
gfill.appendChild(stop);
|
7761 |
-
stops.push(stop);
|
7762 |
-
}
|
7763 |
-
pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + gradientId + ')');
|
7764 |
-
|
7765 |
-
this.gf = gfill;
|
7766 |
-
this.cst = stops;
|
7767 |
-
};
|
7768 |
-
|
7769 |
-
SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) {
|
7770 |
-
if (this.g._hasOpacity && !this.g._collapsable) {
|
7771 |
-
var stop, j, jLen;
|
7772 |
-
var mask = createNS("mask");
|
7773 |
-
var maskElement = createNS('path');
|
7774 |
-
mask.appendChild(maskElement);
|
7775 |
-
var opacityId = createElementID();
|
7776 |
-
var maskId = createElementID();
|
7777 |
-
mask.setAttribute('id', maskId);
|
7778 |
-
var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
|
7779 |
-
opFill.setAttribute('id', opacityId);
|
7780 |
-
opFill.setAttribute('spreadMethod', 'pad');
|
7781 |
-
opFill.setAttribute('gradientUnits', 'userSpaceOnUse');
|
7782 |
-
jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
|
7783 |
-
var stops = this.stops;
|
7784 |
-
for (j = data.g.p * 4; j < jLen; j += 2) {
|
7785 |
-
stop = createNS('stop');
|
7786 |
-
stop.setAttribute('stop-color', 'rgb(255,255,255)');
|
7787 |
-
opFill.appendChild(stop);
|
7788 |
-
stops.push(stop);
|
7789 |
-
}
|
7790 |
-
maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + opacityId + ')');
|
7791 |
-
this.of = opFill;
|
7792 |
-
this.ms = mask;
|
7793 |
-
this.ost = stops;
|
7794 |
-
this.maskId = maskId;
|
7795 |
-
styleOb.msElem = maskElement;
|
7796 |
-
}
|
7797 |
-
};
|
7798 |
-
|
7799 |
-
extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
|
7800 |
-
|
7801 |
-
function SVGGradientStrokeStyleData(elem, data, styleOb) {
|
7802 |
-
this.initDynamicPropertyContainer(elem);
|
7803 |
-
this.getValue = this.iterateDynamicProperties;
|
7804 |
-
this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
|
7805 |
-
this.d = new DashProperty(elem, data.d || {}, 'svg', this);
|
7806 |
-
this.initGradientData(elem, data, styleOb);
|
7807 |
-
this._isAnimated = !!this._isAnimated;
|
7808 |
-
}
|
7809 |
-
|
7810 |
-
extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
|
7811 |
-
|
7812 |
-
function ShapeGroupData() {
|
7813 |
-
this.it = [];
|
7814 |
-
this.prevViewData = [];
|
7815 |
-
this.gr = createNS('g');
|
7816 |
-
}
|
7817 |
-
var SVGElementsRenderer = (function () {
|
7818 |
-
var _identityMatrix = new Matrix();
|
7819 |
-
var _matrixHelper = new Matrix();
|
7820 |
-
|
7821 |
-
var ob = {
|
7822 |
-
createRenderFunction: createRenderFunction
|
7823 |
-
}
|
7824 |
-
|
7825 |
-
function createRenderFunction(data) {
|
7826 |
-
var ty = data.ty;
|
7827 |
-
switch (data.ty) {
|
7828 |
-
case 'fl':
|
7829 |
-
return renderFill;
|
7830 |
-
case 'gf':
|
7831 |
-
return renderGradient;
|
7832 |
-
case 'gs':
|
7833 |
-
return renderGradientStroke;
|
7834 |
-
case 'st':
|
7835 |
-
return renderStroke;
|
7836 |
-
case 'sh':
|
7837 |
-
case 'el':
|
7838 |
-
case 'rc':
|
7839 |
-
case 'sr':
|
7840 |
-
return renderPath;
|
7841 |
-
case 'tr':
|
7842 |
-
return renderContentTransform;
|
7843 |
-
}
|
7844 |
-
}
|
7845 |
-
|
7846 |
-
function renderContentTransform(styleData, itemData, isFirstFrame) {
|
7847 |
-
if (isFirstFrame || itemData.transform.op._mdf) {
|
7848 |
-
itemData.transform.container.setAttribute('opacity', itemData.transform.op.v);
|
7849 |
-
}
|
7850 |
-
if (isFirstFrame || itemData.transform.mProps._mdf) {
|
7851 |
-
itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS());
|
7852 |
-
}
|
7853 |
-
}
|
7854 |
-
|
7855 |
-
function renderPath(styleData, itemData, isFirstFrame) {
|
7856 |
-
var j, jLen, pathStringTransformed, redraw, pathNodes, l, lLen = itemData.styles.length;
|
7857 |
-
var lvl = itemData.lvl;
|
7858 |
-
var paths, mat, props, iterations, k;
|
7859 |
-
for (l = 0; l < lLen; l += 1) {
|
7860 |
-
redraw = itemData.sh._mdf || isFirstFrame;
|
7861 |
-
if (itemData.styles[l].lvl < lvl) {
|
7862 |
-
mat = _matrixHelper.reset();
|
7863 |
-
iterations = lvl - itemData.styles[l].lvl;
|
7864 |
-
k = itemData.transformers.length - 1;
|
7865 |
-
while (!redraw && iterations > 0) {
|
7866 |
-
redraw = itemData.transformers[k].mProps._mdf || redraw;
|
7867 |
-
iterations--;
|
7868 |
-
k--;
|
7869 |
-
}
|
7870 |
-
if (redraw) {
|
7871 |
-
iterations = lvl - itemData.styles[l].lvl;
|
7872 |
-
k = itemData.transformers.length - 1;
|
7873 |
-
while (iterations > 0) {
|
7874 |
-
props = itemData.transformers[k].mProps.v.props;
|
7875 |
-
mat.transform(props[0], props[1], props[2], props[3], props[4], props[5], props[6], props[7], props[8], props[9], props[10], props[11], props[12], props[13], props[14], props[15]);
|
7876 |
-
iterations--;
|
7877 |
-
k--;
|
7878 |
-
}
|
7879 |
-
}
|
7880 |
-
} else {
|
7881 |
-
mat = _identityMatrix;
|
7882 |
-
}
|
7883 |
-
paths = itemData.sh.paths;
|
7884 |
-
jLen = paths._length;
|
7885 |
-
if (redraw) {
|
7886 |
-
pathStringTransformed = '';
|
7887 |
-
for (j = 0; j < jLen; j += 1) {
|
7888 |
-
pathNodes = paths.shapes[j];
|
7889 |
-
if (pathNodes && pathNodes._length) {
|
7890 |
-
pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
|
7891 |
-
}
|
7892 |
-
}
|
7893 |
-
itemData.caches[l] = pathStringTransformed;
|
7894 |
-
} else {
|
7895 |
-
pathStringTransformed = itemData.caches[l];
|
7896 |
-
}
|
7897 |
-
itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
|
7898 |
-
itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
|
7899 |
-
}
|
7900 |
-
}
|
7901 |
-
|
7902 |
-
function renderFill(styleData, itemData, isFirstFrame) {
|
7903 |
-
var styleElem = itemData.style;
|
7904 |
-
|
7905 |
-
if (itemData.c._mdf || isFirstFrame) {
|
7906 |
-
styleElem.pElem.setAttribute('fill', 'rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
|
7907 |
-
}
|
7908 |
-
if (itemData.o._mdf || isFirstFrame) {
|
7909 |
-
styleElem.pElem.setAttribute('fill-opacity', itemData.o.v);
|
7910 |
-
}
|
7911 |
-
};
|
7912 |
-
|
7913 |
-
function renderGradientStroke(styleData, itemData, isFirstFrame) {
|
7914 |
-
renderGradient(styleData, itemData, isFirstFrame);
|
7915 |
-
renderStroke(styleData, itemData, isFirstFrame);
|
7916 |
-
}
|
7917 |
-
|
7918 |
-
function renderGradient(styleData, itemData, isFirstFrame) {
|
7919 |
-
var gfill = itemData.gf;
|
7920 |
-
var hasOpacity = itemData.g._hasOpacity;
|
7921 |
-
var pt1 = itemData.s.v,
|
7922 |
-
pt2 = itemData.e.v;
|
7923 |
-
|
7924 |
-
if (itemData.o._mdf || isFirstFrame) {
|
7925 |
-
var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
|
7926 |
-
itemData.style.pElem.setAttribute(attr, itemData.o.v);
|
7927 |
-
}
|
7928 |
-
if (itemData.s._mdf || isFirstFrame) {
|
7929 |
-
var attr1 = styleData.t === 1 ? 'x1' : 'cx';
|
7930 |
-
var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
|
7931 |
-
gfill.setAttribute(attr1, pt1[0]);
|
7932 |
-
gfill.setAttribute(attr2, pt1[1]);
|
7933 |
-
if (hasOpacity && !itemData.g._collapsable) {
|
7934 |
-
itemData.of.setAttribute(attr1, pt1[0]);
|
7935 |
-
itemData.of.setAttribute(attr2, pt1[1]);
|
7936 |
-
}
|
7937 |
-
}
|
7938 |
-
var stops, i, len, stop;
|
7939 |
-
if (itemData.g._cmdf || isFirstFrame) {
|
7940 |
-
stops = itemData.cst;
|
7941 |
-
var cValues = itemData.g.c;
|
7942 |
-
len = stops.length;
|
7943 |
-
for (i = 0; i < len; i += 1) {
|
7944 |
-
stop = stops[i];
|
7945 |
-
stop.setAttribute('offset', cValues[i * 4] + '%');
|
7946 |
-
stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')');
|
7947 |
-
}
|
7948 |
-
}
|
7949 |
-
if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
|
7950 |
-
var oValues = itemData.g.o;
|
7951 |
-
if (itemData.g._collapsable) {
|
7952 |
-
stops = itemData.cst;
|
7953 |
-
} else {
|
7954 |
-
stops = itemData.ost;
|
7955 |
-
}
|
7956 |
-
len = stops.length;
|
7957 |
-
for (i = 0; i < len; i += 1) {
|
7958 |
-
stop = stops[i];
|
7959 |
-
if (!itemData.g._collapsable) {
|
7960 |
-
stop.setAttribute('offset', oValues[i * 2] + '%');
|
7961 |
-
}
|
7962 |
-
stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
|
7963 |
-
}
|
7964 |
-
}
|
7965 |
-
if (styleData.t === 1) {
|
7966 |
-
if (itemData.e._mdf || isFirstFrame) {
|
7967 |
-
gfill.setAttribute('x2', pt2[0]);
|
7968 |
-
gfill.setAttribute('y2', pt2[1]);
|
7969 |
-
if (hasOpacity && !itemData.g._collapsable) {
|
7970 |
-
itemData.of.setAttribute('x2', pt2[0]);
|
7971 |
-
itemData.of.setAttribute('y2', pt2[1]);
|
7972 |
-
}
|
7973 |
-
}
|
7974 |
-
} else {
|
7975 |
-
var rad;
|
7976 |
-
if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
|
7977 |
-
rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
|
7978 |
-
gfill.setAttribute('r', rad);
|
7979 |
-
if (hasOpacity && !itemData.g._collapsable) {
|
7980 |
-
itemData.of.setAttribute('r', rad);
|
7981 |
-
}
|
7982 |
-
}
|
7983 |
-
if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
|
7984 |
-
if (!rad) {
|
7985 |
-
rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
|
7986 |
-
}
|
7987 |
-
var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
|
7988 |
-
|
7989 |
-
var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99 : itemData.h.v;
|
7990 |
-
var dist = rad * percent;
|
7991 |
-
var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
|
7992 |
-
var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
|
7993 |
-
gfill.setAttribute('fx', x);
|
7994 |
-
gfill.setAttribute('fy', y);
|
7995 |
-
if (hasOpacity && !itemData.g._collapsable) {
|
7996 |
-
itemData.of.setAttribute('fx', x);
|
7997 |
-
itemData.of.setAttribute('fy', y);
|
7998 |
-
}
|
7999 |
-
}
|
8000 |
-
//gfill.setAttribute('fy','200');
|
8001 |
-
}
|
8002 |
-
};
|
8003 |
-
|
8004 |
-
function renderStroke(styleData, itemData, isFirstFrame) {
|
8005 |
-
var styleElem = itemData.style;
|
8006 |
-
var d = itemData.d;
|
8007 |
-
if (d && (d._mdf || isFirstFrame) && d.dashStr) {
|
8008 |
-
styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
|
8009 |
-
styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
|
8010 |
-
}
|
8011 |
-
if (itemData.c && (itemData.c._mdf || isFirstFrame)) {
|
8012 |
-
styleElem.pElem.setAttribute('stroke', 'rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
|
8013 |
-
}
|
8014 |
-
if (itemData.o._mdf || isFirstFrame) {
|
8015 |
-
styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
|
8016 |
-
}
|
8017 |
-
if (itemData.w._mdf || isFirstFrame) {
|
8018 |
-
styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
|
8019 |
-
if (styleElem.msElem) {
|
8020 |
-
styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
|
8021 |
-
}
|
8022 |
-
}
|
8023 |
-
};
|
8024 |
-
|
8025 |
-
return ob;
|
8026 |
-
}())
|
8027 |
-
|
8028 |
-
function ShapeTransformManager() {
|
8029 |
-
this.sequences = {};
|
8030 |
-
this.sequenceList = [];
|
8031 |
-
this.transform_key_count = 0;
|
8032 |
-
}
|
8033 |
-
|
8034 |
-
ShapeTransformManager.prototype = {
|
8035 |
-
addTransformSequence: function (transforms) {
|
8036 |
-
var i, len = transforms.length;
|
8037 |
-
var key = '_';
|
8038 |
-
for (i = 0; i < len; i += 1) {
|
8039 |
-
key += transforms[i].transform.key + '_';
|
8040 |
-
}
|
8041 |
-
var sequence = this.sequences[key];
|
8042 |
-
if (!sequence) {
|
8043 |
-
sequence = {
|
8044 |
-
transforms: [].concat(transforms),
|
8045 |
-
finalTransform: new Matrix(),
|
8046 |
-
_mdf: false
|
8047 |
-
};
|
8048 |
-
this.sequences[key] = sequence;
|
8049 |
-
this.sequenceList.push(sequence);
|
8050 |
-
}
|
8051 |
-
return sequence;
|
8052 |
-
},
|
8053 |
-
processSequence: function (sequence, isFirstFrame) {
|
8054 |
-
var i = 0,
|
8055 |
-
len = sequence.transforms.length,
|
8056 |
-
_mdf = isFirstFrame;
|
8057 |
-
while (i < len && !isFirstFrame) {
|
8058 |
-
if (sequence.transforms[i].transform.mProps._mdf) {
|
8059 |
-
_mdf = true;
|
8060 |
-
break;
|
8061 |
-
}
|
8062 |
-
i += 1
|
8063 |
-
}
|
8064 |
-
if (_mdf) {
|
8065 |
-
var props;
|
8066 |
-
sequence.finalTransform.reset();
|
8067 |
-
for (i = len - 1; i >= 0; i -= 1) {
|
8068 |
-
props = sequence.transforms[i].transform.mProps.v.props;
|
8069 |
-
sequence.finalTransform.transform(props[0], props[1], props[2], props[3], props[4], props[5], props[6], props[7], props[8], props[9], props[10], props[11], props[12], props[13], props[14], props[15]);
|
8070 |
-
}
|
8071 |
-
}
|
8072 |
-
sequence._mdf = _mdf;
|
8073 |
-
|
8074 |
-
},
|
8075 |
-
processSequences: function (isFirstFrame) {
|
8076 |
-
var i, len = this.sequenceList.length;
|
8077 |
-
for (i = 0; i < len; i += 1) {
|
8078 |
-
this.processSequence(this.sequenceList[i], isFirstFrame);
|
8079 |
-
}
|
8080 |
-
|
8081 |
-
},
|
8082 |
-
getNewKey: function () {
|
8083 |
-
return '_' + this.transform_key_count++;
|
8084 |
-
}
|
8085 |
-
}
|
8086 |
-
|
8087 |
-
function CVShapeData(element, data, styles, transformsManager) {
|
8088 |
-
this.styledShapes = [];
|
8089 |
-
this.tr = [0, 0, 0, 0, 0, 0];
|
8090 |
-
var ty = 4;
|
8091 |
-
if (data.ty == 'rc') {
|
8092 |
-
ty = 5;
|
8093 |
-
} else if (data.ty == 'el') {
|
8094 |
-
ty = 6;
|
8095 |
-
} else if (data.ty == 'sr') {
|
8096 |
-
ty = 7;
|
8097 |
-
}
|
8098 |
-
this.sh = ShapePropertyFactory.getShapeProp(element, data, ty, element);
|
8099 |
-
var i, len = styles.length,
|
8100 |
-
styledShape;
|
8101 |
-
for (i = 0; i < len; i += 1) {
|
8102 |
-
if (!styles[i].closed) {
|
8103 |
-
styledShape = {
|
8104 |
-
transforms: transformsManager.addTransformSequence(styles[i].transforms),
|
8105 |
-
trNodes: []
|
8106 |
-
}
|
8107 |
-
this.styledShapes.push(styledShape);
|
8108 |
-
styles[i].elements.push(styledShape);
|
8109 |
-
}
|
8110 |
-
}
|
8111 |
-
}
|
8112 |
-
|
8113 |
-
CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;
|
8114 |
-
|
8115 |
-
function BaseElement() { }
|
8116 |
-
|
8117 |
-
BaseElement.prototype = {
|
8118 |
-
checkMasks: function () {
|
8119 |
-
if (!this.data.hasMask) {
|
8120 |
-
return false;
|
8121 |
-
}
|
8122 |
-
var i = 0,
|
8123 |
-
len = this.data.masksProperties.length;
|
8124 |
-
while (i < len) {
|
8125 |
-
if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
|
8126 |
-
return true;
|
8127 |
-
}
|
8128 |
-
i += 1;
|
8129 |
-
}
|
8130 |
-
return false;
|
8131 |
-
},
|
8132 |
-
initExpressions: function () {
|
8133 |
-
this.layerInterface = LayerExpressionInterface(this);
|
8134 |
-
if (this.data.hasMask && this.maskManager) {
|
8135 |
-
this.layerInterface.registerMaskInterface(this.maskManager);
|
8136 |
-
}
|
8137 |
-
var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
|
8138 |
-
this.layerInterface.registerEffectsInterface(effectsInterface);
|
8139 |
-
|
8140 |
-
if (this.data.ty === 0 || this.data.xt) {
|
8141 |
-
this.compInterface = CompExpressionInterface(this);
|
8142 |
-
} else if (this.data.ty === 4) {
|
8143 |
-
this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
|
8144 |
-
this.layerInterface.content = this.layerInterface.shapeInterface;
|
8145 |
-
} else if (this.data.ty === 5) {
|
8146 |
-
this.layerInterface.textInterface = TextExpressionInterface(this);
|
8147 |
-
this.layerInterface.text = this.layerInterface.textInterface;
|
8148 |
-
}
|
8149 |
-
},
|
8150 |
-
setBlendMode: function () {
|
8151 |
-
var blendModeValue = getBlendMode(this.data.bm);
|
8152 |
-
var elem = this.baseElement || this.layerElement;
|
8153 |
-
|
8154 |
-
elem.style['mix-blend-mode'] = blendModeValue;
|
8155 |
-
},
|
8156 |
-
initBaseData: function (data, globalData, comp) {
|
8157 |
-
this.globalData = globalData;
|
8158 |
-
this.comp = comp;
|
8159 |
-
this.data = data;
|
8160 |
-
this.layerId = createElementID();
|
8161 |
-
|
8162 |
-
//Stretch factor for old animations missing this property.
|
8163 |
-
if (!this.data.sr) {
|
8164 |
-
this.data.sr = 1;
|
8165 |
-
}
|
8166 |
-
// effects manager
|
8167 |
-
this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
|
8168 |
-
|
8169 |
-
},
|
8170 |
-
getType: function () {
|
8171 |
-
return this.type;
|
8172 |
-
},
|
8173 |
-
sourceRectAtTime: function () { }
|
8174 |
-
}
|
8175 |
-
|
8176 |
-
function NullElement(data, globalData, comp) {
|
8177 |
-
this.initFrame();
|
8178 |
-
this.initBaseData(data, globalData, comp);
|
8179 |
-
this.initFrame();
|
8180 |
-
this.initTransform(data, globalData, comp);
|
8181 |
-
this.initHierarchy();
|
8182 |
-
}
|
8183 |
-
|
8184 |
-
NullElement.prototype.prepareFrame = function (num) {
|
8185 |
-
this.prepareProperties(num, true);
|
8186 |
-
};
|
8187 |
-
|
8188 |
-
NullElement.prototype.renderFrame = function () { };
|
8189 |
-
|
8190 |
-
NullElement.prototype.getBaseElement = function () {
|
8191 |
-
return null;
|
8192 |
-
};
|
8193 |
-
|
8194 |
-
NullElement.prototype.destroy = function () { };
|
8195 |
-
|
8196 |
-
NullElement.prototype.sourceRectAtTime = function () { };
|
8197 |
-
|
8198 |
-
NullElement.prototype.hide = function () { };
|
8199 |
-
|
8200 |
-
extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
|
8201 |
-
|
8202 |
-
function SVGBaseElement() { }
|
8203 |
-
|
8204 |
-
SVGBaseElement.prototype = {
|
8205 |
-
initRendererElement: function () {
|
8206 |
-
this.layerElement = createNS('g');
|
8207 |
-
},
|
8208 |
-
createContainerElements: function () {
|
8209 |
-
this.matteElement = createNS('g');
|
8210 |
-
this.transformedElement = this.layerElement;
|
8211 |
-
this.maskedElement = this.layerElement;
|
8212 |
-
this._sizeChanged = false;
|
8213 |
-
var layerElementParent = null;
|
8214 |
-
//If this layer acts as a mask for the following layer
|
8215 |
-
var filId, fil, gg;
|
8216 |
-
if (this.data.td) {
|
8217 |
-
if (this.data.td == 3 || this.data.td == 1) {
|
8218 |
-
var masker = createNS('mask');
|
8219 |
-
masker.setAttribute('id', this.layerId);
|
8220 |
-
masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
|
8221 |
-
masker.appendChild(this.layerElement);
|
8222 |
-
layerElementParent = masker;
|
8223 |
-
this.globalData.defs.appendChild(masker);
|
8224 |
-
// This is only for IE and Edge when mask if of type alpha
|
8225 |
-
if (!featureSupport.maskType && this.data.td == 1) {
|
8226 |
-
masker.setAttribute('mask-type', 'luminance');
|
8227 |
-
filId = createElementID();
|
8228 |
-
fil = filtersFactory.createFilter(filId);
|
8229 |
-
this.globalData.defs.appendChild(fil);
|
8230 |
-
fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
|
8231 |
-
gg = createNS('g');
|
8232 |
-
gg.appendChild(this.layerElement);
|
8233 |
-
layerElementParent = gg;
|
8234 |
-
masker.appendChild(gg);
|
8235 |
-
gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
|
8236 |
-
}
|
8237 |
-
} else if (this.data.td == 2) {
|
8238 |
-
var maskGroup = createNS('mask');
|
8239 |
-
maskGroup.setAttribute('id', this.layerId);
|
8240 |
-
maskGroup.setAttribute('mask-type', 'alpha');
|
8241 |
-
var maskGrouper = createNS('g');
|
8242 |
-
maskGroup.appendChild(maskGrouper);
|
8243 |
-
filId = createElementID();
|
8244 |
-
fil = filtersFactory.createFilter(filId);
|
8245 |
-
////
|
8246 |
-
|
8247 |
-
// This solution doesn't work on Android when meta tag with viewport attribute is set
|
8248 |
-
/*var feColorMatrix = createNS('feColorMatrix');
|
8249 |
-
feColorMatrix.setAttribute('type', 'matrix');
|
8250 |
-
feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
|
8251 |
-
feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
|
8252 |
-
fil.appendChild(feColorMatrix);*/
|
8253 |
-
////
|
8254 |
-
var feCTr = createNS('feComponentTransfer');
|
8255 |
-
feCTr.setAttribute('in', 'SourceGraphic');
|
8256 |
-
fil.appendChild(feCTr);
|
8257 |
-
var feFunc = createNS('feFuncA');
|
8258 |
-
feFunc.setAttribute('type', 'table');
|
8259 |
-
feFunc.setAttribute('tableValues', '1.0 0.0');
|
8260 |
-
feCTr.appendChild(feFunc);
|
8261 |
-
////
|
8262 |
-
this.globalData.defs.appendChild(fil);
|
8263 |
-
var alphaRect = createNS('rect');
|
8264 |
-
alphaRect.setAttribute('width', this.comp.data.w);
|
8265 |
-
alphaRect.setAttribute('height', this.comp.data.h);
|
8266 |
-
alphaRect.setAttribute('x', '0');
|
8267 |
-
alphaRect.setAttribute('y', '0');
|
8268 |
-
alphaRect.setAttribute('fill', '#ffffff');
|
8269 |
-
alphaRect.setAttribute('opacity', '0');
|
8270 |
-
maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
|
8271 |
-
maskGrouper.appendChild(alphaRect);
|
8272 |
-
maskGrouper.appendChild(this.layerElement);
|
8273 |
-
layerElementParent = maskGrouper;
|
8274 |
-
if (!featureSupport.maskType) {
|
8275 |
-
maskGroup.setAttribute('mask-type', 'luminance');
|
8276 |
-
fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
|
8277 |
-
gg = createNS('g');
|
8278 |
-
maskGrouper.appendChild(alphaRect);
|
8279 |
-
gg.appendChild(this.layerElement);
|
8280 |
-
layerElementParent = gg;
|
8281 |
-
maskGrouper.appendChild(gg);
|
8282 |
-
}
|
8283 |
-
this.globalData.defs.appendChild(maskGroup);
|
8284 |
-
}
|
8285 |
-
} else if (this.data.tt) {
|
8286 |
-
this.matteElement.appendChild(this.layerElement);
|
8287 |
-
layerElementParent = this.matteElement;
|
8288 |
-
this.baseElement = this.matteElement;
|
8289 |
-
} else {
|
8290 |
-
this.baseElement = this.layerElement;
|
8291 |
-
}
|
8292 |
-
if (this.data.ln) {
|
8293 |
-
this.layerElement.setAttribute('id', this.data.ln);
|
8294 |
-
}
|
8295 |
-
if (this.data.cl) {
|
8296 |
-
this.layerElement.setAttribute('class', this.data.cl);
|
8297 |
-
}
|
8298 |
-
//Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
|
8299 |
-
if (this.data.ty === 0 && !this.data.hd) {
|
8300 |
-
var cp = createNS('clipPath');
|
8301 |
-
var pt = createNS('path');
|
8302 |
-
pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
|
8303 |
-
var clipId = createElementID();
|
8304 |
-
cp.setAttribute('id', clipId);
|
8305 |
-
cp.appendChild(pt);
|
8306 |
-
this.globalData.defs.appendChild(cp);
|
8307 |
-
|
8308 |
-
if (this.checkMasks()) {
|
8309 |
-
var cpGroup = createNS('g');
|
8310 |
-
cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
|
8311 |
-
cpGroup.appendChild(this.layerElement);
|
8312 |
-
this.transformedElement = cpGroup;
|
8313 |
-
if (layerElementParent) {
|
8314 |
-
layerElementParent.appendChild(this.transformedElement);
|
8315 |
-
} else {
|
8316 |
-
this.baseElement = this.transformedElement;
|
8317 |
-
}
|
8318 |
-
} else {
|
8319 |
-
this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
|
8320 |
-
}
|
8321 |
-
|
8322 |
-
}
|
8323 |
-
if (this.data.bm !== 0) {
|
8324 |
-
this.setBlendMode();
|
8325 |
-
}
|
8326 |
-
|
8327 |
-
},
|
8328 |
-
renderElement: function () {
|
8329 |
-
if (this.finalTransform._matMdf) {
|
8330 |
-
this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
|
8331 |
-
}
|
8332 |
-
if (this.finalTransform._opMdf) {
|
8333 |
-
this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
|
8334 |
-
}
|
8335 |
-
},
|
8336 |
-
destroyBaseElement: function () {
|
8337 |
-
this.layerElement = null;
|
8338 |
-
this.matteElement = null;
|
8339 |
-
this.maskManager.destroy();
|
8340 |
-
},
|
8341 |
-
getBaseElement: function () {
|
8342 |
-
if (this.data.hd) {
|
8343 |
-
return null;
|
8344 |
-
}
|
8345 |
-
return this.baseElement;
|
8346 |
-
},
|
8347 |
-
createRenderableComponents: function () {
|
8348 |
-
this.maskManager = new MaskElement(this.data, this, this.globalData);
|
8349 |
-
this.renderableEffectsManager = new SVGEffects(this);
|
8350 |
-
},
|
8351 |
-
setMatte: function (id) {
|
8352 |
-
if (!this.matteElement) {
|
8353 |
-
return;
|
8354 |
-
}
|
8355 |
-
this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
|
8356 |
-
}
|
8357 |
-
};
|
8358 |
-
|
8359 |
-
function IShapeElement() { }
|
8360 |
-
|
8361 |
-
IShapeElement.prototype = {
|
8362 |
-
addShapeToModifiers: function (data) {
|
8363 |
-
var i, len = this.shapeModifiers.length;
|
8364 |
-
for (i = 0; i < len; i += 1) {
|
8365 |
-
this.shapeModifiers[i].addShape(data);
|
8366 |
-
}
|
8367 |
-
},
|
8368 |
-
isShapeInAnimatedModifiers: function (data) {
|
8369 |
-
var i = 0,
|
8370 |
-
len = this.shapeModifiers.length;
|
8371 |
-
while (i < len) {
|
8372 |
-
if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
|
8373 |
-
return true;
|
8374 |
-
}
|
8375 |
-
}
|
8376 |
-
return false;
|
8377 |
-
},
|
8378 |
-
renderModifiers: function () {
|
8379 |
-
if (!this.shapeModifiers.length) {
|
8380 |
-
return;
|
8381 |
-
}
|
8382 |
-
var i, len = this.shapes.length;
|
8383 |
-
for (i = 0; i < len; i += 1) {
|
8384 |
-
this.shapes[i].sh.reset();
|
8385 |
-
}
|
8386 |
-
|
8387 |
-
len = this.shapeModifiers.length;
|
8388 |
-
for (i = len - 1; i >= 0; i -= 1) {
|
8389 |
-
this.shapeModifiers[i].processShapes(this._isFirstFrame);
|
8390 |
-
}
|
8391 |
-
},
|
8392 |
-
lcEnum: {
|
8393 |
-
'1': 'butt',
|
8394 |
-
'2': 'round',
|
8395 |
-
'3': 'square'
|
8396 |
-
},
|
8397 |
-
ljEnum: {
|
8398 |
-
'1': 'miter',
|
8399 |
-
'2': 'round',
|
8400 |
-
'3': 'bevel'
|
8401 |
-
},
|
8402 |
-
searchProcessedElement: function (elem) {
|
8403 |
-
var elements = this.processedElements;
|
8404 |
-
var i = 0,
|
8405 |
-
len = elements.length;
|
8406 |
-
while (i < len) {
|
8407 |
-
if (elements[i].elem === elem) {
|
8408 |
-
return elements[i].pos;
|
8409 |
-
}
|
8410 |
-
i += 1;
|
8411 |
-
}
|
8412 |
-
return 0;
|
8413 |
-
},
|
8414 |
-
addProcessedElement: function (elem, pos) {
|
8415 |
-
var elements = this.processedElements;
|
8416 |
-
var i = elements.length;
|
8417 |
-
while (i) {
|
8418 |
-
i -= 1;
|
8419 |
-
if (elements[i].elem === elem) {
|
8420 |
-
elements[i].pos = pos;
|
8421 |
-
return;
|
8422 |
-
}
|
8423 |
-
}
|
8424 |
-
elements.push(new ProcessedElement(elem, pos));
|
8425 |
-
},
|
8426 |
-
prepareFrame: function (num) {
|
8427 |
-
this.prepareRenderableFrame(num);
|
8428 |
-
this.prepareProperties(num, this.isInRange);
|
8429 |
-
}
|
8430 |
-
};
|
8431 |
-
|
8432 |
-
function ITextElement() { }
|
8433 |
-
|
8434 |
-
ITextElement.prototype.initElement = function (data, globalData, comp) {
|
8435 |
-
this.lettersChangedFlag = true;
|
8436 |
-
this.initFrame();
|
8437 |
-
this.initBaseData(data, globalData, comp);
|
8438 |
-
this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
|
8439 |
-
this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
|
8440 |
-
this.initTransform(data, globalData, comp);
|
8441 |
-
this.initHierarchy();
|
8442 |
-
this.initRenderable();
|
8443 |
-
this.initRendererElement();
|
8444 |
-
this.createContainerElements();
|
8445 |
-
this.createRenderableComponents();
|
8446 |
-
this.createContent();
|
8447 |
-
this.hide();
|
8448 |
-
this.textAnimator.searchProperties(this.dynamicProperties);
|
8449 |
-
};
|
8450 |
-
|
8451 |
-
ITextElement.prototype.prepareFrame = function (num) {
|
8452 |
-
this._mdf = false;
|
8453 |
-
this.prepareRenderableFrame(num);
|
8454 |
-
this.prepareProperties(num, this.isInRange);
|
8455 |
-
if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
|
8456 |
-
this.buildNewText();
|
8457 |
-
this.textProperty._isFirstFrame = false;
|
8458 |
-
this.textProperty._mdf = false;
|
8459 |
-
}
|
8460 |
-
};
|
8461 |
-
|
8462 |
-
ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
|
8463 |
-
var j, jLen = shapes.length;
|
8464 |
-
var k, kLen, pathNodes;
|
8465 |
-
var shapeStr = '';
|
8466 |
-
for (j = 0; j < jLen; j += 1) {
|
8467 |
-
pathNodes = shapes[j].ks.k;
|
8468 |
-
shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
|
8469 |
-
}
|
8470 |
-
return shapeStr;
|
8471 |
-
};
|
8472 |
-
|
8473 |
-
ITextElement.prototype.updateDocumentData = function (newData, index) {
|
8474 |
-
this.textProperty.updateDocumentData(newData, index);
|
8475 |
-
};
|
8476 |
-
|
8477 |
-
ITextElement.prototype.canResizeFont = function (_canResize) {
|
8478 |
-
this.textProperty.canResizeFont(_canResize);
|
8479 |
-
};
|
8480 |
-
|
8481 |
-
ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
|
8482 |
-
this.textProperty.setMinimumFontSize(_fontSize);
|
8483 |
-
};
|
8484 |
-
|
8485 |
-
ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
|
8486 |
-
if (documentData.ps) {
|
8487 |
-
matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
|
8488 |
-
}
|
8489 |
-
matrixHelper.translate(0, -documentData.ls, 0);
|
8490 |
-
switch (documentData.j) {
|
8491 |
-
case 1:
|
8492 |
-
matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
|
8493 |
-
break;
|
8494 |
-
case 2:
|
8495 |
-
matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
|
8496 |
-
break;
|
8497 |
-
}
|
8498 |
-
matrixHelper.translate(xPos, yPos, 0);
|
8499 |
-
};
|
8500 |
-
|
8501 |
-
|
8502 |
-
ITextElement.prototype.buildColor = function (colorData) {
|
8503 |
-
return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
|
8504 |
-
};
|
8505 |
-
|
8506 |
-
ITextElement.prototype.emptyProp = new LetterProps();
|
8507 |
-
|
8508 |
-
ITextElement.prototype.destroy = function () {
|
8509 |
-
|
8510 |
-
};
|
8511 |
-
|
8512 |
-
function ICompElement() { }
|
8513 |
-
|
8514 |
-
extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
|
8515 |
-
|
8516 |
-
ICompElement.prototype.initElement = function (data, globalData, comp) {
|
8517 |
-
this.initFrame();
|
8518 |
-
this.initBaseData(data, globalData, comp);
|
8519 |
-
this.initTransform(data, globalData, comp);
|
8520 |
-
this.initRenderable();
|
8521 |
-
this.initHierarchy();
|
8522 |
-
this.initRendererElement();
|
8523 |
-
this.createContainerElements();
|
8524 |
-
this.createRenderableComponents();
|
8525 |
-
if (this.data.xt || !globalData.progressiveLoad) {
|
8526 |
-
this.buildAllItems();
|
8527 |
-
}
|
8528 |
-
this.hide();
|
8529 |
-
};
|
8530 |
-
|
8531 |
-
/*ICompElement.prototype.hide = function(){
|
8532 |
-
if(!this.hidden){
|
8533 |
-
this.hideElement();
|
8534 |
-
var i,len = this.elements.length;
|
8535 |
-
for( i = 0; i < len; i+=1 ){
|
8536 |
-
if(this.elements[i]){
|
8537 |
-
this.elements[i].hide();
|
8538 |
-
}
|
8539 |
-
}
|
8540 |
-
}
|
8541 |
-
};*/
|
8542 |
-
|
8543 |
-
ICompElement.prototype.prepareFrame = function (num) {
|
8544 |
-
this._mdf = false;
|
8545 |
-
this.prepareRenderableFrame(num);
|
8546 |
-
this.prepareProperties(num, this.isInRange);
|
8547 |
-
if (!this.isInRange && !this.data.xt) {
|
8548 |
-
return;
|
8549 |
-
}
|
8550 |
-
|
8551 |
-
if (!this.tm._placeholder) {
|
8552 |
-
var timeRemapped = this.tm.v;
|
8553 |
-
if (timeRemapped === this.data.op) {
|
8554 |
-
timeRemapped = this.data.op - 1;
|
8555 |
-
}
|
8556 |
-
this.renderedFrame = timeRemapped;
|
8557 |
-
} else {
|
8558 |
-
this.renderedFrame = num / this.data.sr;
|
8559 |
-
}
|
8560 |
-
var i, len = this.elements.length;
|
8561 |
-
if (!this.completeLayers) {
|
8562 |
-
this.checkLayers(this.renderedFrame);
|
8563 |
-
}
|
8564 |
-
//This iteration needs to be backwards because of how expressions connect between each other
|
8565 |
-
for (i = len - 1; i >= 0; i -= 1) {
|
8566 |
-
if (this.completeLayers || this.elements[i]) {
|
8567 |
-
this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
|
8568 |
-
if (this.elements[i]._mdf) {
|
8569 |
-
this._mdf = true;
|
8570 |
-
}
|
8571 |
-
}
|
8572 |
-
}
|
8573 |
-
};
|
8574 |
-
|
8575 |
-
ICompElement.prototype.renderInnerContent = function () {
|
8576 |
-
var i, len = this.layers.length;
|
8577 |
-
for (i = 0; i < len; i += 1) {
|
8578 |
-
if (this.completeLayers || this.elements[i]) {
|
8579 |
-
this.elements[i].renderFrame();
|
8580 |
-
}
|
8581 |
-
}
|
8582 |
-
};
|
8583 |
-
|
8584 |
-
ICompElement.prototype.setElements = function (elems) {
|
8585 |
-
this.elements = elems;
|
8586 |
-
};
|
8587 |
-
|
8588 |
-
ICompElement.prototype.getElements = function () {
|
8589 |
-
return this.elements;
|
8590 |
-
};
|
8591 |
-
|
8592 |
-
ICompElement.prototype.destroyElements = function () {
|
8593 |
-
var i, len = this.layers.length;
|
8594 |
-
for (i = 0; i < len; i += 1) {
|
8595 |
-
if (this.elements[i]) {
|
8596 |
-
this.elements[i].destroy();
|
8597 |
-
}
|
8598 |
-
}
|
8599 |
-
};
|
8600 |
-
|
8601 |
-
ICompElement.prototype.destroy = function () {
|
8602 |
-
this.destroyElements();
|
8603 |
-
this.destroyBaseElement();
|
8604 |
-
};
|
8605 |
-
|
8606 |
-
function IImageElement(data, globalData, comp) {
|
8607 |
-
this.assetData = globalData.getAssetData(data.refId);
|
8608 |
-
this.initElement(data, globalData, comp);
|
8609 |
-
this.sourceRect = {
|
8610 |
-
top: 0,
|
8611 |
-
left: 0,
|
8612 |
-
width: this.assetData.w,
|
8613 |
-
height: this.assetData.h
|
8614 |
-
};
|
8615 |
-
}
|
8616 |
-
|
8617 |
-
extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
|
8618 |
-
|
8619 |
-
IImageElement.prototype.createContent = function () {
|
8620 |
-
|
8621 |
-
var assetPath = this.globalData.getAssetsPath(this.assetData);
|
8622 |
-
|
8623 |
-
this.innerElem = createNS('image');
|
8624 |
-
this.innerElem.setAttribute('width', this.assetData.w + "px");
|
8625 |
-
this.innerElem.setAttribute('height', this.assetData.h + "px");
|
8626 |
-
this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
|
8627 |
-
this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
|
8628 |
-
|
8629 |
-
this.layerElement.appendChild(this.innerElem);
|
8630 |
-
};
|
8631 |
-
|
8632 |
-
IImageElement.prototype.sourceRectAtTime = function () {
|
8633 |
-
return this.sourceRect;
|
8634 |
-
}
|
8635 |
-
|
8636 |
-
function ISolidElement(data, globalData, comp) {
|
8637 |
-
this.initElement(data, globalData, comp);
|
8638 |
-
}
|
8639 |
-
extendPrototype([IImageElement], ISolidElement);
|
8640 |
-
|
8641 |
-
ISolidElement.prototype.createContent = function () {
|
8642 |
-
|
8643 |
-
var rect = createNS('rect');
|
8644 |
-
////rect.style.width = this.data.sw;
|
8645 |
-
////rect.style.height = this.data.sh;
|
8646 |
-
////rect.style.fill = this.data.sc;
|
8647 |
-
rect.setAttribute('width', this.data.sw);
|
8648 |
-
rect.setAttribute('height', this.data.sh);
|
8649 |
-
rect.setAttribute('fill', this.data.sc);
|
8650 |
-
this.layerElement.appendChild(rect);
|
8651 |
-
};
|
8652 |
-
|
8653 |
-
function SVGCompElement(data, globalData, comp) {
|
8654 |
-
this.layers = data.layers;
|
8655 |
-
this.supports3d = true;
|
8656 |
-
this.completeLayers = false;
|
8657 |
-
this.pendingElements = [];
|
8658 |
-
this.elements = this.layers ? createSizedArray(this.layers.length) : [];
|
8659 |
-
//this.layerElement = createNS('g');
|
8660 |
-
this.initElement(data, globalData, comp);
|
8661 |
-
this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {
|
8662 |
-
_placeholder: true
|
8663 |
-
};
|
8664 |
-
}
|
8665 |
-
|
8666 |
-
extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement);
|
8667 |
-
|
8668 |
-
function SVGTextElement(data, globalData, comp) {
|
8669 |
-
this.textSpans = [];
|
8670 |
-
this.renderType = 'svg';
|
8671 |
-
this.initElement(data, globalData, comp);
|
8672 |
-
}
|
8673 |
-
|
8674 |
-
extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextElement);
|
8675 |
-
|
8676 |
-
SVGTextElement.prototype.createContent = function () {
|
8677 |
-
|
8678 |
-
if (this.data.singleShape && !this.globalData.fontManager.chars) {
|
8679 |
-
this.textContainer = createNS('text');
|
8680 |
-
}
|
8681 |
-
};
|
8682 |
-
|
8683 |
-
SVGTextElement.prototype.buildTextContents = function (textArray) {
|
8684 |
-
var i = 0,
|
8685 |
-
len = textArray.length;
|
8686 |
-
var textContents = [],
|
8687 |
-
currentTextContent = '';
|
8688 |
-
while (i < len) {
|
8689 |
-
if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
|
8690 |
-
textContents.push(currentTextContent);
|
8691 |
-
currentTextContent = '';
|
8692 |
-
} else {
|
8693 |
-
currentTextContent += textArray[i];
|
8694 |
-
}
|
8695 |
-
i += 1;
|
8696 |
-
}
|
8697 |
-
textContents.push(currentTextContent);
|
8698 |
-
return textContents;
|
8699 |
-
}
|
8700 |
-
|
8701 |
-
SVGTextElement.prototype.buildNewText = function () {
|
8702 |
-
var i, len;
|
8703 |
-
|
8704 |
-
var documentData = this.textProperty.currentData;
|
8705 |
-
this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
|
8706 |
-
if (documentData.fc) {
|
8707 |
-
this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
|
8708 |
-
} else {
|
8709 |
-
this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
|
8710 |
-
}
|
8711 |
-
if (documentData.sc) {
|
8712 |
-
this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
|
8713 |
-
this.layerElement.setAttribute('stroke-width', documentData.sw);
|
8714 |
-
}
|
8715 |
-
this.layerElement.setAttribute('font-size', documentData.finalSize);
|
8716 |
-
var fontData = this.globalData.fontManager.getFontByName(documentData.f);
|
8717 |
-
if (fontData.fClass) {
|
8718 |
-
this.layerElement.setAttribute('class', fontData.fClass);
|
8719 |
-
} else {
|
8720 |
-
this.layerElement.setAttribute('font-family', fontData.fFamily);
|
8721 |
-
var fWeight = documentData.fWeight,
|
8722 |
-
fStyle = documentData.fStyle;
|
8723 |
-
this.layerElement.setAttribute('font-style', fStyle);
|
8724 |
-
this.layerElement.setAttribute('font-weight', fWeight);
|
8725 |
-
}
|
8726 |
-
this.layerElement.setAttribute('aria-label', documentData.t);
|
8727 |
-
|
8728 |
-
var letters = documentData.l || [];
|
8729 |
-
var usesGlyphs = !!this.globalData.fontManager.chars;
|
8730 |
-
len = letters.length;
|
8731 |
-
|
8732 |
-
var tSpan;
|
8733 |
-
var matrixHelper = this.mHelper;
|
8734 |
-
var shapes, shapeStr = '',
|
8735 |
-
singleShape = this.data.singleShape;
|
8736 |
-
var xPos = 0,
|
8737 |
-
yPos = 0,
|
8738 |
-
firstLine = true;
|
8739 |
-
var trackingOffset = documentData.tr / 1000 * documentData.finalSize;
|
8740 |
-
if (singleShape && !usesGlyphs && !documentData.sz) {
|
8741 |
-
var tElement = this.textContainer;
|
8742 |
-
var justify = 'start';
|
8743 |
-
switch (documentData.j) {
|
8744 |
-
case 1:
|
8745 |
-
justify = 'end';
|
8746 |
-
break;
|
8747 |
-
case 2:
|
8748 |
-
justify = 'middle';
|
8749 |
-
break;
|
8750 |
-
}
|
8751 |
-
tElement.setAttribute('text-anchor', justify);
|
8752 |
-
tElement.setAttribute('letter-spacing', trackingOffset);
|
8753 |
-
var textContent = this.buildTextContents(documentData.finalText);
|
8754 |
-
len = textContent.length;
|
8755 |
-
yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
|
8756 |
-
for (i = 0; i < len; i += 1) {
|
8757 |
-
tSpan = this.textSpans[i] || createNS('tspan');
|
8758 |
-
tSpan.textContent = textContent[i];
|
8759 |
-
tSpan.setAttribute('x', 0);
|
8760 |
-
tSpan.setAttribute('y', yPos);
|
8761 |
-
tSpan.style.display = 'inherit';
|
8762 |
-
tElement.appendChild(tSpan);
|
8763 |
-
this.textSpans[i] = tSpan;
|
8764 |
-
yPos += documentData.finalLineHeight;
|
8765 |
-
}
|
8766 |
-
|
8767 |
-
this.layerElement.appendChild(tElement);
|
8768 |
-
} else {
|
8769 |
-
var cachedSpansLength = this.textSpans.length;
|
8770 |
-
var shapeData, charData;
|
8771 |
-
for (i = 0; i < len; i += 1) {
|
8772 |
-
if (!usesGlyphs || !singleShape || i === 0) {
|
8773 |
-
tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs ? 'path' : 'text');
|
8774 |
-
if (cachedSpansLength <= i) {
|
8775 |
-
tSpan.setAttribute('stroke-linecap', 'butt');
|
8776 |
-
tSpan.setAttribute('stroke-linejoin', 'round');
|
8777 |
-
tSpan.setAttribute('stroke-miterlimit', '4');
|
8778 |
-
this.textSpans[i] = tSpan;
|
8779 |
-
this.layerElement.appendChild(tSpan);
|
8780 |
-
}
|
8781 |
-
tSpan.style.display = 'inherit';
|
8782 |
-
}
|
8783 |
-
|
8784 |
-
matrixHelper.reset();
|
8785 |
-
matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
|
8786 |
-
if (singleShape) {
|
8787 |
-
if (letters[i].n) {
|
8788 |
-
xPos = -trackingOffset;
|
8789 |
-
yPos += documentData.yOffset;
|
8790 |
-
yPos += firstLine ? 1 : 0;
|
8791 |
-
firstLine = false;
|
8792 |
-
}
|
8793 |
-
this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
|
8794 |
-
xPos += letters[i].l || 0;
|
8795 |
-
//xPos += letters[i].val === ' ' ? 0 : trackingOffset;
|
8796 |
-
xPos += trackingOffset;
|
8797 |
-
}
|
8798 |
-
if (usesGlyphs) {
|
8799 |
-
charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
|
8800 |
-
shapeData = charData && charData.data || {};
|
8801 |
-
shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
|
8802 |
-
if (!singleShape) {
|
8803 |
-
tSpan.setAttribute('d', this.createPathShape(matrixHelper, shapes));
|
8804 |
-
} else {
|
8805 |
-
shapeStr += this.createPathShape(matrixHelper, shapes);
|
8806 |
-
}
|
8807 |
-
} else {
|
8808 |
-
if (singleShape) {
|
8809 |
-
tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")");
|
8810 |
-
}
|
8811 |
-
tSpan.textContent = letters[i].val;
|
8812 |
-
tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
|
8813 |
-
}
|
8814 |
-
//
|
8815 |
-
}
|
8816 |
-
if (singleShape && tSpan) {
|
8817 |
-
tSpan.setAttribute('d', shapeStr);
|
8818 |
-
}
|
8819 |
-
}
|
8820 |
-
while (i < this.textSpans.length) {
|
8821 |
-
this.textSpans[i].style.display = 'none';
|
8822 |
-
i += 1;
|
8823 |
-
}
|
8824 |
-
|
8825 |
-
this._sizeChanged = true;
|
8826 |
-
};
|
8827 |
-
|
8828 |
-
SVGTextElement.prototype.sourceRectAtTime = function (time) {
|
8829 |
-
this.prepareFrame(this.comp.renderedFrame - this.data.st);
|
8830 |
-
this.renderInnerContent();
|
8831 |
-
if (this._sizeChanged) {
|
8832 |
-
this._sizeChanged = false;
|
8833 |
-
var textBox = this.layerElement.getBBox();
|
8834 |
-
this.bbox = {
|
8835 |
-
top: textBox.y,
|
8836 |
-
left: textBox.x,
|
8837 |
-
width: textBox.width,
|
8838 |
-
height: textBox.height
|
8839 |
-
};
|
8840 |
-
}
|
8841 |
-
return this.bbox;
|
8842 |
-
};
|
8843 |
-
|
8844 |
-
SVGTextElement.prototype.renderInnerContent = function () {
|
8845 |
-
|
8846 |
-
if (!this.data.singleShape) {
|
8847 |
-
this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
|
8848 |
-
if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
|
8849 |
-
this._sizeChanged = true;
|
8850 |
-
var i, len;
|
8851 |
-
var renderedLetters = this.textAnimator.renderedLetters;
|
8852 |
-
|
8853 |
-
var letters = this.textProperty.currentData.l;
|
8854 |
-
|
8855 |
-
len = letters.length;
|
8856 |
-
var renderedLetter, textSpan;
|
8857 |
-
for (i = 0; i < len; i += 1) {
|
8858 |
-
if (letters[i].n) {
|
8859 |
-
continue;
|
8860 |
-
}
|
8861 |
-
renderedLetter = renderedLetters[i];
|
8862 |
-
textSpan = this.textSpans[i];
|
8863 |
-
if (renderedLetter._mdf.m) {
|
8864 |
-
textSpan.setAttribute('transform', renderedLetter.m);
|
8865 |
-
}
|
8866 |
-
if (renderedLetter._mdf.o) {
|
8867 |
-
textSpan.setAttribute('opacity', renderedLetter.o);
|
8868 |
-
}
|
8869 |
-
if (renderedLetter._mdf.sw) {
|
8870 |
-
textSpan.setAttribute('stroke-width', renderedLetter.sw);
|
8871 |
-
}
|
8872 |
-
if (renderedLetter._mdf.sc) {
|
8873 |
-
textSpan.setAttribute('stroke', renderedLetter.sc);
|
8874 |
-
}
|
8875 |
-
if (renderedLetter._mdf.fc) {
|
8876 |
-
textSpan.setAttribute('fill', renderedLetter.fc);
|
8877 |
-
}
|
8878 |
-
}
|
8879 |
-
}
|
8880 |
-
}
|
8881 |
-
};
|
8882 |
-
|
8883 |
-
function SVGShapeElement(data, globalData, comp) {
|
8884 |
-
//List of drawable elements
|
8885 |
-
this.shapes = [];
|
8886 |
-
// Full shape data
|
8887 |
-
this.shapesData = data.shapes;
|
8888 |
-
//List of styles that will be applied to shapes
|
8889 |
-
this.stylesList = [];
|
8890 |
-
//List of modifiers that will be applied to shapes
|
8891 |
-
this.shapeModifiers = [];
|
8892 |
-
//List of items in shape tree
|
8893 |
-
this.itemsData = [];
|
8894 |
-
//List of items in previous shape tree
|
8895 |
-
this.processedElements = [];
|
8896 |
-
// List of animated components
|
8897 |
-
this.animatedContents = [];
|
8898 |
-
this.initElement(data, globalData, comp);
|
8899 |
-
//Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
|
8900 |
-
// List of elements that have been created
|
8901 |
-
this.prevViewData = [];
|
8902 |
-
//Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
|
8903 |
-
}
|
8904 |
-
|
8905 |
-
extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
|
8906 |
-
|
8907 |
-
SVGShapeElement.prototype.initSecondaryElement = function () { };
|
8908 |
-
|
8909 |
-
SVGShapeElement.prototype.identityMatrix = new Matrix();
|
8910 |
-
|
8911 |
-
SVGShapeElement.prototype.buildExpressionInterface = function () { };
|
8912 |
-
|
8913 |
-
SVGShapeElement.prototype.createContent = function () {
|
8914 |
-
this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
|
8915 |
-
this.filterUniqueShapes();
|
8916 |
-
};
|
8917 |
-
|
8918 |
-
/*
|
8919 |
-
This method searches for multiple shapes that affect a single element and one of them is animated
|
8920 |
-
*/
|
8921 |
-
SVGShapeElement.prototype.filterUniqueShapes = function () {
|
8922 |
-
var i, len = this.shapes.length,
|
8923 |
-
shape;
|
8924 |
-
var j, jLen = this.stylesList.length;
|
8925 |
-
var style, count = 0;
|
8926 |
-
var tempShapes = [];
|
8927 |
-
var areAnimated = false;
|
8928 |
-
for (j = 0; j < jLen; j += 1) {
|
8929 |
-
style = this.stylesList[j];
|
8930 |
-
areAnimated = false;
|
8931 |
-
tempShapes.length = 0;
|
8932 |
-
for (i = 0; i < len; i += 1) {
|
8933 |
-
shape = this.shapes[i];
|
8934 |
-
if (shape.styles.indexOf(style) !== -1) {
|
8935 |
-
tempShapes.push(shape);
|
8936 |
-
areAnimated = shape._isAnimated || areAnimated;
|
8937 |
-
}
|
8938 |
-
}
|
8939 |
-
if (tempShapes.length > 1 && areAnimated) {
|
8940 |
-
this.setShapesAsAnimated(tempShapes);
|
8941 |
-
}
|
8942 |
-
}
|
8943 |
-
}
|
8944 |
-
|
8945 |
-
SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
|
8946 |
-
var i, len = shapes.length;
|
8947 |
-
for (i = 0; i < len; i += 1) {
|
8948 |
-
shapes[i].setAsAnimated();
|
8949 |
-
}
|
8950 |
-
}
|
8951 |
-
|
8952 |
-
SVGShapeElement.prototype.createStyleElement = function (data, level) {
|
8953 |
-
//TODO: prevent drawing of hidden styles
|
8954 |
-
var elementData;
|
8955 |
-
var styleOb = new SVGStyleData(data, level);
|
8956 |
-
|
8957 |
-
var pathElement = styleOb.pElem;
|
8958 |
-
if (data.ty === 'st') {
|
8959 |
-
elementData = new SVGStrokeStyleData(this, data, styleOb);
|
8960 |
-
} else if (data.ty === 'fl') {
|
8961 |
-
elementData = new SVGFillStyleData(this, data, styleOb);
|
8962 |
-
} else if (data.ty === 'gf' || data.ty === 'gs') {
|
8963 |
-
var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
|
8964 |
-
elementData = new gradientConstructor(this, data, styleOb);
|
8965 |
-
this.globalData.defs.appendChild(elementData.gf);
|
8966 |
-
if (elementData.maskId) {
|
8967 |
-
this.globalData.defs.appendChild(elementData.ms);
|
8968 |
-
this.globalData.defs.appendChild(elementData.of);
|
8969 |
-
pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
|
8970 |
-
}
|
8971 |
-
}
|
8972 |
-
|
8973 |
-
if (data.ty === 'st' || data.ty === 'gs') {
|
8974 |
-
pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
|
8975 |
-
pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
|
8976 |
-
pathElement.setAttribute('fill-opacity', '0');
|
8977 |
-
if (data.lj === 1) {
|
8978 |
-
pathElement.setAttribute('stroke-miterlimit', data.ml);
|
8979 |
-
}
|
8980 |
-
}
|
8981 |
-
|
8982 |
-
if (data.r === 2) {
|
8983 |
-
pathElement.setAttribute('fill-rule', 'evenodd');
|
8984 |
-
}
|
8985 |
-
|
8986 |
-
if (data.ln) {
|
8987 |
-
pathElement.setAttribute('id', data.ln);
|
8988 |
-
}
|
8989 |
-
if (data.cl) {
|
8990 |
-
pathElement.setAttribute('class', data.cl);
|
8991 |
-
}
|
8992 |
-
if (data.bm) {
|
8993 |
-
pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
|
8994 |
-
}
|
8995 |
-
this.stylesList.push(styleOb);
|
8996 |
-
this.addToAnimatedContents(data, elementData);
|
8997 |
-
return elementData;
|
8998 |
-
};
|
8999 |
-
|
9000 |
-
SVGShapeElement.prototype.createGroupElement = function (data) {
|
9001 |
-
var elementData = new ShapeGroupData();
|
9002 |
-
if (data.ln) {
|
9003 |
-
elementData.gr.setAttribute('id', data.ln);
|
9004 |
-
}
|
9005 |
-
if (data.cl) {
|
9006 |
-
elementData.gr.setAttribute('class', data.cl);
|
9007 |
-
}
|
9008 |
-
if (data.bm) {
|
9009 |
-
elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
|
9010 |
-
}
|
9011 |
-
return elementData;
|
9012 |
-
};
|
9013 |
-
|
9014 |
-
SVGShapeElement.prototype.createTransformElement = function (data, container) {
|
9015 |
-
var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
|
9016 |
-
var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
|
9017 |
-
this.addToAnimatedContents(data, elementData);
|
9018 |
-
return elementData;
|
9019 |
-
};
|
9020 |
-
|
9021 |
-
SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
|
9022 |
-
var ty = 4;
|
9023 |
-
if (data.ty === 'rc') {
|
9024 |
-
ty = 5;
|
9025 |
-
} else if (data.ty === 'el') {
|
9026 |
-
ty = 6;
|
9027 |
-
} else if (data.ty === 'sr') {
|
9028 |
-
ty = 7;
|
9029 |
-
}
|
9030 |
-
var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
|
9031 |
-
var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
|
9032 |
-
this.shapes.push(elementData);
|
9033 |
-
this.addShapeToModifiers(elementData);
|
9034 |
-
this.addToAnimatedContents(data, elementData);
|
9035 |
-
return elementData;
|
9036 |
-
};
|
9037 |
-
|
9038 |
-
SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
|
9039 |
-
var i = 0,
|
9040 |
-
len = this.animatedContents.length;
|
9041 |
-
while (i < len) {
|
9042 |
-
if (this.animatedContents[i].element === element) {
|
9043 |
-
return;
|
9044 |
-
}
|
9045 |
-
i += 1;
|
9046 |
-
}
|
9047 |
-
this.animatedContents.push({
|
9048 |
-
fn: SVGElementsRenderer.createRenderFunction(data),
|
9049 |
-
element: element,
|
9050 |
-
data: data
|
9051 |
-
});
|
9052 |
-
};
|
9053 |
-
|
9054 |
-
SVGShapeElement.prototype.setElementStyles = function (elementData) {
|
9055 |
-
var arr = elementData.styles;
|
9056 |
-
var j, jLen = this.stylesList.length;
|
9057 |
-
for (j = 0; j < jLen; j += 1) {
|
9058 |
-
if (!this.stylesList[j].closed) {
|
9059 |
-
arr.push(this.stylesList[j]);
|
9060 |
-
}
|
9061 |
-
}
|
9062 |
-
};
|
9063 |
-
|
9064 |
-
SVGShapeElement.prototype.reloadShapes = function () {
|
9065 |
-
this._isFirstFrame = true;
|
9066 |
-
var i, len = this.itemsData.length;
|
9067 |
-
for (i = 0; i < len; i += 1) {
|
9068 |
-
this.prevViewData[i] = this.itemsData[i];
|
9069 |
-
}
|
9070 |
-
this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
|
9071 |
-
this.filterUniqueShapes();
|
9072 |
-
len = this.dynamicProperties.length;
|
9073 |
-
for (i = 0; i < len; i += 1) {
|
9074 |
-
this.dynamicProperties[i].getValue();
|
9075 |
-
}
|
9076 |
-
this.renderModifiers();
|
9077 |
-
};
|
9078 |
-
|
9079 |
-
SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
|
9080 |
-
var ownTransformers = [].concat(transformers);
|
9081 |
-
var i, len = arr.length - 1;
|
9082 |
-
var j, jLen;
|
9083 |
-
var ownStyles = [],
|
9084 |
-
ownModifiers = [],
|
9085 |
-
styleOb, currentTransform, modifier, processedPos;
|
9086 |
-
for (i = len; i >= 0; i -= 1) {
|
9087 |
-
processedPos = this.searchProcessedElement(arr[i]);
|
9088 |
-
if (!processedPos) {
|
9089 |
-
arr[i]._render = render;
|
9090 |
-
} else {
|
9091 |
-
itemsData[i] = prevViewData[processedPos - 1];
|
9092 |
-
}
|
9093 |
-
if (arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs') {
|
9094 |
-
if (!processedPos) {
|
9095 |
-
itemsData[i] = this.createStyleElement(arr[i], level);
|
9096 |
-
} else {
|
9097 |
-
itemsData[i].style.closed = false;
|
9098 |
-
}
|
9099 |
-
if (arr[i]._render) {
|
9100 |
-
container.appendChild(itemsData[i].style.pElem);
|
9101 |
-
}
|
9102 |
-
ownStyles.push(itemsData[i].style);
|
9103 |
-
} else if (arr[i].ty == 'gr') {
|
9104 |
-
if (!processedPos) {
|
9105 |
-
itemsData[i] = this.createGroupElement(arr[i]);
|
9106 |
-
} else {
|
9107 |
-
jLen = itemsData[i].it.length;
|
9108 |
-
for (j = 0; j < jLen; j += 1) {
|
9109 |
-
itemsData[i].prevViewData[j] = itemsData[i].it[j];
|
9110 |
-
}
|
9111 |
-
}
|
9112 |
-
this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
|
9113 |
-
if (arr[i]._render) {
|
9114 |
-
container.appendChild(itemsData[i].gr);
|
9115 |
-
}
|
9116 |
-
} else if (arr[i].ty == 'tr') {
|
9117 |
-
if (!processedPos) {
|
9118 |
-
itemsData[i] = this.createTransformElement(arr[i], container);
|
9119 |
-
}
|
9120 |
-
currentTransform = itemsData[i].transform;
|
9121 |
-
ownTransformers.push(currentTransform);
|
9122 |
-
} else if (arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr') {
|
9123 |
-
if (!processedPos) {
|
9124 |
-
itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
|
9125 |
-
}
|
9126 |
-
this.setElementStyles(itemsData[i]);
|
9127 |
-
|
9128 |
-
} else if (arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms') {
|
9129 |
-
if (!processedPos) {
|
9130 |
-
modifier = ShapeModifiers.getModifier(arr[i].ty);
|
9131 |
-
modifier.init(this, arr[i]);
|
9132 |
-
itemsData[i] = modifier;
|
9133 |
-
this.shapeModifiers.push(modifier);
|
9134 |
-
} else {
|
9135 |
-
modifier = itemsData[i];
|
9136 |
-
modifier.closed = false;
|
9137 |
-
}
|
9138 |
-
ownModifiers.push(modifier);
|
9139 |
-
} else if (arr[i].ty == 'rp') {
|
9140 |
-
if (!processedPos) {
|
9141 |
-
modifier = ShapeModifiers.getModifier(arr[i].ty);
|
9142 |
-
itemsData[i] = modifier;
|
9143 |
-
modifier.init(this, arr, i, itemsData);
|
9144 |
-
this.shapeModifiers.push(modifier);
|
9145 |
-
render = false;
|
9146 |
-
} else {
|
9147 |
-
modifier = itemsData[i];
|
9148 |
-
modifier.closed = true;
|
9149 |
-
}
|
9150 |
-
ownModifiers.push(modifier);
|
9151 |
-
}
|
9152 |
-
this.addProcessedElement(arr[i], i + 1);
|
9153 |
-
}
|
9154 |
-
len = ownStyles.length;
|
9155 |
-
for (i = 0; i < len; i += 1) {
|
9156 |
-
ownStyles[i].closed = true;
|
9157 |
-
}
|
9158 |
-
len = ownModifiers.length;
|
9159 |
-
for (i = 0; i < len; i += 1) {
|
9160 |
-
ownModifiers[i].closed = true;
|
9161 |
-
}
|
9162 |
-
};
|
9163 |
-
|
9164 |
-
SVGShapeElement.prototype.renderInnerContent = function () {
|
9165 |
-
this.renderModifiers();
|
9166 |
-
var i, len = this.stylesList.length;
|
9167 |
-
for (i = 0; i < len; i += 1) {
|
9168 |
-
this.stylesList[i].reset();
|
9169 |
-
}
|
9170 |
-
this.renderShape();
|
9171 |
-
|
9172 |
-
for (i = 0; i < len; i += 1) {
|
9173 |
-
if (this.stylesList[i]._mdf || this._isFirstFrame) {
|
9174 |
-
if (this.stylesList[i].msElem) {
|
9175 |
-
this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
|
9176 |
-
//Adding M0 0 fixes same mask bug on all browsers
|
9177 |
-
this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
|
9178 |
-
}
|
9179 |
-
this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
|
9180 |
-
}
|
9181 |
-
}
|
9182 |
-
};
|
9183 |
-
|
9184 |
-
SVGShapeElement.prototype.renderShape = function () {
|
9185 |
-
var i, len = this.animatedContents.length;
|
9186 |
-
var animatedContent;
|
9187 |
-
for (i = 0; i < len; i += 1) {
|
9188 |
-
animatedContent = this.animatedContents[i];
|
9189 |
-
if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
|
9190 |
-
animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
|
9191 |
-
}
|
9192 |
-
}
|
9193 |
-
}
|
9194 |
-
|
9195 |
-
SVGShapeElement.prototype.destroy = function () {
|
9196 |
-
this.destroyBaseElement();
|
9197 |
-
this.shapesData = null;
|
9198 |
-
this.itemsData = null;
|
9199 |
-
};
|
9200 |
-
|
9201 |
-
function SVGTintFilter(filter, filterManager) {
|
9202 |
-
this.filterManager = filterManager;
|
9203 |
-
var feColorMatrix = createNS('feColorMatrix');
|
9204 |
-
feColorMatrix.setAttribute('type', 'matrix');
|
9205 |
-
feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
|
9206 |
-
feColorMatrix.setAttribute('values', '0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0');
|
9207 |
-
feColorMatrix.setAttribute('result', 'f1');
|
9208 |
-
filter.appendChild(feColorMatrix);
|
9209 |
-
feColorMatrix = createNS('feColorMatrix');
|
9210 |
-
feColorMatrix.setAttribute('type', 'matrix');
|
9211 |
-
feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
|
9212 |
-
feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
|
9213 |
-
feColorMatrix.setAttribute('result', 'f2');
|
9214 |
-
filter.appendChild(feColorMatrix);
|
9215 |
-
this.matrixFilter = feColorMatrix;
|
9216 |
-
if (filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k) {
|
9217 |
-
var feMerge = createNS('feMerge');
|
9218 |
-
filter.appendChild(feMerge);
|
9219 |
-
var feMergeNode;
|
9220 |
-
feMergeNode = createNS('feMergeNode');
|
9221 |
-
feMergeNode.setAttribute('in', 'SourceGraphic');
|
9222 |
-
feMerge.appendChild(feMergeNode);
|
9223 |
-
feMergeNode = createNS('feMergeNode');
|
9224 |
-
feMergeNode.setAttribute('in', 'f2');
|
9225 |
-
feMerge.appendChild(feMergeNode);
|
9226 |
-
}
|
9227 |
-
}
|
9228 |
-
|
9229 |
-
SVGTintFilter.prototype.renderFrame = function (forceRender) {
|
9230 |
-
if (forceRender || this.filterManager._mdf) {
|
9231 |
-
var colorBlack = this.filterManager.effectElements[0].p.v;
|
9232 |
-
var colorWhite = this.filterManager.effectElements[1].p.v;
|
9233 |
-
var opacity = this.filterManager.effectElements[2].p.v / 100;
|
9234 |
-
this.matrixFilter.setAttribute('values', (colorWhite[0] - colorBlack[0]) + ' 0 0 0 ' + colorBlack[0] + ' ' + (colorWhite[1] - colorBlack[1]) + ' 0 0 0 ' + colorBlack[1] + ' ' + (colorWhite[2] - colorBlack[2]) + ' 0 0 0 ' + colorBlack[2] + ' 0 0 0 ' + opacity + ' 0');
|
9235 |
-
}
|
9236 |
-
};
|
9237 |
-
|
9238 |
-
function SVGFillFilter(filter, filterManager) {
|
9239 |
-
this.filterManager = filterManager;
|
9240 |
-
var feColorMatrix = createNS('feColorMatrix');
|
9241 |
-
feColorMatrix.setAttribute('type', 'matrix');
|
9242 |
-
feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
|
9243 |
-
feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
|
9244 |
-
filter.appendChild(feColorMatrix);
|
9245 |
-
this.matrixFilter = feColorMatrix;
|
9246 |
-
}
|
9247 |
-
SVGFillFilter.prototype.renderFrame = function (forceRender) {
|
9248 |
-
if (forceRender || this.filterManager._mdf) {
|
9249 |
-
var color = this.filterManager.effectElements[2].p.v;
|
9250 |
-
var opacity = this.filterManager.effectElements[6].p.v;
|
9251 |
-
this.matrixFilter.setAttribute('values', '0 0 0 0 ' + color[0] + ' 0 0 0 0 ' + color[1] + ' 0 0 0 0 ' + color[2] + ' 0 0 0 ' + opacity + ' 0');
|
9252 |
-
}
|
9253 |
-
};
|
9254 |
-
|
9255 |
-
function SVGGaussianBlurEffect(filter, filterManager) {
|
9256 |
-
// Outset the filter region by 100% on all sides to accommodate blur expansion.
|
9257 |
-
filter.setAttribute('x', '-100%');
|
9258 |
-
filter.setAttribute('y', '-100%');
|
9259 |
-
filter.setAttribute('width', '300%');
|
9260 |
-
filter.setAttribute('height', '300%');
|
9261 |
-
|
9262 |
-
this.filterManager = filterManager;
|
9263 |
-
var feGaussianBlur = createNS('feGaussianBlur');
|
9264 |
-
filter.appendChild(feGaussianBlur);
|
9265 |
-
this.feGaussianBlur = feGaussianBlur;
|
9266 |
-
}
|
9267 |
-
|
9268 |
-
SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) {
|
9269 |
-
if (forceRender || this.filterManager._mdf) {
|
9270 |
-
// Empirical value, matching AE's blur appearance.
|
9271 |
-
var kBlurrinessToSigma = 0.3;
|
9272 |
-
var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
|
9273 |
-
|
9274 |
-
// Dimensions mapping:
|
9275 |
-
//
|
9276 |
-
// 1 -> horizontal & vertical
|
9277 |
-
// 2 -> horizontal only
|
9278 |
-
// 3 -> vertical only
|
9279 |
-
//
|
9280 |
-
var dimensions = this.filterManager.effectElements[1].p.v;
|
9281 |
-
var sigmaX = (dimensions == 3) ? 0 : sigma;
|
9282 |
-
var sigmaY = (dimensions == 2) ? 0 : sigma;
|
9283 |
-
|
9284 |
-
this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + " " + sigmaY);
|
9285 |
-
|
9286 |
-
// Repeat edges mapping:
|
9287 |
-
//
|
9288 |
-
// 0 -> off -> duplicate
|
9289 |
-
// 1 -> on -> wrap
|
9290 |
-
var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate';
|
9291 |
-
this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
|
9292 |
-
}
|
9293 |
-
}
|
9294 |
-
|
9295 |
-
function SVGStrokeEffect(elem, filterManager) {
|
9296 |
-
this.initialized = false;
|
9297 |
-
this.filterManager = filterManager;
|
9298 |
-
this.elem = elem;
|
9299 |
-
this.paths = [];
|
9300 |
-
}
|
9301 |
-
|
9302 |
-
SVGStrokeEffect.prototype.initialize = function () {
|
9303 |
-
|
9304 |
-
var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
|
9305 |
-
var path, groupPath, i, len;
|
9306 |
-
if (this.filterManager.effectElements[1].p.v === 1) {
|
9307 |
-
len = this.elem.maskManager.masksProperties.length;
|
9308 |
-
i = 0;
|
9309 |
-
} else {
|
9310 |
-
i = this.filterManager.effectElements[0].p.v - 1;
|
9311 |
-
len = i + 1;
|
9312 |
-
}
|
9313 |
-
groupPath = createNS('g');
|
9314 |
-
groupPath.setAttribute('fill', 'none');
|
9315 |
-
groupPath.setAttribute('stroke-linecap', 'round');
|
9316 |
-
groupPath.setAttribute('stroke-dashoffset', 1);
|
9317 |
-
for (i; i < len; i += 1) {
|
9318 |
-
path = createNS('path');
|
9319 |
-
groupPath.appendChild(path);
|
9320 |
-
this.paths.push({
|
9321 |
-
p: path,
|
9322 |
-
m: i
|
9323 |
-
});
|
9324 |
-
}
|
9325 |
-
if (this.filterManager.effectElements[10].p.v === 3) {
|
9326 |
-
var mask = createNS('mask');
|
9327 |
-
var id = createElementID();
|
9328 |
-
mask.setAttribute('id', id);
|
9329 |
-
mask.setAttribute('mask-type', 'alpha');
|
9330 |
-
mask.appendChild(groupPath);
|
9331 |
-
this.elem.globalData.defs.appendChild(mask);
|
9332 |
-
var g = createNS('g');
|
9333 |
-
g.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
|
9334 |
-
while (elemChildren[0]) {
|
9335 |
-
g.appendChild(elemChildren[0]);
|
9336 |
-
}
|
9337 |
-
this.elem.layerElement.appendChild(g);
|
9338 |
-
this.masker = mask;
|
9339 |
-
groupPath.setAttribute('stroke', '#fff');
|
9340 |
-
} else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
|
9341 |
-
if (this.filterManager.effectElements[10].p.v === 2) {
|
9342 |
-
elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
|
9343 |
-
while (elemChildren.length) {
|
9344 |
-
this.elem.layerElement.removeChild(elemChildren[0]);
|
9345 |
-
}
|
9346 |
-
}
|
9347 |
-
this.elem.layerElement.appendChild(groupPath);
|
9348 |
-
this.elem.layerElement.removeAttribute('mask');
|
9349 |
-
groupPath.setAttribute('stroke', '#fff');
|
9350 |
-
}
|
9351 |
-
this.initialized = true;
|
9352 |
-
this.pathMasker = groupPath;
|
9353 |
-
};
|
9354 |
-
|
9355 |
-
SVGStrokeEffect.prototype.renderFrame = function (forceRender) {
|
9356 |
-
if (!this.initialized) {
|
9357 |
-
this.initialize();
|
9358 |
-
}
|
9359 |
-
var i, len = this.paths.length;
|
9360 |
-
var mask, path;
|
9361 |
-
for (i = 0; i < len; i += 1) {
|
9362 |
-
if (this.paths[i].m === -1) {
|
9363 |
-
continue;
|
9364 |
-
}
|
9365 |
-
mask = this.elem.maskManager.viewData[this.paths[i].m];
|
9366 |
-
path = this.paths[i].p;
|
9367 |
-
if (forceRender || this.filterManager._mdf || mask.prop._mdf) {
|
9368 |
-
path.setAttribute('d', mask.lastPath);
|
9369 |
-
}
|
9370 |
-
if (forceRender || this.filterManager.effectElements[9].p._mdf || this.filterManager.effectElements[4].p._mdf || this.filterManager.effectElements[7].p._mdf || this.filterManager.effectElements[8].p._mdf || mask.prop._mdf) {
|
9371 |
-
var dasharrayValue;
|
9372 |
-
if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) {
|
9373 |
-
var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) / 100;
|
9374 |
-
var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) / 100;
|
9375 |
-
var l = path.getTotalLength();
|
9376 |
-
dasharrayValue = '0 0 0 ' + l * s + ' ';
|
9377 |
-
var lineLength = l * (e - s);
|
9378 |
-
var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v / 100;
|
9379 |
-
var units = Math.floor(lineLength / segment);
|
9380 |
-
var j;
|
9381 |
-
for (j = 0; j < units; j += 1) {
|
9382 |
-
dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v / 100 + ' ';
|
9383 |
-
}
|
9384 |
-
dasharrayValue += '0 ' + l * 10 + ' 0 0';
|
9385 |
-
} else {
|
9386 |
-
dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v / 100;
|
9387 |
-
}
|
9388 |
-
path.setAttribute('stroke-dasharray', dasharrayValue);
|
9389 |
-
}
|
9390 |
-
}
|
9391 |
-
if (forceRender || this.filterManager.effectElements[4].p._mdf) {
|
9392 |
-
this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2);
|
9393 |
-
}
|
9394 |
-
|
9395 |
-
if (forceRender || this.filterManager.effectElements[6].p._mdf) {
|
9396 |
-
this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v);
|
9397 |
-
}
|
9398 |
-
if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
|
9399 |
-
if (forceRender || this.filterManager.effectElements[3].p._mdf) {
|
9400 |
-
var color = this.filterManager.effectElements[3].p.v;
|
9401 |
-
this.pathMasker.setAttribute('stroke', 'rgb(' + bm_floor(color[0] * 255) + ',' + bm_floor(color[1] * 255) + ',' + bm_floor(color[2] * 255) + ')');
|
9402 |
-
}
|
9403 |
-
}
|
9404 |
-
};
|
9405 |
-
|
9406 |
-
function SVGTritoneFilter(filter, filterManager) {
|
9407 |
-
this.filterManager = filterManager;
|
9408 |
-
var feColorMatrix = createNS('feColorMatrix');
|
9409 |
-
feColorMatrix.setAttribute('type', 'matrix');
|
9410 |
-
feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
|
9411 |
-
feColorMatrix.setAttribute('values', '0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0');
|
9412 |
-
feColorMatrix.setAttribute('result', 'f1');
|
9413 |
-
filter.appendChild(feColorMatrix);
|
9414 |
-
var feComponentTransfer = createNS('feComponentTransfer');
|
9415 |
-
feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
|
9416 |
-
filter.appendChild(feComponentTransfer);
|
9417 |
-
this.matrixFilter = feComponentTransfer;
|
9418 |
-
var feFuncR = createNS('feFuncR');
|
9419 |
-
feFuncR.setAttribute('type', 'table');
|
9420 |
-
feComponentTransfer.appendChild(feFuncR);
|
9421 |
-
this.feFuncR = feFuncR;
|
9422 |
-
var feFuncG = createNS('feFuncG');
|
9423 |
-
feFuncG.setAttribute('type', 'table');
|
9424 |
-
feComponentTransfer.appendChild(feFuncG);
|
9425 |
-
this.feFuncG = feFuncG;
|
9426 |
-
var feFuncB = createNS('feFuncB');
|
9427 |
-
feFuncB.setAttribute('type', 'table');
|
9428 |
-
feComponentTransfer.appendChild(feFuncB);
|
9429 |
-
this.feFuncB = feFuncB;
|
9430 |
-
}
|
9431 |
-
|
9432 |
-
SVGTritoneFilter.prototype.renderFrame = function (forceRender) {
|
9433 |
-
if (forceRender || this.filterManager._mdf) {
|
9434 |
-
var color1 = this.filterManager.effectElements[0].p.v;
|
9435 |
-
var color2 = this.filterManager.effectElements[1].p.v;
|
9436 |
-
var color3 = this.filterManager.effectElements[2].p.v;
|
9437 |
-
var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
|
9438 |
-
var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
|
9439 |
-
var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
|
9440 |
-
this.feFuncR.setAttribute('tableValues', tableR);
|
9441 |
-
this.feFuncG.setAttribute('tableValues', tableG);
|
9442 |
-
this.feFuncB.setAttribute('tableValues', tableB);
|
9443 |
-
//var opacity = this.filterManager.effectElements[2].p.v/100;
|
9444 |
-
//this.matrixFilter.setAttribute('values',(colorWhite[0]- colorBlack[0])+' 0 0 0 '+ colorBlack[0] +' '+ (colorWhite[1]- colorBlack[1]) +' 0 0 0 '+ colorBlack[1] +' '+ (colorWhite[2]- colorBlack[2]) +' 0 0 0 '+ colorBlack[2] +' 0 0 0 ' + opacity + ' 0');
|
9445 |
-
}
|
9446 |
-
};
|
9447 |
-
|
9448 |
-
function SVGProLevelsFilter(filter, filterManager) {
|
9449 |
-
this.filterManager = filterManager;
|
9450 |
-
var effectElements = this.filterManager.effectElements;
|
9451 |
-
var feComponentTransfer = createNS('feComponentTransfer');
|
9452 |
-
var feFuncR, feFuncG, feFuncB;
|
9453 |
-
|
9454 |
-
if (effectElements[10].p.k || effectElements[10].p.v !== 0 || effectElements[11].p.k || effectElements[11].p.v !== 1 || effectElements[12].p.k || effectElements[12].p.v !== 1 || effectElements[13].p.k || effectElements[13].p.v !== 0 || effectElements[14].p.k || effectElements[14].p.v !== 1) {
|
9455 |
-
this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
|
9456 |
-
}
|
9457 |
-
if (effectElements[17].p.k || effectElements[17].p.v !== 0 || effectElements[18].p.k || effectElements[18].p.v !== 1 || effectElements[19].p.k || effectElements[19].p.v !== 1 || effectElements[20].p.k || effectElements[20].p.v !== 0 || effectElements[21].p.k || effectElements[21].p.v !== 1) {
|
9458 |
-
this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
|
9459 |
-
}
|
9460 |
-
if (effectElements[24].p.k || effectElements[24].p.v !== 0 || effectElements[25].p.k || effectElements[25].p.v !== 1 || effectElements[26].p.k || effectElements[26].p.v !== 1 || effectElements[27].p.k || effectElements[27].p.v !== 0 || effectElements[28].p.k || effectElements[28].p.v !== 1) {
|
9461 |
-
this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
|
9462 |
-
}
|
9463 |
-
if (effectElements[31].p.k || effectElements[31].p.v !== 0 || effectElements[32].p.k || effectElements[32].p.v !== 1 || effectElements[33].p.k || effectElements[33].p.v !== 1 || effectElements[34].p.k || effectElements[34].p.v !== 0 || effectElements[35].p.k || effectElements[35].p.v !== 1) {
|
9464 |
-
this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
|
9465 |
-
}
|
9466 |
-
|
9467 |
-
if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) {
|
9468 |
-
feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
|
9469 |
-
filter.appendChild(feComponentTransfer);
|
9470 |
-
feComponentTransfer = createNS('feComponentTransfer');
|
9471 |
-
}
|
9472 |
-
|
9473 |
-
if (effectElements[3].p.k || effectElements[3].p.v !== 0 || effectElements[4].p.k || effectElements[4].p.v !== 1 || effectElements[5].p.k || effectElements[5].p.v !== 1 || effectElements[6].p.k || effectElements[6].p.v !== 0 || effectElements[7].p.k || effectElements[7].p.v !== 1) {
|
9474 |
-
|
9475 |
-
feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
|
9476 |
-
filter.appendChild(feComponentTransfer);
|
9477 |
-
this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
|
9478 |
-
this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
|
9479 |
-
this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
|
9480 |
-
}
|
9481 |
-
}
|
9482 |
-
|
9483 |
-
SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) {
|
9484 |
-
var feFunc = createNS(type);
|
9485 |
-
feFunc.setAttribute('type', 'table');
|
9486 |
-
feComponentTransfer.appendChild(feFunc);
|
9487 |
-
return feFunc;
|
9488 |
-
};
|
9489 |
-
|
9490 |
-
SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
|
9491 |
-
var cnt = 0;
|
9492 |
-
var segments = 256;
|
9493 |
-
var perc;
|
9494 |
-
var min = Math.min(inputBlack, inputWhite);
|
9495 |
-
var max = Math.max(inputBlack, inputWhite);
|
9496 |
-
var table = Array.call(null, {
|
9497 |
-
length: segments
|
9498 |
-
});
|
9499 |
-
var colorValue;
|
9500 |
-
var pos = 0;
|
9501 |
-
var outputDelta = outputWhite - outputBlack;
|
9502 |
-
var inputDelta = inputWhite - inputBlack;
|
9503 |
-
while (cnt <= 256) {
|
9504 |
-
perc = cnt / 256;
|
9505 |
-
if (perc <= min) {
|
9506 |
-
colorValue = inputDelta < 0 ? outputWhite : outputBlack;
|
9507 |
-
} else if (perc >= max) {
|
9508 |
-
colorValue = inputDelta < 0 ? outputBlack : outputWhite;
|
9509 |
-
} else {
|
9510 |
-
colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
|
9511 |
-
}
|
9512 |
-
table[pos++] = colorValue;
|
9513 |
-
cnt += 256 / (segments - 1);
|
9514 |
-
}
|
9515 |
-
return table.join(' ');
|
9516 |
-
};
|
9517 |
-
|
9518 |
-
SVGProLevelsFilter.prototype.renderFrame = function (forceRender) {
|
9519 |
-
if (forceRender || this.filterManager._mdf) {
|
9520 |
-
var val, cnt, perc, bezier;
|
9521 |
-
var effectElements = this.filterManager.effectElements;
|
9522 |
-
if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) {
|
9523 |
-
val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v);
|
9524 |
-
this.feFuncRComposed.setAttribute('tableValues', val);
|
9525 |
-
this.feFuncGComposed.setAttribute('tableValues', val);
|
9526 |
-
this.feFuncBComposed.setAttribute('tableValues', val);
|
9527 |
-
}
|
9528 |
-
|
9529 |
-
|
9530 |
-
if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) {
|
9531 |
-
val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v);
|
9532 |
-
this.feFuncR.setAttribute('tableValues', val);
|
9533 |
-
}
|
9534 |
-
|
9535 |
-
if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) {
|
9536 |
-
val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v);
|
9537 |
-
this.feFuncG.setAttribute('tableValues', val);
|
9538 |
-
}
|
9539 |
-
|
9540 |
-
if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) {
|
9541 |
-
val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v);
|
9542 |
-
this.feFuncB.setAttribute('tableValues', val);
|
9543 |
-
}
|
9544 |
-
|
9545 |
-
if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) {
|
9546 |
-
val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v);
|
9547 |
-
this.feFuncA.setAttribute('tableValues', val);
|
9548 |
-
}
|
9549 |
-
|
9550 |
-
}
|
9551 |
-
};
|
9552 |
-
|
9553 |
-
function SVGDropShadowEffect(filter, filterManager) {
|
9554 |
-
var filterSize = filterManager.container.globalData.renderConfig.filterSize
|
9555 |
-
filter.setAttribute('x', filterSize.x);
|
9556 |
-
filter.setAttribute('y', filterSize.y);
|
9557 |
-
filter.setAttribute('width', filterSize.width);
|
9558 |
-
filter.setAttribute('height', filterSize.height);
|
9559 |
-
this.filterManager = filterManager;
|
9560 |
-
|
9561 |
-
var feGaussianBlur = createNS('feGaussianBlur');
|
9562 |
-
feGaussianBlur.setAttribute('in', 'SourceAlpha');
|
9563 |
-
feGaussianBlur.setAttribute('result', 'drop_shadow_1');
|
9564 |
-
feGaussianBlur.setAttribute('stdDeviation', '0');
|
9565 |
-
this.feGaussianBlur = feGaussianBlur;
|
9566 |
-
filter.appendChild(feGaussianBlur);
|
9567 |
-
|
9568 |
-
var feOffset = createNS('feOffset');
|
9569 |
-
feOffset.setAttribute('dx', '25');
|
9570 |
-
feOffset.setAttribute('dy', '0');
|
9571 |
-
feOffset.setAttribute('in', 'drop_shadow_1');
|
9572 |
-
feOffset.setAttribute('result', 'drop_shadow_2');
|
9573 |
-
this.feOffset = feOffset;
|
9574 |
-
filter.appendChild(feOffset);
|
9575 |
-
var feFlood = createNS('feFlood');
|
9576 |
-
feFlood.setAttribute('flood-color', '#00ff00');
|
9577 |
-
feFlood.setAttribute('flood-opacity', '1');
|
9578 |
-
feFlood.setAttribute('result', 'drop_shadow_3');
|
9579 |
-
this.feFlood = feFlood;
|
9580 |
-
filter.appendChild(feFlood);
|
9581 |
-
|
9582 |
-
var feComposite = createNS('feComposite');
|
9583 |
-
feComposite.setAttribute('in', 'drop_shadow_3');
|
9584 |
-
feComposite.setAttribute('in2', 'drop_shadow_2');
|
9585 |
-
feComposite.setAttribute('operator', 'in');
|
9586 |
-
feComposite.setAttribute('result', 'drop_shadow_4');
|
9587 |
-
filter.appendChild(feComposite);
|
9588 |
-
|
9589 |
-
|
9590 |
-
var feMerge = createNS('feMerge');
|
9591 |
-
filter.appendChild(feMerge);
|
9592 |
-
var feMergeNode;
|
9593 |
-
feMergeNode = createNS('feMergeNode');
|
9594 |
-
feMerge.appendChild(feMergeNode);
|
9595 |
-
feMergeNode = createNS('feMergeNode');
|
9596 |
-
feMergeNode.setAttribute('in', 'SourceGraphic');
|
9597 |
-
this.feMergeNode = feMergeNode;
|
9598 |
-
this.feMerge = feMerge;
|
9599 |
-
this.originalNodeAdded = false;
|
9600 |
-
feMerge.appendChild(feMergeNode);
|
9601 |
-
}
|
9602 |
-
|
9603 |
-
SVGDropShadowEffect.prototype.renderFrame = function (forceRender) {
|
9604 |
-
if (forceRender || this.filterManager._mdf) {
|
9605 |
-
if (forceRender || this.filterManager.effectElements[4].p._mdf) {
|
9606 |
-
this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
|
9607 |
-
}
|
9608 |
-
if (forceRender || this.filterManager.effectElements[0].p._mdf) {
|
9609 |
-
var col = this.filterManager.effectElements[0].p.v;
|
9610 |
-
this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255)));
|
9611 |
-
}
|
9612 |
-
if (forceRender || this.filterManager.effectElements[1].p._mdf) {
|
9613 |
-
this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255);
|
9614 |
-
}
|
9615 |
-
if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {
|
9616 |
-
var distance = this.filterManager.effectElements[3].p.v;
|
9617 |
-
var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
|
9618 |
-
var x = distance * Math.cos(angle);
|
9619 |
-
var y = distance * Math.sin(angle);
|
9620 |
-
this.feOffset.setAttribute('dx', x);
|
9621 |
-
this.feOffset.setAttribute('dy', y);
|
9622 |
-
}
|
9623 |
-
/*if(forceRender || this.filterManager.effectElements[5].p._mdf){
|
9624 |
-
if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
|
9625 |
-
this.feMerge.removeChild(this.feMergeNode);
|
9626 |
-
this.originalNodeAdded = false;
|
9627 |
-
} else if(this.filterManager.effectElements[5].p.v === 0 && !this.originalNodeAdded) {
|
9628 |
-
this.feMerge.appendChild(this.feMergeNode);
|
9629 |
-
this.originalNodeAdded = true;
|
9630 |
-
}
|
9631 |
-
}*/
|
9632 |
-
}
|
9633 |
-
};
|
9634 |
-
var _svgMatteSymbols = [];
|
9635 |
-
|
9636 |
-
function SVGMatte3Effect(filterElem, filterManager, elem) {
|
9637 |
-
this.initialized = false;
|
9638 |
-
this.filterManager = filterManager;
|
9639 |
-
this.filterElem = filterElem;
|
9640 |
-
this.elem = elem;
|
9641 |
-
elem.matteElement = createNS('g');
|
9642 |
-
elem.matteElement.appendChild(elem.layerElement);
|
9643 |
-
elem.matteElement.appendChild(elem.transformedElement);
|
9644 |
-
elem.baseElement = elem.matteElement;
|
9645 |
-
}
|
9646 |
-
|
9647 |
-
SVGMatte3Effect.prototype.findSymbol = function (mask) {
|
9648 |
-
var i = 0,
|
9649 |
-
len = _svgMatteSymbols.length;
|
9650 |
-
while (i < len) {
|
9651 |
-
if (_svgMatteSymbols[i] === mask) {
|
9652 |
-
return _svgMatteSymbols[i];
|
9653 |
-
}
|
9654 |
-
i += 1;
|
9655 |
-
}
|
9656 |
-
return null;
|
9657 |
-
};
|
9658 |
-
|
9659 |
-
SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) {
|
9660 |
-
var parentNode = mask.layerElement.parentNode;
|
9661 |
-
if (!parentNode) {
|
9662 |
-
return;
|
9663 |
-
}
|
9664 |
-
var children = parentNode.children;
|
9665 |
-
var i = 0,
|
9666 |
-
len = children.length;
|
9667 |
-
while (i < len) {
|
9668 |
-
if (children[i] === mask.layerElement) {
|
9669 |
-
break;
|
9670 |
-
}
|
9671 |
-
i += 1;
|
9672 |
-
}
|
9673 |
-
var nextChild;
|
9674 |
-
if (i <= len - 2) {
|
9675 |
-
nextChild = children[i + 1];
|
9676 |
-
}
|
9677 |
-
var useElem = createNS('use');
|
9678 |
-
useElem.setAttribute('href', '#' + symbolId);
|
9679 |
-
if (nextChild) {
|
9680 |
-
parentNode.insertBefore(useElem, nextChild);
|
9681 |
-
} else {
|
9682 |
-
parentNode.appendChild(useElem);
|
9683 |
-
}
|
9684 |
-
};
|
9685 |
-
|
9686 |
-
SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) {
|
9687 |
-
if (!this.findSymbol(mask)) {
|
9688 |
-
var symbolId = createElementID();
|
9689 |
-
var masker = createNS('mask');
|
9690 |
-
masker.setAttribute('id', mask.layerId);
|
9691 |
-
masker.setAttribute('mask-type', 'alpha');
|
9692 |
-
_svgMatteSymbols.push(mask);
|
9693 |
-
var defs = elem.globalData.defs;
|
9694 |
-
defs.appendChild(masker);
|
9695 |
-
var symbol = createNS('symbol');
|
9696 |
-
symbol.setAttribute('id', symbolId);
|
9697 |
-
this.replaceInParent(mask, symbolId);
|
9698 |
-
symbol.appendChild(mask.layerElement);
|
9699 |
-
defs.appendChild(symbol);
|
9700 |
-
var useElem = createNS('use');
|
9701 |
-
useElem.setAttribute('href', '#' + symbolId);
|
9702 |
-
masker.appendChild(useElem);
|
9703 |
-
mask.data.hd = false;
|
9704 |
-
mask.show();
|
9705 |
-
}
|
9706 |
-
elem.setMatte(mask.layerId);
|
9707 |
-
};
|
9708 |
-
|
9709 |
-
SVGMatte3Effect.prototype.initialize = function () {
|
9710 |
-
var ind = this.filterManager.effectElements[0].p.v;
|
9711 |
-
var elements = this.elem.comp.elements;
|
9712 |
-
var i = 0,
|
9713 |
-
len = elements.length;
|
9714 |
-
while (i < len) {
|
9715 |
-
if (elements[i] && elements[i].data.ind === ind) {
|
9716 |
-
this.setElementAsMask(this.elem, elements[i]);
|
9717 |
-
}
|
9718 |
-
i += 1;
|
9719 |
-
}
|
9720 |
-
this.initialized = true;
|
9721 |
-
};
|
9722 |
-
|
9723 |
-
SVGMatte3Effect.prototype.renderFrame = function () {
|
9724 |
-
if (!this.initialized) {
|
9725 |
-
this.initialize();
|
9726 |
-
}
|
9727 |
-
};
|
9728 |
-
|
9729 |
-
function SVGEffects(elem) {
|
9730 |
-
var i, len = elem.data.ef ? elem.data.ef.length : 0;
|
9731 |
-
var filId = createElementID();
|
9732 |
-
var fil = filtersFactory.createFilter(filId);
|
9733 |
-
var count = 0;
|
9734 |
-
this.filters = [];
|
9735 |
-
var filterManager;
|
9736 |
-
for (i = 0; i < len; i += 1) {
|
9737 |
-
filterManager = null;
|
9738 |
-
if (elem.data.ef[i].ty === 20) {
|
9739 |
-
count += 1;
|
9740 |
-
filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
|
9741 |
-
} else if (elem.data.ef[i].ty === 21) {
|
9742 |
-
count += 1;
|
9743 |
-
filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
|
9744 |
-
} else if (elem.data.ef[i].ty === 22) {
|
9745 |
-
filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
|
9746 |
-
} else if (elem.data.ef[i].ty === 23) {
|
9747 |
-
count += 1;
|
9748 |
-
filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
|
9749 |
-
} else if (elem.data.ef[i].ty === 24) {
|
9750 |
-
count += 1;
|
9751 |
-
filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
|
9752 |
-
} else if (elem.data.ef[i].ty === 25) {
|
9753 |
-
count += 1;
|
9754 |
-
filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
|
9755 |
-
} else if (elem.data.ef[i].ty === 28) {
|
9756 |
-
//count += 1;
|
9757 |
-
filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
|
9758 |
-
} else if (elem.data.ef[i].ty === 29) {
|
9759 |
-
count += 1;
|
9760 |
-
filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
|
9761 |
-
}
|
9762 |
-
if (filterManager) {
|
9763 |
-
this.filters.push(filterManager);
|
9764 |
-
}
|
9765 |
-
}
|
9766 |
-
if (count) {
|
9767 |
-
elem.globalData.defs.appendChild(fil);
|
9768 |
-
elem.layerElement.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
|
9769 |
-
}
|
9770 |
-
if (this.filters.length) {
|
9771 |
-
elem.addRenderableComponent(this);
|
9772 |
-
}
|
9773 |
-
}
|
9774 |
-
|
9775 |
-
SVGEffects.prototype.renderFrame = function (_isFirstFrame) {
|
9776 |
-
var i, len = this.filters.length;
|
9777 |
-
for (i = 0; i < len; i += 1) {
|
9778 |
-
this.filters[i].renderFrame(_isFirstFrame);
|
9779 |
-
}
|
9780 |
-
};
|
9781 |
-
|
9782 |
-
function CVContextData() {
|
9783 |
-
this.saved = [];
|
9784 |
-
this.cArrPos = 0;
|
9785 |
-
this.cTr = new Matrix();
|
9786 |
-
this.cO = 1;
|
9787 |
-
var i, len = 15;
|
9788 |
-
this.savedOp = createTypedArray('float32', len);
|
9789 |
-
for (i = 0; i < len; i += 1) {
|
9790 |
-
this.saved[i] = createTypedArray('float32', 16);
|
9791 |
-
}
|
9792 |
-
this._length = len;
|
9793 |
-
}
|
9794 |
-
|
9795 |
-
CVContextData.prototype.duplicate = function () {
|
9796 |
-
var newLength = this._length * 2;
|
9797 |
-
var currentSavedOp = this.savedOp;
|
9798 |
-
this.savedOp = createTypedArray('float32', newLength);
|
9799 |
-
this.savedOp.set(currentSavedOp);
|
9800 |
-
var i = 0;
|
9801 |
-
for (i = this._length; i < newLength; i += 1) {
|
9802 |
-
this.saved[i] = createTypedArray('float32', 16);
|
9803 |
-
}
|
9804 |
-
this._length = newLength;
|
9805 |
-
};
|
9806 |
-
|
9807 |
-
CVContextData.prototype.reset = function () {
|
9808 |
-
this.cArrPos = 0;
|
9809 |
-
this.cTr.reset();
|
9810 |
-
this.cO = 1;
|
9811 |
-
};
|
9812 |
-
|
9813 |
-
function CVBaseElement() { }
|
9814 |
-
|
9815 |
-
CVBaseElement.prototype = {
|
9816 |
-
createElements: function () { },
|
9817 |
-
initRendererElement: function () { },
|
9818 |
-
createContainerElements: function () {
|
9819 |
-
this.canvasContext = this.globalData.canvasContext;
|
9820 |
-
this.renderableEffectsManager = new CVEffects(this);
|
9821 |
-
},
|
9822 |
-
createContent: function () { },
|
9823 |
-
setBlendMode: function () {
|
9824 |
-
var globalData = this.globalData;
|
9825 |
-
if (globalData.blendMode !== this.data.bm) {
|
9826 |
-
globalData.blendMode = this.data.bm;
|
9827 |
-
var blendModeValue = getBlendMode(this.data.bm);
|
9828 |
-
globalData.canvasContext.globalCompositeOperation = blendModeValue;
|
9829 |
-
}
|
9830 |
-
},
|
9831 |
-
createRenderableComponents: function () {
|
9832 |
-
this.maskManager = new CVMaskElement(this.data, this);
|
9833 |
-
},
|
9834 |
-
hideElement: function () {
|
9835 |
-
if (!this.hidden && (!this.isInRange || this.isTransparent)) {
|
9836 |
-
this.hidden = true;
|
9837 |
-
}
|
9838 |
-
},
|
9839 |
-
showElement: function () {
|
9840 |
-
if (this.isInRange && !this.isTransparent) {
|
9841 |
-
this.hidden = false;
|
9842 |
-
this._isFirstFrame = true;
|
9843 |
-
this.maskManager._isFirstFrame = true;
|
9844 |
-
}
|
9845 |
-
},
|
9846 |
-
renderFrame: function () {
|
9847 |
-
if (this.hidden || this.data.hd) {
|
9848 |
-
return;
|
9849 |
-
}
|
9850 |
-
this.renderTransform();
|
9851 |
-
this.renderRenderable();
|
9852 |
-
this.setBlendMode();
|
9853 |
-
var forceRealStack = this.data.ty === 0;
|
9854 |
-
this.globalData.renderer.save(forceRealStack);
|
9855 |
-
this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
|
9856 |
-
this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
|
9857 |
-
this.renderInnerContent();
|
9858 |
-
this.globalData.renderer.restore(forceRealStack);
|
9859 |
-
if (this.maskManager.hasMasks) {
|
9860 |
-
this.globalData.renderer.restore(true);
|
9861 |
-
}
|
9862 |
-
if (this._isFirstFrame) {
|
9863 |
-
this._isFirstFrame = false;
|
9864 |
-
}
|
9865 |
-
},
|
9866 |
-
destroy: function () {
|
9867 |
-
this.canvasContext = null;
|
9868 |
-
this.data = null;
|
9869 |
-
this.globalData = null;
|
9870 |
-
this.maskManager.destroy();
|
9871 |
-
},
|
9872 |
-
mHelper: new Matrix()
|
9873 |
-
};
|
9874 |
-
CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;
|
9875 |
-
CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;
|
9876 |
-
|
9877 |
-
function CVImageElement(data, globalData, comp) {
|
9878 |
-
this.assetData = globalData.getAssetData(data.refId);
|
9879 |
-
this.img = globalData.imageLoader.getImage(this.assetData);
|
9880 |
-
this.initElement(data, globalData, comp);
|
9881 |
-
}
|
9882 |
-
extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement);
|
9883 |
-
|
9884 |
-
CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement;
|
9885 |
-
CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
|
9886 |
-
|
9887 |
-
CVImageElement.prototype.createContent = function () {
|
9888 |
-
|
9889 |
-
if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
|
9890 |
-
var canvas = createTag('canvas');
|
9891 |
-
canvas.width = this.assetData.w;
|
9892 |
-
canvas.height = this.assetData.h;
|
9893 |
-
var ctx = canvas.getContext('2d');
|
9894 |
-
|
9895 |
-
var imgW = this.img.width;
|
9896 |
-
var imgH = this.img.height;
|
9897 |
-
var imgRel = imgW / imgH;
|
9898 |
-
var canvasRel = this.assetData.w / this.assetData.h;
|
9899 |
-
var widthCrop, heightCrop;
|
9900 |
-
var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
|
9901 |
-
if ((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) {
|
9902 |
-
heightCrop = imgH;
|
9903 |
-
widthCrop = heightCrop * canvasRel;
|
9904 |
-
} else {
|
9905 |
-
widthCrop = imgW;
|
9906 |
-
heightCrop = widthCrop / canvasRel;
|
9907 |
-
}
|
9908 |
-
ctx.drawImage(this.img, (imgW - widthCrop) / 2, (imgH - heightCrop) / 2, widthCrop, heightCrop, 0, 0, this.assetData.w, this.assetData.h);
|
9909 |
-
this.img = canvas;
|
9910 |
-
}
|
9911 |
-
|
9912 |
-
};
|
9913 |
-
|
9914 |
-
CVImageElement.prototype.renderInnerContent = function (parentMatrix) {
|
9915 |
-
this.canvasContext.drawImage(this.img, 0, 0);
|
9916 |
-
};
|
9917 |
-
|
9918 |
-
CVImageElement.prototype.destroy = function () {
|
9919 |
-
this.img = null;
|
9920 |
-
};
|
9921 |
-
|
9922 |
-
function CVCompElement(data, globalData, comp) {
|
9923 |
-
this.completeLayers = false;
|
9924 |
-
this.layers = data.layers;
|
9925 |
-
this.pendingElements = [];
|
9926 |
-
this.elements = createSizedArray(this.layers.length);
|
9927 |
-
this.initElement(data, globalData, comp);
|
9928 |
-
this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {
|
9929 |
-
_placeholder: true
|
9930 |
-
};
|
9931 |
-
}
|
9932 |
-
|
9933 |
-
extendPrototype([CanvasRenderer, ICompElement, CVBaseElement], CVCompElement);
|
9934 |
-
|
9935 |
-
CVCompElement.prototype.renderInnerContent = function () {
|
9936 |
-
var ctx = this.canvasContext;
|
9937 |
-
ctx.beginPath();
|
9938 |
-
ctx.moveTo(0, 0);
|
9939 |
-
ctx.lineTo(this.data.w, 0);
|
9940 |
-
ctx.lineTo(this.data.w, this.data.h);
|
9941 |
-
ctx.lineTo(0, this.data.h);
|
9942 |
-
ctx.lineTo(0, 0);
|
9943 |
-
ctx.clip();
|
9944 |
-
var i, len = this.layers.length;
|
9945 |
-
for (i = len - 1; i >= 0; i -= 1) {
|
9946 |
-
if (this.completeLayers || this.elements[i]) {
|
9947 |
-
this.elements[i].renderFrame();
|
9948 |
-
}
|
9949 |
-
}
|
9950 |
-
};
|
9951 |
-
|
9952 |
-
CVCompElement.prototype.destroy = function () {
|
9953 |
-
var i, len = this.layers.length;
|
9954 |
-
for (i = len - 1; i >= 0; i -= 1) {
|
9955 |
-
if (this.elements[i]) {
|
9956 |
-
this.elements[i].destroy();
|
9957 |
-
}
|
9958 |
-
}
|
9959 |
-
this.layers = null;
|
9960 |
-
this.elements = null;
|
9961 |
-
};
|
9962 |
-
|
9963 |
-
function CVMaskElement(data, element) {
|
9964 |
-
this.data = data;
|
9965 |
-
this.element = element;
|
9966 |
-
this.masksProperties = this.data.masksProperties || [];
|
9967 |
-
this.viewData = createSizedArray(this.masksProperties.length);
|
9968 |
-
var i, len = this.masksProperties.length,
|
9969 |
-
hasMasks = false;
|
9970 |
-
for (i = 0; i < len; i++) {
|
9971 |
-
if (this.masksProperties[i].mode !== 'n') {
|
9972 |
-
hasMasks = true;
|
9973 |
-
}
|
9974 |
-
this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[i], 3);
|
9975 |
-
}
|
9976 |
-
this.hasMasks = hasMasks;
|
9977 |
-
if (hasMasks) {
|
9978 |
-
this.element.addRenderableComponent(this);
|
9979 |
-
}
|
9980 |
-
}
|
9981 |
-
|
9982 |
-
CVMaskElement.prototype.renderFrame = function () {
|
9983 |
-
if (!this.hasMasks) {
|
9984 |
-
return;
|
9985 |
-
}
|
9986 |
-
var transform = this.element.finalTransform.mat;
|
9987 |
-
var ctx = this.element.canvasContext;
|
9988 |
-
var i, len = this.masksProperties.length;
|
9989 |
-
var pt, pts, data;
|
9990 |
-
ctx.beginPath();
|
9991 |
-
for (i = 0; i < len; i++) {
|
9992 |
-
if (this.masksProperties[i].mode !== 'n') {
|
9993 |
-
if (this.masksProperties[i].inv) {
|
9994 |
-
ctx.moveTo(0, 0);
|
9995 |
-
ctx.lineTo(this.element.globalData.compSize.w, 0);
|
9996 |
-
ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
|
9997 |
-
ctx.lineTo(0, this.element.globalData.compSize.h);
|
9998 |
-
ctx.lineTo(0, 0);
|
9999 |
-
}
|
10000 |
-
data = this.viewData[i].v;
|
10001 |
-
pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0);
|
10002 |
-
ctx.moveTo(pt[0], pt[1]);
|
10003 |
-
var j, jLen = data._length;
|
10004 |
-
for (j = 1; j < jLen; j++) {
|
10005 |
-
pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
|
10006 |
-
ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
|
10007 |
-
}
|
10008 |
-
pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
|
10009 |
-
ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
|
10010 |
-
}
|
10011 |
-
}
|
10012 |
-
this.element.globalData.renderer.save(true);
|
10013 |
-
ctx.clip();
|
10014 |
-
};
|
10015 |
-
|
10016 |
-
CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;
|
10017 |
-
|
10018 |
-
CVMaskElement.prototype.destroy = function () {
|
10019 |
-
this.element = null;
|
10020 |
-
};
|
10021 |
-
|
10022 |
-
function CVShapeElement(data, globalData, comp) {
|
10023 |
-
this.shapes = [];
|
10024 |
-
this.shapesData = data.shapes;
|
10025 |
-
this.stylesList = [];
|
10026 |
-
this.itemsData = [];
|
10027 |
-
this.prevViewData = [];
|
10028 |
-
this.shapeModifiers = [];
|
10029 |
-
this.processedElements = [];
|
10030 |
-
this.transformsManager = new ShapeTransformManager();
|
10031 |
-
this.initElement(data, globalData, comp);
|
10032 |
-
}
|
10033 |
-
|
10034 |
-
extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement);
|
10035 |
-
|
10036 |
-
CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;
|
10037 |
-
|
10038 |
-
CVShapeElement.prototype.transformHelper = {
|
10039 |
-
opacity: 1,
|
10040 |
-
_opMdf: false
|
10041 |
-
};
|
10042 |
-
|
10043 |
-
CVShapeElement.prototype.dashResetter = [];
|
10044 |
-
|
10045 |
-
CVShapeElement.prototype.createContent = function () {
|
10046 |
-
this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
|
10047 |
-
};
|
10048 |
-
|
10049 |
-
CVShapeElement.prototype.createStyleElement = function (data, transforms) {
|
10050 |
-
var styleElem = {
|
10051 |
-
data: data,
|
10052 |
-
type: data.ty,
|
10053 |
-
preTransforms: this.transformsManager.addTransformSequence(transforms),
|
10054 |
-
transforms: [],
|
10055 |
-
elements: [],
|
10056 |
-
closed: data.hd === true
|
10057 |
-
};
|
10058 |
-
var elementData = {};
|
10059 |
-
if (data.ty == 'fl' || data.ty == 'st') {
|
10060 |
-
elementData.c = PropertyFactory.getProp(this, data.c, 1, 255, this);
|
10061 |
-
if (!elementData.c.k) {
|
10062 |
-
styleElem.co = 'rgb(' + bm_floor(elementData.c.v[0]) + ',' + bm_floor(elementData.c.v[1]) + ',' + bm_floor(elementData.c.v[2]) + ')';
|
10063 |
-
}
|
10064 |
-
} else if (data.ty === 'gf' || data.ty === 'gs') {
|
10065 |
-
elementData.s = PropertyFactory.getProp(this, data.s, 1, null, this);
|
10066 |
-
elementData.e = PropertyFactory.getProp(this, data.e, 1, null, this);
|
10067 |
-
elementData.h = PropertyFactory.getProp(this, data.h || {
|
10068 |
-
k: 0
|
10069 |
-
}, 0, 0.01, this);
|
10070 |
-
elementData.a = PropertyFactory.getProp(this, data.a || {
|
10071 |
-
k: 0
|
10072 |
-
}, 0, degToRads, this);
|
10073 |
-
elementData.g = new GradientProperty(this, data.g, this);
|
10074 |
-
}
|
10075 |
-
elementData.o = PropertyFactory.getProp(this, data.o, 0, 0.01, this);
|
10076 |
-
if (data.ty == 'st' || data.ty == 'gs') {
|
10077 |
-
styleElem.lc = this.lcEnum[data.lc] || 'round';
|
10078 |
-
styleElem.lj = this.ljEnum[data.lj] || 'round';
|
10079 |
-
if (data.lj == 1) {
|
10080 |
-
styleElem.ml = data.ml;
|
10081 |
-
}
|
10082 |
-
elementData.w = PropertyFactory.getProp(this, data.w, 0, null, this);
|
10083 |
-
if (!elementData.w.k) {
|
10084 |
-
styleElem.wi = elementData.w.v;
|
10085 |
-
}
|
10086 |
-
if (data.d) {
|
10087 |
-
var d = new DashProperty(this, data.d, 'canvas', this);
|
10088 |
-
elementData.d = d;
|
10089 |
-
if (!elementData.d.k) {
|
10090 |
-
styleElem.da = elementData.d.dashArray;
|
10091 |
-
styleElem.do = elementData.d.dashoffset[0];
|
10092 |
-
}
|
10093 |
-
}
|
10094 |
-
} else {
|
10095 |
-
styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
|
10096 |
-
}
|
10097 |
-
this.stylesList.push(styleElem);
|
10098 |
-
elementData.style = styleElem;
|
10099 |
-
return elementData;
|
10100 |
-
};
|
10101 |
-
|
10102 |
-
CVShapeElement.prototype.createGroupElement = function (data) {
|
10103 |
-
var elementData = {
|
10104 |
-
it: [],
|
10105 |
-
prevViewData: []
|
10106 |
-
};
|
10107 |
-
return elementData;
|
10108 |
-
};
|
10109 |
-
|
10110 |
-
CVShapeElement.prototype.createTransformElement = function (data) {
|
10111 |
-
var elementData = {
|
10112 |
-
transform: {
|
10113 |
-
opacity: 1,
|
10114 |
-
_opMdf: false,
|
10115 |
-
key: this.transformsManager.getNewKey(),
|
10116 |
-
op: PropertyFactory.getProp(this, data.o, 0, 0.01, this),
|
10117 |
-
mProps: TransformPropertyFactory.getTransformProperty(this, data, this)
|
10118 |
-
}
|
10119 |
-
};
|
10120 |
-
return elementData;
|
10121 |
-
};
|
10122 |
-
|
10123 |
-
CVShapeElement.prototype.createShapeElement = function (data) {
|
10124 |
-
var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
|
10125 |
-
|
10126 |
-
this.shapes.push(elementData);
|
10127 |
-
this.addShapeToModifiers(elementData);
|
10128 |
-
return elementData;
|
10129 |
-
};
|
10130 |
-
|
10131 |
-
CVShapeElement.prototype.reloadShapes = function () {
|
10132 |
-
this._isFirstFrame = true;
|
10133 |
-
var i, len = this.itemsData.length;
|
10134 |
-
for (i = 0; i < len; i += 1) {
|
10135 |
-
this.prevViewData[i] = this.itemsData[i];
|
10136 |
-
}
|
10137 |
-
this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
|
10138 |
-
len = this.dynamicProperties.length;
|
10139 |
-
for (i = 0; i < len; i += 1) {
|
10140 |
-
this.dynamicProperties[i].getValue();
|
10141 |
-
}
|
10142 |
-
this.renderModifiers();
|
10143 |
-
this.transformsManager.processSequences(this._isFirstFrame);
|
10144 |
-
};
|
10145 |
-
|
10146 |
-
CVShapeElement.prototype.addTransformToStyleList = function (transform) {
|
10147 |
-
var i, len = this.stylesList.length;
|
10148 |
-
for (i = 0; i < len; i += 1) {
|
10149 |
-
if (!this.stylesList[i].closed) {
|
10150 |
-
this.stylesList[i].transforms.push(transform);
|
10151 |
-
}
|
10152 |
-
}
|
10153 |
-
}
|
10154 |
-
|
10155 |
-
CVShapeElement.prototype.removeTransformFromStyleList = function () {
|
10156 |
-
var i, len = this.stylesList.length;
|
10157 |
-
for (i = 0; i < len; i += 1) {
|
10158 |
-
if (!this.stylesList[i].closed) {
|
10159 |
-
this.stylesList[i].transforms.pop();
|
10160 |
-
}
|
10161 |
-
}
|
10162 |
-
}
|
10163 |
-
|
10164 |
-
CVShapeElement.prototype.closeStyles = function (styles) {
|
10165 |
-
var i, len = styles.length,
|
10166 |
-
j, jLen;
|
10167 |
-
for (i = 0; i < len; i += 1) {
|
10168 |
-
styles[i].closed = true;
|
10169 |
-
}
|
10170 |
-
}
|
10171 |
-
|
10172 |
-
CVShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, shouldRender, transforms) {
|
10173 |
-
var i, len = arr.length - 1;
|
10174 |
-
var j, jLen;
|
10175 |
-
var ownStyles = [],
|
10176 |
-
ownModifiers = [],
|
10177 |
-
processedPos, modifier, currentTransform;
|
10178 |
-
var ownTransforms = [].concat(transforms);
|
10179 |
-
for (i = len; i >= 0; i -= 1) {
|
10180 |
-
processedPos = this.searchProcessedElement(arr[i]);
|
10181 |
-
if (!processedPos) {
|
10182 |
-
arr[i]._shouldRender = shouldRender;
|
10183 |
-
} else {
|
10184 |
-
itemsData[i] = prevViewData[processedPos - 1];
|
10185 |
-
}
|
10186 |
-
if (arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs') {
|
10187 |
-
if (!processedPos) {
|
10188 |
-
itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
|
10189 |
-
} else {
|
10190 |
-
itemsData[i].style.closed = false;
|
10191 |
-
}
|
10192 |
-
|
10193 |
-
ownStyles.push(itemsData[i].style);
|
10194 |
-
} else if (arr[i].ty == 'gr') {
|
10195 |
-
if (!processedPos) {
|
10196 |
-
itemsData[i] = this.createGroupElement(arr[i]);
|
10197 |
-
} else {
|
10198 |
-
jLen = itemsData[i].it.length;
|
10199 |
-
for (j = 0; j < jLen; j += 1) {
|
10200 |
-
itemsData[i].prevViewData[j] = itemsData[i].it[j];
|
10201 |
-
}
|
10202 |
-
}
|
10203 |
-
this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, shouldRender, ownTransforms);
|
10204 |
-
} else if (arr[i].ty == 'tr') {
|
10205 |
-
if (!processedPos) {
|
10206 |
-
currentTransform = this.createTransformElement(arr[i]);
|
10207 |
-
itemsData[i] = currentTransform;
|
10208 |
-
}
|
10209 |
-
ownTransforms.push(itemsData[i]);
|
10210 |
-
this.addTransformToStyleList(itemsData[i]);
|
10211 |
-
} else if (arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr') {
|
10212 |
-
if (!processedPos) {
|
10213 |
-
itemsData[i] = this.createShapeElement(arr[i]);
|
10214 |
-
}
|
10215 |
-
|
10216 |
-
} else if (arr[i].ty == 'tm' || arr[i].ty == 'rd') {
|
10217 |
-
if (!processedPos) {
|
10218 |
-
modifier = ShapeModifiers.getModifier(arr[i].ty);
|
10219 |
-
modifier.init(this, arr[i]);
|
10220 |
-
itemsData[i] = modifier;
|
10221 |
-
this.shapeModifiers.push(modifier);
|
10222 |
-
} else {
|
10223 |
-
modifier = itemsData[i];
|
10224 |
-
modifier.closed = false;
|
10225 |
-
}
|
10226 |
-
ownModifiers.push(modifier);
|
10227 |
-
} else if (arr[i].ty == 'rp') {
|
10228 |
-
if (!processedPos) {
|
10229 |
-
modifier = ShapeModifiers.getModifier(arr[i].ty);
|
10230 |
-
itemsData[i] = modifier;
|
10231 |
-
modifier.init(this, arr, i, itemsData);
|
10232 |
-
this.shapeModifiers.push(modifier);
|
10233 |
-
shouldRender = false;
|
10234 |
-
} else {
|
10235 |
-
modifier = itemsData[i];
|
10236 |
-
modifier.closed = true;
|
10237 |
-
}
|
10238 |
-
ownModifiers.push(modifier);
|
10239 |
-
}
|
10240 |
-
this.addProcessedElement(arr[i], i + 1);
|
10241 |
-
}
|
10242 |
-
this.removeTransformFromStyleList();
|
10243 |
-
this.closeStyles(ownStyles);
|
10244 |
-
len = ownModifiers.length;
|
10245 |
-
for (i = 0; i < len; i += 1) {
|
10246 |
-
ownModifiers[i].closed = true;
|
10247 |
-
}
|
10248 |
-
};
|
10249 |
-
|
10250 |
-
CVShapeElement.prototype.renderInnerContent = function () {
|
10251 |
-
this.transformHelper.opacity = 1;
|
10252 |
-
this.transformHelper._opMdf = false;
|
10253 |
-
this.renderModifiers();
|
10254 |
-
this.transformsManager.processSequences(this._isFirstFrame);
|
10255 |
-
this.renderShape(this.transformHelper, this.shapesData, this.itemsData, true);
|
10256 |
-
};
|
10257 |
-
|
10258 |
-
CVShapeElement.prototype.renderShapeTransform = function (parentTransform, groupTransform) {
|
10259 |
-
var props, groupMatrix;
|
10260 |
-
if (parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
|
10261 |
-
groupTransform.opacity = parentTransform.opacity;
|
10262 |
-
groupTransform.opacity *= groupTransform.op.v;
|
10263 |
-
groupTransform._opMdf = true;
|
10264 |
-
}
|
10265 |
-
};
|
10266 |
-
|
10267 |
-
CVShapeElement.prototype.drawLayer = function () {
|
10268 |
-
var i, len = this.stylesList.length;
|
10269 |
-
var j, jLen, k, kLen, elems, nodes, renderer = this.globalData.renderer,
|
10270 |
-
ctx = this.globalData.canvasContext,
|
10271 |
-
type, currentStyle;
|
10272 |
-
for (i = 0; i < len; i += 1) {
|
10273 |
-
currentStyle = this.stylesList[i];
|
10274 |
-
type = currentStyle.type;
|
10275 |
-
|
10276 |
-
//Skipping style when
|
10277 |
-
//Stroke width equals 0
|
10278 |
-
//style should not be rendered (extra unused repeaters)
|
10279 |
-
//current opacity equals 0
|
10280 |
-
//global opacity equals 0
|
10281 |
-
if (((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0) {
|
10282 |
-
continue;
|
10283 |
-
}
|
10284 |
-
renderer.save();
|
10285 |
-
elems = currentStyle.elements;
|
10286 |
-
if (type === 'st' || type === 'gs') {
|
10287 |
-
ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
|
10288 |
-
ctx.lineWidth = currentStyle.wi;
|
10289 |
-
ctx.lineCap = currentStyle.lc;
|
10290 |
-
ctx.lineJoin = currentStyle.lj;
|
10291 |
-
ctx.miterLimit = currentStyle.ml || 0;
|
10292 |
-
} else {
|
10293 |
-
ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
|
10294 |
-
}
|
10295 |
-
renderer.ctxOpacity(currentStyle.coOp);
|
10296 |
-
if (type !== 'st' && type !== 'gs') {
|
10297 |
-
ctx.beginPath();
|
10298 |
-
}
|
10299 |
-
renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
|
10300 |
-
jLen = elems.length;
|
10301 |
-
for (j = 0; j < jLen; j += 1) {
|
10302 |
-
if (type === 'st' || type === 'gs') {
|
10303 |
-
ctx.beginPath();
|
10304 |
-
if (currentStyle.da) {
|
10305 |
-
ctx.setLineDash(currentStyle.da);
|
10306 |
-
ctx.lineDashOffset = currentStyle.do;
|
10307 |
-
}
|
10308 |
-
}
|
10309 |
-
nodes = elems[j].trNodes;
|
10310 |
-
kLen = nodes.length;
|
10311 |
-
|
10312 |
-
for (k = 0; k < kLen; k += 1) {
|
10313 |
-
if (nodes[k].t == 'm') {
|
10314 |
-
ctx.moveTo(nodes[k].p[0], nodes[k].p[1]);
|
10315 |
-
} else if (nodes[k].t == 'c') {
|
10316 |
-
ctx.bezierCurveTo(nodes[k].pts[0], nodes[k].pts[1], nodes[k].pts[2], nodes[k].pts[3], nodes[k].pts[4], nodes[k].pts[5]);
|
10317 |
-
} else {
|
10318 |
-
ctx.closePath();
|
10319 |
-
}
|
10320 |
-
}
|
10321 |
-
if (type === 'st' || type === 'gs') {
|
10322 |
-
ctx.stroke();
|
10323 |
-
if (currentStyle.da) {
|
10324 |
-
ctx.setLineDash(this.dashResetter);
|
10325 |
-
}
|
10326 |
-
}
|
10327 |
-
}
|
10328 |
-
if (type !== 'st' && type !== 'gs') {
|
10329 |
-
ctx.fill(currentStyle.r);
|
10330 |
-
}
|
10331 |
-
renderer.restore();
|
10332 |
-
}
|
10333 |
-
};
|
10334 |
-
|
10335 |
-
CVShapeElement.prototype.renderShape = function (parentTransform, items, data, isMain) {
|
10336 |
-
var i, len = items.length - 1;
|
10337 |
-
var groupTransform;
|
10338 |
-
groupTransform = parentTransform;
|
10339 |
-
for (i = len; i >= 0; i -= 1) {
|
10340 |
-
if (items[i].ty == 'tr') {
|
10341 |
-
groupTransform = data[i].transform;
|
10342 |
-
this.renderShapeTransform(parentTransform, groupTransform);
|
10343 |
-
} else if (items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc' || items[i].ty == 'sr') {
|
10344 |
-
this.renderPath(items[i], data[i]);
|
10345 |
-
} else if (items[i].ty == 'fl') {
|
10346 |
-
this.renderFill(items[i], data[i], groupTransform);
|
10347 |
-
} else if (items[i].ty == 'st') {
|
10348 |
-
this.renderStroke(items[i], data[i], groupTransform);
|
10349 |
-
} else if (items[i].ty == 'gf' || items[i].ty == 'gs') {
|
10350 |
-
this.renderGradientFill(items[i], data[i], groupTransform);
|
10351 |
-
} else if (items[i].ty == 'gr') {
|
10352 |
-
this.renderShape(groupTransform, items[i].it, data[i].it);
|
10353 |
-
} else if (items[i].ty == 'tm') {
|
10354 |
-
//
|
10355 |
-
}
|
10356 |
-
}
|
10357 |
-
if (isMain) {
|
10358 |
-
this.drawLayer();
|
10359 |
-
}
|
10360 |
-
|
10361 |
-
};
|
10362 |
-
|
10363 |
-
CVShapeElement.prototype.renderStyledShape = function (styledShape, shape) {
|
10364 |
-
if (this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
|
10365 |
-
var shapeNodes = styledShape.trNodes;
|
10366 |
-
var paths = shape.paths;
|
10367 |
-
var i, len, j, jLen = paths._length;
|
10368 |
-
shapeNodes.length = 0;
|
10369 |
-
var groupTransformMat = styledShape.transforms.finalTransform;
|
10370 |
-
for (j = 0; j < jLen; j += 1) {
|
10371 |
-
var pathNodes = paths.shapes[j];
|
10372 |
-
if (pathNodes && pathNodes.v) {
|
10373 |
-
len = pathNodes._length;
|
10374 |
-
for (i = 1; i < len; i += 1) {
|
10375 |
-
if (i === 1) {
|
10376 |
-
shapeNodes.push({
|
10377 |
-
t: 'm',
|
10378 |
-
p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
|
10379 |
-
});
|
10380 |
-
}
|
10381 |
-
shapeNodes.push({
|
10382 |
-
t: 'c',
|
10383 |
-
pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])
|
10384 |
-
});
|
10385 |
-
}
|
10386 |
-
if (len === 1) {
|
10387 |
-
shapeNodes.push({
|
10388 |
-
t: 'm',
|
10389 |
-
p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
|
10390 |
-
});
|
10391 |
-
}
|
10392 |
-
if (pathNodes.c && len) {
|
10393 |
-
shapeNodes.push({
|
10394 |
-
t: 'c',
|
10395 |
-
pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])
|
10396 |
-
});
|
10397 |
-
shapeNodes.push({
|
10398 |
-
t: 'z'
|
10399 |
-
});
|
10400 |
-
}
|
10401 |
-
}
|
10402 |
-
}
|
10403 |
-
styledShape.trNodes = shapeNodes;
|
10404 |
-
}
|
10405 |
-
}
|
10406 |
-
|
10407 |
-
CVShapeElement.prototype.renderPath = function (pathData, itemData) {
|
10408 |
-
if (pathData.hd !== true && pathData._shouldRender) {
|
10409 |
-
var i, len = itemData.styledShapes.length;
|
10410 |
-
for (i = 0; i < len; i += 1) {
|
10411 |
-
this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
|
10412 |
-
}
|
10413 |
-
}
|
10414 |
-
};
|
10415 |
-
|
10416 |
-
CVShapeElement.prototype.renderFill = function (styleData, itemData, groupTransform) {
|
10417 |
-
var styleElem = itemData.style;
|
10418 |
-
|
10419 |
-
if (itemData.c._mdf || this._isFirstFrame) {
|
10420 |
-
styleElem.co = 'rgb(' +
|
10421 |
-
bm_floor(itemData.c.v[0]) + ',' +
|
10422 |
-
bm_floor(itemData.c.v[1]) + ',' +
|
10423 |
-
bm_floor(itemData.c.v[2]) + ')';
|
10424 |
-
}
|
10425 |
-
if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
|
10426 |
-
styleElem.coOp = itemData.o.v * groupTransform.opacity;
|
10427 |
-
}
|
10428 |
-
};
|
10429 |
-
|
10430 |
-
CVShapeElement.prototype.renderGradientFill = function (styleData, itemData, groupTransform) {
|
10431 |
-
var styleElem = itemData.style;
|
10432 |
-
if (!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
|
10433 |
-
var ctx = this.globalData.canvasContext;
|
10434 |
-
var grd;
|
10435 |
-
var pt1 = itemData.s.v,
|
10436 |
-
pt2 = itemData.e.v;
|
10437 |
-
if (styleData.t === 1) {
|
10438 |
-
grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
|
10439 |
-
} else {
|
10440 |
-
var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
|
10441 |
-
var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
|
10442 |
-
|
10443 |
-
var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99 : itemData.h.v;
|
10444 |
-
var dist = rad * percent;
|
10445 |
-
var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
|
10446 |
-
var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
|
10447 |
-
var grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
|
10448 |
-
}
|
10449 |
-
|
10450 |
-
var i, len = styleData.g.p;
|
10451 |
-
var cValues = itemData.g.c;
|
10452 |
-
var opacity = 1;
|
10453 |
-
|
10454 |
-
for (i = 0; i < len; i += 1) {
|
10455 |
-
if (itemData.g._hasOpacity && itemData.g._collapsable) {
|
10456 |
-
opacity = itemData.g.o[i * 2 + 1];
|
10457 |
-
}
|
10458 |
-
grd.addColorStop(cValues[i * 4] / 100, 'rgba(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ',' + opacity + ')');
|
10459 |
-
}
|
10460 |
-
styleElem.grd = grd;
|
10461 |
-
}
|
10462 |
-
styleElem.coOp = itemData.o.v * groupTransform.opacity;
|
10463 |
-
|
10464 |
-
};
|
10465 |
-
|
10466 |
-
CVShapeElement.prototype.renderStroke = function (styleData, itemData, groupTransform) {
|
10467 |
-
var styleElem = itemData.style;
|
10468 |
-
var d = itemData.d;
|
10469 |
-
if (d && (d._mdf || this._isFirstFrame)) {
|
10470 |
-
styleElem.da = d.dashArray;
|
10471 |
-
styleElem.do = d.dashoffset[0];
|
10472 |
-
}
|
10473 |
-
if (itemData.c._mdf || this._isFirstFrame) {
|
10474 |
-
styleElem.co = 'rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')';
|
10475 |
-
}
|
10476 |
-
if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
|
10477 |
-
styleElem.coOp = itemData.o.v * groupTransform.opacity;
|
10478 |
-
}
|
10479 |
-
if (itemData.w._mdf || this._isFirstFrame) {
|
10480 |
-
styleElem.wi = itemData.w.v;
|
10481 |
-
}
|
10482 |
-
};
|
10483 |
-
|
10484 |
-
|
10485 |
-
CVShapeElement.prototype.destroy = function () {
|
10486 |
-
this.shapesData = null;
|
10487 |
-
this.globalData = null;
|
10488 |
-
this.canvasContext = null;
|
10489 |
-
this.stylesList.length = 0;
|
10490 |
-
this.itemsData.length = 0;
|
10491 |
-
};
|
10492 |
-
|
10493 |
-
|
10494 |
-
function CVSolidElement(data, globalData, comp) {
|
10495 |
-
this.initElement(data, globalData, comp);
|
10496 |
-
}
|
10497 |
-
extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);
|
10498 |
-
|
10499 |
-
CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;
|
10500 |
-
CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
|
10501 |
-
|
10502 |
-
CVSolidElement.prototype.renderInnerContent = function () {
|
10503 |
-
var ctx = this.canvasContext;
|
10504 |
-
ctx.fillStyle = this.data.sc;
|
10505 |
-
ctx.fillRect(0, 0, this.data.sw, this.data.sh);
|
10506 |
-
//
|
10507 |
-
};
|
10508 |
-
|
10509 |
-
function CVTextElement(data, globalData, comp) {
|
10510 |
-
this.textSpans = [];
|
10511 |
-
this.yOffset = 0;
|
10512 |
-
this.fillColorAnim = false;
|
10513 |
-
this.strokeColorAnim = false;
|
10514 |
-
this.strokeWidthAnim = false;
|
10515 |
-
this.stroke = false;
|
10516 |
-
this.fill = false;
|
10517 |
-
this.justifyOffset = 0;
|
10518 |
-
this.currentRender = null;
|
10519 |
-
this.renderType = 'canvas';
|
10520 |
-
this.values = {
|
10521 |
-
fill: 'rgba(0,0,0,0)',
|
10522 |
-
stroke: 'rgba(0,0,0,0)',
|
10523 |
-
sWidth: 0,
|
10524 |
-
fValue: ''
|
10525 |
-
};
|
10526 |
-
this.initElement(data, globalData, comp);
|
10527 |
-
}
|
10528 |
-
extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement);
|
10529 |
-
|
10530 |
-
CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d');
|
10531 |
-
|
10532 |
-
CVTextElement.prototype.buildNewText = function () {
|
10533 |
-
var documentData = this.textProperty.currentData;
|
10534 |
-
this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
|
10535 |
-
|
10536 |
-
var hasFill = false;
|
10537 |
-
if (documentData.fc) {
|
10538 |
-
hasFill = true;
|
10539 |
-
this.values.fill = this.buildColor(documentData.fc);
|
10540 |
-
} else {
|
10541 |
-
this.values.fill = 'rgba(0,0,0,0)';
|
10542 |
-
}
|
10543 |
-
this.fill = hasFill;
|
10544 |
-
var hasStroke = false;
|
10545 |
-
if (documentData.sc) {
|
10546 |
-
hasStroke = true;
|
10547 |
-
this.values.stroke = this.buildColor(documentData.sc);
|
10548 |
-
this.values.sWidth = documentData.sw;
|
10549 |
-
}
|
10550 |
-
var fontData = this.globalData.fontManager.getFontByName(documentData.f);
|
10551 |
-
var i, len;
|
10552 |
-
var letters = documentData.l;
|
10553 |
-
var matrixHelper = this.mHelper;
|
10554 |
-
this.stroke = hasStroke;
|
10555 |
-
this.values.fValue = documentData.finalSize + 'px ' + this.globalData.fontManager.getFontByName(documentData.f).fFamily;
|
10556 |
-
len = documentData.finalText.length;
|
10557 |
-
//this.tHelper.font = this.values.fValue;
|
10558 |
-
var charData, shapeData, k, kLen, shapes, j, jLen, pathNodes, commands, pathArr, singleShape = this.data.singleShape;
|
10559 |
-
var trackingOffset = documentData.tr / 1000 * documentData.finalSize;
|
10560 |
-
var xPos = 0,
|
10561 |
-
yPos = 0,
|
10562 |
-
firstLine = true;
|
10563 |
-
var cnt = 0;
|
10564 |
-
for (i = 0; i < len; i += 1) {
|
10565 |
-
charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
|
10566 |
-
shapeData = charData && charData.data || {};
|
10567 |
-
matrixHelper.reset();
|
10568 |
-
if (singleShape && letters[i].n) {
|
10569 |
-
xPos = -trackingOffset;
|
10570 |
-
yPos += documentData.yOffset;
|
10571 |
-
yPos += firstLine ? 1 : 0;
|
10572 |
-
firstLine = false;
|
10573 |
-
}
|
10574 |
-
|
10575 |
-
shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
|
10576 |
-
jLen = shapes.length;
|
10577 |
-
matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
|
10578 |
-
if (singleShape) {
|
10579 |
-
this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
|
10580 |
-
}
|
10581 |
-
commands = createSizedArray(jLen);
|
10582 |
-
for (j = 0; j < jLen; j += 1) {
|
10583 |
-
kLen = shapes[j].ks.k.i.length;
|
10584 |
-
pathNodes = shapes[j].ks.k;
|
10585 |
-
pathArr = [];
|
10586 |
-
for (k = 1; k < kLen; k += 1) {
|
10587 |
-
if (k == 1) {
|
10588 |
-
pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));
|
10589 |
-
}
|
10590 |
-
pathArr.push(matrixHelper.applyToX(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToY(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToX(pathNodes.i[k][0], pathNodes.i[k][1], 0), matrixHelper.applyToY(pathNodes.i[k][0], pathNodes.i[k][1], 0), matrixHelper.applyToX(pathNodes.v[k][0], pathNodes.v[k][1], 0), matrixHelper.applyToY(pathNodes.v[k][0], pathNodes.v[k][1], 0));
|
10591 |
-
}
|
10592 |
-
pathArr.push(matrixHelper.applyToX(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToY(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToX(pathNodes.i[0][0], pathNodes.i[0][1], 0), matrixHelper.applyToY(pathNodes.i[0][0], pathNodes.i[0][1], 0), matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));
|
10593 |
-
commands[j] = pathArr;
|
10594 |
-
}
|
10595 |
-
if (singleShape) {
|
10596 |
-
xPos += letters[i].l;
|
10597 |
-
xPos += trackingOffset;
|
10598 |
-
}
|
10599 |
-
if (this.textSpans[cnt]) {
|
10600 |
-
this.textSpans[cnt].elem = commands;
|
10601 |
-
} else {
|
10602 |
-
this.textSpans[cnt] = {
|
10603 |
-
elem: commands
|
10604 |
-
};
|
10605 |
-
}
|
10606 |
-
cnt += 1;
|
10607 |
-
}
|
10608 |
-
};
|
10609 |
-
|
10610 |
-
CVTextElement.prototype.renderInnerContent = function () {
|
10611 |
-
var ctx = this.canvasContext;
|
10612 |
-
var finalMat = this.finalTransform.mat.props;
|
10613 |
-
ctx.font = this.values.fValue;
|
10614 |
-
ctx.lineCap = 'butt';
|
10615 |
-
ctx.lineJoin = 'miter';
|
10616 |
-
ctx.miterLimit = 4;
|
10617 |
-
|
10618 |
-
if (!this.data.singleShape) {
|
10619 |
-
this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
|
10620 |
-
}
|
10621 |
-
|
10622 |
-
var i, len, j, jLen, k, kLen;
|
10623 |
-
var renderedLetters = this.textAnimator.renderedLetters;
|
10624 |
-
|
10625 |
-
var letters = this.textProperty.currentData.l;
|
10626 |
-
|
10627 |
-
len = letters.length;
|
10628 |
-
var renderedLetter;
|
10629 |
-
var lastFill = null,
|
10630 |
-
lastStroke = null,
|
10631 |
-
lastStrokeW = null,
|
10632 |
-
commands, pathArr;
|
10633 |
-
for (i = 0; i < len; i += 1) {
|
10634 |
-
if (letters[i].n) {
|
10635 |
-
continue;
|
10636 |
-
}
|
10637 |
-
renderedLetter = renderedLetters[i];
|
10638 |
-
if (renderedLetter) {
|
10639 |
-
this.globalData.renderer.save();
|
10640 |
-
this.globalData.renderer.ctxTransform(renderedLetter.p);
|
10641 |
-
this.globalData.renderer.ctxOpacity(renderedLetter.o);
|
10642 |
-
}
|
10643 |
-
if (this.fill) {
|
10644 |
-
if (renderedLetter && renderedLetter.fc) {
|
10645 |
-
if (lastFill !== renderedLetter.fc) {
|
10646 |
-
lastFill = renderedLetter.fc;
|
10647 |
-
ctx.fillStyle = renderedLetter.fc;
|
10648 |
-
}
|
10649 |
-
} else if (lastFill !== this.values.fill) {
|
10650 |
-
lastFill = this.values.fill;
|
10651 |
-
ctx.fillStyle = this.values.fill;
|
10652 |
-
}
|
10653 |
-
commands = this.textSpans[i].elem;
|
10654 |
-
jLen = commands.length;
|
10655 |
-
this.globalData.canvasContext.beginPath();
|
10656 |
-
for (j = 0; j < jLen; j += 1) {
|
10657 |
-
pathArr = commands[j];
|
10658 |
-
kLen = pathArr.length;
|
10659 |
-
this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
|
10660 |
-
for (k = 2; k < kLen; k += 6) {
|
10661 |
-
this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
|
10662 |
-
}
|
10663 |
-
}
|
10664 |
-
this.globalData.canvasContext.closePath();
|
10665 |
-
this.globalData.canvasContext.fill();
|
10666 |
-
///ctx.fillText(this.textSpans[i].val,0,0);
|
10667 |
-
}
|
10668 |
-
if (this.stroke) {
|
10669 |
-
if (renderedLetter && renderedLetter.sw) {
|
10670 |
-
if (lastStrokeW !== renderedLetter.sw) {
|
10671 |
-
lastStrokeW = renderedLetter.sw;
|
10672 |
-
ctx.lineWidth = renderedLetter.sw;
|
10673 |
-
}
|
10674 |
-
} else if (lastStrokeW !== this.values.sWidth) {
|
10675 |
-
lastStrokeW = this.values.sWidth;
|
10676 |
-
ctx.lineWidth = this.values.sWidth;
|
10677 |
-
}
|
10678 |
-
if (renderedLetter && renderedLetter.sc) {
|
10679 |
-
if (lastStroke !== renderedLetter.sc) {
|
10680 |
-
lastStroke = renderedLetter.sc;
|
10681 |
-
ctx.strokeStyle = renderedLetter.sc;
|
10682 |
-
}
|
10683 |
-
} else if (lastStroke !== this.values.stroke) {
|
10684 |
-
lastStroke = this.values.stroke;
|
10685 |
-
ctx.strokeStyle = this.values.stroke;
|
10686 |
-
}
|
10687 |
-
commands = this.textSpans[i].elem;
|
10688 |
-
jLen = commands.length;
|
10689 |
-
this.globalData.canvasContext.beginPath();
|
10690 |
-
for (j = 0; j < jLen; j += 1) {
|
10691 |
-
pathArr = commands[j];
|
10692 |
-
kLen = pathArr.length;
|
10693 |
-
this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
|
10694 |
-
for (k = 2; k < kLen; k += 6) {
|
10695 |
-
this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
|
10696 |
-
}
|
10697 |
-
}
|
10698 |
-
this.globalData.canvasContext.closePath();
|
10699 |
-
this.globalData.canvasContext.stroke();
|
10700 |
-
///ctx.strokeText(letters[i].val,0,0);
|
10701 |
-
}
|
10702 |
-
if (renderedLetter) {
|
10703 |
-
this.globalData.renderer.restore();
|
10704 |
-
}
|
10705 |
-
}
|
10706 |
-
};
|
10707 |
-
|
10708 |
-
function CVEffects() {
|
10709 |
-
|
10710 |
-
}
|
10711 |
-
CVEffects.prototype.renderFrame = function () { };
|
10712 |
-
|
10713 |
-
function HBaseElement(data, globalData, comp) { }
|
10714 |
-
HBaseElement.prototype = {
|
10715 |
-
checkBlendMode: function () { },
|
10716 |
-
initRendererElement: function () {
|
10717 |
-
this.baseElement = createTag(this.data.tg || 'div');
|
10718 |
-
if (this.data.hasMask) {
|
10719 |
-
this.svgElement = createNS('svg');
|
10720 |
-
this.layerElement = createNS('g');
|
10721 |
-
this.maskedElement = this.layerElement;
|
10722 |
-
this.svgElement.appendChild(this.layerElement);
|
10723 |
-
this.baseElement.appendChild(this.svgElement);
|
10724 |
-
} else {
|
10725 |
-
this.layerElement = this.baseElement;
|
10726 |
-
}
|
10727 |
-
styleDiv(this.baseElement);
|
10728 |
-
},
|
10729 |
-
createContainerElements: function () {
|
10730 |
-
this.renderableEffectsManager = new CVEffects(this);
|
10731 |
-
this.transformedElement = this.baseElement;
|
10732 |
-
this.maskedElement = this.layerElement;
|
10733 |
-
if (this.data.ln) {
|
10734 |
-
this.layerElement.setAttribute('id', this.data.ln);
|
10735 |
-
}
|
10736 |
-
if (this.data.cl) {
|
10737 |
-
this.layerElement.setAttribute('class', this.data.cl);
|
10738 |
-
}
|
10739 |
-
if (this.data.bm !== 0) {
|
10740 |
-
this.setBlendMode();
|
10741 |
-
}
|
10742 |
-
},
|
10743 |
-
renderElement: function () {
|
10744 |
-
if (this.finalTransform._matMdf) {
|
10745 |
-
this.transformedElement.style.transform = this.transformedElement.style.webkitTransform = this.finalTransform.mat.toCSS();
|
10746 |
-
}
|
10747 |
-
if (this.finalTransform._opMdf) {
|
10748 |
-
this.transformedElement.style.opacity = this.finalTransform.mProp.o.v;
|
10749 |
-
}
|
10750 |
-
},
|
10751 |
-
renderFrame: function () {
|
10752 |
-
//If it is exported as hidden (data.hd === true) no need to render
|
10753 |
-
//If it is not visible no need to render
|
10754 |
-
if (this.data.hd || this.hidden) {
|
10755 |
-
return;
|
10756 |
-
}
|
10757 |
-
this.renderTransform();
|
10758 |
-
this.renderRenderable();
|
10759 |
-
this.renderElement();
|
10760 |
-
this.renderInnerContent();
|
10761 |
-
if (this._isFirstFrame) {
|
10762 |
-
this._isFirstFrame = false;
|
10763 |
-
}
|
10764 |
-
},
|
10765 |
-
destroy: function () {
|
10766 |
-
this.layerElement = null;
|
10767 |
-
this.transformedElement = null;
|
10768 |
-
if (this.matteElement) {
|
10769 |
-
this.matteElement = null;
|
10770 |
-
}
|
10771 |
-
if (this.maskManager) {
|
10772 |
-
this.maskManager.destroy();
|
10773 |
-
this.maskManager = null;
|
10774 |
-
}
|
10775 |
-
},
|
10776 |
-
createRenderableComponents: function () {
|
10777 |
-
this.maskManager = new MaskElement(this.data, this, this.globalData);
|
10778 |
-
},
|
10779 |
-
addEffects: function () { },
|
10780 |
-
setMatte: function () { }
|
10781 |
-
};
|
10782 |
-
HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;
|
10783 |
-
HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;
|
10784 |
-
HBaseElement.prototype.buildElementParenting = HybridRenderer.prototype.buildElementParenting;
|
10785 |
-
|
10786 |
-
function HSolidElement(data, globalData, comp) {
|
10787 |
-
this.initElement(data, globalData, comp);
|
10788 |
-
}
|
10789 |
-
extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement);
|
10790 |
-
|
10791 |
-
HSolidElement.prototype.createContent = function () {
|
10792 |
-
var rect;
|
10793 |
-
if (this.data.hasMask) {
|
10794 |
-
rect = createNS('rect');
|
10795 |
-
rect.setAttribute('width', this.data.sw);
|
10796 |
-
rect.setAttribute('height', this.data.sh);
|
10797 |
-
rect.setAttribute('fill', this.data.sc);
|
10798 |
-
this.svgElement.setAttribute('width', this.data.sw);
|
10799 |
-
this.svgElement.setAttribute('height', this.data.sh);
|
10800 |
-
} else {
|
10801 |
-
rect = createTag('div');
|
10802 |
-
rect.style.width = this.data.sw + 'px';
|
10803 |
-
rect.style.height = this.data.sh + 'px';
|
10804 |
-
rect.style.backgroundColor = this.data.sc;
|
10805 |
-
}
|
10806 |
-
this.layerElement.appendChild(rect);
|
10807 |
-
};
|
10808 |
-
|
10809 |
-
function HCompElement(data, globalData, comp) {
|
10810 |
-
this.layers = data.layers;
|
10811 |
-
this.supports3d = !data.hasMask;
|
10812 |
-
this.completeLayers = false;
|
10813 |
-
this.pendingElements = [];
|
10814 |
-
this.elements = this.layers ? createSizedArray(this.layers.length) : [];
|
10815 |
-
this.initElement(data, globalData, comp);
|
10816 |
-
this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {
|
10817 |
-
_placeholder: true
|
10818 |
-
};
|
10819 |
-
}
|
10820 |
-
|
10821 |
-
extendPrototype([HybridRenderer, ICompElement, HBaseElement], HCompElement);
|
10822 |
-
HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements;
|
10823 |
-
|
10824 |
-
HCompElement.prototype.createContainerElements = function () {
|
10825 |
-
this._createBaseContainerElements();
|
10826 |
-
//divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
|
10827 |
-
if (this.data.hasMask) {
|
10828 |
-
this.svgElement.setAttribute('width', this.data.w);
|
10829 |
-
this.svgElement.setAttribute('height', this.data.h);
|
10830 |
-
this.transformedElement = this.baseElement;
|
10831 |
-
} else {
|
10832 |
-
this.transformedElement = this.layerElement;
|
10833 |
-
}
|
10834 |
-
};
|
10835 |
-
|
10836 |
-
HCompElement.prototype.addTo3dContainer = function (elem, pos) {
|
10837 |
-
var j = 0;
|
10838 |
-
var nextElement;
|
10839 |
-
while (j < pos) {
|
10840 |
-
if (this.elements[j] && this.elements[j].getBaseElement) {
|
10841 |
-
nextElement = this.elements[j].getBaseElement();
|
10842 |
-
}
|
10843 |
-
j += 1;
|
10844 |
-
}
|
10845 |
-
if (nextElement) {
|
10846 |
-
this.layerElement.insertBefore(elem, nextElement);
|
10847 |
-
} else {
|
10848 |
-
this.layerElement.appendChild(elem);
|
10849 |
-
}
|
10850 |
-
}
|
10851 |
-
|
10852 |
-
function HShapeElement(data, globalData, comp) {
|
10853 |
-
//List of drawable elements
|
10854 |
-
this.shapes = [];
|
10855 |
-
// Full shape data
|
10856 |
-
this.shapesData = data.shapes;
|
10857 |
-
//List of styles that will be applied to shapes
|
10858 |
-
this.stylesList = [];
|
10859 |
-
//List of modifiers that will be applied to shapes
|
10860 |
-
this.shapeModifiers = [];
|
10861 |
-
//List of items in shape tree
|
10862 |
-
this.itemsData = [];
|
10863 |
-
//List of items in previous shape tree
|
10864 |
-
this.processedElements = [];
|
10865 |
-
// List of animated components
|
10866 |
-
this.animatedContents = [];
|
10867 |
-
this.shapesContainer = createNS('g');
|
10868 |
-
this.initElement(data, globalData, comp);
|
10869 |
-
//Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
|
10870 |
-
// List of elements that have been created
|
10871 |
-
this.prevViewData = [];
|
10872 |
-
this.currentBBox = {
|
10873 |
-
x: 999999,
|
10874 |
-
y: -999999,
|
10875 |
-
h: 0,
|
10876 |
-
w: 0
|
10877 |
-
};
|
10878 |
-
}
|
10879 |
-
extendPrototype([BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement], HShapeElement);
|
10880 |
-
HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent;
|
10881 |
-
|
10882 |
-
HShapeElement.prototype.createContent = function () {
|
10883 |
-
var cont;
|
10884 |
-
this.baseElement.style.fontSize = 0;
|
10885 |
-
if (this.data.hasMask) {
|
10886 |
-
this.layerElement.appendChild(this.shapesContainer);
|
10887 |
-
cont = this.svgElement;
|
10888 |
-
} else {
|
10889 |
-
cont = createNS('svg');
|
10890 |
-
var size = this.comp.data ? this.comp.data : this.globalData.compSize;
|
10891 |
-
cont.setAttribute('width', size.w);
|
10892 |
-
cont.setAttribute('height', size.h);
|
10893 |
-
cont.appendChild(this.shapesContainer);
|
10894 |
-
this.layerElement.appendChild(cont);
|
10895 |
-
}
|
10896 |
-
|
10897 |
-
this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], true);
|
10898 |
-
this.filterUniqueShapes();
|
10899 |
-
this.shapeCont = cont;
|
10900 |
-
};
|
10901 |
-
|
10902 |
-
HShapeElement.prototype.getTransformedPoint = function (transformers, point) {
|
10903 |
-
var i, len = transformers.length;
|
10904 |
-
for (i = 0; i < len; i += 1) {
|
10905 |
-
point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
|
10906 |
-
}
|
10907 |
-
return point;
|
10908 |
-
}
|
10909 |
-
|
10910 |
-
HShapeElement.prototype.calculateShapeBoundingBox = function (item, boundingBox) {
|
10911 |
-
var shape = item.sh.v;
|
10912 |
-
var transformers = item.transformers;
|
10913 |
-
var i, len = shape._length,
|
10914 |
-
vPoint, oPoint, nextIPoint, nextVPoint, bounds;
|
10915 |
-
if (len <= 1) {
|
10916 |
-
return;
|
10917 |
-
}
|
10918 |
-
for (i = 0; i < len - 1; i += 1) {
|
10919 |
-
vPoint = this.getTransformedPoint(transformers, shape.v[i]);
|
10920 |
-
oPoint = this.getTransformedPoint(transformers, shape.o[i]);
|
10921 |
-
nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
|
10922 |
-
nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
|
10923 |
-
this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
|
10924 |
-
}
|
10925 |
-
if (shape.c) {
|
10926 |
-
vPoint = this.getTransformedPoint(transformers, shape.v[i]);
|
10927 |
-
oPoint = this.getTransformedPoint(transformers, shape.o[i]);
|
10928 |
-
nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
|
10929 |
-
nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
|
10930 |
-
this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
|
10931 |
-
}
|
10932 |
-
}
|
10933 |
-
|
10934 |
-
HShapeElement.prototype.checkBounds = function (vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
|
10935 |
-
this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
|
10936 |
-
var bounds = this.shapeBoundingBox;
|
10937 |
-
boundingBox.x = bm_min(bounds.left, boundingBox.x);
|
10938 |
-
boundingBox.xMax = bm_max(bounds.right, boundingBox.xMax);
|
10939 |
-
boundingBox.y = bm_min(bounds.top, boundingBox.y);
|
10940 |
-
boundingBox.yMax = bm_max(bounds.bottom, boundingBox.yMax);
|
10941 |
-
}
|
10942 |
-
|
10943 |
-
HShapeElement.prototype.shapeBoundingBox = {
|
10944 |
-
left: 0,
|
10945 |
-
right: 0,
|
10946 |
-
top: 0,
|
10947 |
-
bottom: 0,
|
10948 |
-
}
|
10949 |
-
|
10950 |
-
HShapeElement.prototype.tempBoundingBox = {
|
10951 |
-
x: 0,
|
10952 |
-
xMax: 0,
|
10953 |
-
y: 0,
|
10954 |
-
yMax: 0,
|
10955 |
-
width: 0,
|
10956 |
-
height: 0
|
10957 |
-
}
|
10958 |
-
|
10959 |
-
HShapeElement.prototype.getBoundsOfCurve = function (p0, p1, p2, p3) {
|
10960 |
-
|
10961 |
-
var bounds = [
|
10962 |
-
[p0[0], p3[0]],
|
10963 |
-
[p0[1], p3[1]]
|
10964 |
-
];
|
10965 |
-
|
10966 |
-
for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) {
|
10967 |
-
|
10968 |
-
b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
|
10969 |
-
a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
|
10970 |
-
c = 3 * p1[i] - 3 * p0[i];
|
10971 |
-
|
10972 |
-
b = b | 0;
|
10973 |
-
a = a | 0;
|
10974 |
-
c = c | 0;
|
10975 |
-
|
10976 |
-
if (a === 0) {
|
10977 |
-
|
10978 |
-
if (b === 0) {
|
10979 |
-
continue;
|
10980 |
-
}
|
10981 |
-
|
10982 |
-
t = -c / b;
|
10983 |
-
|
10984 |
-
if (0 < t && t < 1) {
|
10985 |
-
bounds[i].push(this.calculateF(t, p0, p1, p2, p3, i));
|
10986 |
-
}
|
10987 |
-
continue;
|
10988 |
-
}
|
10989 |
-
|
10990 |
-
b2ac = b * b - 4 * c * a;
|
10991 |
-
|
10992 |
-
if (b2ac < 0) {
|
10993 |
-
continue;
|
10994 |
-
}
|
10995 |
-
|
10996 |
-
t1 = (-b + bm_sqrt(b2ac)) / (2 * a);
|
10997 |
-
if (0 < t1 && t1 < 1) bounds[i].push(this.calculateF(t1, p0, p1, p2, p3, i));
|
10998 |
-
|
10999 |
-
t2 = (-b - bm_sqrt(b2ac)) / (2 * a);
|
11000 |
-
if (0 < t2 && t2 < 1) bounds[i].push(this.calculateF(t2, p0, p1, p2, p3, i));
|
11001 |
-
|
11002 |
-
}
|
11003 |
-
|
11004 |
-
this.shapeBoundingBox.left = bm_min.apply(null, bounds[0]);
|
11005 |
-
this.shapeBoundingBox.top = bm_min.apply(null, bounds[1]);
|
11006 |
-
this.shapeBoundingBox.right = bm_max.apply(null, bounds[0]);
|
11007 |
-
this.shapeBoundingBox.bottom = bm_max.apply(null, bounds[1]);
|
11008 |
-
};
|
11009 |
-
|
11010 |
-
HShapeElement.prototype.calculateF = function (t, p0, p1, p2, p3, i) {
|
11011 |
-
return bm_pow(1 - t, 3) * p0[i] +
|
11012 |
-
3 * bm_pow(1 - t, 2) * t * p1[i] +
|
11013 |
-
3 * (1 - t) * bm_pow(t, 2) * p2[i] +
|
11014 |
-
bm_pow(t, 3) * p3[i];
|
11015 |
-
}
|
11016 |
-
|
11017 |
-
HShapeElement.prototype.calculateBoundingBox = function (itemsData, boundingBox) {
|
11018 |
-
var i, len = itemsData.length,
|
11019 |
-
path;
|
11020 |
-
for (i = 0; i < len; i += 1) {
|
11021 |
-
if (itemsData[i] && itemsData[i].sh) {
|
11022 |
-
this.calculateShapeBoundingBox(itemsData[i], boundingBox)
|
11023 |
-
} else if (itemsData[i] && itemsData[i].it) {
|
11024 |
-
this.calculateBoundingBox(itemsData[i].it, boundingBox)
|
11025 |
-
}
|
11026 |
-
}
|
11027 |
-
}
|
11028 |
-
|
11029 |
-
HShapeElement.prototype.currentBoxContains = function (box) {
|
11030 |
-
return this.currentBBox.x <= box.x &&
|
11031 |
-
this.currentBBox.y <= box.y &&
|
11032 |
-
this.currentBBox.width + this.currentBBox.x >= box.x + box.width &&
|
11033 |
-
this.currentBBox.height + this.currentBBox.y >= box.y + box.height
|
11034 |
-
}
|
11035 |
-
|
11036 |
-
HShapeElement.prototype.renderInnerContent = function () {
|
11037 |
-
this._renderShapeFrame();
|
11038 |
-
|
11039 |
-
if (!this.hidden && (this._isFirstFrame || this._mdf)) {
|
11040 |
-
var tempBoundingBox = this.tempBoundingBox;
|
11041 |
-
var max = 999999;
|
11042 |
-
tempBoundingBox.x = max;
|
11043 |
-
tempBoundingBox.xMax = -max;
|
11044 |
-
tempBoundingBox.y = max;
|
11045 |
-
tempBoundingBox.yMax = -max;
|
11046 |
-
this.calculateBoundingBox(this.itemsData, tempBoundingBox);
|
11047 |
-
tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
|
11048 |
-
tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
|
11049 |
-
//var tempBoundingBox = this.shapeCont.getBBox();
|
11050 |
-
if (this.currentBoxContains(tempBoundingBox)) {
|
11051 |
-
return;
|
11052 |
-
}
|
11053 |
-
var changed = false;
|
11054 |
-
if (this.currentBBox.w !== tempBoundingBox.width) {
|
11055 |
-
this.currentBBox.w = tempBoundingBox.width;
|
11056 |
-
this.shapeCont.setAttribute('width', tempBoundingBox.width);
|
11057 |
-
changed = true;
|
11058 |
-
}
|
11059 |
-
if (this.currentBBox.h !== tempBoundingBox.height) {
|
11060 |
-
this.currentBBox.h = tempBoundingBox.height;
|
11061 |
-
this.shapeCont.setAttribute('height', tempBoundingBox.height);
|
11062 |
-
changed = true;
|
11063 |
-
}
|
11064 |
-
if (changed || this.currentBBox.x !== tempBoundingBox.x || this.currentBBox.y !== tempBoundingBox.y) {
|
11065 |
-
this.currentBBox.w = tempBoundingBox.width;
|
11066 |
-
this.currentBBox.h = tempBoundingBox.height;
|
11067 |
-
this.currentBBox.x = tempBoundingBox.x;
|
11068 |
-
this.currentBBox.y = tempBoundingBox.y;
|
11069 |
-
|
11070 |
-
this.shapeCont.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
|
11071 |
-
this.shapeCont.style.transform = this.shapeCont.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
|
11072 |
-
}
|
11073 |
-
}
|
11074 |
-
|
11075 |
-
};
|
11076 |
-
|
11077 |
-
function HTextElement(data, globalData, comp) {
|
11078 |
-
this.textSpans = [];
|
11079 |
-
this.textPaths = [];
|
11080 |
-
this.currentBBox = {
|
11081 |
-
x: 999999,
|
11082 |
-
y: -999999,
|
11083 |
-
h: 0,
|
11084 |
-
w: 0
|
11085 |
-
};
|
11086 |
-
this.renderType = 'svg';
|
11087 |
-
this.isMasked = false;
|
11088 |
-
this.initElement(data, globalData, comp);
|
11089 |
-
|
11090 |
-
}
|
11091 |
-
extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement);
|
11092 |
-
|
11093 |
-
HTextElement.prototype.createContent = function () {
|
11094 |
-
this.isMasked = this.checkMasks();
|
11095 |
-
if (this.isMasked) {
|
11096 |
-
this.renderType = 'svg';
|
11097 |
-
this.compW = this.comp.data.w;
|
11098 |
-
this.compH = this.comp.data.h;
|
11099 |
-
this.svgElement.setAttribute('width', this.compW);
|
11100 |
-
this.svgElement.setAttribute('height', this.compH);
|
11101 |
-
var g = createNS('g');
|
11102 |
-
this.maskedElement.appendChild(g);
|
11103 |
-
this.innerElem = g;
|
11104 |
-
} else {
|
11105 |
-
this.renderType = 'html';
|
11106 |
-
this.innerElem = this.layerElement;
|
11107 |
-
}
|
11108 |
-
|
11109 |
-
this.checkParenting();
|
11110 |
-
|
11111 |
-
};
|
11112 |
-
|
11113 |
-
HTextElement.prototype.buildNewText = function () {
|
11114 |
-
var documentData = this.textProperty.currentData;
|
11115 |
-
this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
|
11116 |
-
var innerElemStyle = this.innerElem.style;
|
11117 |
-
innerElemStyle.color = innerElemStyle.fill = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
|
11118 |
-
if (documentData.sc) {
|
11119 |
-
innerElemStyle.stroke = this.buildColor(documentData.sc);
|
11120 |
-
innerElemStyle.strokeWidth = documentData.sw + 'px';
|
11121 |
-
}
|
11122 |
-
var fontData = this.globalData.fontManager.getFontByName(documentData.f);
|
11123 |
-
if (!this.globalData.fontManager.chars) {
|
11124 |
-
innerElemStyle.fontSize = documentData.finalSize + 'px';
|
11125 |
-
innerElemStyle.lineHeight = documentData.finalSize + 'px';
|
11126 |
-
if (fontData.fClass) {
|
11127 |
-
this.innerElem.className = fontData.fClass;
|
11128 |
-
} else {
|
11129 |
-
innerElemStyle.fontFamily = fontData.fFamily;
|
11130 |
-
var fWeight = documentData.fWeight,
|
11131 |
-
fStyle = documentData.fStyle;
|
11132 |
-
innerElemStyle.fontStyle = fStyle;
|
11133 |
-
innerElemStyle.fontWeight = fWeight;
|
11134 |
-
}
|
11135 |
-
}
|
11136 |
-
var i, len;
|
11137 |
-
|
11138 |
-
var letters = documentData.l;
|
11139 |
-
len = letters.length;
|
11140 |
-
var tSpan, tParent, tCont;
|
11141 |
-
var matrixHelper = this.mHelper;
|
11142 |
-
var shapes, shapeStr = '';
|
11143 |
-
var cnt = 0;
|
11144 |
-
for (i = 0; i < len; i += 1) {
|
11145 |
-
if (this.globalData.fontManager.chars) {
|
11146 |
-
if (!this.textPaths[cnt]) {
|
11147 |
-
tSpan = createNS('path');
|
11148 |
-
tSpan.setAttribute('stroke-linecap', 'butt');
|
11149 |
-
tSpan.setAttribute('stroke-linejoin', 'round');
|
11150 |
-
tSpan.setAttribute('stroke-miterlimit', '4');
|
11151 |
-
} else {
|
11152 |
-
tSpan = this.textPaths[cnt];
|
11153 |
-
}
|
11154 |
-
if (!this.isMasked) {
|
11155 |
-
if (this.textSpans[cnt]) {
|
11156 |
-
tParent = this.textSpans[cnt];
|
11157 |
-
tCont = tParent.children[0];
|
11158 |
-
} else {
|
11159 |
-
|
11160 |
-
tParent = createTag('div');
|
11161 |
-
tParent.style.lineHeight = 0;
|
11162 |
-
tCont = createNS('svg');
|
11163 |
-
tCont.appendChild(tSpan);
|
11164 |
-
styleDiv(tParent);
|
11165 |
-
}
|
11166 |
-
}
|
11167 |
-
} else {
|
11168 |
-
if (!this.isMasked) {
|
11169 |
-
if (this.textSpans[cnt]) {
|
11170 |
-
tParent = this.textSpans[cnt];
|
11171 |
-
tSpan = this.textPaths[cnt];
|
11172 |
-
} else {
|
11173 |
-
tParent = createTag('span');
|
11174 |
-
styleDiv(tParent);
|
11175 |
-
tSpan = createTag('span');
|
11176 |
-
styleDiv(tSpan);
|
11177 |
-
tParent.appendChild(tSpan);
|
11178 |
-
}
|
11179 |
-
} else {
|
11180 |
-
tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
|
11181 |
-
}
|
11182 |
-
}
|
11183 |
-
//tSpan.setAttribute('visibility', 'hidden');
|
11184 |
-
if (this.globalData.fontManager.chars) {
|
11185 |
-
var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
|
11186 |
-
var shapeData;
|
11187 |
-
if (charData) {
|
11188 |
-
shapeData = charData.data;
|
11189 |
-
} else {
|
11190 |
-
shapeData = null;
|
11191 |
-
}
|
11192 |
-
matrixHelper.reset();
|
11193 |
-
if (shapeData && shapeData.shapes) {
|
11194 |
-
shapes = shapeData.shapes[0].it;
|
11195 |
-
matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
|
11196 |
-
shapeStr = this.createPathShape(matrixHelper, shapes);
|
11197 |
-
tSpan.setAttribute('d', shapeStr);
|
11198 |
-
}
|
11199 |
-
if (!this.isMasked) {
|
11200 |
-
this.innerElem.appendChild(tParent);
|
11201 |
-
if (shapeData && shapeData.shapes) {
|
11202 |
-
|
11203 |
-
//document.body.appendChild is needed to get exact measure of shape
|
11204 |
-
document.body.appendChild(tCont);
|
11205 |
-
var boundingBox = tCont.getBBox();
|
11206 |
-
tCont.setAttribute('width', boundingBox.width + 2);
|
11207 |
-
tCont.setAttribute('height', boundingBox.height + 2);
|
11208 |
-
tCont.setAttribute('viewBox', (boundingBox.x - 1) + ' ' + (boundingBox.y - 1) + ' ' + (boundingBox.width + 2) + ' ' + (boundingBox.height + 2));
|
11209 |
-
tCont.style.transform = tCont.style.webkitTransform = 'translate(' + (boundingBox.x - 1) + 'px,' + (boundingBox.y - 1) + 'px)';
|
11210 |
-
|
11211 |
-
letters[i].yOffset = boundingBox.y - 1;
|
11212 |
-
|
11213 |
-
} else {
|
11214 |
-
tCont.setAttribute('width', 1);
|
11215 |
-
tCont.setAttribute('height', 1);
|
11216 |
-
}
|
11217 |
-
tParent.appendChild(tCont);
|
11218 |
-
} else {
|
11219 |
-
this.innerElem.appendChild(tSpan);
|
11220 |
-
}
|
11221 |
-
} else {
|
11222 |
-
tSpan.textContent = letters[i].val;
|
11223 |
-
tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
|
11224 |
-
if (!this.isMasked) {
|
11225 |
-
this.innerElem.appendChild(tParent);
|
11226 |
-
//
|
11227 |
-
tSpan.style.transform = tSpan.style.webkitTransform = 'translate3d(0,' + -documentData.finalSize / 1.2 + 'px,0)';
|
11228 |
-
} else {
|
11229 |
-
this.innerElem.appendChild(tSpan);
|
11230 |
-
}
|
11231 |
-
}
|
11232 |
-
//
|
11233 |
-
if (!this.isMasked) {
|
11234 |
-
this.textSpans[cnt] = tParent;
|
11235 |
-
} else {
|
11236 |
-
this.textSpans[cnt] = tSpan;
|
11237 |
-
}
|
11238 |
-
this.textSpans[cnt].style.display = 'block';
|
11239 |
-
this.textPaths[cnt] = tSpan;
|
11240 |
-
cnt += 1;
|
11241 |
-
}
|
11242 |
-
while (cnt < this.textSpans.length) {
|
11243 |
-
this.textSpans[cnt].style.display = 'none';
|
11244 |
-
cnt += 1;
|
11245 |
-
}
|
11246 |
-
};
|
11247 |
-
|
11248 |
-
HTextElement.prototype.renderInnerContent = function () {
|
11249 |
-
|
11250 |
-
if (this.data.singleShape) {
|
11251 |
-
if (!this._isFirstFrame && !this.lettersChangedFlag) {
|
11252 |
-
return;
|
11253 |
-
} else {
|
11254 |
-
// Todo Benchmark if using this is better than getBBox
|
11255 |
-
if (this.isMasked && this.finalTransform._matMdf) {
|
11256 |
-
this.svgElement.setAttribute('viewBox', -this.finalTransform.mProp.p.v[0] + ' ' + -this.finalTransform.mProp.p.v[1] + ' ' + this.compW + ' ' + this.compH);
|
11257 |
-
this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
|
11258 |
-
}
|
11259 |
-
}
|
11260 |
-
}
|
11261 |
-
|
11262 |
-
this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
|
11263 |
-
if (!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag) {
|
11264 |
-
return;
|
11265 |
-
}
|
11266 |
-
var i, len, count = 0;
|
11267 |
-
var renderedLetters = this.textAnimator.renderedLetters;
|
11268 |
-
|
11269 |
-
var letters = this.textProperty.currentData.l;
|
11270 |
-
|
11271 |
-
len = letters.length;
|
11272 |
-
var renderedLetter, textSpan, textPath;
|
11273 |
-
for (i = 0; i < len; i += 1) {
|
11274 |
-
if (letters[i].n) {
|
11275 |
-
count += 1;
|
11276 |
-
continue;
|
11277 |
-
}
|
11278 |
-
textSpan = this.textSpans[i];
|
11279 |
-
textPath = this.textPaths[i];
|
11280 |
-
renderedLetter = renderedLetters[count];
|
11281 |
-
count += 1;
|
11282 |
-
if (renderedLetter._mdf.m) {
|
11283 |
-
if (!this.isMasked) {
|
11284 |
-
textSpan.style.transform = textSpan.style.webkitTransform = renderedLetter.m;
|
11285 |
-
} else {
|
11286 |
-
textSpan.setAttribute('transform', renderedLetter.m);
|
11287 |
-
}
|
11288 |
-
}
|
11289 |
-
////textSpan.setAttribute('opacity',renderedLetter.o);
|
11290 |
-
textSpan.style.opacity = renderedLetter.o;
|
11291 |
-
if (renderedLetter.sw && renderedLetter._mdf.sw) {
|
11292 |
-
textPath.setAttribute('stroke-width', renderedLetter.sw);
|
11293 |
-
}
|
11294 |
-
if (renderedLetter.sc && renderedLetter._mdf.sc) {
|
11295 |
-
textPath.setAttribute('stroke', renderedLetter.sc);
|
11296 |
-
}
|
11297 |
-
if (renderedLetter.fc && renderedLetter._mdf.fc) {
|
11298 |
-
textPath.setAttribute('fill', renderedLetter.fc);
|
11299 |
-
textPath.style.color = renderedLetter.fc;
|
11300 |
-
}
|
11301 |
-
}
|
11302 |
-
|
11303 |
-
if (this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)) {
|
11304 |
-
var boundingBox = this.innerElem.getBBox();
|
11305 |
-
|
11306 |
-
if (this.currentBBox.w !== boundingBox.width) {
|
11307 |
-
this.currentBBox.w = boundingBox.width;
|
11308 |
-
this.svgElement.setAttribute('width', boundingBox.width);
|
11309 |
-
}
|
11310 |
-
if (this.currentBBox.h !== boundingBox.height) {
|
11311 |
-
this.currentBBox.h = boundingBox.height;
|
11312 |
-
this.svgElement.setAttribute('height', boundingBox.height);
|
11313 |
-
}
|
11314 |
-
|
11315 |
-
var margin = 1;
|
11316 |
-
if (this.currentBBox.w !== (boundingBox.width + margin * 2) || this.currentBBox.h !== (boundingBox.height + margin * 2) || this.currentBBox.x !== (boundingBox.x - margin) || this.currentBBox.y !== (boundingBox.y - margin)) {
|
11317 |
-
this.currentBBox.w = boundingBox.width + margin * 2;
|
11318 |
-
this.currentBBox.h = boundingBox.height + margin * 2;
|
11319 |
-
this.currentBBox.x = boundingBox.x - margin;
|
11320 |
-
this.currentBBox.y = boundingBox.y - margin;
|
11321 |
-
|
11322 |
-
this.svgElement.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
|
11323 |
-
this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
|
11324 |
-
}
|
11325 |
-
}
|
11326 |
-
};
|
11327 |
-
|
11328 |
-
function HImageElement(data, globalData, comp) {
|
11329 |
-
this.assetData = globalData.getAssetData(data.refId);
|
11330 |
-
this.initElement(data, globalData, comp);
|
11331 |
-
}
|
11332 |
-
|
11333 |
-
extendPrototype([BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement);
|
11334 |
-
|
11335 |
-
|
11336 |
-
HImageElement.prototype.createContent = function () {
|
11337 |
-
var assetPath = this.globalData.getAssetsPath(this.assetData);
|
11338 |
-
var img = new Image();
|
11339 |
-
|
11340 |
-
if (this.data.hasMask) {
|
11341 |
-
this.imageElem = createNS('image');
|
11342 |
-
this.imageElem.setAttribute('width', this.assetData.w + "px");
|
11343 |
-
this.imageElem.setAttribute('height', this.assetData.h + "px");
|
11344 |
-
this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
|
11345 |
-
this.layerElement.appendChild(this.imageElem);
|
11346 |
-
this.baseElement.setAttribute('width', this.assetData.w);
|
11347 |
-
this.baseElement.setAttribute('height', this.assetData.h);
|
11348 |
-
} else {
|
11349 |
-
this.layerElement.appendChild(img);
|
11350 |
-
}
|
11351 |
-
img.src = assetPath;
|
11352 |
-
if (this.data.ln) {
|
11353 |
-
this.baseElement.setAttribute('id', this.data.ln);
|
11354 |
-
}
|
11355 |
-
};
|
11356 |
-
|
11357 |
-
function HCameraElement(data, globalData, comp) {
|
11358 |
-
this.initFrame();
|
11359 |
-
this.initBaseData(data, globalData, comp);
|
11360 |
-
this.initHierarchy();
|
11361 |
-
var getProp = PropertyFactory.getProp;
|
11362 |
-
this.pe = getProp(this, data.pe, 0, 0, this);
|
11363 |
-
if (data.ks.p.s) {
|
11364 |
-
this.px = getProp(this, data.ks.p.x, 1, 0, this);
|
11365 |
-
this.py = getProp(this, data.ks.p.y, 1, 0, this);
|
11366 |
-
this.pz = getProp(this, data.ks.p.z, 1, 0, this);
|
11367 |
-
} else {
|
11368 |
-
this.p = getProp(this, data.ks.p, 1, 0, this);
|
11369 |
-
}
|
11370 |
-
if (data.ks.a) {
|
11371 |
-
this.a = getProp(this, data.ks.a, 1, 0, this);
|
11372 |
-
}
|
11373 |
-
if (data.ks.or.k.length && data.ks.or.k[0].to) {
|
11374 |
-
var i, len = data.ks.or.k.length;
|
11375 |
-
for (i = 0; i < len; i += 1) {
|
11376 |
-
data.ks.or.k[i].to = null;
|
11377 |
-
data.ks.or.k[i].ti = null;
|
11378 |
-
}
|
11379 |
-
}
|
11380 |
-
this.or = getProp(this, data.ks.or, 1, degToRads, this);
|
11381 |
-
this.or.sh = true;
|
11382 |
-
this.rx = getProp(this, data.ks.rx, 0, degToRads, this);
|
11383 |
-
this.ry = getProp(this, data.ks.ry, 0, degToRads, this);
|
11384 |
-
this.rz = getProp(this, data.ks.rz, 0, degToRads, this);
|
11385 |
-
this.mat = new Matrix();
|
11386 |
-
this._prevMat = new Matrix();
|
11387 |
-
this._isFirstFrame = true;
|
11388 |
-
|
11389 |
-
// TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
|
11390 |
-
this.finalTransform = {
|
11391 |
-
mProp: this
|
11392 |
-
};
|
11393 |
-
}
|
11394 |
-
extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement);
|
11395 |
-
|
11396 |
-
HCameraElement.prototype.setup = function () {
|
11397 |
-
var i, len = this.comp.threeDElements.length,
|
11398 |
-
comp;
|
11399 |
-
for (i = 0; i < len; i += 1) {
|
11400 |
-
//[perspectiveElem,container]
|
11401 |
-
comp = this.comp.threeDElements[i];
|
11402 |
-
if (comp.type === '3d') {
|
11403 |
-
comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v + 'px';
|
11404 |
-
comp.container.style.transformOrigin = comp.container.style.mozTransformOrigin = comp.container.style.webkitTransformOrigin = "0px 0px 0px";
|
11405 |
-
comp.perspectiveElem.style.transform = comp.perspectiveElem.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
|
11406 |
-
}
|
11407 |
-
}
|
11408 |
-
};
|
11409 |
-
|
11410 |
-
HCameraElement.prototype.createElements = function () { };
|
11411 |
-
|
11412 |
-
HCameraElement.prototype.hide = function () { };
|
11413 |
-
|
11414 |
-
HCameraElement.prototype.renderFrame = function () {
|
11415 |
-
var _mdf = this._isFirstFrame;
|
11416 |
-
var i, len;
|
11417 |
-
if (this.hierarchy) {
|
11418 |
-
len = this.hierarchy.length;
|
11419 |
-
for (i = 0; i < len; i += 1) {
|
11420 |
-
_mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
|
11421 |
-
}
|
11422 |
-
}
|
11423 |
-
if (_mdf || this.pe._mdf || (this.p && this.p._mdf) || (this.px && (this.px._mdf || this.py._mdf || this.pz._mdf)) || this.rx._mdf || this.ry._mdf || this.rz._mdf || this.or._mdf || (this.a && this.a._mdf)) {
|
11424 |
-
this.mat.reset();
|
11425 |
-
|
11426 |
-
if (this.hierarchy) {
|
11427 |
-
var mat;
|
11428 |
-
len = this.hierarchy.length - 1;
|
11429 |
-
for (i = len; i >= 0; i -= 1) {
|
11430 |
-
var mTransf = this.hierarchy[i].finalTransform.mProp;
|
11431 |
-
this.mat.translate(-mTransf.p.v[0], -mTransf.p.v[1], mTransf.p.v[2]);
|
11432 |
-
this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
|
11433 |
-
this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
|
11434 |
-
this.mat.scale(1 / mTransf.s.v[0], 1 / mTransf.s.v[1], 1 / mTransf.s.v[2]);
|
11435 |
-
this.mat.translate(mTransf.a.v[0], mTransf.a.v[1], mTransf.a.v[2]);
|
11436 |
-
}
|
11437 |
-
}
|
11438 |
-
if (this.p) {
|
11439 |
-
this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]);
|
11440 |
-
} else {
|
11441 |
-
this.mat.translate(-this.px.v, -this.py.v, this.pz.v);
|
11442 |
-
}
|
11443 |
-
if (this.a) {
|
11444 |
-
var diffVector
|
11445 |
-
if (this.p) {
|
11446 |
-
diffVector = [this.p.v[0] - this.a.v[0], this.p.v[1] - this.a.v[1], this.p.v[2] - this.a.v[2]];
|
11447 |
-
} else {
|
11448 |
-
diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
|
11449 |
-
}
|
11450 |
-
var mag = Math.sqrt(Math.pow(diffVector[0], 2) + Math.pow(diffVector[1], 2) + Math.pow(diffVector[2], 2));
|
11451 |
-
//var lookDir = getNormalizedPoint(getDiffVector(this.a.v,this.p.v));
|
11452 |
-
var lookDir = [diffVector[0] / mag, diffVector[1] / mag, diffVector[2] / mag];
|
11453 |
-
var lookLengthOnXZ = Math.sqrt(lookDir[2] * lookDir[2] + lookDir[0] * lookDir[0]);
|
11454 |
-
var m_rotationX = (Math.atan2(lookDir[1], lookLengthOnXZ));
|
11455 |
-
var m_rotationY = (Math.atan2(lookDir[0], -lookDir[2]));
|
11456 |
-
this.mat.rotateY(m_rotationY).rotateX(-m_rotationX);
|
11457 |
-
|
11458 |
-
}
|
11459 |
-
this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
|
11460 |
-
this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
|
11461 |
-
this.mat.translate(this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0);
|
11462 |
-
this.mat.translate(0, 0, this.pe.v);
|
11463 |
-
|
11464 |
-
|
11465 |
-
|
11466 |
-
|
11467 |
-
var hasMatrixChanged = !this._prevMat.equals(this.mat);
|
11468 |
-
if ((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
|
11469 |
-
len = this.comp.threeDElements.length;
|
11470 |
-
var comp;
|
11471 |
-
for (i = 0; i < len; i += 1) {
|
11472 |
-
comp = this.comp.threeDElements[i];
|
11473 |
-
if (comp.type === '3d') {
|
11474 |
-
if (hasMatrixChanged) {
|
11475 |
-
comp.container.style.transform = comp.container.style.webkitTransform = this.mat.toCSS();
|
11476 |
-
}
|
11477 |
-
if (this.pe._mdf) {
|
11478 |
-
comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v + 'px';
|
11479 |
-
}
|
11480 |
-
}
|
11481 |
-
}
|
11482 |
-
this.mat.clone(this._prevMat);
|
11483 |
-
}
|
11484 |
-
}
|
11485 |
-
this._isFirstFrame = false;
|
11486 |
-
};
|
11487 |
-
|
11488 |
-
HCameraElement.prototype.prepareFrame = function (num) {
|
11489 |
-
this.prepareProperties(num, true);
|
11490 |
-
};
|
11491 |
-
|
11492 |
-
HCameraElement.prototype.destroy = function () { };
|
11493 |
-
HCameraElement.prototype.getBaseElement = function () {
|
11494 |
-
return null;
|
11495 |
-
};
|
11496 |
-
|
11497 |
-
function HEffects() { }
|
11498 |
-
HEffects.prototype.renderFrame = function () { };
|
11499 |
-
var animationManager = (function () {
|
11500 |
-
var moduleOb = {};
|
11501 |
-
var registeredAnimations = [];
|
11502 |
-
var initTime = 0;
|
11503 |
-
var len = 0;
|
11504 |
-
var playingAnimationsNum = 0;
|
11505 |
-
var _stopped = true;
|
11506 |
-
var _isFrozen = false;
|
11507 |
-
|
11508 |
-
function removeElement(ev) {
|
11509 |
-
var i = 0;
|
11510 |
-
var animItem = ev.target;
|
11511 |
-
while (i < len) {
|
11512 |
-
if (registeredAnimations[i].animation === animItem) {
|
11513 |
-
registeredAnimations.splice(i, 1);
|
11514 |
-
i -= 1;
|
11515 |
-
len -= 1;
|
11516 |
-
if (!animItem.isPaused) {
|
11517 |
-
subtractPlayingCount();
|
11518 |
-
}
|
11519 |
-
}
|
11520 |
-
i += 1;
|
11521 |
-
}
|
11522 |
-
}
|
11523 |
-
|
11524 |
-
function registerAnimation(element, animationData) {
|
11525 |
-
if (!element) {
|
11526 |
-
return null;
|
11527 |
-
}
|
11528 |
-
var i = 0;
|
11529 |
-
while (i < len) {
|
11530 |
-
if (registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null) {
|
11531 |
-
return registeredAnimations[i].animation;
|
11532 |
-
}
|
11533 |
-
i += 1;
|
11534 |
-
}
|
11535 |
-
var animItem = new AnimationItem();
|
11536 |
-
setupAnimation(animItem, element);
|
11537 |
-
animItem.setData(element, animationData);
|
11538 |
-
return animItem;
|
11539 |
-
}
|
11540 |
-
|
11541 |
-
function getRegisteredAnimations() {
|
11542 |
-
var i, len = registeredAnimations.length;
|
11543 |
-
var animations = [];
|
11544 |
-
for (i = 0; i < len; i += 1) {
|
11545 |
-
animations.push(registeredAnimations[i].animation);
|
11546 |
-
}
|
11547 |
-
return animations;
|
11548 |
-
}
|
11549 |
-
|
11550 |
-
function addPlayingCount() {
|
11551 |
-
playingAnimationsNum += 1;
|
11552 |
-
activate();
|
11553 |
-
}
|
11554 |
-
|
11555 |
-
function subtractPlayingCount() {
|
11556 |
-
playingAnimationsNum -= 1;
|
11557 |
-
}
|
11558 |
-
|
11559 |
-
function setupAnimation(animItem, element) {
|
11560 |
-
animItem.addEventListener('destroy', removeElement);
|
11561 |
-
animItem.addEventListener('_active', addPlayingCount);
|
11562 |
-
animItem.addEventListener('_idle', subtractPlayingCount);
|
11563 |
-
registeredAnimations.push({
|
11564 |
-
elem: element,
|
11565 |
-
animation: animItem
|
11566 |
-
});
|
11567 |
-
len += 1;
|
11568 |
-
}
|
11569 |
-
|
11570 |
-
function loadAnimation(params) {
|
11571 |
-
var animItem = new AnimationItem();
|
11572 |
-
setupAnimation(animItem, null);
|
11573 |
-
animItem.setParams(params);
|
11574 |
-
return animItem;
|
11575 |
-
}
|
11576 |
-
|
11577 |
-
|
11578 |
-
function setSpeed(val, animation) {
|
11579 |
-
var i;
|
11580 |
-
for (i = 0; i < len; i += 1) {
|
11581 |
-
registeredAnimations[i].animation.setSpeed(val, animation);
|
11582 |
-
}
|
11583 |
-
}
|
11584 |
-
|
11585 |
-
function setDirection(val, animation) {
|
11586 |
-
var i;
|
11587 |
-
for (i = 0; i < len; i += 1) {
|
11588 |
-
registeredAnimations[i].animation.setDirection(val, animation);
|
11589 |
-
}
|
11590 |
-
}
|
11591 |
-
|
11592 |
-
function play(animation) {
|
11593 |
-
var i;
|
11594 |
-
for (i = 0; i < len; i += 1) {
|
11595 |
-
registeredAnimations[i].animation.play(animation);
|
11596 |
-
}
|
11597 |
-
}
|
11598 |
-
|
11599 |
-
function resume(nowTime) {
|
11600 |
-
var elapsedTime = nowTime - initTime;
|
11601 |
-
var i;
|
11602 |
-
for (i = 0; i < len; i += 1) {
|
11603 |
-
registeredAnimations[i].animation.advanceTime(elapsedTime);
|
11604 |
-
}
|
11605 |
-
initTime = nowTime;
|
11606 |
-
if (playingAnimationsNum && !_isFrozen) {
|
11607 |
-
window.requestAnimationFrame(resume);
|
11608 |
-
} else {
|
11609 |
-
_stopped = true;
|
11610 |
-
}
|
11611 |
-
}
|
11612 |
-
|
11613 |
-
function first(nowTime) {
|
11614 |
-
initTime = nowTime;
|
11615 |
-
window.requestAnimationFrame(resume);
|
11616 |
-
}
|
11617 |
-
|
11618 |
-
function pause(animation) {
|
11619 |
-
var i;
|
11620 |
-
for (i = 0; i < len; i += 1) {
|
11621 |
-
registeredAnimations[i].animation.pause(animation);
|
11622 |
-
}
|
11623 |
-
}
|
11624 |
-
|
11625 |
-
function goToAndStop(value, isFrame, animation) {
|
11626 |
-
var i;
|
11627 |
-
for (i = 0; i < len; i += 1) {
|
11628 |
-
registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
|
11629 |
-
}
|
11630 |
-
}
|
11631 |
-
|
11632 |
-
function stop(animation) {
|
11633 |
-
var i;
|
11634 |
-
for (i = 0; i < len; i += 1) {
|
11635 |
-
registeredAnimations[i].animation.stop(animation);
|
11636 |
-
}
|
11637 |
-
}
|
11638 |
-
|
11639 |
-
function togglePause(animation) {
|
11640 |
-
var i;
|
11641 |
-
for (i = 0; i < len; i += 1) {
|
11642 |
-
registeredAnimations[i].animation.togglePause(animation);
|
11643 |
-
}
|
11644 |
-
}
|
11645 |
-
|
11646 |
-
function destroy(animation) {
|
11647 |
-
var i;
|
11648 |
-
for (i = (len - 1); i >= 0; i -= 1) {
|
11649 |
-
registeredAnimations[i].animation.destroy(animation);
|
11650 |
-
}
|
11651 |
-
}
|
11652 |
-
|
11653 |
-
function searchAnimations(animationData, standalone, renderer) {
|
11654 |
-
var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
|
11655 |
-
[].slice.call(document.getElementsByClassName('bodymovin')));
|
11656 |
-
var i, len = animElements.length;
|
11657 |
-
for (i = 0; i < len; i += 1) {
|
11658 |
-
if (renderer) {
|
11659 |
-
animElements[i].setAttribute('data-bm-type', renderer);
|
11660 |
-
}
|
11661 |
-
registerAnimation(animElements[i], animationData);
|
11662 |
-
}
|
11663 |
-
if (standalone && len === 0) {
|
11664 |
-
if (!renderer) {
|
11665 |
-
renderer = 'svg';
|
11666 |
-
}
|
11667 |
-
var body = document.getElementsByTagName('body')[0];
|
11668 |
-
body.innerHTML = '';
|
11669 |
-
var div = createTag('div');
|
11670 |
-
div.style.width = '100%';
|
11671 |
-
div.style.height = '100%';
|
11672 |
-
div.setAttribute('data-bm-type', renderer);
|
11673 |
-
body.appendChild(div);
|
11674 |
-
registerAnimation(div, animationData);
|
11675 |
-
}
|
11676 |
-
}
|
11677 |
-
|
11678 |
-
function resize() {
|
11679 |
-
var i;
|
11680 |
-
for (i = 0; i < len; i += 1) {
|
11681 |
-
registeredAnimations[i].animation.resize();
|
11682 |
-
}
|
11683 |
-
}
|
11684 |
-
|
11685 |
-
function activate() {
|
11686 |
-
if (!_isFrozen && playingAnimationsNum) {
|
11687 |
-
if (_stopped) {
|
11688 |
-
window.requestAnimationFrame(first);
|
11689 |
-
_stopped = false;
|
11690 |
-
}
|
11691 |
-
}
|
11692 |
-
}
|
11693 |
-
|
11694 |
-
function freeze() {
|
11695 |
-
_isFrozen = true;
|
11696 |
-
}
|
11697 |
-
|
11698 |
-
function unfreeze() {
|
11699 |
-
_isFrozen = false;
|
11700 |
-
activate();
|
11701 |
-
}
|
11702 |
-
|
11703 |
-
moduleOb.registerAnimation = registerAnimation;
|
11704 |
-
moduleOb.loadAnimation = loadAnimation;
|
11705 |
-
moduleOb.setSpeed = setSpeed;
|
11706 |
-
moduleOb.setDirection = setDirection;
|
11707 |
-
moduleOb.play = play;
|
11708 |
-
moduleOb.pause = pause;
|
11709 |
-
moduleOb.stop = stop;
|
11710 |
-
moduleOb.togglePause = togglePause;
|
11711 |
-
moduleOb.searchAnimations = searchAnimations;
|
11712 |
-
moduleOb.resize = resize;
|
11713 |
-
//moduleOb.start = start;
|
11714 |
-
moduleOb.goToAndStop = goToAndStop;
|
11715 |
-
moduleOb.destroy = destroy;
|
11716 |
-
moduleOb.freeze = freeze;
|
11717 |
-
moduleOb.unfreeze = unfreeze;
|
11718 |
-
moduleOb.getRegisteredAnimations = getRegisteredAnimations;
|
11719 |
-
return moduleOb;
|
11720 |
-
}());
|
11721 |
-
|
11722 |
-
var AnimationItem = function () {
|
11723 |
-
this._cbs = [];
|
11724 |
-
this.name = '';
|
11725 |
-
this.path = '';
|
11726 |
-
this.isLoaded = false;
|
11727 |
-
this.currentFrame = 0;
|
11728 |
-
this.currentRawFrame = 0;
|
11729 |
-
this.firstFrame = 0;
|
11730 |
-
this.totalFrames = 0;
|
11731 |
-
this.frameRate = 0;
|
11732 |
-
this.frameMult = 0;
|
11733 |
-
this.playSpeed = 1;
|
11734 |
-
this.playDirection = 1;
|
11735 |
-
this.playCount = 0;
|
11736 |
-
this.animationData = {};
|
11737 |
-
this.assets = [];
|
11738 |
-
this.isPaused = true;
|
11739 |
-
this.autoplay = false;
|
11740 |
-
this.loop = true;
|
11741 |
-
this.renderer = null;
|
11742 |
-
this.animationID = createElementID();
|
11743 |
-
this.assetsPath = '';
|
11744 |
-
this.timeCompleted = 0;
|
11745 |
-
this.segmentPos = 0;
|
11746 |
-
this.subframeEnabled = subframeEnabled;
|
11747 |
-
this.segments = [];
|
11748 |
-
this._idle = true;
|
11749 |
-
this._completedLoop = false;
|
11750 |
-
this.projectInterface = ProjectInterface();
|
11751 |
-
this.imagePreloader = new ImagePreloader();
|
11752 |
-
};
|
11753 |
-
|
11754 |
-
extendPrototype([BaseEvent], AnimationItem);
|
11755 |
-
|
11756 |
-
AnimationItem.prototype.setParams = function (params) {
|
11757 |
-
if (params.context) {
|
11758 |
-
this.context = params.context;
|
11759 |
-
}
|
11760 |
-
if (params.wrapper || params.container) {
|
11761 |
-
this.wrapper = params.wrapper || params.container;
|
11762 |
-
}
|
11763 |
-
var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
|
11764 |
-
switch (animType) {
|
11765 |
-
case 'canvas':
|
11766 |
-
this.renderer = new CanvasRenderer(this, params.rendererSettings);
|
11767 |
-
break;
|
11768 |
-
case 'svg':
|
11769 |
-
this.renderer = new SVGRenderer(this, params.rendererSettings);
|
11770 |
-
break;
|
11771 |
-
default:
|
11772 |
-
this.renderer = new HybridRenderer(this, params.rendererSettings);
|
11773 |
-
break;
|
11774 |
-
}
|
11775 |
-
this.renderer.setProjectInterface(this.projectInterface);
|
11776 |
-
this.animType = animType;
|
11777 |
-
|
11778 |
-
if (params.loop === '' || params.loop === null) { } else if (params.loop === false) {
|
11779 |
-
this.loop = false;
|
11780 |
-
} else if (params.loop === true) {
|
11781 |
-
this.loop = true;
|
11782 |
-
} else {
|
11783 |
-
this.loop = parseInt(params.loop);
|
11784 |
-
}
|
11785 |
-
this.autoplay = 'autoplay' in params ? params.autoplay : true;
|
11786 |
-
this.name = params.name ? params.name : '';
|
11787 |
-
this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments : true;
|
11788 |
-
this.assetsPath = params.assetsPath;
|
11789 |
-
if (params.animationData) {
|
11790 |
-
this.configAnimation(params.animationData);
|
11791 |
-
} else if (params.path) {
|
11792 |
-
|
11793 |
-
if (params.path.lastIndexOf('\\') !== -1) {
|
11794 |
-
this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
|
11795 |
-
} else {
|
11796 |
-
this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
|
11797 |
-
}
|
11798 |
-
this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
|
11799 |
-
this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
|
11800 |
-
|
11801 |
-
assetLoader.load(params.path, this.configAnimation.bind(this), function () {
|
11802 |
-
this.trigger('data_failed');
|
11803 |
-
}.bind(this));
|
11804 |
-
}
|
11805 |
-
|
11806 |
-
this.initialSegment = params.initialSegment;
|
11807 |
-
};
|
11808 |
-
|
11809 |
-
AnimationItem.prototype.setData = function (wrapper, animationData) {
|
11810 |
-
var params = {
|
11811 |
-
wrapper: wrapper,
|
11812 |
-
animationData: animationData ? (typeof animationData === "object") ? animationData : JSON.parse(animationData) : null
|
11813 |
-
};
|
11814 |
-
var wrapperAttributes = wrapper.attributes;
|
11815 |
-
|
11816 |
-
params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value : wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
|
11817 |
-
params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value : wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
|
11818 |
-
|
11819 |
-
var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value : wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value : wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
|
11820 |
-
if (loop === '') { } else if (loop === 'false') {
|
11821 |
-
params.loop = false;
|
11822 |
-
} else if (loop === 'true') {
|
11823 |
-
params.loop = true;
|
11824 |
-
} else {
|
11825 |
-
params.loop = parseInt(loop);
|
11826 |
-
}
|
11827 |
-
var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value : wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value : wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
|
11828 |
-
params.autoplay = autoplay !== "false";
|
11829 |
-
|
11830 |
-
params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value : wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value : '';
|
11831 |
-
var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value : wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value : wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
|
11832 |
-
|
11833 |
-
if (prerender === 'false') {
|
11834 |
-
params.prerender = false;
|
11835 |
-
}
|
11836 |
-
this.setParams(params);
|
11837 |
-
};
|
11838 |
-
|
11839 |
-
AnimationItem.prototype.includeLayers = function (data) {
|
11840 |
-
if (data.op > this.animationData.op) {
|
11841 |
-
this.animationData.op = data.op;
|
11842 |
-
this.totalFrames = Math.floor(data.op - this.animationData.ip);
|
11843 |
-
}
|
11844 |
-
var layers = this.animationData.layers;
|
11845 |
-
var i, len = layers.length;
|
11846 |
-
var newLayers = data.layers;
|
11847 |
-
var j, jLen = newLayers.length;
|
11848 |
-
for (j = 0; j < jLen; j += 1) {
|
11849 |
-
i = 0;
|
11850 |
-
while (i < len) {
|
11851 |
-
if (layers[i].id == newLayers[j].id) {
|
11852 |
-
layers[i] = newLayers[j];
|
11853 |
-
break;
|
11854 |
-
}
|
11855 |
-
i += 1;
|
11856 |
-
}
|
11857 |
-
}
|
11858 |
-
if (data.chars || data.fonts) {
|
11859 |
-
this.renderer.globalData.fontManager.addChars(data.chars);
|
11860 |
-
this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
|
11861 |
-
}
|
11862 |
-
if (data.assets) {
|
11863 |
-
len = data.assets.length;
|
11864 |
-
for (i = 0; i < len; i += 1) {
|
11865 |
-
this.animationData.assets.push(data.assets[i]);
|
11866 |
-
}
|
11867 |
-
}
|
11868 |
-
this.animationData.__complete = false;
|
11869 |
-
dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
|
11870 |
-
this.renderer.includeLayers(data.layers);
|
11871 |
-
if (expressionsPlugin) {
|
11872 |
-
expressionsPlugin.initExpressions(this);
|
11873 |
-
}
|
11874 |
-
this.loadNextSegment();
|
11875 |
-
};
|
11876 |
-
|
11877 |
-
AnimationItem.prototype.loadNextSegment = function () {
|
11878 |
-
var segments = this.animationData.segments;
|
11879 |
-
if (!segments || segments.length === 0 || !this.autoloadSegments) {
|
11880 |
-
this.trigger('data_ready');
|
11881 |
-
this.timeCompleted = this.totalFrames;
|
11882 |
-
return;
|
11883 |
-
}
|
11884 |
-
var segment = segments.shift();
|
11885 |
-
this.timeCompleted = segment.time * this.frameRate;
|
11886 |
-
var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
|
11887 |
-
this.segmentPos += 1;
|
11888 |
-
assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
|
11889 |
-
this.trigger('data_failed');
|
11890 |
-
}.bind(this));
|
11891 |
-
};
|
11892 |
-
|
11893 |
-
AnimationItem.prototype.loadSegments = function () {
|
11894 |
-
var segments = this.animationData.segments;
|
11895 |
-
if (!segments) {
|
11896 |
-
this.timeCompleted = this.totalFrames;
|
11897 |
-
}
|
11898 |
-
this.loadNextSegment();
|
11899 |
-
};
|
11900 |
-
|
11901 |
-
AnimationItem.prototype.imagesLoaded = function () {
|
11902 |
-
this.trigger('loaded_images');
|
11903 |
-
this.checkLoaded()
|
11904 |
-
}
|
11905 |
-
|
11906 |
-
AnimationItem.prototype.preloadImages = function () {
|
11907 |
-
this.imagePreloader.setAssetsPath(this.assetsPath);
|
11908 |
-
this.imagePreloader.setPath(this.path);
|
11909 |
-
this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
|
11910 |
-
}
|
11911 |
-
|
11912 |
-
AnimationItem.prototype.configAnimation = function (animData) {
|
11913 |
-
if (!this.renderer) {
|
11914 |
-
return;
|
11915 |
-
}
|
11916 |
-
try {
|
11917 |
-
this.animationData = animData;
|
11918 |
-
|
11919 |
-
if (this.initialSegment) {
|
11920 |
-
this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
|
11921 |
-
this.firstFrame = Math.round(this.initialSegment[0]);
|
11922 |
-
} else {
|
11923 |
-
this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
|
11924 |
-
this.firstFrame = Math.round(this.animationData.ip);
|
11925 |
-
}
|
11926 |
-
this.renderer.configAnimation(animData);
|
11927 |
-
if (!animData.assets) {
|
11928 |
-
animData.assets = [];
|
11929 |
-
}
|
11930 |
-
|
11931 |
-
this.assets = this.animationData.assets;
|
11932 |
-
this.frameRate = this.animationData.fr;
|
11933 |
-
this.frameMult = this.animationData.fr / 1000;
|
11934 |
-
this.renderer.searchExtraCompositions(animData.assets);
|
11935 |
-
this.trigger('config_ready');
|
11936 |
-
this.preloadImages();
|
11937 |
-
this.loadSegments();
|
11938 |
-
this.updaFrameModifier();
|
11939 |
-
this.waitForFontsLoaded();
|
11940 |
-
} catch (error) {
|
11941 |
-
this.triggerConfigError(error);
|
11942 |
-
}
|
11943 |
-
};
|
11944 |
-
|
11945 |
-
AnimationItem.prototype.waitForFontsLoaded = function () {
|
11946 |
-
if (!this.renderer) {
|
11947 |
-
return;
|
11948 |
-
}
|
11949 |
-
if (this.renderer.globalData.fontManager.loaded()) {
|
11950 |
-
this.checkLoaded();
|
11951 |
-
} else {
|
11952 |
-
setTimeout(this.waitForFontsLoaded.bind(this), 20);
|
11953 |
-
}
|
11954 |
-
}
|
11955 |
-
|
11956 |
-
AnimationItem.prototype.checkLoaded = function () {
|
11957 |
-
if (!this.isLoaded && this.renderer.globalData.fontManager.loaded() && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')) {
|
11958 |
-
this.isLoaded = true;
|
11959 |
-
dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
|
11960 |
-
if (expressionsPlugin) {
|
11961 |
-
expressionsPlugin.initExpressions(this);
|
11962 |
-
}
|
11963 |
-
this.renderer.initItems();
|
11964 |
-
setTimeout(function () {
|
11965 |
-
this.trigger('DOMLoaded');
|
11966 |
-
}.bind(this), 0);
|
11967 |
-
this.gotoFrame();
|
11968 |
-
if (this.autoplay) {
|
11969 |
-
this.play();
|
11970 |
-
}
|
11971 |
-
}
|
11972 |
-
};
|
11973 |
-
|
11974 |
-
AnimationItem.prototype.resize = function () {
|
11975 |
-
this.renderer.updateContainerSize();
|
11976 |
-
};
|
11977 |
-
|
11978 |
-
AnimationItem.prototype.setSubframe = function (flag) {
|
11979 |
-
this.subframeEnabled = flag ? true : false;
|
11980 |
-
};
|
11981 |
-
|
11982 |
-
AnimationItem.prototype.gotoFrame = function () {
|
11983 |
-
this.currentFrame = this.subframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
|
11984 |
-
|
11985 |
-
if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
|
11986 |
-
this.currentFrame = this.timeCompleted;
|
11987 |
-
}
|
11988 |
-
this.trigger('enterFrame');
|
11989 |
-
this.renderFrame();
|
11990 |
-
};
|
11991 |
-
|
11992 |
-
AnimationItem.prototype.renderFrame = function () {
|
11993 |
-
if (this.isLoaded === false) {
|
11994 |
-
return;
|
11995 |
-
}
|
11996 |
-
try {
|
11997 |
-
this.renderer.renderFrame(this.currentFrame + this.firstFrame);
|
11998 |
-
} catch (error) {
|
11999 |
-
this.triggerRenderFrameError(error);
|
12000 |
-
}
|
12001 |
-
};
|
12002 |
-
|
12003 |
-
AnimationItem.prototype.play = function (name) {
|
12004 |
-
if (name && this.name != name) {
|
12005 |
-
return;
|
12006 |
-
}
|
12007 |
-
if (this.isPaused === true) {
|
12008 |
-
this.isPaused = false;
|
12009 |
-
if (this._idle) {
|
12010 |
-
this._idle = false;
|
12011 |
-
this.trigger('_active');
|
12012 |
-
}
|
12013 |
-
}
|
12014 |
-
};
|
12015 |
-
|
12016 |
-
AnimationItem.prototype.pause = function (name) {
|
12017 |
-
if (name && this.name != name) {
|
12018 |
-
return;
|
12019 |
-
}
|
12020 |
-
if (this.isPaused === false) {
|
12021 |
-
this.isPaused = true;
|
12022 |
-
this._idle = true;
|
12023 |
-
this.trigger('_idle');
|
12024 |
-
}
|
12025 |
-
};
|
12026 |
-
|
12027 |
-
AnimationItem.prototype.togglePause = function (name) {
|
12028 |
-
if (name && this.name != name) {
|
12029 |
-
return;
|
12030 |
-
}
|
12031 |
-
if (this.isPaused === true) {
|
12032 |
-
this.play();
|
12033 |
-
} else {
|
12034 |
-
this.pause();
|
12035 |
-
}
|
12036 |
-
};
|
12037 |
-
|
12038 |
-
AnimationItem.prototype.stop = function (name) {
|
12039 |
-
if (name && this.name != name) {
|
12040 |
-
return;
|
12041 |
-
}
|
12042 |
-
this.pause();
|
12043 |
-
this.playCount = 0;
|
12044 |
-
this._completedLoop = false;
|
12045 |
-
this.setCurrentRawFrameValue(0);
|
12046 |
-
};
|
12047 |
-
|
12048 |
-
AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
|
12049 |
-
if (name && this.name != name) {
|
12050 |
-
return;
|
12051 |
-
}
|
12052 |
-
if (isFrame) {
|
12053 |
-
this.setCurrentRawFrameValue(value);
|
12054 |
-
} else {
|
12055 |
-
this.setCurrentRawFrameValue(value * this.frameModifier);
|
12056 |
-
}
|
12057 |
-
this.pause();
|
12058 |
-
};
|
12059 |
-
|
12060 |
-
AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
|
12061 |
-
this.goToAndStop(value, isFrame, name);
|
12062 |
-
this.play();
|
12063 |
-
};
|
12064 |
-
|
12065 |
-
AnimationItem.prototype.advanceTime = function (value) {
|
12066 |
-
if (this.isPaused === true || this.isLoaded === false) {
|
12067 |
-
return;
|
12068 |
-
}
|
12069 |
-
var nextValue = this.currentRawFrame + value * this.frameModifier;
|
12070 |
-
var _isComplete = false;
|
12071 |
-
// Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
|
12072 |
-
// If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
|
12073 |
-
if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
|
12074 |
-
if (!this.loop || this.playCount === this.loop) {
|
12075 |
-
if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
|
12076 |
-
_isComplete = true;
|
12077 |
-
nextValue = this.totalFrames - 1;
|
12078 |
-
}
|
12079 |
-
} else if (nextValue >= this.totalFrames) {
|
12080 |
-
this.playCount += 1;
|
12081 |
-
if (!this.checkSegments(nextValue % this.totalFrames)) {
|
12082 |
-
this.setCurrentRawFrameValue(nextValue % this.totalFrames);
|
12083 |
-
this._completedLoop = true;
|
12084 |
-
this.trigger('loopComplete');
|
12085 |
-
}
|
12086 |
-
} else {
|
12087 |
-
this.setCurrentRawFrameValue(nextValue);
|
12088 |
-
}
|
12089 |
-
} else if (nextValue < 0) {
|
12090 |
-
if (!this.checkSegments(nextValue % this.totalFrames)) {
|
12091 |
-
if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
|
12092 |
-
this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
|
12093 |
-
if (!this._completedLoop) {
|
12094 |
-
this._completedLoop = true;
|
12095 |
-
} else {
|
12096 |
-
this.trigger('loopComplete');
|
12097 |
-
}
|
12098 |
-
} else {
|
12099 |
-
_isComplete = true;
|
12100 |
-
nextValue = 0;
|
12101 |
-
}
|
12102 |
-
}
|
12103 |
-
} else {
|
12104 |
-
this.setCurrentRawFrameValue(nextValue);
|
12105 |
-
}
|
12106 |
-
if (_isComplete) {
|
12107 |
-
this.setCurrentRawFrameValue(nextValue);
|
12108 |
-
this.pause();
|
12109 |
-
this.trigger('complete');
|
12110 |
-
}
|
12111 |
-
};
|
12112 |
-
|
12113 |
-
AnimationItem.prototype.adjustSegment = function (arr, offset) {
|
12114 |
-
this.playCount = 0;
|
12115 |
-
if (arr[1] < arr[0]) {
|
12116 |
-
if (this.frameModifier > 0) {
|
12117 |
-
if (this.playSpeed < 0) {
|
12118 |
-
this.setSpeed(-this.playSpeed);
|
12119 |
-
} else {
|
12120 |
-
this.setDirection(-1);
|
12121 |
-
}
|
12122 |
-
}
|
12123 |
-
this.timeCompleted = this.totalFrames = arr[0] - arr[1];
|
12124 |
-
this.firstFrame = arr[1];
|
12125 |
-
this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
|
12126 |
-
} else if (arr[1] > arr[0]) {
|
12127 |
-
if (this.frameModifier < 0) {
|
12128 |
-
if (this.playSpeed < 0) {
|
12129 |
-
this.setSpeed(-this.playSpeed);
|
12130 |
-
} else {
|
12131 |
-
this.setDirection(1);
|
12132 |
-
}
|
12133 |
-
}
|
12134 |
-
this.timeCompleted = this.totalFrames = arr[1] - arr[0];
|
12135 |
-
this.firstFrame = arr[0];
|
12136 |
-
this.setCurrentRawFrameValue(0.001 + offset);
|
12137 |
-
}
|
12138 |
-
this.trigger('segmentStart');
|
12139 |
-
};
|
12140 |
-
AnimationItem.prototype.setSegment = function (init, end) {
|
12141 |
-
var pendingFrame = -1;
|
12142 |
-
if (this.isPaused) {
|
12143 |
-
if (this.currentRawFrame + this.firstFrame < init) {
|
12144 |
-
pendingFrame = init;
|
12145 |
-
} else if (this.currentRawFrame + this.firstFrame > end) {
|
12146 |
-
pendingFrame = end - init;
|
12147 |
-
}
|
12148 |
-
}
|
12149 |
-
|
12150 |
-
this.firstFrame = init;
|
12151 |
-
this.timeCompleted = this.totalFrames = end - init;
|
12152 |
-
if (pendingFrame !== -1) {
|
12153 |
-
this.goToAndStop(pendingFrame, true);
|
12154 |
-
}
|
12155 |
-
};
|
12156 |
-
|
12157 |
-
AnimationItem.prototype.playSegments = function (arr, forceFlag) {
|
12158 |
-
if (forceFlag) {
|
12159 |
-
this.segments.length = 0;
|
12160 |
-
}
|
12161 |
-
if (typeof arr[0] === 'object') {
|
12162 |
-
var i, len = arr.length;
|
12163 |
-
for (i = 0; i < len; i += 1) {
|
12164 |
-
this.segments.push(arr[i]);
|
12165 |
-
}
|
12166 |
-
} else {
|
12167 |
-
this.segments.push(arr);
|
12168 |
-
}
|
12169 |
-
if (this.segments.length && forceFlag) {
|
12170 |
-
this.adjustSegment(this.segments.shift(), 0);
|
12171 |
-
}
|
12172 |
-
if (this.isPaused) {
|
12173 |
-
this.play();
|
12174 |
-
}
|
12175 |
-
};
|
12176 |
-
|
12177 |
-
AnimationItem.prototype.resetSegments = function (forceFlag) {
|
12178 |
-
this.segments.length = 0;
|
12179 |
-
this.segments.push([this.animationData.ip, this.animationData.op]);
|
12180 |
-
//this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
|
12181 |
-
if (forceFlag) {
|
12182 |
-
this.checkSegments(0);
|
12183 |
-
}
|
12184 |
-
};
|
12185 |
-
AnimationItem.prototype.checkSegments = function (offset) {
|
12186 |
-
if (this.segments.length) {
|
12187 |
-
this.adjustSegment(this.segments.shift(), offset);
|
12188 |
-
return true;
|
12189 |
-
}
|
12190 |
-
return false;
|
12191 |
-
};
|
12192 |
-
|
12193 |
-
AnimationItem.prototype.destroy = function (name) {
|
12194 |
-
if ((name && this.name != name) || !this.renderer) {
|
12195 |
-
return;
|
12196 |
-
}
|
12197 |
-
this.renderer.destroy();
|
12198 |
-
this.imagePreloader.destroy();
|
12199 |
-
this.trigger('destroy');
|
12200 |
-
this._cbs = null;
|
12201 |
-
this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
|
12202 |
-
this.renderer = null;
|
12203 |
-
};
|
12204 |
-
|
12205 |
-
AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
|
12206 |
-
this.currentRawFrame = value;
|
12207 |
-
this.gotoFrame();
|
12208 |
-
};
|
12209 |
-
|
12210 |
-
AnimationItem.prototype.setSpeed = function (val) {
|
12211 |
-
this.playSpeed = val;
|
12212 |
-
this.updaFrameModifier();
|
12213 |
-
};
|
12214 |
-
|
12215 |
-
AnimationItem.prototype.setDirection = function (val) {
|
12216 |
-
this.playDirection = val < 0 ? -1 : 1;
|
12217 |
-
this.updaFrameModifier();
|
12218 |
-
};
|
12219 |
-
|
12220 |
-
AnimationItem.prototype.updaFrameModifier = function () {
|
12221 |
-
this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
|
12222 |
-
};
|
12223 |
-
|
12224 |
-
AnimationItem.prototype.getPath = function () {
|
12225 |
-
return this.path;
|
12226 |
-
};
|
12227 |
-
|
12228 |
-
AnimationItem.prototype.getAssetsPath = function (assetData) {
|
12229 |
-
var path = '';
|
12230 |
-
if (assetData.e) {
|
12231 |
-
path = assetData.p;
|
12232 |
-
} else if (this.assetsPath) {
|
12233 |
-
var imagePath = assetData.p;
|
12234 |
-
if (imagePath.indexOf('images/') !== -1) {
|
12235 |
-
imagePath = imagePath.split('/')[1];
|
12236 |
-
}
|
12237 |
-
path = this.assetsPath + imagePath;
|
12238 |
-
} else {
|
12239 |
-
path = this.path;
|
12240 |
-
path += assetData.u ? assetData.u : '';
|
12241 |
-
path += assetData.p;
|
12242 |
-
}
|
12243 |
-
return path;
|
12244 |
-
};
|
12245 |
-
|
12246 |
-
AnimationItem.prototype.getAssetData = function (id) {
|
12247 |
-
var i = 0,
|
12248 |
-
len = this.assets.length;
|
12249 |
-
while (i < len) {
|
12250 |
-
if (id == this.assets[i].id) {
|
12251 |
-
return this.assets[i];
|
12252 |
-
}
|
12253 |
-
i += 1;
|
12254 |
-
}
|
12255 |
-
};
|
12256 |
-
|
12257 |
-
AnimationItem.prototype.hide = function () {
|
12258 |
-
this.renderer.hide();
|
12259 |
-
};
|
12260 |
-
|
12261 |
-
AnimationItem.prototype.show = function () {
|
12262 |
-
this.renderer.show();
|
12263 |
-
};
|
12264 |
-
|
12265 |
-
AnimationItem.prototype.getDuration = function (isFrame) {
|
12266 |
-
return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
|
12267 |
-
};
|
12268 |
-
|
12269 |
-
AnimationItem.prototype.trigger = function (name) {
|
12270 |
-
if (this._cbs && this._cbs[name]) {
|
12271 |
-
switch (name) {
|
12272 |
-
case 'enterFrame':
|
12273 |
-
this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
|
12274 |
-
break;
|
12275 |
-
case 'loopComplete':
|
12276 |
-
this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
|
12277 |
-
break;
|
12278 |
-
case 'complete':
|
12279 |
-
this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
|
12280 |
-
break;
|
12281 |
-
case 'segmentStart':
|
12282 |
-
this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
|
12283 |
-
break;
|
12284 |
-
case 'destroy':
|
12285 |
-
this.triggerEvent(name, new BMDestroyEvent(name, this));
|
12286 |
-
break;
|
12287 |
-
default:
|
12288 |
-
this.triggerEvent(name);
|
12289 |
-
}
|
12290 |
-
}
|
12291 |
-
if (name === 'enterFrame' && this.onEnterFrame) {
|
12292 |
-
this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
|
12293 |
-
}
|
12294 |
-
if (name === 'loopComplete' && this.onLoopComplete) {
|
12295 |
-
this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
|
12296 |
-
}
|
12297 |
-
if (name === 'complete' && this.onComplete) {
|
12298 |
-
this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
|
12299 |
-
}
|
12300 |
-
if (name === 'segmentStart' && this.onSegmentStart) {
|
12301 |
-
this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
|
12302 |
-
}
|
12303 |
-
if (name === 'destroy' && this.onDestroy) {
|
12304 |
-
this.onDestroy.call(this, new BMDestroyEvent(name, this));
|
12305 |
-
}
|
12306 |
-
};
|
12307 |
-
|
12308 |
-
AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
|
12309 |
-
|
12310 |
-
var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
|
12311 |
-
this.triggerEvent('error', error);
|
12312 |
-
|
12313 |
-
if (this.onError) {
|
12314 |
-
this.onError.call(this, error);
|
12315 |
-
}
|
12316 |
-
}
|
12317 |
-
|
12318 |
-
AnimationItem.prototype.triggerConfigError = function (nativeError) {
|
12319 |
-
|
12320 |
-
var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
|
12321 |
-
this.triggerEvent('error', error);
|
12322 |
-
|
12323 |
-
if (this.onError) {
|
12324 |
-
this.onError.call(this, error);
|
12325 |
-
}
|
12326 |
-
}
|
12327 |
-
var Expressions = (function () {
|
12328 |
-
var ob = {};
|
12329 |
-
ob.initExpressions = initExpressions;
|
12330 |
-
|
12331 |
-
|
12332 |
-
function initExpressions(animation) {
|
12333 |
-
|
12334 |
-
var stackCount = 0;
|
12335 |
-
var registers = [];
|
12336 |
-
|
12337 |
-
function pushExpression() {
|
12338 |
-
stackCount += 1;
|
12339 |
-
}
|
12340 |
-
|
12341 |
-
function popExpression() {
|
12342 |
-
stackCount -= 1;
|
12343 |
-
if (stackCount === 0) {
|
12344 |
-
releaseInstances();
|
12345 |
-
}
|
12346 |
-
}
|
12347 |
-
|
12348 |
-
function registerExpressionProperty(expression) {
|
12349 |
-
if (registers.indexOf(expression) === -1) {
|
12350 |
-
registers.push(expression)
|
12351 |
-
}
|
12352 |
-
}
|
12353 |
-
|
12354 |
-
function releaseInstances() {
|
12355 |
-
var i, len = registers.length;
|
12356 |
-
for (i = 0; i < len; i += 1) {
|
12357 |
-
registers[i].release();
|
12358 |
-
}
|
12359 |
-
registers.length = 0;
|
12360 |
-
}
|
12361 |
-
|
12362 |
-
animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
|
12363 |
-
animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
|
12364 |
-
animation.renderer.globalData.pushExpression = pushExpression;
|
12365 |
-
animation.renderer.globalData.popExpression = popExpression;
|
12366 |
-
animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
|
12367 |
-
}
|
12368 |
-
return ob;
|
12369 |
-
}());
|
12370 |
-
|
12371 |
-
expressionsPlugin = Expressions;
|
12372 |
-
|
12373 |
-
var ExpressionManager = (function () {
|
12374 |
-
'use strict';
|
12375 |
-
var ob = {};
|
12376 |
-
var Math = BMMath;
|
12377 |
-
var window = null;
|
12378 |
-
var document = null;
|
12379 |
-
|
12380 |
-
function $bm_isInstanceOfArray(arr) {
|
12381 |
-
return arr.constructor === Array || arr.constructor === Float32Array;
|
12382 |
-
}
|
12383 |
-
|
12384 |
-
function isNumerable(tOfV, v) {
|
12385 |
-
return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
|
12386 |
-
}
|
12387 |
-
|
12388 |
-
function $bm_neg(a) {
|
12389 |
-
var tOfA = typeof a;
|
12390 |
-
if (tOfA === 'number' || tOfA === 'boolean' || a instanceof Number) {
|
12391 |
-
return -a;
|
12392 |
-
}
|
12393 |
-
if ($bm_isInstanceOfArray(a)) {
|
12394 |
-
var i, lenA = a.length;
|
12395 |
-
var retArr = [];
|
12396 |
-
for (i = 0; i < lenA; i += 1) {
|
12397 |
-
retArr[i] = -a[i];
|
12398 |
-
}
|
12399 |
-
return retArr;
|
12400 |
-
}
|
12401 |
-
if (a.propType) {
|
12402 |
-
return a.v;
|
12403 |
-
}
|
12404 |
-
}
|
12405 |
-
|
12406 |
-
var easeInBez = BezierFactory.getBezierEasing(0.333, 0, .833, .833, 'easeIn').get;
|
12407 |
-
var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, .667, 1, 'easeOut').get;
|
12408 |
-
var easeInOutBez = BezierFactory.getBezierEasing(.33, 0, .667, 1, 'easeInOut').get;
|
12409 |
-
|
12410 |
-
function sum(a, b) {
|
12411 |
-
var tOfA = typeof a;
|
12412 |
-
var tOfB = typeof b;
|
12413 |
-
if (tOfA === 'string' || tOfB === 'string') {
|
12414 |
-
return a + b;
|
12415 |
-
}
|
12416 |
-
if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
|
12417 |
-
return a + b;
|
12418 |
-
}
|
12419 |
-
if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
|
12420 |
-
a = a.slice(0);
|
12421 |
-
a[0] = a[0] + b;
|
12422 |
-
return a;
|
12423 |
-
}
|
12424 |
-
if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
|
12425 |
-
b = b.slice(0);
|
12426 |
-
b[0] = a + b[0];
|
12427 |
-
return b;
|
12428 |
-
}
|
12429 |
-
if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
|
12430 |
-
|
12431 |
-
var i = 0,
|
12432 |
-
lenA = a.length,
|
12433 |
-
lenB = b.length;
|
12434 |
-
var retArr = [];
|
12435 |
-
while (i < lenA || i < lenB) {
|
12436 |
-
if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
|
12437 |
-
retArr[i] = a[i] + b[i];
|
12438 |
-
} else {
|
12439 |
-
retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
|
12440 |
-
}
|
12441 |
-
i += 1;
|
12442 |
-
}
|
12443 |
-
return retArr;
|
12444 |
-
}
|
12445 |
-
return 0;
|
12446 |
-
}
|
12447 |
-
var add = sum;
|
12448 |
-
|
12449 |
-
function sub(a, b) {
|
12450 |
-
var tOfA = typeof a;
|
12451 |
-
var tOfB = typeof b;
|
12452 |
-
if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
|
12453 |
-
if (tOfA === 'string') {
|
12454 |
-
a = parseInt(a);
|
12455 |
-
}
|
12456 |
-
if (tOfB === 'string') {
|
12457 |
-
b = parseInt(b);
|
12458 |
-
}
|
12459 |
-
return a - b;
|
12460 |
-
}
|
12461 |
-
if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
|
12462 |
-
a = a.slice(0);
|
12463 |
-
a[0] = a[0] - b;
|
12464 |
-
return a;
|
12465 |
-
}
|
12466 |
-
if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
|
12467 |
-
b = b.slice(0);
|
12468 |
-
b[0] = a - b[0];
|
12469 |
-
return b;
|
12470 |
-
}
|
12471 |
-
if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
|
12472 |
-
var i = 0,
|
12473 |
-
lenA = a.length,
|
12474 |
-
lenB = b.length;
|
12475 |
-
var retArr = [];
|
12476 |
-
while (i < lenA || i < lenB) {
|
12477 |
-
if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
|
12478 |
-
retArr[i] = a[i] - b[i];
|
12479 |
-
} else {
|
12480 |
-
retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
|
12481 |
-
}
|
12482 |
-
i += 1;
|
12483 |
-
}
|
12484 |
-
return retArr;
|
12485 |
-
}
|
12486 |
-
return 0;
|
12487 |
-
}
|
12488 |
-
|
12489 |
-
function mul(a, b) {
|
12490 |
-
var tOfA = typeof a;
|
12491 |
-
var tOfB = typeof b;
|
12492 |
-
var arr;
|
12493 |
-
if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
|
12494 |
-
return a * b;
|
12495 |
-
}
|
12496 |
-
|
12497 |
-
var i, len;
|
12498 |
-
if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
|
12499 |
-
len = a.length;
|
12500 |
-
arr = createTypedArray('float32', len);
|
12501 |
-
for (i = 0; i < len; i += 1) {
|
12502 |
-
arr[i] = a[i] * b;
|
12503 |
-
}
|
12504 |
-
return arr;
|
12505 |
-
}
|
12506 |
-
if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
|
12507 |
-
len = b.length;
|
12508 |
-
arr = createTypedArray('float32', len);
|
12509 |
-
for (i = 0; i < len; i += 1) {
|
12510 |
-
arr[i] = a * b[i];
|
12511 |
-
}
|
12512 |
-
return arr;
|
12513 |
-
}
|
12514 |
-
return 0;
|
12515 |
-
}
|
12516 |
-
|
12517 |
-
function div(a, b) {
|
12518 |
-
var tOfA = typeof a;
|
12519 |
-
var tOfB = typeof b;
|
12520 |
-
var arr;
|
12521 |
-
if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
|
12522 |
-
return a / b;
|
12523 |
-
}
|
12524 |
-
var i, len;
|
12525 |
-
if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
|
12526 |
-
len = a.length;
|
12527 |
-
arr = createTypedArray('float32', len);
|
12528 |
-
for (i = 0; i < len; i += 1) {
|
12529 |
-
arr[i] = a[i] / b;
|
12530 |
-
}
|
12531 |
-
return arr;
|
12532 |
-
}
|
12533 |
-
if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
|
12534 |
-
len = b.length;
|
12535 |
-
arr = createTypedArray('float32', len);
|
12536 |
-
for (i = 0; i < len; i += 1) {
|
12537 |
-
arr[i] = a / b[i];
|
12538 |
-
}
|
12539 |
-
return arr;
|
12540 |
-
}
|
12541 |
-
return 0;
|
12542 |
-
}
|
12543 |
-
|
12544 |
-
function mod(a, b) {
|
12545 |
-
if (typeof a === 'string') {
|
12546 |
-
a = parseInt(a);
|
12547 |
-
}
|
12548 |
-
if (typeof b === 'string') {
|
12549 |
-
b = parseInt(b);
|
12550 |
-
}
|
12551 |
-
return a % b;
|
12552 |
-
}
|
12553 |
-
var $bm_sum = sum;
|
12554 |
-
var $bm_sub = sub;
|
12555 |
-
var $bm_mul = mul;
|
12556 |
-
var $bm_div = div;
|
12557 |
-
var $bm_mod = mod;
|
12558 |
-
|
12559 |
-
function clamp(num, min, max) {
|
12560 |
-
if (min > max) {
|
12561 |
-
var mm = max;
|
12562 |
-
max = min;
|
12563 |
-
min = mm;
|
12564 |
-
}
|
12565 |
-
return Math.min(Math.max(num, min), max);
|
12566 |
-
}
|
12567 |
-
|
12568 |
-
function radiansToDegrees(val) {
|
12569 |
-
return val / degToRads;
|
12570 |
-
}
|
12571 |
-
var radians_to_degrees = radiansToDegrees;
|
12572 |
-
|
12573 |
-
function degreesToRadians(val) {
|
12574 |
-
return val * degToRads;
|
12575 |
-
}
|
12576 |
-
var degrees_to_radians = radiansToDegrees;
|
12577 |
-
|
12578 |
-
var helperLengthArray = [0, 0, 0, 0, 0, 0];
|
12579 |
-
|
12580 |
-
function length(arr1, arr2) {
|
12581 |
-
if (typeof arr1 === 'number' || arr1 instanceof Number) {
|
12582 |
-
arr2 = arr2 || 0;
|
12583 |
-
return Math.abs(arr1 - arr2);
|
12584 |
-
}
|
12585 |
-
if (!arr2) {
|
12586 |
-
arr2 = helperLengthArray;
|
12587 |
-
}
|
12588 |
-
var i, len = Math.min(arr1.length, arr2.length);
|
12589 |
-
var addedLength = 0;
|
12590 |
-
for (i = 0; i < len; i += 1) {
|
12591 |
-
addedLength += Math.pow(arr2[i] - arr1[i], 2);
|
12592 |
-
}
|
12593 |
-
return Math.sqrt(addedLength);
|
12594 |
-
}
|
12595 |
-
|
12596 |
-
function normalize(vec) {
|
12597 |
-
return div(vec, length(vec));
|
12598 |
-
}
|
12599 |
-
|
12600 |
-
function rgbToHsl(val) {
|
12601 |
-
var r = val[0];
|
12602 |
-
var g = val[1];
|
12603 |
-
var b = val[2];
|
12604 |
-
var max = Math.max(r, g, b),
|
12605 |
-
min = Math.min(r, g, b);
|
12606 |
-
var h, s, l = (max + min) / 2;
|
12607 |
-
|
12608 |
-
if (max == min) {
|
12609 |
-
h = s = 0; // achromatic
|
12610 |
-
} else {
|
12611 |
-
var d = max - min;
|
12612 |
-
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
12613 |
-
switch (max) {
|
12614 |
-
case r:
|
12615 |
-
h = (g - b) / d + (g < b ? 6 : 0);
|
12616 |
-
break;
|
12617 |
-
case g:
|
12618 |
-
h = (b - r) / d + 2;
|
12619 |
-
break;
|
12620 |
-
case b:
|
12621 |
-
h = (r - g) / d + 4;
|
12622 |
-
break;
|
12623 |
-
}
|
12624 |
-
h /= 6;
|
12625 |
-
}
|
12626 |
-
|
12627 |
-
return [h, s, l, val[3]];
|
12628 |
-
}
|
12629 |
-
|
12630 |
-
function hue2rgb(p, q, t) {
|
12631 |
-
if (t < 0) t += 1;
|
12632 |
-
if (t > 1) t -= 1;
|
12633 |
-
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
12634 |
-
if (t < 1 / 2) return q;
|
12635 |
-
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
12636 |
-
return p;
|
12637 |
-
}
|
12638 |
-
|
12639 |
-
function hslToRgb(val) {
|
12640 |
-
var h = val[0];
|
12641 |
-
var s = val[1];
|
12642 |
-
var l = val[2];
|
12643 |
-
|
12644 |
-
var r, g, b;
|
12645 |
-
|
12646 |
-
if (s === 0) {
|
12647 |
-
r = g = b = l; // achromatic
|
12648 |
-
} else {
|
12649 |
-
|
12650 |
-
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
12651 |
-
var p = 2 * l - q;
|
12652 |
-
r = hue2rgb(p, q, h + 1 / 3);
|
12653 |
-
g = hue2rgb(p, q, h);
|
12654 |
-
b = hue2rgb(p, q, h - 1 / 3);
|
12655 |
-
}
|
12656 |
-
|
12657 |
-
return [r, g, b, val[3]];
|
12658 |
-
}
|
12659 |
-
|
12660 |
-
function linear(t, tMin, tMax, value1, value2) {
|
12661 |
-
if (value1 === undefined || value2 === undefined) {
|
12662 |
-
value1 = tMin;
|
12663 |
-
value2 = tMax;
|
12664 |
-
tMin = 0;
|
12665 |
-
tMax = 1;
|
12666 |
-
}
|
12667 |
-
if (tMax < tMin) {
|
12668 |
-
var _tMin = tMax;
|
12669 |
-
tMax = tMin;
|
12670 |
-
tMin = _tMin;
|
12671 |
-
}
|
12672 |
-
if (t <= tMin) {
|
12673 |
-
return value1;
|
12674 |
-
} else if (t >= tMax) {
|
12675 |
-
return value2;
|
12676 |
-
}
|
12677 |
-
var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin);
|
12678 |
-
if (!value1.length) {
|
12679 |
-
return value1 + (value2 - value1) * perc;
|
12680 |
-
}
|
12681 |
-
var i, len = value1.length;
|
12682 |
-
var arr = createTypedArray('float32', len);
|
12683 |
-
for (i = 0; i < len; i += 1) {
|
12684 |
-
arr[i] = value1[i] + (value2[i] - value1[i]) * perc;
|
12685 |
-
}
|
12686 |
-
return arr;
|
12687 |
-
}
|
12688 |
-
|
12689 |
-
function random(min, max) {
|
12690 |
-
if (max === undefined) {
|
12691 |
-
if (min === undefined) {
|
12692 |
-
min = 0;
|
12693 |
-
max = 1;
|
12694 |
-
} else {
|
12695 |
-
max = min;
|
12696 |
-
min = undefined;
|
12697 |
-
}
|
12698 |
-
}
|
12699 |
-
if (max.length) {
|
12700 |
-
var i, len = max.length;
|
12701 |
-
if (!min) {
|
12702 |
-
min = createTypedArray('float32', len);
|
12703 |
-
}
|
12704 |
-
var arr = createTypedArray('float32', len);
|
12705 |
-
var rnd = BMMath.random();
|
12706 |
-
for (i = 0; i < len; i += 1) {
|
12707 |
-
arr[i] = min[i] + rnd * (max[i] - min[i]);
|
12708 |
-
}
|
12709 |
-
return arr;
|
12710 |
-
}
|
12711 |
-
if (min === undefined) {
|
12712 |
-
min = 0;
|
12713 |
-
}
|
12714 |
-
var rndm = BMMath.random();
|
12715 |
-
return min + rndm * (max - min);
|
12716 |
-
}
|
12717 |
-
|
12718 |
-
function createPath(points, inTangents, outTangents, closed) {
|
12719 |
-
var i, len = points.length;
|
12720 |
-
var path = shape_pool.newElement();
|
12721 |
-
path.setPathData(!!closed, len);
|
12722 |
-
var arrPlaceholder = [0, 0],
|
12723 |
-
inVertexPoint, outVertexPoint;
|
12724 |
-
for (i = 0; i < len; i += 1) {
|
12725 |
-
inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
|
12726 |
-
outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
|
12727 |
-
path.setTripleAt(points[i][0], points[i][1], outVertexPoint[0] + points[i][0], outVertexPoint[1] + points[i][1], inVertexPoint[0] + points[i][0], inVertexPoint[1] + points[i][1], i, true);
|
12728 |
-
}
|
12729 |
-
return path;
|
12730 |
-
}
|
12731 |
-
|
12732 |
-
function initiateExpression(elem, data, property) {
|
12733 |
-
var val = data.x;
|
12734 |
-
var needsVelocity = /velocity(?![\w\d])/.test(val);
|
12735 |
-
var _needsRandom = val.indexOf('random') !== -1;
|
12736 |
-
var elemType = elem.data.ty;
|
12737 |
-
var transform, $bm_transform, content, effect;
|
12738 |
-
var thisProperty = property;
|
12739 |
-
thisProperty.valueAtTime = thisProperty.getValueAtTime;
|
12740 |
-
Object.defineProperty(thisProperty, 'value', {
|
12741 |
-
get: function () {
|
12742 |
-
return thisProperty.v
|
12743 |
-
}
|
12744 |
-
})
|
12745 |
-
elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate;
|
12746 |
-
elem.comp.displayStartTime = 0;
|
12747 |
-
var inPoint = elem.data.ip / elem.comp.globalData.frameRate;
|
12748 |
-
var outPoint = elem.data.op / elem.comp.globalData.frameRate;
|
12749 |
-
var width = elem.data.sw ? elem.data.sw : 0;
|
12750 |
-
var height = elem.data.sh ? elem.data.sh : 0;
|
12751 |
-
var name = elem.data.nm;
|
12752 |
-
var loopIn, loop_in, loopOut, loop_out, smooth;
|
12753 |
-
var toWorld, fromWorld, fromComp, toComp, fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp, mask, valueAtTime, velocityAtTime;
|
12754 |
-
var __expression_functions = [];
|
12755 |
-
if (data.xf) {
|
12756 |
-
var i, len = data.xf.length;
|
12757 |
-
for (i = 0; i < len; i += 1) {
|
12758 |
-
__expression_functions[i] = eval('(function(){ return ' + data.xf[i] + '}())');
|
12759 |
-
}
|
12760 |
-
}
|
12761 |
-
|
12762 |
-
var scoped_bm_rt;
|
12763 |
-
var expression_function = eval('[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}' + ']')[0];
|
12764 |
-
var numKeys = property.kf ? data.k.length : 0;
|
12765 |
-
|
12766 |
-
var active = !this.data || this.data.hd !== true;
|
12767 |
-
|
12768 |
-
var wiggle = function wiggle(freq, amp) {
|
12769 |
-
var i, j, len = this.pv.length ? this.pv.length : 1;
|
12770 |
-
var addedAmps = createTypedArray('float32', len);
|
12771 |
-
freq = 5;
|
12772 |
-
var iterations = Math.floor(time * freq);
|
12773 |
-
i = 0;
|
12774 |
-
j = 0;
|
12775 |
-
while (i < iterations) {
|
12776 |
-
//var rnd = BMMath.random();
|
12777 |
-
for (j = 0; j < len; j += 1) {
|
12778 |
-
addedAmps[j] += -amp + amp * 2 * BMMath.random();
|
12779 |
-
//addedAmps[j] += -amp + amp*2*rnd;
|
12780 |
-
}
|
12781 |
-
i += 1;
|
12782 |
-
}
|
12783 |
-
//var rnd2 = BMMath.random();
|
12784 |
-
var periods = time * freq;
|
12785 |
-
var perc = periods - Math.floor(periods);
|
12786 |
-
var arr = createTypedArray('float32', len);
|
12787 |
-
if (len > 1) {
|
12788 |
-
for (j = 0; j < len; j += 1) {
|
12789 |
-
arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp * 2 * BMMath.random()) * perc;
|
12790 |
-
//arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp*2*rnd)*perc;
|
12791 |
-
//arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
|
12792 |
-
}
|
12793 |
-
return arr;
|
12794 |
-
} else {
|
12795 |
-
return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc;
|
12796 |
-
}
|
12797 |
-
}.bind(this);
|
12798 |
-
|
12799 |
-
if (thisProperty.loopIn) {
|
12800 |
-
loopIn = thisProperty.loopIn.bind(thisProperty);
|
12801 |
-
loop_in = loopIn;
|
12802 |
-
}
|
12803 |
-
|
12804 |
-
if (thisProperty.loopOut) {
|
12805 |
-
loopOut = thisProperty.loopOut.bind(thisProperty);
|
12806 |
-
loop_out = loopOut;
|
12807 |
-
}
|
12808 |
-
|
12809 |
-
if (thisProperty.smooth) {
|
12810 |
-
smooth = thisProperty.smooth.bind(thisProperty);
|
12811 |
-
}
|
12812 |
-
|
12813 |
-
function loopInDuration(type, duration) {
|
12814 |
-
return loopIn(type, duration, true);
|
12815 |
-
}
|
12816 |
-
|
12817 |
-
function loopOutDuration(type, duration) {
|
12818 |
-
return loopOut(type, duration, true);
|
12819 |
-
}
|
12820 |
-
|
12821 |
-
if (this.getValueAtTime) {
|
12822 |
-
valueAtTime = this.getValueAtTime.bind(this);
|
12823 |
-
}
|
12824 |
-
|
12825 |
-
if (this.getVelocityAtTime) {
|
12826 |
-
velocityAtTime = this.getVelocityAtTime.bind(this);
|
12827 |
-
}
|
12828 |
-
|
12829 |
-
var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
|
12830 |
-
|
12831 |
-
function lookAt(elem1, elem2) {
|
12832 |
-
var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]];
|
12833 |
-
var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads;
|
12834 |
-
var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads;
|
12835 |
-
return [yaw, pitch, 0];
|
12836 |
-
}
|
12837 |
-
|
12838 |
-
function easeOut(t, tMin, tMax, val1, val2) {
|
12839 |
-
return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
|
12840 |
-
}
|
12841 |
-
|
12842 |
-
function easeIn(t, tMin, tMax, val1, val2) {
|
12843 |
-
return applyEase(easeInBez, t, tMin, tMax, val1, val2);
|
12844 |
-
}
|
12845 |
-
|
12846 |
-
function ease(t, tMin, tMax, val1, val2) {
|
12847 |
-
return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
|
12848 |
-
}
|
12849 |
-
|
12850 |
-
function applyEase(fn, t, tMin, tMax, val1, val2) {
|
12851 |
-
if (val1 === undefined) {
|
12852 |
-
val1 = tMin;
|
12853 |
-
val2 = tMax;
|
12854 |
-
} else {
|
12855 |
-
t = (t - tMin) / (tMax - tMin);
|
12856 |
-
}
|
12857 |
-
t = t > 1 ? 1 : t < 0 ? 0 : t;
|
12858 |
-
var mult = fn(t);
|
12859 |
-
if ($bm_isInstanceOfArray(val1)) {
|
12860 |
-
var i, len = val1.length;
|
12861 |
-
var arr = createTypedArray('float32', len);
|
12862 |
-
for (i = 0; i < len; i += 1) {
|
12863 |
-
arr[i] = (val2[i] - val1[i]) * mult + val1[i];
|
12864 |
-
}
|
12865 |
-
return arr;
|
12866 |
-
} else {
|
12867 |
-
return (val2 - val1) * mult + val1;
|
12868 |
-
}
|
12869 |
-
}
|
12870 |
-
|
12871 |
-
function nearestKey(time) {
|
12872 |
-
var i, len = data.k.length,
|
12873 |
-
index, keyTime;
|
12874 |
-
if (!data.k.length || typeof (data.k[0]) === 'number') {
|
12875 |
-
index = 0;
|
12876 |
-
keyTime = 0;
|
12877 |
-
} else {
|
12878 |
-
index = -1;
|
12879 |
-
time *= elem.comp.globalData.frameRate;
|
12880 |
-
if (time < data.k[0].t) {
|
12881 |
-
index = 1;
|
12882 |
-
keyTime = data.k[0].t;
|
12883 |
-
} else {
|
12884 |
-
for (i = 0; i < len - 1; i += 1) {
|
12885 |
-
if (time === data.k[i].t) {
|
12886 |
-
index = i + 1;
|
12887 |
-
keyTime = data.k[i].t;
|
12888 |
-
break;
|
12889 |
-
} else if (time > data.k[i].t && time < data.k[i + 1].t) {
|
12890 |
-
if (time - data.k[i].t > data.k[i + 1].t - time) {
|
12891 |
-
index = i + 2;
|
12892 |
-
keyTime = data.k[i + 1].t;
|
12893 |
-
} else {
|
12894 |
-
index = i + 1;
|
12895 |
-
keyTime = data.k[i].t;
|
12896 |
-
}
|
12897 |
-
break;
|
12898 |
-
}
|
12899 |
-
}
|
12900 |
-
if (index === -1) {
|
12901 |
-
index = i + 1;
|
12902 |
-
keyTime = data.k[i].t;
|
12903 |
-
}
|
12904 |
-
}
|
12905 |
-
|
12906 |
-
}
|
12907 |
-
var ob = {};
|
12908 |
-
ob.index = index;
|
12909 |
-
ob.time = keyTime / elem.comp.globalData.frameRate;
|
12910 |
-
return ob;
|
12911 |
-
}
|
12912 |
-
|
12913 |
-
function key(ind) {
|
12914 |
-
var ob, i, len;
|
12915 |
-
if (!data.k.length || typeof (data.k[0]) === 'number') {
|
12916 |
-
throw new Error('The property has no keyframe at index ' + ind);
|
12917 |
-
}
|
12918 |
-
ind -= 1;
|
12919 |
-
ob = {
|
12920 |
-
time: data.k[ind].t / elem.comp.globalData.frameRate,
|
12921 |
-
value: []
|
12922 |
-
};
|
12923 |
-
var arr = data.k[ind].hasOwnProperty('s') ? data.k[ind].s : data.k[ind - 1].e;
|
12924 |
-
|
12925 |
-
len = arr.length;
|
12926 |
-
for (i = 0; i < len; i += 1) {
|
12927 |
-
ob[i] = arr[i];
|
12928 |
-
ob.value[i] = arr[i]
|
12929 |
-
}
|
12930 |
-
return ob;
|
12931 |
-
}
|
12932 |
-
|
12933 |
-
function framesToTime(frames, fps) {
|
12934 |
-
if (!fps) {
|
12935 |
-
fps = elem.comp.globalData.frameRate;
|
12936 |
-
}
|
12937 |
-
return frames / fps;
|
12938 |
-
}
|
12939 |
-
|
12940 |
-
function timeToFrames(t, fps) {
|
12941 |
-
if (!t && t !== 0) {
|
12942 |
-
t = time;
|
12943 |
-
}
|
12944 |
-
if (!fps) {
|
12945 |
-
fps = elem.comp.globalData.frameRate;
|
12946 |
-
}
|
12947 |
-
return t * fps;
|
12948 |
-
}
|
12949 |
-
|
12950 |
-
function seedRandom(seed) {
|
12951 |
-
BMMath.seedrandom(randSeed + seed);
|
12952 |
-
}
|
12953 |
-
|
12954 |
-
function sourceRectAtTime() {
|
12955 |
-
return elem.sourceRectAtTime();
|
12956 |
-
}
|
12957 |
-
|
12958 |
-
function substring(init, end) {
|
12959 |
-
if (typeof value === 'string') {
|
12960 |
-
if (end === undefined) {
|
12961 |
-
return value.substring(init)
|
12962 |
-
}
|
12963 |
-
return value.substring(init, end)
|
12964 |
-
}
|
12965 |
-
return '';
|
12966 |
-
}
|
12967 |
-
|
12968 |
-
function substr(init, end) {
|
12969 |
-
if (typeof value === 'string') {
|
12970 |
-
if (end === undefined) {
|
12971 |
-
return value.substr(init)
|
12972 |
-
}
|
12973 |
-
return value.substr(init, end)
|
12974 |
-
}
|
12975 |
-
return '';
|
12976 |
-
}
|
12977 |
-
|
12978 |
-
function posterizeTime(framesPerSecond) {
|
12979 |
-
time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond
|
12980 |
-
value = valueAtTime(time)
|
12981 |
-
}
|
12982 |
-
|
12983 |
-
var time, velocity, value, text, textIndex, textTotal, selectorValue;
|
12984 |
-
var index = elem.data.ind;
|
12985 |
-
var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
|
12986 |
-
var parent;
|
12987 |
-
var randSeed = Math.floor(Math.random() * 1000000);
|
12988 |
-
var globalData = elem.globalData;
|
12989 |
-
|
12990 |
-
function executeExpression(_value) {
|
12991 |
-
// globalData.pushExpression();
|
12992 |
-
value = _value;
|
12993 |
-
if (_needsRandom) {
|
12994 |
-
seedRandom(randSeed);
|
12995 |
-
}
|
12996 |
-
if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
|
12997 |
-
return value;
|
12998 |
-
}
|
12999 |
-
if (this.propType === 'textSelector') {
|
13000 |
-
textIndex = this.textIndex;
|
13001 |
-
textTotal = this.textTotal;
|
13002 |
-
selectorValue = this.selectorValue;
|
13003 |
-
}
|
13004 |
-
if (!thisLayer) {
|
13005 |
-
text = elem.layerInterface.text;
|
13006 |
-
thisLayer = elem.layerInterface;
|
13007 |
-
thisComp = elem.comp.compInterface;
|
13008 |
-
toWorld = thisLayer.toWorld.bind(thisLayer);
|
13009 |
-
fromWorld = thisLayer.fromWorld.bind(thisLayer);
|
13010 |
-
fromComp = thisLayer.fromComp.bind(thisLayer);
|
13011 |
-
toComp = thisLayer.toComp.bind(thisLayer);
|
13012 |
-
mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
|
13013 |
-
fromCompToSurface = fromComp;
|
13014 |
-
}
|
13015 |
-
if (!transform) {
|
13016 |
-
transform = elem.layerInterface("ADBE Transform Group");
|
13017 |
-
$bm_transform = transform;
|
13018 |
-
if (transform) {
|
13019 |
-
anchorPoint = transform.anchorPoint;
|
13020 |
-
/*position = transform.position;
|
13021 |
-
rotation = transform.rotation;
|
13022 |
-
scale = transform.scale;*/
|
13023 |
-
}
|
13024 |
-
}
|
13025 |
-
|
13026 |
-
if (elemType === 4 && !content) {
|
13027 |
-
content = thisLayer("ADBE Root Vectors Group");
|
13028 |
-
}
|
13029 |
-
if (!effect) {
|
13030 |
-
effect = thisLayer(4);
|
13031 |
-
}
|
13032 |
-
hasParent = !!(elem.hierarchy && elem.hierarchy.length);
|
13033 |
-
if (hasParent && !parent) {
|
13034 |
-
parent = elem.hierarchy[0].layerInterface;
|
13035 |
-
}
|
13036 |
-
time = this.comp.renderedFrame / this.comp.globalData.frameRate;
|
13037 |
-
if (needsVelocity) {
|
13038 |
-
velocity = velocityAtTime(time);
|
13039 |
-
}
|
13040 |
-
expression_function();
|
13041 |
-
this.frameExpressionId = elem.globalData.frameId;
|
13042 |
-
|
13043 |
-
|
13044 |
-
//TODO: Check if it's possible to return on ShapeInterface the .v value
|
13045 |
-
if (scoped_bm_rt.propType === "shape") {
|
13046 |
-
scoped_bm_rt = scoped_bm_rt.v;
|
13047 |
-
}
|
13048 |
-
// globalData.popExpression();
|
13049 |
-
return scoped_bm_rt;
|
13050 |
-
}
|
13051 |
-
return executeExpression;
|
13052 |
-
}
|
13053 |
-
|
13054 |
-
ob.initiateExpression = initiateExpression;
|
13055 |
-
return ob;
|
13056 |
-
}());
|
13057 |
-
var expressionHelpers = (function () {
|
13058 |
-
|
13059 |
-
function searchExpressions(elem, data, prop) {
|
13060 |
-
if (data.x) {
|
13061 |
-
prop.k = true;
|
13062 |
-
prop.x = true;
|
13063 |
-
prop.initiateExpression = ExpressionManager.initiateExpression;
|
13064 |
-
prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop));
|
13065 |
-
}
|
13066 |
-
}
|
13067 |
-
|
13068 |
-
function getValueAtTime(frameNum) {
|
13069 |
-
frameNum *= this.elem.globalData.frameRate;
|
13070 |
-
frameNum -= this.offsetTime;
|
13071 |
-
if (frameNum !== this._cachingAtTime.lastFrame) {
|
13072 |
-
this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
|
13073 |
-
this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
|
13074 |
-
this._cachingAtTime.lastFrame = frameNum;
|
13075 |
-
}
|
13076 |
-
return this._cachingAtTime.value;
|
13077 |
-
|
13078 |
-
}
|
13079 |
-
|
13080 |
-
function getSpeedAtTime(frameNum) {
|
13081 |
-
var delta = -0.01;
|
13082 |
-
var v1 = this.getValueAtTime(frameNum);
|
13083 |
-
var v2 = this.getValueAtTime(frameNum + delta);
|
13084 |
-
var speed = 0;
|
13085 |
-
if (v1.length) {
|
13086 |
-
var i;
|
13087 |
-
for (i = 0; i < v1.length; i += 1) {
|
13088 |
-
speed += Math.pow(v2[i] - v1[i], 2);
|
13089 |
-
}
|
13090 |
-
speed = Math.sqrt(speed) * 100;
|
13091 |
-
} else {
|
13092 |
-
speed = 0;
|
13093 |
-
}
|
13094 |
-
return speed;
|
13095 |
-
}
|
13096 |
-
|
13097 |
-
function getVelocityAtTime(frameNum) {
|
13098 |
-
if (this.vel !== undefined) {
|
13099 |
-
return this.vel;
|
13100 |
-
}
|
13101 |
-
var delta = -0.001;
|
13102 |
-
//frameNum += this.elem.data.st;
|
13103 |
-
var v1 = this.getValueAtTime(frameNum);
|
13104 |
-
var v2 = this.getValueAtTime(frameNum + delta);
|
13105 |
-
var velocity;
|
13106 |
-
if (v1.length) {
|
13107 |
-
velocity = createTypedArray('float32', v1.length);
|
13108 |
-
var i;
|
13109 |
-
for (i = 0; i < v1.length; i += 1) {
|
13110 |
-
//removing frameRate
|
13111 |
-
//if needed, don't add it here
|
13112 |
-
//velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
|
13113 |
-
velocity[i] = (v2[i] - v1[i]) / delta;
|
13114 |
-
}
|
13115 |
-
} else {
|
13116 |
-
velocity = (v2 - v1) / delta;
|
13117 |
-
}
|
13118 |
-
return velocity;
|
13119 |
-
}
|
13120 |
-
|
13121 |
-
function getStaticValueAtTime() {
|
13122 |
-
return this.pv;
|
13123 |
-
}
|
13124 |
-
|
13125 |
-
function setGroupProperty(propertyGroup) {
|
13126 |
-
this.propertyGroup = propertyGroup;
|
13127 |
-
}
|
13128 |
-
|
13129 |
-
return {
|
13130 |
-
searchExpressions: searchExpressions,
|
13131 |
-
getSpeedAtTime: getSpeedAtTime,
|
13132 |
-
getVelocityAtTime: getVelocityAtTime,
|
13133 |
-
getValueAtTime: getValueAtTime,
|
13134 |
-
getStaticValueAtTime: getStaticValueAtTime,
|
13135 |
-
setGroupProperty: setGroupProperty,
|
13136 |
-
}
|
13137 |
-
}());
|
13138 |
-
(function addPropertyDecorator() {
|
13139 |
-
|
13140 |
-
function loopOut(type, duration, durationFlag) {
|
13141 |
-
if (!this.k || !this.keyframes) {
|
13142 |
-
return this.pv;
|
13143 |
-
}
|
13144 |
-
type = type ? type.toLowerCase() : '';
|
13145 |
-
var currentFrame = this.comp.renderedFrame;
|
13146 |
-
var keyframes = this.keyframes;
|
13147 |
-
var lastKeyFrame = keyframes[keyframes.length - 1].t;
|
13148 |
-
if (currentFrame <= lastKeyFrame) {
|
13149 |
-
return this.pv;
|
13150 |
-
} else {
|
13151 |
-
var cycleDuration, firstKeyFrame;
|
13152 |
-
if (!durationFlag) {
|
13153 |
-
if (!duration || duration > keyframes.length - 1) {
|
13154 |
-
duration = keyframes.length - 1;
|
13155 |
-
}
|
13156 |
-
firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
|
13157 |
-
cycleDuration = lastKeyFrame - firstKeyFrame;
|
13158 |
-
} else {
|
13159 |
-
if (!duration) {
|
13160 |
-
cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip);
|
13161 |
-
} else {
|
13162 |
-
cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate * duration);
|
13163 |
-
}
|
13164 |
-
firstKeyFrame = lastKeyFrame - cycleDuration;
|
13165 |
-
}
|
13166 |
-
var i, len, ret;
|
13167 |
-
if (type === 'pingpong') {
|
13168 |
-
var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
|
13169 |
-
if (iterations % 2 !== 0) {
|
13170 |
-
return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0);
|
13171 |
-
}
|
13172 |
-
} else if (type === 'offset') {
|
13173 |
-
var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
|
13174 |
-
var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
|
13175 |
-
var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0);
|
13176 |
-
var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
|
13177 |
-
if (this.pv.length) {
|
13178 |
-
ret = new Array(initV.length);
|
13179 |
-
len = ret.length;
|
13180 |
-
for (i = 0; i < len; i += 1) {
|
13181 |
-
ret[i] = (endV[i] - initV[i]) * repeats + current[i];
|
13182 |
-
}
|
13183 |
-
return ret;
|
13184 |
-
}
|
13185 |
-
return (endV - initV) * repeats + current;
|
13186 |
-
} else if (type === 'continue') {
|
13187 |
-
var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
|
13188 |
-
var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
|
13189 |
-
if (this.pv.length) {
|
13190 |
-
ret = new Array(lastValue.length);
|
13191 |
-
len = ret.length;
|
13192 |
-
for (i = 0; i < len; i += 1) {
|
13193 |
-
ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005;
|
13194 |
-
}
|
13195 |
-
return ret;
|
13196 |
-
}
|
13197 |
-
return lastValue + (lastValue - nextLastValue) * (((currentFrame - lastKeyFrame)) / 0.001);
|
13198 |
-
}
|
13199 |
-
return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0);
|
13200 |
-
}
|
13201 |
-
}
|
13202 |
-
|
13203 |
-
function loopIn(type, duration, durationFlag) {
|
13204 |
-
if (!this.k) {
|
13205 |
-
return this.pv;
|
13206 |
-
}
|
13207 |
-
type = type ? type.toLowerCase() : '';
|
13208 |
-
var currentFrame = this.comp.renderedFrame;
|
13209 |
-
var keyframes = this.keyframes;
|
13210 |
-
var firstKeyFrame = keyframes[0].t;
|
13211 |
-
if (currentFrame >= firstKeyFrame) {
|
13212 |
-
return this.pv;
|
13213 |
-
} else {
|
13214 |
-
var cycleDuration, lastKeyFrame;
|
13215 |
-
if (!durationFlag) {
|
13216 |
-
if (!duration || duration > keyframes.length - 1) {
|
13217 |
-
duration = keyframes.length - 1;
|
13218 |
-
}
|
13219 |
-
lastKeyFrame = keyframes[duration].t;
|
13220 |
-
cycleDuration = lastKeyFrame - firstKeyFrame;
|
13221 |
-
} else {
|
13222 |
-
if (!duration) {
|
13223 |
-
cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame);
|
13224 |
-
} else {
|
13225 |
-
cycleDuration = Math.abs(elem.comp.globalData.frameRate * duration);
|
13226 |
-
}
|
13227 |
-
lastKeyFrame = firstKeyFrame + cycleDuration;
|
13228 |
-
}
|
13229 |
-
var i, len, ret;
|
13230 |
-
if (type === 'pingpong') {
|
13231 |
-
var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration);
|
13232 |
-
if (iterations % 2 === 0) {
|
13233 |
-
return this.getValueAtTime((((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0);
|
13234 |
-
}
|
13235 |
-
} else if (type === 'offset') {
|
13236 |
-
var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
|
13237 |
-
var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
|
13238 |
-
var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0);
|
13239 |
-
var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1;
|
13240 |
-
if (this.pv.length) {
|
13241 |
-
ret = new Array(initV.length);
|
13242 |
-
len = ret.length;
|
13243 |
-
for (i = 0; i < len; i += 1) {
|
13244 |
-
ret[i] = current[i] - (endV[i] - initV[i]) * repeats;
|
13245 |
-
}
|
13246 |
-
return ret;
|
13247 |
-
}
|
13248 |
-
return current - (endV - initV) * repeats;
|
13249 |
-
} else if (type === 'continue') {
|
13250 |
-
var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
|
13251 |
-
var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
|
13252 |
-
if (this.pv.length) {
|
13253 |
-
ret = new Array(firstValue.length);
|
13254 |
-
len = ret.length;
|
13255 |
-
for (i = 0; i < len; i += 1) {
|
13256 |
-
ret[i] = firstValue[i] + (firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame) / 0.001;
|
13257 |
-
}
|
13258 |
-
return ret;
|
13259 |
-
}
|
13260 |
-
return firstValue + (firstValue - nextFirstValue) * (firstKeyFrame - currentFrame) / 0.001;
|
13261 |
-
}
|
13262 |
-
return this.getValueAtTime(((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0);
|
13263 |
-
}
|
13264 |
-
}
|
13265 |
-
|
13266 |
-
function smooth(width, samples) {
|
13267 |
-
if (!this.k) {
|
13268 |
-
return this.pv;
|
13269 |
-
}
|
13270 |
-
width = (width || 0.4) * 0.5;
|
13271 |
-
samples = Math.floor(samples || 5);
|
13272 |
-
if (samples <= 1) {
|
13273 |
-
return this.pv;
|
13274 |
-
}
|
13275 |
-
var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
|
13276 |
-
var initFrame = currentTime - width;
|
13277 |
-
var endFrame = currentTime + width;
|
13278 |
-
var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
|
13279 |
-
var i = 0,
|
13280 |
-
j = 0;
|
13281 |
-
var value;
|
13282 |
-
if (this.pv.length) {
|
13283 |
-
value = createTypedArray('float32', this.pv.length);
|
13284 |
-
} else {
|
13285 |
-
value = 0;
|
13286 |
-
}
|
13287 |
-
var sampleValue;
|
13288 |
-
while (i < samples) {
|
13289 |
-
sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
|
13290 |
-
if (this.pv.length) {
|
13291 |
-
for (j = 0; j < this.pv.length; j += 1) {
|
13292 |
-
value[j] += sampleValue[j];
|
13293 |
-
}
|
13294 |
-
} else {
|
13295 |
-
value += sampleValue;
|
13296 |
-
}
|
13297 |
-
i += 1;
|
13298 |
-
}
|
13299 |
-
if (this.pv.length) {
|
13300 |
-
for (j = 0; j < this.pv.length; j += 1) {
|
13301 |
-
value[j] /= samples;
|
13302 |
-
}
|
13303 |
-
} else {
|
13304 |
-
value /= samples;
|
13305 |
-
}
|
13306 |
-
return value;
|
13307 |
-
}
|
13308 |
-
|
13309 |
-
function getValueAtTime(frameNum) {
|
13310 |
-
frameNum *= this.elem.globalData.frameRate;
|
13311 |
-
frameNum -= this.offsetTime;
|
13312 |
-
if (frameNum !== this._cachingAtTime.lastFrame) {
|
13313 |
-
this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
|
13314 |
-
this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
|
13315 |
-
this._cachingAtTime.lastFrame = frameNum;
|
13316 |
-
}
|
13317 |
-
return this._cachingAtTime.value;
|
13318 |
-
|
13319 |
-
}
|
13320 |
-
|
13321 |
-
function getTransformValueAtTime(time) {
|
13322 |
-
console.warn('Transform at time not supported');
|
13323 |
-
}
|
13324 |
-
|
13325 |
-
function getTransformStaticValueAtTime(time) {
|
13326 |
-
|
13327 |
-
}
|
13328 |
-
|
13329 |
-
var getTransformProperty = TransformPropertyFactory.getTransformProperty;
|
13330 |
-
TransformPropertyFactory.getTransformProperty = function (elem, data, container) {
|
13331 |
-
var prop = getTransformProperty(elem, data, container);
|
13332 |
-
if (prop.dynamicProperties.length) {
|
13333 |
-
prop.getValueAtTime = getTransformValueAtTime.bind(prop);
|
13334 |
-
} else {
|
13335 |
-
prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
|
13336 |
-
}
|
13337 |
-
prop.setGroupProperty = expressionHelpers.setGroupProperty;
|
13338 |
-
return prop;
|
13339 |
-
};
|
13340 |
-
|
13341 |
-
var propertyGetProp = PropertyFactory.getProp;
|
13342 |
-
PropertyFactory.getProp = function (elem, data, type, mult, container) {
|
13343 |
-
var prop = propertyGetProp(elem, data, type, mult, container);
|
13344 |
-
//prop.getVelocityAtTime = getVelocityAtTime;
|
13345 |
-
//prop.loopOut = loopOut;
|
13346 |
-
//prop.loopIn = loopIn;
|
13347 |
-
if (prop.kf) {
|
13348 |
-
prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
|
13349 |
-
} else {
|
13350 |
-
prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
|
13351 |
-
}
|
13352 |
-
prop.setGroupProperty = expressionHelpers.setGroupProperty;
|
13353 |
-
prop.loopOut = loopOut;
|
13354 |
-
prop.loopIn = loopIn;
|
13355 |
-
prop.smooth = smooth;
|
13356 |
-
prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
|
13357 |
-
prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
|
13358 |
-
prop.numKeys = data.a === 1 ? data.k.length : 0;
|
13359 |
-
prop.propertyIndex = data.ix;
|
13360 |
-
var value = 0;
|
13361 |
-
if (type !== 0) {
|
13362 |
-
value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);
|
13363 |
-
}
|
13364 |
-
prop._cachingAtTime = {
|
13365 |
-
lastFrame: initialDefaultFrame,
|
13366 |
-
lastIndex: 0,
|
13367 |
-
value: value
|
13368 |
-
};
|
13369 |
-
expressionHelpers.searchExpressions(elem, data, prop);
|
13370 |
-
if (prop.k) {
|
13371 |
-
container.addDynamicProperty(prop);
|
13372 |
-
}
|
13373 |
-
|
13374 |
-
return prop;
|
13375 |
-
};
|
13376 |
-
|
13377 |
-
function getShapeValueAtTime(frameNum) {
|
13378 |
-
//For now this caching object is created only when needed instead of creating it when the shape is initialized.
|
13379 |
-
if (!this._cachingAtTime) {
|
13380 |
-
this._cachingAtTime = {
|
13381 |
-
shapeValue: shape_pool.clone(this.pv),
|
13382 |
-
lastIndex: 0,
|
13383 |
-
lastTime: initialDefaultFrame
|
13384 |
-
};
|
13385 |
-
}
|
13386 |
-
|
13387 |
-
frameNum *= this.elem.globalData.frameRate;
|
13388 |
-
frameNum -= this.offsetTime;
|
13389 |
-
if (frameNum !== this._cachingAtTime.lastTime) {
|
13390 |
-
this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
|
13391 |
-
this._cachingAtTime.lastTime = frameNum;
|
13392 |
-
this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
|
13393 |
-
}
|
13394 |
-
return this._cachingAtTime.shapeValue;
|
13395 |
-
}
|
13396 |
-
|
13397 |
-
var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
|
13398 |
-
var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
|
13399 |
-
|
13400 |
-
function ShapeExpressions() { }
|
13401 |
-
ShapeExpressions.prototype = {
|
13402 |
-
vertices: function (prop, time) {
|
13403 |
-
if (this.k) {
|
13404 |
-
this.getValue();
|
13405 |
-
}
|
13406 |
-
var shapePath = this.v;
|
13407 |
-
if (time !== undefined) {
|
13408 |
-
shapePath = this.getValueAtTime(time, 0);
|
13409 |
-
}
|
13410 |
-
var i, len = shapePath._length;
|
13411 |
-
var vertices = shapePath[prop];
|
13412 |
-
var points = shapePath.v;
|
13413 |
-
var arr = createSizedArray(len);
|
13414 |
-
for (i = 0; i < len; i += 1) {
|
13415 |
-
if (prop === 'i' || prop === 'o') {
|
13416 |
-
arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
|
13417 |
-
} else {
|
13418 |
-
arr[i] = [vertices[i][0], vertices[i][1]];
|
13419 |
-
}
|
13420 |
-
|
13421 |
-
}
|
13422 |
-
return arr;
|
13423 |
-
},
|
13424 |
-
points: function (time) {
|
13425 |
-
return this.vertices('v', time);
|
13426 |
-
},
|
13427 |
-
inTangents: function (time) {
|
13428 |
-
return this.vertices('i', time);
|
13429 |
-
},
|
13430 |
-
outTangents: function (time) {
|
13431 |
-
return this.vertices('o', time);
|
13432 |
-
},
|
13433 |
-
isClosed: function () {
|
13434 |
-
return this.v.c;
|
13435 |
-
},
|
13436 |
-
pointOnPath: function (perc, time) {
|
13437 |
-
var shapePath = this.v;
|
13438 |
-
if (time !== undefined) {
|
13439 |
-
shapePath = this.getValueAtTime(time, 0);
|
13440 |
-
}
|
13441 |
-
if (!this._segmentsLength) {
|
13442 |
-
this._segmentsLength = bez.getSegmentsLength(shapePath);
|
13443 |
-
}
|
13444 |
-
|
13445 |
-
var segmentsLength = this._segmentsLength;
|
13446 |
-
var lengths = segmentsLength.lengths;
|
13447 |
-
var lengthPos = segmentsLength.totalLength * perc;
|
13448 |
-
var i = 0,
|
13449 |
-
len = lengths.length;
|
13450 |
-
var j = 0,
|
13451 |
-
jLen;
|
13452 |
-
var accumulatedLength = 0,
|
13453 |
-
pt;
|
13454 |
-
while (i < len) {
|
13455 |
-
if (accumulatedLength + lengths[i].addedLength > lengthPos) {
|
13456 |
-
var initIndex = i;
|
13457 |
-
var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
|
13458 |
-
var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength;
|
13459 |
-
pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
|
13460 |
-
break;
|
13461 |
-
} else {
|
13462 |
-
accumulatedLength += lengths[i].addedLength;
|
13463 |
-
}
|
13464 |
-
i += 1;
|
13465 |
-
}
|
13466 |
-
if (!pt) {
|
13467 |
-
pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]];
|
13468 |
-
}
|
13469 |
-
return pt;
|
13470 |
-
},
|
13471 |
-
vectorOnPath: function (perc, time, vectorType) {
|
13472 |
-
//perc doesn't use triple equality because it can be a Number object as well as a primitive.
|
13473 |
-
perc = perc == 1 ? this.v.c ? 0 : 0.999 : perc;
|
13474 |
-
var pt1 = this.pointOnPath(perc, time);
|
13475 |
-
var pt2 = this.pointOnPath(perc + 0.001, time);
|
13476 |
-
var xLength = pt2[0] - pt1[0];
|
13477 |
-
var yLength = pt2[1] - pt1[1];
|
13478 |
-
var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2));
|
13479 |
-
if (magnitude === 0) {
|
13480 |
-
return [0, 0];
|
13481 |
-
}
|
13482 |
-
var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude];
|
13483 |
-
return unitVector;
|
13484 |
-
},
|
13485 |
-
tangentOnPath: function (perc, time) {
|
13486 |
-
return this.vectorOnPath(perc, time, 'tangent');
|
13487 |
-
},
|
13488 |
-
normalOnPath: function (perc, time) {
|
13489 |
-
return this.vectorOnPath(perc, time, 'normal');
|
13490 |
-
},
|
13491 |
-
setGroupProperty: expressionHelpers.setGroupProperty,
|
13492 |
-
getValueAtTime: expressionHelpers.getStaticValueAtTime
|
13493 |
-
};
|
13494 |
-
extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
|
13495 |
-
extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
|
13496 |
-
KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
|
13497 |
-
KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
|
13498 |
-
|
13499 |
-
var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
|
13500 |
-
ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) {
|
13501 |
-
var prop = propertyGetShapeProp(elem, data, type, arr, trims);
|
13502 |
-
prop.propertyIndex = data.ix;
|
13503 |
-
prop.lock = false;
|
13504 |
-
if (type === 3) {
|
13505 |
-
expressionHelpers.searchExpressions(elem, data.pt, prop);
|
13506 |
-
} else if (type === 4) {
|
13507 |
-
expressionHelpers.searchExpressions(elem, data.ks, prop);
|
13508 |
-
}
|
13509 |
-
if (prop.k) {
|
13510 |
-
elem.addDynamicProperty(prop);
|
13511 |
-
}
|
13512 |
-
return prop;
|
13513 |
-
};
|
13514 |
-
}());
|
13515 |
-
(function addDecorator() {
|
13516 |
-
|
13517 |
-
function searchExpressions() {
|
13518 |
-
if (this.data.d.x) {
|
13519 |
-
this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this);
|
13520 |
-
this.addEffect(this.getExpressionValue.bind(this));
|
13521 |
-
return true;
|
13522 |
-
}
|
13523 |
-
}
|
13524 |
-
|
13525 |
-
TextProperty.prototype.getExpressionValue = function (currentValue, text) {
|
13526 |
-
var newValue = this.calculateExpression(text);
|
13527 |
-
if (currentValue.t !== newValue) {
|
13528 |
-
var newData = {};
|
13529 |
-
this.copyData(newData, currentValue);
|
13530 |
-
newData.t = newValue.toString();
|
13531 |
-
newData.__complete = false;
|
13532 |
-
return newData;
|
13533 |
-
}
|
13534 |
-
return currentValue;
|
13535 |
-
}
|
13536 |
-
|
13537 |
-
TextProperty.prototype.searchProperty = function () {
|
13538 |
-
|
13539 |
-
var isKeyframed = this.searchKeyframes();
|
13540 |
-
var hasExpressions = this.searchExpressions();
|
13541 |
-
this.kf = isKeyframed || hasExpressions;
|
13542 |
-
return this.kf;
|
13543 |
-
};
|
13544 |
-
|
13545 |
-
TextProperty.prototype.searchExpressions = searchExpressions;
|
13546 |
-
|
13547 |
-
}());
|
13548 |
-
var ShapeExpressionInterface = (function () {
|
13549 |
-
|
13550 |
-
function iterateElements(shapes, view, propertyGroup) {
|
13551 |
-
var arr = [];
|
13552 |
-
var i, len = shapes ? shapes.length : 0;
|
13553 |
-
for (i = 0; i < len; i += 1) {
|
13554 |
-
if (shapes[i].ty == 'gr') {
|
13555 |
-
arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13556 |
-
} else if (shapes[i].ty == 'fl') {
|
13557 |
-
arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13558 |
-
} else if (shapes[i].ty == 'st') {
|
13559 |
-
arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13560 |
-
} else if (shapes[i].ty == 'tm') {
|
13561 |
-
arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13562 |
-
} else if (shapes[i].ty == 'tr') {
|
13563 |
-
//arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13564 |
-
} else if (shapes[i].ty == 'el') {
|
13565 |
-
arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13566 |
-
} else if (shapes[i].ty == 'sr') {
|
13567 |
-
arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13568 |
-
} else if (shapes[i].ty == 'sh') {
|
13569 |
-
arr.push(pathInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13570 |
-
} else if (shapes[i].ty == 'rc') {
|
13571 |
-
arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13572 |
-
} else if (shapes[i].ty == 'rd') {
|
13573 |
-
arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13574 |
-
} else if (shapes[i].ty == 'rp') {
|
13575 |
-
arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup));
|
13576 |
-
}
|
13577 |
-
}
|
13578 |
-
return arr;
|
13579 |
-
}
|
13580 |
-
|
13581 |
-
function contentsInterfaceFactory(shape, view, propertyGroup) {
|
13582 |
-
var interfaces;
|
13583 |
-
var interfaceFunction = function _interfaceFunction(value) {
|
13584 |
-
var i = 0,
|
13585 |
-
len = interfaces.length;
|
13586 |
-
while (i < len) {
|
13587 |
-
if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) {
|
13588 |
-
return interfaces[i];
|
13589 |
-
}
|
13590 |
-
i += 1;
|
13591 |
-
}
|
13592 |
-
if (typeof value === 'number') {
|
13593 |
-
return interfaces[value - 1];
|
13594 |
-
}
|
13595 |
-
};
|
13596 |
-
interfaceFunction.propertyGroup = function (val) {
|
13597 |
-
if (val === 1) {
|
13598 |
-
return interfaceFunction;
|
13599 |
-
} else {
|
13600 |
-
return propertyGroup(val - 1);
|
13601 |
-
}
|
13602 |
-
};
|
13603 |
-
interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
|
13604 |
-
interfaceFunction.numProperties = interfaces.length;
|
13605 |
-
interfaceFunction.propertyIndex = shape.cix;
|
13606 |
-
interfaceFunction._name = shape.nm;
|
13607 |
-
|
13608 |
-
return interfaceFunction;
|
13609 |
-
}
|
13610 |
-
|
13611 |
-
function groupInterfaceFactory(shape, view, propertyGroup) {
|
13612 |
-
var interfaceFunction = function _interfaceFunction(value) {
|
13613 |
-
switch (value) {
|
13614 |
-
case 'ADBE Vectors Group':
|
13615 |
-
case 'Contents':
|
13616 |
-
case 2:
|
13617 |
-
return interfaceFunction.content;
|
13618 |
-
//Not necessary for now. Keeping them here in case a new case appears
|
13619 |
-
//case 'ADBE Vector Transform Group':
|
13620 |
-
//case 3:
|
13621 |
-
default:
|
13622 |
-
return interfaceFunction.transform;
|
13623 |
-
}
|
13624 |
-
};
|
13625 |
-
interfaceFunction.propertyGroup = function (val) {
|
13626 |
-
if (val === 1) {
|
13627 |
-
return interfaceFunction;
|
13628 |
-
} else {
|
13629 |
-
return propertyGroup(val - 1);
|
13630 |
-
}
|
13631 |
-
};
|
13632 |
-
var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup);
|
13633 |
-
var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
|
13634 |
-
interfaceFunction.content = content;
|
13635 |
-
interfaceFunction.transform = transformInterface;
|
13636 |
-
Object.defineProperty(interfaceFunction, '_name', {
|
13637 |
-
get: function () {
|
13638 |
-
return shape.nm;
|
13639 |
-
}
|
13640 |
-
});
|
13641 |
-
//interfaceFunction.content = interfaceFunction;
|
13642 |
-
interfaceFunction.numProperties = shape.np;
|
13643 |
-
interfaceFunction.propertyIndex = shape.ix;
|
13644 |
-
interfaceFunction.nm = shape.nm;
|
13645 |
-
interfaceFunction.mn = shape.mn;
|
13646 |
-
return interfaceFunction;
|
13647 |
-
}
|
13648 |
-
|
13649 |
-
function fillInterfaceFactory(shape, view, propertyGroup) {
|
13650 |
-
function interfaceFunction(val) {
|
13651 |
-
if (val === 'Color' || val === 'color') {
|
13652 |
-
return interfaceFunction.color;
|
13653 |
-
} else if (val === 'Opacity' || val === 'opacity') {
|
13654 |
-
return interfaceFunction.opacity;
|
13655 |
-
}
|
13656 |
-
}
|
13657 |
-
Object.defineProperties(interfaceFunction, {
|
13658 |
-
'color': {
|
13659 |
-
get: ExpressionPropertyInterface(view.c)
|
13660 |
-
},
|
13661 |
-
'opacity': {
|
13662 |
-
get: ExpressionPropertyInterface(view.o)
|
13663 |
-
},
|
13664 |
-
'_name': {
|
13665 |
-
value: shape.nm
|
13666 |
-
},
|
13667 |
-
'mn': {
|
13668 |
-
value: shape.mn
|
13669 |
-
}
|
13670 |
-
});
|
13671 |
-
|
13672 |
-
view.c.setGroupProperty(propertyGroup);
|
13673 |
-
view.o.setGroupProperty(propertyGroup);
|
13674 |
-
return interfaceFunction;
|
13675 |
-
}
|
13676 |
-
|
13677 |
-
function strokeInterfaceFactory(shape, view, propertyGroup) {
|
13678 |
-
function _propertyGroup(val) {
|
13679 |
-
if (val === 1) {
|
13680 |
-
return ob;
|
13681 |
-
} else {
|
13682 |
-
return propertyGroup(val - 1);
|
13683 |
-
}
|
13684 |
-
}
|
13685 |
-
|
13686 |
-
function _dashPropertyGroup(val) {
|
13687 |
-
if (val === 1) {
|
13688 |
-
return dashOb;
|
13689 |
-
} else {
|
13690 |
-
return _propertyGroup(val - 1);
|
13691 |
-
}
|
13692 |
-
}
|
13693 |
-
|
13694 |
-
function addPropertyToDashOb(i) {
|
13695 |
-
Object.defineProperty(dashOb, shape.d[i].nm, {
|
13696 |
-
get: ExpressionPropertyInterface(view.d.dataProps[i].p)
|
13697 |
-
});
|
13698 |
-
}
|
13699 |
-
var i, len = shape.d ? shape.d.length : 0;
|
13700 |
-
var dashOb = {};
|
13701 |
-
for (i = 0; i < len; i += 1) {
|
13702 |
-
addPropertyToDashOb(i);
|
13703 |
-
view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
|
13704 |
-
}
|
13705 |
-
|
13706 |
-
function interfaceFunction(val) {
|
13707 |
-
if (val === 'Color' || val === 'color') {
|
13708 |
-
return interfaceFunction.color;
|
13709 |
-
} else if (val === 'Opacity' || val === 'opacity') {
|
13710 |
-
return interfaceFunction.opacity;
|
13711 |
-
} else if (val === 'Stroke Width' || val === 'stroke width') {
|
13712 |
-
return interfaceFunction.strokeWidth;
|
13713 |
-
}
|
13714 |
-
}
|
13715 |
-
Object.defineProperties(interfaceFunction, {
|
13716 |
-
'color': {
|
13717 |
-
get: ExpressionPropertyInterface(view.c)
|
13718 |
-
},
|
13719 |
-
'opacity': {
|
13720 |
-
get: ExpressionPropertyInterface(view.o)
|
13721 |
-
},
|
13722 |
-
'strokeWidth': {
|
13723 |
-
get: ExpressionPropertyInterface(view.w)
|
13724 |
-
},
|
13725 |
-
'dash': {
|
13726 |
-
get: function () {
|
13727 |
-
return dashOb;
|
13728 |
-
}
|
13729 |
-
},
|
13730 |
-
'_name': {
|
13731 |
-
value: shape.nm
|
13732 |
-
},
|
13733 |
-
'mn': {
|
13734 |
-
value: shape.mn
|
13735 |
-
}
|
13736 |
-
});
|
13737 |
-
|
13738 |
-
view.c.setGroupProperty(_propertyGroup);
|
13739 |
-
view.o.setGroupProperty(_propertyGroup);
|
13740 |
-
view.w.setGroupProperty(_propertyGroup);
|
13741 |
-
return interfaceFunction;
|
13742 |
-
}
|
13743 |
-
|
13744 |
-
function trimInterfaceFactory(shape, view, propertyGroup) {
|
13745 |
-
function _propertyGroup(val) {
|
13746 |
-
if (val == 1) {
|
13747 |
-
return interfaceFunction;
|
13748 |
-
} else {
|
13749 |
-
return propertyGroup(--val);
|
13750 |
-
}
|
13751 |
-
}
|
13752 |
-
interfaceFunction.propertyIndex = shape.ix;
|
13753 |
-
|
13754 |
-
view.s.setGroupProperty(_propertyGroup);
|
13755 |
-
view.e.setGroupProperty(_propertyGroup);
|
13756 |
-
view.o.setGroupProperty(_propertyGroup);
|
13757 |
-
|
13758 |
-
function interfaceFunction(val) {
|
13759 |
-
if (val === shape.e.ix || val === 'End' || val === 'end') {
|
13760 |
-
return interfaceFunction.end;
|
13761 |
-
}
|
13762 |
-
if (val === shape.s.ix) {
|
13763 |
-
return interfaceFunction.start;
|
13764 |
-
}
|
13765 |
-
if (val === shape.o.ix) {
|
13766 |
-
return interfaceFunction.offset;
|
13767 |
-
}
|
13768 |
-
}
|
13769 |
-
interfaceFunction.propertyIndex = shape.ix;
|
13770 |
-
interfaceFunction.propertyGroup = propertyGroup;
|
13771 |
-
|
13772 |
-
Object.defineProperties(interfaceFunction, {
|
13773 |
-
'start': {
|
13774 |
-
get: ExpressionPropertyInterface(view.s)
|
13775 |
-
},
|
13776 |
-
'end': {
|
13777 |
-
get: ExpressionPropertyInterface(view.e)
|
13778 |
-
},
|
13779 |
-
'offset': {
|
13780 |
-
get: ExpressionPropertyInterface(view.o)
|
13781 |
-
},
|
13782 |
-
'_name': {
|
13783 |
-
value: shape.nm
|
13784 |
-
}
|
13785 |
-
});
|
13786 |
-
interfaceFunction.mn = shape.mn;
|
13787 |
-
return interfaceFunction;
|
13788 |
-
}
|
13789 |
-
|
13790 |
-
function transformInterfaceFactory(shape, view, propertyGroup) {
|
13791 |
-
function _propertyGroup(val) {
|
13792 |
-
if (val == 1) {
|
13793 |
-
return interfaceFunction;
|
13794 |
-
} else {
|
13795 |
-
return propertyGroup(--val);
|
13796 |
-
}
|
13797 |
-
}
|
13798 |
-
view.transform.mProps.o.setGroupProperty(_propertyGroup);
|
13799 |
-
view.transform.mProps.p.setGroupProperty(_propertyGroup);
|
13800 |
-
view.transform.mProps.a.setGroupProperty(_propertyGroup);
|
13801 |
-
view.transform.mProps.s.setGroupProperty(_propertyGroup);
|
13802 |
-
view.transform.mProps.r.setGroupProperty(_propertyGroup);
|
13803 |
-
if (view.transform.mProps.sk) {
|
13804 |
-
view.transform.mProps.sk.setGroupProperty(_propertyGroup);
|
13805 |
-
view.transform.mProps.sa.setGroupProperty(_propertyGroup);
|
13806 |
-
}
|
13807 |
-
view.transform.op.setGroupProperty(_propertyGroup);
|
13808 |
-
|
13809 |
-
function interfaceFunction(value) {
|
13810 |
-
if (shape.a.ix === value || value === 'Anchor Point') {
|
13811 |
-
return interfaceFunction.anchorPoint;
|
13812 |
-
}
|
13813 |
-
if (shape.o.ix === value || value === 'Opacity') {
|
13814 |
-
return interfaceFunction.opacity;
|
13815 |
-
}
|
13816 |
-
if (shape.p.ix === value || value === 'Position') {
|
13817 |
-
return interfaceFunction.position;
|
13818 |
-
}
|
13819 |
-
if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') {
|
13820 |
-
return interfaceFunction.rotation;
|
13821 |
-
}
|
13822 |
-
if (shape.s.ix === value || value === 'Scale') {
|
13823 |
-
return interfaceFunction.scale;
|
13824 |
-
}
|
13825 |
-
if (shape.sk && shape.sk.ix === value || value === 'Skew') {
|
13826 |
-
return interfaceFunction.skew;
|
13827 |
-
}
|
13828 |
-
if (shape.sa && shape.sa.ix === value || value === 'Skew Axis') {
|
13829 |
-
return interfaceFunction.skewAxis;
|
13830 |
-
}
|
13831 |
-
|
13832 |
-
}
|
13833 |
-
Object.defineProperties(interfaceFunction, {
|
13834 |
-
'opacity': {
|
13835 |
-
get: ExpressionPropertyInterface(view.transform.mProps.o)
|
13836 |
-
},
|
13837 |
-
'position': {
|
13838 |
-
get: ExpressionPropertyInterface(view.transform.mProps.p)
|
13839 |
-
},
|
13840 |
-
'anchorPoint': {
|
13841 |
-
get: ExpressionPropertyInterface(view.transform.mProps.a)
|
13842 |
-
},
|
13843 |
-
'scale': {
|
13844 |
-
get: ExpressionPropertyInterface(view.transform.mProps.s)
|
13845 |
-
},
|
13846 |
-
'rotation': {
|
13847 |
-
get: ExpressionPropertyInterface(view.transform.mProps.r)
|
13848 |
-
},
|
13849 |
-
'skew': {
|
13850 |
-
get: ExpressionPropertyInterface(view.transform.mProps.sk)
|
13851 |
-
},
|
13852 |
-
'skewAxis': {
|
13853 |
-
get: ExpressionPropertyInterface(view.transform.mProps.sa)
|
13854 |
-
},
|
13855 |
-
'_name': {
|
13856 |
-
value: shape.nm
|
13857 |
-
}
|
13858 |
-
});
|
13859 |
-
interfaceFunction.ty = 'tr';
|
13860 |
-
interfaceFunction.mn = shape.mn;
|
13861 |
-
interfaceFunction.propertyGroup = propertyGroup;
|
13862 |
-
return interfaceFunction;
|
13863 |
-
}
|
13864 |
-
|
13865 |
-
function ellipseInterfaceFactory(shape, view, propertyGroup) {
|
13866 |
-
function _propertyGroup(val) {
|
13867 |
-
if (val == 1) {
|
13868 |
-
return interfaceFunction;
|
13869 |
-
} else {
|
13870 |
-
return propertyGroup(--val);
|
13871 |
-
}
|
13872 |
-
}
|
13873 |
-
interfaceFunction.propertyIndex = shape.ix;
|
13874 |
-
var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
|
13875 |
-
prop.s.setGroupProperty(_propertyGroup);
|
13876 |
-
prop.p.setGroupProperty(_propertyGroup);
|
13877 |
-
|
13878 |
-
function interfaceFunction(value) {
|
13879 |
-
if (shape.p.ix === value) {
|
13880 |
-
return interfaceFunction.position;
|
13881 |
-
}
|
13882 |
-
if (shape.s.ix === value) {
|
13883 |
-
return interfaceFunction.size;
|
13884 |
-
}
|
13885 |
-
}
|
13886 |
-
|
13887 |
-
Object.defineProperties(interfaceFunction, {
|
13888 |
-
'size': {
|
13889 |
-
get: ExpressionPropertyInterface(prop.s)
|
13890 |
-
},
|
13891 |
-
'position': {
|
13892 |
-
get: ExpressionPropertyInterface(prop.p)
|
13893 |
-
},
|
13894 |
-
'_name': {
|
13895 |
-
value: shape.nm
|
13896 |
-
}
|
13897 |
-
});
|
13898 |
-
interfaceFunction.mn = shape.mn;
|
13899 |
-
return interfaceFunction;
|
13900 |
-
}
|
13901 |
-
|
13902 |
-
function starInterfaceFactory(shape, view, propertyGroup) {
|
13903 |
-
function _propertyGroup(val) {
|
13904 |
-
if (val == 1) {
|
13905 |
-
return interfaceFunction;
|
13906 |
-
} else {
|
13907 |
-
return propertyGroup(--val);
|
13908 |
-
}
|
13909 |
-
}
|
13910 |
-
var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
|
13911 |
-
interfaceFunction.propertyIndex = shape.ix;
|
13912 |
-
prop.or.setGroupProperty(_propertyGroup);
|
13913 |
-
prop.os.setGroupProperty(_propertyGroup);
|
13914 |
-
prop.pt.setGroupProperty(_propertyGroup);
|
13915 |
-
prop.p.setGroupProperty(_propertyGroup);
|
13916 |
-
prop.r.setGroupProperty(_propertyGroup);
|
13917 |
-
if (shape.ir) {
|
13918 |
-
prop.ir.setGroupProperty(_propertyGroup);
|
13919 |
-
prop.is.setGroupProperty(_propertyGroup);
|
13920 |
-
}
|
13921 |
-
|
13922 |
-
function interfaceFunction(value) {
|
13923 |
-
if (shape.p.ix === value) {
|
13924 |
-
return interfaceFunction.position;
|
13925 |
-
}
|
13926 |
-
if (shape.r.ix === value) {
|
13927 |
-
return interfaceFunction.rotation;
|
13928 |
-
}
|
13929 |
-
if (shape.pt.ix === value) {
|
13930 |
-
return interfaceFunction.points;
|
13931 |
-
}
|
13932 |
-
if (shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value) {
|
13933 |
-
return interfaceFunction.outerRadius;
|
13934 |
-
}
|
13935 |
-
if (shape.os.ix === value) {
|
13936 |
-
return interfaceFunction.outerRoundness;
|
13937 |
-
}
|
13938 |
-
if (shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)) {
|
13939 |
-
return interfaceFunction.innerRadius;
|
13940 |
-
}
|
13941 |
-
if (shape.is && shape.is.ix === value) {
|
13942 |
-
return interfaceFunction.innerRoundness;
|
13943 |
-
}
|
13944 |
-
|
13945 |
-
}
|
13946 |
-
|
13947 |
-
Object.defineProperties(interfaceFunction, {
|
13948 |
-
'position': {
|
13949 |
-
get: ExpressionPropertyInterface(prop.p)
|
13950 |
-
},
|
13951 |
-
'rotation': {
|
13952 |
-
get: ExpressionPropertyInterface(prop.r)
|
13953 |
-
},
|
13954 |
-
'points': {
|
13955 |
-
get: ExpressionPropertyInterface(prop.pt)
|
13956 |
-
},
|
13957 |
-
'outerRadius': {
|
13958 |
-
get: ExpressionPropertyInterface(prop.or)
|
13959 |
-
},
|
13960 |
-
'outerRoundness': {
|
13961 |
-
get: ExpressionPropertyInterface(prop.os)
|
13962 |
-
},
|
13963 |
-
'innerRadius': {
|
13964 |
-
get: ExpressionPropertyInterface(prop.ir)
|
13965 |
-
},
|
13966 |
-
'innerRoundness': {
|
13967 |
-
get: ExpressionPropertyInterface(prop.is)
|
13968 |
-
},
|
13969 |
-
'_name': {
|
13970 |
-
value: shape.nm
|
13971 |
-
}
|
13972 |
-
});
|
13973 |
-
interfaceFunction.mn = shape.mn;
|
13974 |
-
return interfaceFunction;
|
13975 |
-
}
|
13976 |
-
|
13977 |
-
function rectInterfaceFactory(shape, view, propertyGroup) {
|
13978 |
-
function _propertyGroup(val) {
|
13979 |
-
if (val == 1) {
|
13980 |
-
return interfaceFunction;
|
13981 |
-
} else {
|
13982 |
-
return propertyGroup(--val);
|
13983 |
-
}
|
13984 |
-
}
|
13985 |
-
var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
|
13986 |
-
interfaceFunction.propertyIndex = shape.ix;
|
13987 |
-
prop.p.setGroupProperty(_propertyGroup);
|
13988 |
-
prop.s.setGroupProperty(_propertyGroup);
|
13989 |
-
prop.r.setGroupProperty(_propertyGroup);
|
13990 |
-
|
13991 |
-
function interfaceFunction(value) {
|
13992 |
-
if (shape.p.ix === value) {
|
13993 |
-
return interfaceFunction.position;
|
13994 |
-
}
|
13995 |
-
if (shape.r.ix === value) {
|
13996 |
-
return interfaceFunction.roundness;
|
13997 |
-
}
|
13998 |
-
if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') {
|
13999 |
-
return interfaceFunction.size;
|
14000 |
-
}
|
14001 |
-
|
14002 |
-
}
|
14003 |
-
Object.defineProperties(interfaceFunction, {
|
14004 |
-
'position': {
|
14005 |
-
get: ExpressionPropertyInterface(prop.p)
|
14006 |
-
},
|
14007 |
-
'roundness': {
|
14008 |
-
get: ExpressionPropertyInterface(prop.r)
|
14009 |
-
},
|
14010 |
-
'size': {
|
14011 |
-
get: ExpressionPropertyInterface(prop.s)
|
14012 |
-
},
|
14013 |
-
'_name': {
|
14014 |
-
value: shape.nm
|
14015 |
-
}
|
14016 |
-
});
|
14017 |
-
interfaceFunction.mn = shape.mn;
|
14018 |
-
return interfaceFunction;
|
14019 |
-
}
|
14020 |
-
|
14021 |
-
function roundedInterfaceFactory(shape, view, propertyGroup) {
|
14022 |
-
function _propertyGroup(val) {
|
14023 |
-
if (val == 1) {
|
14024 |
-
return interfaceFunction;
|
14025 |
-
} else {
|
14026 |
-
return propertyGroup(--val);
|
14027 |
-
}
|
14028 |
-
}
|
14029 |
-
var prop = view;
|
14030 |
-
interfaceFunction.propertyIndex = shape.ix;
|
14031 |
-
prop.rd.setGroupProperty(_propertyGroup);
|
14032 |
-
|
14033 |
-
function interfaceFunction(value) {
|
14034 |
-
if (shape.r.ix === value || 'Round Corners 1' === value) {
|
14035 |
-
return interfaceFunction.radius;
|
14036 |
-
}
|
14037 |
-
|
14038 |
-
}
|
14039 |
-
Object.defineProperties(interfaceFunction, {
|
14040 |
-
'radius': {
|
14041 |
-
get: ExpressionPropertyInterface(prop.rd)
|
14042 |
-
},
|
14043 |
-
'_name': {
|
14044 |
-
value: shape.nm
|
14045 |
-
}
|
14046 |
-
});
|
14047 |
-
interfaceFunction.mn = shape.mn;
|
14048 |
-
return interfaceFunction;
|
14049 |
-
}
|
14050 |
-
|
14051 |
-
function repeaterInterfaceFactory(shape, view, propertyGroup) {
|
14052 |
-
function _propertyGroup(val) {
|
14053 |
-
if (val == 1) {
|
14054 |
-
return interfaceFunction;
|
14055 |
-
} else {
|
14056 |
-
return propertyGroup(--val);
|
14057 |
-
}
|
14058 |
-
}
|
14059 |
-
var prop = view;
|
14060 |
-
interfaceFunction.propertyIndex = shape.ix;
|
14061 |
-
prop.c.setGroupProperty(_propertyGroup);
|
14062 |
-
prop.o.setGroupProperty(_propertyGroup);
|
14063 |
-
|
14064 |
-
function interfaceFunction(value) {
|
14065 |
-
if (shape.c.ix === value || 'Copies' === value) {
|
14066 |
-
return interfaceFunction.copies;
|
14067 |
-
} else if (shape.o.ix === value || 'Offset' === value) {
|
14068 |
-
return interfaceFunction.offset;
|
14069 |
-
}
|
14070 |
-
|
14071 |
-
}
|
14072 |
-
Object.defineProperties(interfaceFunction, {
|
14073 |
-
'copies': {
|
14074 |
-
get: ExpressionPropertyInterface(prop.c)
|
14075 |
-
},
|
14076 |
-
'offset': {
|
14077 |
-
get: ExpressionPropertyInterface(prop.o)
|
14078 |
-
},
|
14079 |
-
'_name': {
|
14080 |
-
value: shape.nm
|
14081 |
-
}
|
14082 |
-
});
|
14083 |
-
interfaceFunction.mn = shape.mn;
|
14084 |
-
return interfaceFunction;
|
14085 |
-
}
|
14086 |
-
|
14087 |
-
function pathInterfaceFactory(shape, view, propertyGroup) {
|
14088 |
-
var prop = view.sh;
|
14089 |
-
|
14090 |
-
function _propertyGroup(val) {
|
14091 |
-
if (val == 1) {
|
14092 |
-
return interfaceFunction;
|
14093 |
-
} else {
|
14094 |
-
return propertyGroup(--val);
|
14095 |
-
}
|
14096 |
-
}
|
14097 |
-
prop.setGroupProperty(_propertyGroup);
|
14098 |
-
|
14099 |
-
function interfaceFunction(val) {
|
14100 |
-
if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {
|
14101 |
-
return interfaceFunction.path;
|
14102 |
-
}
|
14103 |
-
}
|
14104 |
-
Object.defineProperties(interfaceFunction, {
|
14105 |
-
'path': {
|
14106 |
-
get: function () {
|
14107 |
-
if (prop.k) {
|
14108 |
-
prop.getValue();
|
14109 |
-
}
|
14110 |
-
return prop;
|
14111 |
-
}
|
14112 |
-
},
|
14113 |
-
'shape': {
|
14114 |
-
get: function () {
|
14115 |
-
if (prop.k) {
|
14116 |
-
prop.getValue();
|
14117 |
-
}
|
14118 |
-
return prop;
|
14119 |
-
}
|
14120 |
-
},
|
14121 |
-
'_name': {
|
14122 |
-
value: shape.nm
|
14123 |
-
},
|
14124 |
-
'ix': {
|
14125 |
-
value: shape.ix
|
14126 |
-
},
|
14127 |
-
'propertyIndex': {
|
14128 |
-
value: shape.ix
|
14129 |
-
},
|
14130 |
-
'mn': {
|
14131 |
-
value: shape.mn
|
14132 |
-
}
|
14133 |
-
});
|
14134 |
-
return interfaceFunction;
|
14135 |
-
}
|
14136 |
-
|
14137 |
-
return function (shapes, view, propertyGroup) {
|
14138 |
-
var interfaces;
|
14139 |
-
|
14140 |
-
function _interfaceFunction(value) {
|
14141 |
-
if (typeof value === 'number') {
|
14142 |
-
return interfaces[value - 1];
|
14143 |
-
} else {
|
14144 |
-
var i = 0,
|
14145 |
-
len = interfaces.length;
|
14146 |
-
while (i < len) {
|
14147 |
-
if (interfaces[i]._name === value) {
|
14148 |
-
return interfaces[i];
|
14149 |
-
}
|
14150 |
-
i += 1;
|
14151 |
-
}
|
14152 |
-
}
|
14153 |
-
}
|
14154 |
-
_interfaceFunction.propertyGroup = propertyGroup;
|
14155 |
-
interfaces = iterateElements(shapes, view, _interfaceFunction);
|
14156 |
-
_interfaceFunction.numProperties = interfaces.length;
|
14157 |
-
return _interfaceFunction;
|
14158 |
-
};
|
14159 |
-
}());
|
14160 |
-
|
14161 |
-
var TextExpressionInterface = (function () {
|
14162 |
-
return function (elem) {
|
14163 |
-
var _prevValue, _sourceText;
|
14164 |
-
|
14165 |
-
function _thisLayerFunction() { }
|
14166 |
-
Object.defineProperty(_thisLayerFunction, "sourceText", {
|
14167 |
-
get: function () {
|
14168 |
-
elem.textProperty.getValue()
|
14169 |
-
var stringValue = elem.textProperty.currentData.t;
|
14170 |
-
if (stringValue !== _prevValue) {
|
14171 |
-
elem.textProperty.currentData.t = _prevValue;
|
14172 |
-
_sourceText = new String(stringValue);
|
14173 |
-
//If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
|
14174 |
-
_sourceText.value = stringValue ? stringValue : new String(stringValue);
|
14175 |
-
}
|
14176 |
-
return _sourceText;
|
14177 |
-
}
|
14178 |
-
});
|
14179 |
-
return _thisLayerFunction;
|
14180 |
-
};
|
14181 |
-
}());
|
14182 |
-
var LayerExpressionInterface = (function () {
|
14183 |
-
function toWorld(arr, time) {
|
14184 |
-
var toWorldMat = new Matrix();
|
14185 |
-
toWorldMat.reset();
|
14186 |
-
var transformMat;
|
14187 |
-
if (time) {
|
14188 |
-
//Todo implement value at time on transform properties
|
14189 |
-
//transformMat = this._elem.finalTransform.mProp.getValueAtTime(time);
|
14190 |
-
transformMat = this._elem.finalTransform.mProp;
|
14191 |
-
} else {
|
14192 |
-
transformMat = this._elem.finalTransform.mProp;
|
14193 |
-
}
|
14194 |
-
transformMat.applyToMatrix(toWorldMat);
|
14195 |
-
if (this._elem.hierarchy && this._elem.hierarchy.length) {
|
14196 |
-
var i, len = this._elem.hierarchy.length;
|
14197 |
-
for (i = 0; i < len; i += 1) {
|
14198 |
-
this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
|
14199 |
-
}
|
14200 |
-
return toWorldMat.applyToPointArray(arr[0], arr[1], arr[2] || 0);
|
14201 |
-
}
|
14202 |
-
return toWorldMat.applyToPointArray(arr[0], arr[1], arr[2] || 0);
|
14203 |
-
}
|
14204 |
-
|
14205 |
-
function fromWorld(arr, time) {
|
14206 |
-
var toWorldMat = new Matrix();
|
14207 |
-
toWorldMat.reset();
|
14208 |
-
var transformMat;
|
14209 |
-
if (time) {
|
14210 |
-
//Todo implement value at time on transform properties
|
14211 |
-
//transformMat = this._elem.finalTransform.mProp.getValueAtTime(time);
|
14212 |
-
transformMat = this._elem.finalTransform.mProp;
|
14213 |
-
} else {
|
14214 |
-
transformMat = this._elem.finalTransform.mProp;
|
14215 |
-
}
|
14216 |
-
transformMat.applyToMatrix(toWorldMat);
|
14217 |
-
if (this._elem.hierarchy && this._elem.hierarchy.length) {
|
14218 |
-
var i, len = this._elem.hierarchy.length;
|
14219 |
-
for (i = 0; i < len; i += 1) {
|
14220 |
-
this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
|
14221 |
-
}
|
14222 |
-
return toWorldMat.inversePoint(arr);
|
14223 |
-
}
|
14224 |
-
return toWorldMat.inversePoint(arr);
|
14225 |
-
}
|
14226 |
-
|
14227 |
-
function fromComp(arr) {
|
14228 |
-
var toWorldMat = new Matrix();
|
14229 |
-
toWorldMat.reset();
|
14230 |
-
this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
|
14231 |
-
if (this._elem.hierarchy && this._elem.hierarchy.length) {
|
14232 |
-
var i, len = this._elem.hierarchy.length;
|
14233 |
-
for (i = 0; i < len; i += 1) {
|
14234 |
-
this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
|
14235 |
-
}
|
14236 |
-
return toWorldMat.inversePoint(arr);
|
14237 |
-
}
|
14238 |
-
return toWorldMat.inversePoint(arr);
|
14239 |
-
}
|
14240 |
-
|
14241 |
-
function sampleImage() {
|
14242 |
-
return [1, 1, 1, 1];
|
14243 |
-
}
|
14244 |
-
|
14245 |
-
|
14246 |
-
return function (elem) {
|
14247 |
-
|
14248 |
-
var transformInterface;
|
14249 |
-
|
14250 |
-
function _registerMaskInterface(maskManager) {
|
14251 |
-
_thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
|
14252 |
-
}
|
14253 |
-
|
14254 |
-
function _registerEffectsInterface(effects) {
|
14255 |
-
_thisLayerFunction.effect = effects;
|
14256 |
-
}
|
14257 |
-
|
14258 |
-
function _thisLayerFunction(name) {
|
14259 |
-
switch (name) {
|
14260 |
-
case "ADBE Root Vectors Group":
|
14261 |
-
case "Contents":
|
14262 |
-
case 2:
|
14263 |
-
return _thisLayerFunction.shapeInterface;
|
14264 |
-
case 1:
|
14265 |
-
case 6:
|
14266 |
-
case "Transform":
|
14267 |
-
case "transform":
|
14268 |
-
case "ADBE Transform Group":
|
14269 |
-
return transformInterface;
|
14270 |
-
case 4:
|
14271 |
-
case "ADBE Effect Parade":
|
14272 |
-
case "effects":
|
14273 |
-
case "Effects":
|
14274 |
-
return _thisLayerFunction.effect;
|
14275 |
-
}
|
14276 |
-
}
|
14277 |
-
_thisLayerFunction.toWorld = toWorld;
|
14278 |
-
_thisLayerFunction.fromWorld = fromWorld;
|
14279 |
-
_thisLayerFunction.toComp = toWorld;
|
14280 |
-
_thisLayerFunction.fromComp = fromComp;
|
14281 |
-
_thisLayerFunction.sampleImage = sampleImage;
|
14282 |
-
_thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
|
14283 |
-
_thisLayerFunction._elem = elem;
|
14284 |
-
transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
|
14285 |
-
var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
|
14286 |
-
Object.defineProperties(_thisLayerFunction, {
|
14287 |
-
hasParent: {
|
14288 |
-
get: function () {
|
14289 |
-
return elem.hierarchy.length;
|
14290 |
-
}
|
14291 |
-
},
|
14292 |
-
parent: {
|
14293 |
-
get: function () {
|
14294 |
-
return elem.hierarchy[0].layerInterface;
|
14295 |
-
}
|
14296 |
-
},
|
14297 |
-
rotation: getDescriptor(transformInterface, 'rotation'),
|
14298 |
-
scale: getDescriptor(transformInterface, 'scale'),
|
14299 |
-
position: getDescriptor(transformInterface, 'position'),
|
14300 |
-
opacity: getDescriptor(transformInterface, 'opacity'),
|
14301 |
-
anchorPoint: anchorPointDescriptor,
|
14302 |
-
anchor_point: anchorPointDescriptor,
|
14303 |
-
transform: {
|
14304 |
-
get: function () {
|
14305 |
-
return transformInterface;
|
14306 |
-
}
|
14307 |
-
},
|
14308 |
-
active: {
|
14309 |
-
get: function () {
|
14310 |
-
return elem.isInRange;
|
14311 |
-
}
|
14312 |
-
}
|
14313 |
-
});
|
14314 |
-
|
14315 |
-
_thisLayerFunction.startTime = elem.data.st;
|
14316 |
-
_thisLayerFunction.index = elem.data.ind;
|
14317 |
-
_thisLayerFunction.source = elem.data.refId;
|
14318 |
-
_thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
|
14319 |
-
_thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
|
14320 |
-
_thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate;
|
14321 |
-
_thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate;
|
14322 |
-
_thisLayerFunction._name = elem.data.nm;
|
14323 |
-
|
14324 |
-
_thisLayerFunction.registerMaskInterface = _registerMaskInterface;
|
14325 |
-
_thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
|
14326 |
-
return _thisLayerFunction;
|
14327 |
-
};
|
14328 |
-
}());
|
14329 |
-
|
14330 |
-
var CompExpressionInterface = (function () {
|
14331 |
-
return function (comp) {
|
14332 |
-
function _thisLayerFunction(name) {
|
14333 |
-
var i = 0,
|
14334 |
-
len = comp.layers.length;
|
14335 |
-
while (i < len) {
|
14336 |
-
if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
|
14337 |
-
return comp.elements[i].layerInterface;
|
14338 |
-
}
|
14339 |
-
i += 1;
|
14340 |
-
}
|
14341 |
-
return null;
|
14342 |
-
//return {active:false};
|
14343 |
-
}
|
14344 |
-
Object.defineProperty(_thisLayerFunction, "_name", {
|
14345 |
-
value: comp.data.nm
|
14346 |
-
});
|
14347 |
-
_thisLayerFunction.layer = _thisLayerFunction;
|
14348 |
-
_thisLayerFunction.pixelAspect = 1;
|
14349 |
-
_thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
|
14350 |
-
_thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
|
14351 |
-
_thisLayerFunction.pixelAspect = 1;
|
14352 |
-
_thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
|
14353 |
-
_thisLayerFunction.displayStartTime = 0;
|
14354 |
-
_thisLayerFunction.numLayers = comp.layers.length;
|
14355 |
-
return _thisLayerFunction;
|
14356 |
-
};
|
14357 |
-
}());
|
14358 |
-
var TransformExpressionInterface = (function () {
|
14359 |
-
return function (transform) {
|
14360 |
-
function _thisFunction(name) {
|
14361 |
-
switch (name) {
|
14362 |
-
case "scale":
|
14363 |
-
case "Scale":
|
14364 |
-
case "ADBE Scale":
|
14365 |
-
case 6:
|
14366 |
-
return _thisFunction.scale;
|
14367 |
-
case "rotation":
|
14368 |
-
case "Rotation":
|
14369 |
-
case "ADBE Rotation":
|
14370 |
-
case "ADBE Rotate Z":
|
14371 |
-
case 10:
|
14372 |
-
return _thisFunction.rotation;
|
14373 |
-
case "ADBE Rotate X":
|
14374 |
-
return _thisFunction.xRotation;
|
14375 |
-
case "ADBE Rotate Y":
|
14376 |
-
return _thisFunction.yRotation;
|
14377 |
-
case "position":
|
14378 |
-
case "Position":
|
14379 |
-
case "ADBE Position":
|
14380 |
-
case 2:
|
14381 |
-
return _thisFunction.position;
|
14382 |
-
case 'ADBE Position_0':
|
14383 |
-
return _thisFunction.xPosition;
|
14384 |
-
case 'ADBE Position_1':
|
14385 |
-
return _thisFunction.yPosition;
|
14386 |
-
case 'ADBE Position_2':
|
14387 |
-
return _thisFunction.zPosition;
|
14388 |
-
case "anchorPoint":
|
14389 |
-
case "AnchorPoint":
|
14390 |
-
case "Anchor Point":
|
14391 |
-
case "ADBE AnchorPoint":
|
14392 |
-
case 1:
|
14393 |
-
return _thisFunction.anchorPoint;
|
14394 |
-
case "opacity":
|
14395 |
-
case "Opacity":
|
14396 |
-
case 11:
|
14397 |
-
return _thisFunction.opacity;
|
14398 |
-
}
|
14399 |
-
}
|
14400 |
-
|
14401 |
-
Object.defineProperty(_thisFunction, "rotation", {
|
14402 |
-
get: ExpressionPropertyInterface(transform.r || transform.rz)
|
14403 |
-
});
|
14404 |
-
|
14405 |
-
Object.defineProperty(_thisFunction, "zRotation", {
|
14406 |
-
get: ExpressionPropertyInterface(transform.rz || transform.r)
|
14407 |
-
});
|
14408 |
-
|
14409 |
-
Object.defineProperty(_thisFunction, "xRotation", {
|
14410 |
-
get: ExpressionPropertyInterface(transform.rx)
|
14411 |
-
});
|
14412 |
-
|
14413 |
-
Object.defineProperty(_thisFunction, "yRotation", {
|
14414 |
-
get: ExpressionPropertyInterface(transform.ry)
|
14415 |
-
});
|
14416 |
-
Object.defineProperty(_thisFunction, "scale", {
|
14417 |
-
get: ExpressionPropertyInterface(transform.s)
|
14418 |
-
});
|
14419 |
-
|
14420 |
-
if (transform.p) {
|
14421 |
-
var _transformFactory = ExpressionPropertyInterface(transform.p);
|
14422 |
-
}
|
14423 |
-
Object.defineProperty(_thisFunction, "position", {
|
14424 |
-
get: function () {
|
14425 |
-
if (transform.p) {
|
14426 |
-
return _transformFactory();
|
14427 |
-
} else {
|
14428 |
-
return [transform.px.v, transform.py.v, transform.pz ? transform.pz.v : 0];
|
14429 |
-
}
|
14430 |
-
}
|
14431 |
-
});
|
14432 |
-
|
14433 |
-
Object.defineProperty(_thisFunction, "xPosition", {
|
14434 |
-
get: ExpressionPropertyInterface(transform.px)
|
14435 |
-
});
|
14436 |
-
|
14437 |
-
Object.defineProperty(_thisFunction, "yPosition", {
|
14438 |
-
get: ExpressionPropertyInterface(transform.py)
|
14439 |
-
});
|
14440 |
-
|
14441 |
-
Object.defineProperty(_thisFunction, "zPosition", {
|
14442 |
-
get: ExpressionPropertyInterface(transform.pz)
|
14443 |
-
});
|
14444 |
-
|
14445 |
-
Object.defineProperty(_thisFunction, "anchorPoint", {
|
14446 |
-
get: ExpressionPropertyInterface(transform.a)
|
14447 |
-
});
|
14448 |
-
|
14449 |
-
Object.defineProperty(_thisFunction, "opacity", {
|
14450 |
-
get: ExpressionPropertyInterface(transform.o)
|
14451 |
-
});
|
14452 |
-
|
14453 |
-
Object.defineProperty(_thisFunction, "skew", {
|
14454 |
-
get: ExpressionPropertyInterface(transform.sk)
|
14455 |
-
});
|
14456 |
-
|
14457 |
-
Object.defineProperty(_thisFunction, "skewAxis", {
|
14458 |
-
get: ExpressionPropertyInterface(transform.sa)
|
14459 |
-
});
|
14460 |
-
|
14461 |
-
Object.defineProperty(_thisFunction, "orientation", {
|
14462 |
-
get: ExpressionPropertyInterface(transform.or)
|
14463 |
-
});
|
14464 |
-
|
14465 |
-
return _thisFunction;
|
14466 |
-
};
|
14467 |
-
}());
|
14468 |
-
var ProjectInterface = (function () {
|
14469 |
-
|
14470 |
-
function registerComposition(comp) {
|
14471 |
-
this.compositions.push(comp);
|
14472 |
-
}
|
14473 |
-
|
14474 |
-
return function () {
|
14475 |
-
function _thisProjectFunction(name) {
|
14476 |
-
var i = 0,
|
14477 |
-
len = this.compositions.length;
|
14478 |
-
while (i < len) {
|
14479 |
-
if (this.compositions[i].data && this.compositions[i].data.nm === name) {
|
14480 |
-
if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
|
14481 |
-
this.compositions[i].prepareFrame(this.currentFrame);
|
14482 |
-
}
|
14483 |
-
return this.compositions[i].compInterface;
|
14484 |
-
}
|
14485 |
-
i += 1;
|
14486 |
-
}
|
14487 |
-
}
|
14488 |
-
|
14489 |
-
_thisProjectFunction.compositions = [];
|
14490 |
-
_thisProjectFunction.currentFrame = 0;
|
14491 |
-
|
14492 |
-
_thisProjectFunction.registerComposition = registerComposition;
|
14493 |
-
|
14494 |
-
|
14495 |
-
|
14496 |
-
return _thisProjectFunction;
|
14497 |
-
};
|
14498 |
-
}());
|
14499 |
-
var EffectsExpressionInterface = (function () {
|
14500 |
-
var ob = {
|
14501 |
-
createEffectsInterface: createEffectsInterface
|
14502 |
-
};
|
14503 |
-
|
14504 |
-
function createEffectsInterface(elem, propertyGroup) {
|
14505 |
-
if (elem.effectsManager) {
|
14506 |
-
|
14507 |
-
var effectElements = [];
|
14508 |
-
var effectsData = elem.data.ef;
|
14509 |
-
var i, len = elem.effectsManager.effectElements.length;
|
14510 |
-
for (i = 0; i < len; i += 1) {
|
14511 |
-
effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem));
|
14512 |
-
}
|
14513 |
-
|
14514 |
-
return function (name) {
|
14515 |
-
var effects = elem.data.ef || [],
|
14516 |
-
i = 0,
|
14517 |
-
len = effects.length;
|
14518 |
-
while (i < len) {
|
14519 |
-
if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
|
14520 |
-
return effectElements[i];
|
14521 |
-
}
|
14522 |
-
i += 1;
|
14523 |
-
}
|
14524 |
-
};
|
14525 |
-
}
|
14526 |
-
}
|
14527 |
-
|
14528 |
-
function createGroupInterface(data, elements, propertyGroup, elem) {
|
14529 |
-
var effectElements = [];
|
14530 |
-
var i, len = data.ef.length;
|
14531 |
-
for (i = 0; i < len; i += 1) {
|
14532 |
-
if (data.ef[i].ty === 5) {
|
14533 |
-
effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem));
|
14534 |
-
} else {
|
14535 |
-
effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup));
|
14536 |
-
}
|
14537 |
-
}
|
14538 |
-
|
14539 |
-
function _propertyGroup(val) {
|
14540 |
-
if (val === 1) {
|
14541 |
-
return groupInterface;
|
14542 |
-
} else {
|
14543 |
-
return propertyGroup(val - 1);
|
14544 |
-
}
|
14545 |
-
}
|
14546 |
-
|
14547 |
-
var groupInterface = function (name) {
|
14548 |
-
var effects = data.ef,
|
14549 |
-
i = 0,
|
14550 |
-
len = effects.length;
|
14551 |
-
while (i < len) {
|
14552 |
-
if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
|
14553 |
-
if (effects[i].ty === 5) {
|
14554 |
-
return effectElements[i];
|
14555 |
-
} else {
|
14556 |
-
return effectElements[i]();
|
14557 |
-
}
|
14558 |
-
}
|
14559 |
-
i += 1;
|
14560 |
-
}
|
14561 |
-
return effectElements[0]();
|
14562 |
-
};
|
14563 |
-
|
14564 |
-
groupInterface.propertyGroup = _propertyGroup;
|
14565 |
-
|
14566 |
-
if (data.mn === 'ADBE Color Control') {
|
14567 |
-
Object.defineProperty(groupInterface, 'color', {
|
14568 |
-
get: function () {
|
14569 |
-
return effectElements[0]();
|
14570 |
-
}
|
14571 |
-
});
|
14572 |
-
}
|
14573 |
-
Object.defineProperty(groupInterface, 'numProperties', {
|
14574 |
-
get: function () {
|
14575 |
-
return data.np;
|
14576 |
-
}
|
14577 |
-
});
|
14578 |
-
groupInterface.active = groupInterface.enabled = data.en !== 0;
|
14579 |
-
return groupInterface;
|
14580 |
-
}
|
14581 |
-
|
14582 |
-
function createValueInterface(element, type, elem, propertyGroup) {
|
14583 |
-
var expressionProperty = ExpressionPropertyInterface(element.p);
|
14584 |
-
|
14585 |
-
function interfaceFunction() {
|
14586 |
-
if (type === 10) {
|
14587 |
-
return elem.comp.compInterface(element.p.v);
|
14588 |
-
}
|
14589 |
-
return expressionProperty();
|
14590 |
-
}
|
14591 |
-
|
14592 |
-
if (element.p.setGroupProperty) {
|
14593 |
-
element.p.setGroupProperty(propertyGroup);
|
14594 |
-
}
|
14595 |
-
|
14596 |
-
return interfaceFunction;
|
14597 |
-
}
|
14598 |
-
|
14599 |
-
return ob;
|
14600 |
-
|
14601 |
-
}());
|
14602 |
-
var MaskManagerInterface = (function () {
|
14603 |
-
|
14604 |
-
function MaskInterface(mask, data) {
|
14605 |
-
this._mask = mask;
|
14606 |
-
this._data = data;
|
14607 |
-
}
|
14608 |
-
Object.defineProperty(MaskInterface.prototype, 'maskPath', {
|
14609 |
-
get: function () {
|
14610 |
-
if (this._mask.prop.k) {
|
14611 |
-
this._mask.prop.getValue();
|
14612 |
-
}
|
14613 |
-
return this._mask.prop;
|
14614 |
-
}
|
14615 |
-
});
|
14616 |
-
Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
|
14617 |
-
get: function () {
|
14618 |
-
if (this._mask.op.k) {
|
14619 |
-
this._mask.op.getValue();
|
14620 |
-
}
|
14621 |
-
return this._mask.op.v * 100;
|
14622 |
-
}
|
14623 |
-
});
|
14624 |
-
|
14625 |
-
var MaskManager = function (maskManager, elem) {
|
14626 |
-
var _maskManager = maskManager;
|
14627 |
-
var _elem = elem;
|
14628 |
-
var _masksInterfaces = createSizedArray(maskManager.viewData.length);
|
14629 |
-
var i, len = maskManager.viewData.length;
|
14630 |
-
for (i = 0; i < len; i += 1) {
|
14631 |
-
_masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
|
14632 |
-
}
|
14633 |
-
|
14634 |
-
var maskFunction = function (name) {
|
14635 |
-
i = 0;
|
14636 |
-
while (i < len) {
|
14637 |
-
if (maskManager.masksProperties[i].nm === name) {
|
14638 |
-
return _masksInterfaces[i];
|
14639 |
-
}
|
14640 |
-
i += 1;
|
14641 |
-
}
|
14642 |
-
};
|
14643 |
-
return maskFunction;
|
14644 |
-
};
|
14645 |
-
return MaskManager;
|
14646 |
-
}());
|
14647 |
-
|
14648 |
-
var ExpressionPropertyInterface = (function () {
|
14649 |
-
|
14650 |
-
var defaultUnidimensionalValue = {
|
14651 |
-
pv: 0,
|
14652 |
-
v: 0,
|
14653 |
-
mult: 1
|
14654 |
-
}
|
14655 |
-
var defaultMultidimensionalValue = {
|
14656 |
-
pv: [0, 0, 0],
|
14657 |
-
v: [0, 0, 0],
|
14658 |
-
mult: 1
|
14659 |
-
}
|
14660 |
-
|
14661 |
-
function completeProperty(expressionValue, property, type) {
|
14662 |
-
Object.defineProperty(expressionValue, 'velocity', {
|
14663 |
-
get: function () {
|
14664 |
-
return property.getVelocityAtTime(property.comp.currentFrame);
|
14665 |
-
}
|
14666 |
-
});
|
14667 |
-
expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
|
14668 |
-
expressionValue.key = function (pos) {
|
14669 |
-
if (!expressionValue.numKeys) {
|
14670 |
-
return 0;
|
14671 |
-
} else {
|
14672 |
-
var value = '';
|
14673 |
-
if ('s' in property.keyframes[pos - 1]) {
|
14674 |
-
value = property.keyframes[pos - 1].s;
|
14675 |
-
} else if ('e' in property.keyframes[pos - 2]) {
|
14676 |
-
value = property.keyframes[pos - 2].e;
|
14677 |
-
} else {
|
14678 |
-
value = property.keyframes[pos - 2].s;
|
14679 |
-
}
|
14680 |
-
var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value);
|
14681 |
-
valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate;
|
14682 |
-
return valueProp;
|
14683 |
-
}
|
14684 |
-
};
|
14685 |
-
expressionValue.valueAtTime = property.getValueAtTime;
|
14686 |
-
expressionValue.speedAtTime = property.getSpeedAtTime;
|
14687 |
-
expressionValue.velocityAtTime = property.getVelocityAtTime;
|
14688 |
-
expressionValue.propertyGroup = property.propertyGroup;
|
14689 |
-
}
|
14690 |
-
|
14691 |
-
function UnidimensionalPropertyInterface(property) {
|
14692 |
-
if (!property || !('pv' in property)) {
|
14693 |
-
property = defaultUnidimensionalValue;
|
14694 |
-
}
|
14695 |
-
var mult = 1 / property.mult;
|
14696 |
-
var val = property.pv * mult;
|
14697 |
-
var expressionValue = new Number(val);
|
14698 |
-
expressionValue.value = val;
|
14699 |
-
completeProperty(expressionValue, property, 'unidimensional');
|
14700 |
-
|
14701 |
-
return function () {
|
14702 |
-
if (property.k) {
|
14703 |
-
property.getValue();
|
14704 |
-
}
|
14705 |
-
val = property.v * mult;
|
14706 |
-
if (expressionValue.value !== val) {
|
14707 |
-
expressionValue = new Number(val);
|
14708 |
-
expressionValue.value = val;
|
14709 |
-
completeProperty(expressionValue, property, 'unidimensional');
|
14710 |
-
}
|
14711 |
-
return expressionValue;
|
14712 |
-
}
|
14713 |
-
}
|
14714 |
-
|
14715 |
-
function MultidimensionalPropertyInterface(property) {
|
14716 |
-
if (!property || !('pv' in property)) {
|
14717 |
-
property = defaultMultidimensionalValue;
|
14718 |
-
}
|
14719 |
-
var mult = 1 / property.mult;
|
14720 |
-
var len = property.pv.length;
|
14721 |
-
var expressionValue = createTypedArray('float32', len);
|
14722 |
-
var arrValue = createTypedArray('float32', len);
|
14723 |
-
expressionValue.value = arrValue;
|
14724 |
-
completeProperty(expressionValue, property, 'multidimensional');
|
14725 |
-
|
14726 |
-
return function () {
|
14727 |
-
if (property.k) {
|
14728 |
-
property.getValue();
|
14729 |
-
}
|
14730 |
-
for (var i = 0; i < len; i += 1) {
|
14731 |
-
expressionValue[i] = arrValue[i] = property.v[i] * mult;
|
14732 |
-
}
|
14733 |
-
return expressionValue;
|
14734 |
-
}
|
14735 |
-
}
|
14736 |
-
|
14737 |
-
//TODO: try to avoid using this getter
|
14738 |
-
function defaultGetter() {
|
14739 |
-
return defaultUnidimensionalValue;
|
14740 |
-
}
|
14741 |
-
|
14742 |
-
return function (property) {
|
14743 |
-
if (!property) {
|
14744 |
-
return defaultGetter;
|
14745 |
-
} else if (property.propType === 'unidimensional') {
|
14746 |
-
return UnidimensionalPropertyInterface(property);
|
14747 |
-
} else {
|
14748 |
-
return MultidimensionalPropertyInterface(property);
|
14749 |
-
}
|
14750 |
-
}
|
14751 |
-
}());
|
14752 |
-
|
14753 |
-
(function () {
|
14754 |
-
|
14755 |
-
var TextExpressionSelectorProp = (function () {
|
14756 |
-
|
14757 |
-
function getValueProxy(index, total) {
|
14758 |
-
this.textIndex = index + 1;
|
14759 |
-
this.textTotal = total;
|
14760 |
-
this.v = this.getValue() * this.mult;
|
14761 |
-
return this.v;
|
14762 |
-
}
|
14763 |
-
|
14764 |
-
return function TextExpressionSelectorProp(elem, data) {
|
14765 |
-
this.pv = 1;
|
14766 |
-
this.comp = elem.comp;
|
14767 |
-
this.elem = elem;
|
14768 |
-
this.mult = 0.01;
|
14769 |
-
this.propType = 'textSelector';
|
14770 |
-
this.textTotal = data.totalChars;
|
14771 |
-
this.selectorValue = 100;
|
14772 |
-
this.lastValue = [1, 1, 1];
|
14773 |
-
this.k = true;
|
14774 |
-
this.x = true;
|
14775 |
-
this.getValue = ExpressionManager.initiateExpression.bind(this)(elem, data, this);
|
14776 |
-
this.getMult = getValueProxy;
|
14777 |
-
this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
|
14778 |
-
if (this.kf) {
|
14779 |
-
this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
|
14780 |
-
} else {
|
14781 |
-
this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
|
14782 |
-
}
|
14783 |
-
this.setGroupProperty = expressionHelpers.setGroupProperty;
|
14784 |
-
};
|
14785 |
-
}());
|
14786 |
-
|
14787 |
-
var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
|
14788 |
-
TextSelectorProp.getTextSelectorProp = function (elem, data, arr) {
|
14789 |
-
if (data.t === 1) {
|
14790 |
-
return new TextExpressionSelectorProp(elem, data, arr);
|
14791 |
-
} else {
|
14792 |
-
return propertyGetTextProp(elem, data, arr);
|
14793 |
-
}
|
14794 |
-
};
|
14795 |
-
}());
|
14796 |
-
|
14797 |
-
function SliderEffect(data, elem, container) {
|
14798 |
-
this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
|
14799 |
-
}
|
14800 |
-
|
14801 |
-
function AngleEffect(data, elem, container) {
|
14802 |
-
this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
|
14803 |
-
}
|
14804 |
-
|
14805 |
-
function ColorEffect(data, elem, container) {
|
14806 |
-
this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
|
14807 |
-
}
|
14808 |
-
|
14809 |
-
function PointEffect(data, elem, container) {
|
14810 |
-
this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
|
14811 |
-
}
|
14812 |
-
|
14813 |
-
function LayerIndexEffect(data, elem, container) {
|
14814 |
-
this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
|
14815 |
-
}
|
14816 |
-
|
14817 |
-
function MaskIndexEffect(data, elem, container) {
|
14818 |
-
this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
|
14819 |
-
}
|
14820 |
-
|
14821 |
-
function CheckboxEffect(data, elem, container) {
|
14822 |
-
this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
|
14823 |
-
}
|
14824 |
-
|
14825 |
-
function NoValueEffect() {
|
14826 |
-
this.p = {};
|
14827 |
-
}
|
14828 |
-
|
14829 |
-
function EffectsManager() { }
|
14830 |
-
|
14831 |
-
function EffectsManager(data, element) {
|
14832 |
-
var effects = data.ef || [];
|
14833 |
-
this.effectElements = [];
|
14834 |
-
var i, len = effects.length;
|
14835 |
-
var effectItem;
|
14836 |
-
for (i = 0; i < len; i++) {
|
14837 |
-
effectItem = new GroupEffect(effects[i], element);
|
14838 |
-
this.effectElements.push(effectItem);
|
14839 |
-
}
|
14840 |
-
}
|
14841 |
-
|
14842 |
-
function GroupEffect(data, element) {
|
14843 |
-
this.init(data, element);
|
14844 |
-
}
|
14845 |
-
|
14846 |
-
extendPrototype([DynamicPropertyContainer], GroupEffect);
|
14847 |
-
|
14848 |
-
GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
|
14849 |
-
|
14850 |
-
GroupEffect.prototype.init = function (data, element) {
|
14851 |
-
this.data = data;
|
14852 |
-
this.effectElements = [];
|
14853 |
-
this.initDynamicPropertyContainer(element);
|
14854 |
-
var i, len = this.data.ef.length;
|
14855 |
-
var eff, effects = this.data.ef;
|
14856 |
-
for (i = 0; i < len; i += 1) {
|
14857 |
-
eff = null;
|
14858 |
-
switch (effects[i].ty) {
|
14859 |
-
case 0:
|
14860 |
-
eff = new SliderEffect(effects[i], element, this);
|
14861 |
-
break;
|
14862 |
-
case 1:
|
14863 |
-
eff = new AngleEffect(effects[i], element, this);
|
14864 |
-
break;
|
14865 |
-
case 2:
|
14866 |
-
eff = new ColorEffect(effects[i], element, this);
|
14867 |
-
break;
|
14868 |
-
case 3:
|
14869 |
-
eff = new PointEffect(effects[i], element, this);
|
14870 |
-
break;
|
14871 |
-
case 4:
|
14872 |
-
case 7:
|
14873 |
-
eff = new CheckboxEffect(effects[i], element, this);
|
14874 |
-
break;
|
14875 |
-
case 10:
|
14876 |
-
eff = new LayerIndexEffect(effects[i], element, this);
|
14877 |
-
break;
|
14878 |
-
case 11:
|
14879 |
-
eff = new MaskIndexEffect(effects[i], element, this);
|
14880 |
-
break;
|
14881 |
-
case 5:
|
14882 |
-
eff = new EffectsManager(effects[i], element, this);
|
14883 |
-
break;
|
14884 |
-
//case 6:
|
14885 |
-
default:
|
14886 |
-
eff = new NoValueEffect(effects[i], element, this);
|
14887 |
-
break;
|
14888 |
-
}
|
14889 |
-
if (eff) {
|
14890 |
-
this.effectElements.push(eff);
|
14891 |
-
}
|
14892 |
-
}
|
14893 |
-
};
|
14894 |
-
|
14895 |
-
var lottie = {};
|
14896 |
-
|
14897 |
-
var _isFrozen = false;
|
14898 |
-
|
14899 |
-
function setLocationHref(href) {
|
14900 |
-
locationHref = href;
|
14901 |
-
}
|
14902 |
-
|
14903 |
-
function searchAnimations() {
|
14904 |
-
if (standalone === true) {
|
14905 |
-
animationManager.searchAnimations(animationData, standalone, renderer);
|
14906 |
-
} else {
|
14907 |
-
animationManager.searchAnimations();
|
14908 |
-
}
|
14909 |
-
}
|
14910 |
-
|
14911 |
-
function setSubframeRendering(flag) {
|
14912 |
-
subframeEnabled = flag;
|
14913 |
-
}
|
14914 |
-
|
14915 |
-
function loadAnimation(params) {
|
14916 |
-
if (standalone === true) {
|
14917 |
-
params.animationData = JSON.parse(animationData);
|
14918 |
-
}
|
14919 |
-
return animationManager.loadAnimation(params);
|
14920 |
-
}
|
14921 |
-
|
14922 |
-
function setQuality(value) {
|
14923 |
-
if (typeof value === 'string') {
|
14924 |
-
switch (value) {
|
14925 |
-
case 'high':
|
14926 |
-
defaultCurveSegments = 200;
|
14927 |
-
break;
|
14928 |
-
case 'medium':
|
14929 |
-
defaultCurveSegments = 50;
|
14930 |
-
break;
|
14931 |
-
case 'low':
|
14932 |
-
defaultCurveSegments = 10;
|
14933 |
-
break;
|
14934 |
-
}
|
14935 |
-
} else if (!isNaN(value) && value > 1) {
|
14936 |
-
defaultCurveSegments = value;
|
14937 |
-
}
|
14938 |
-
if (defaultCurveSegments >= 50) {
|
14939 |
-
roundValues(false);
|
14940 |
-
} else {
|
14941 |
-
roundValues(true);
|
14942 |
-
}
|
14943 |
-
}
|
14944 |
-
|
14945 |
-
function inBrowser() {
|
14946 |
-
return typeof navigator !== 'undefined';
|
14947 |
-
}
|
14948 |
-
|
14949 |
-
function installPlugin(type, plugin) {
|
14950 |
-
if (type === 'expressions') {
|
14951 |
-
expressionsPlugin = plugin;
|
14952 |
-
}
|
14953 |
-
}
|
14954 |
-
|
14955 |
-
function getFactory(name) {
|
14956 |
-
switch (name) {
|
14957 |
-
case "propertyFactory":
|
14958 |
-
return PropertyFactory;
|
14959 |
-
case "shapePropertyFactory":
|
14960 |
-
return ShapePropertyFactory;
|
14961 |
-
case "matrix":
|
14962 |
-
return Matrix;
|
14963 |
-
}
|
14964 |
-
}
|
14965 |
-
|
14966 |
-
lottie.play = animationManager.play;
|
14967 |
-
lottie.pause = animationManager.pause;
|
14968 |
-
lottie.setLocationHref = setLocationHref;
|
14969 |
-
lottie.togglePause = animationManager.togglePause;
|
14970 |
-
lottie.setSpeed = animationManager.setSpeed;
|
14971 |
-
lottie.setDirection = animationManager.setDirection;
|
14972 |
-
lottie.stop = animationManager.stop;
|
14973 |
-
lottie.searchAnimations = searchAnimations;
|
14974 |
-
lottie.registerAnimation = animationManager.registerAnimation;
|
14975 |
-
lottie.loadAnimation = loadAnimation;
|
14976 |
-
lottie.setSubframeRendering = setSubframeRendering;
|
14977 |
-
lottie.resize = animationManager.resize;
|
14978 |
-
//lottie.start = start;
|
14979 |
-
lottie.goToAndStop = animationManager.goToAndStop;
|
14980 |
-
lottie.destroy = animationManager.destroy;
|
14981 |
-
lottie.setQuality = setQuality;
|
14982 |
-
lottie.inBrowser = inBrowser;
|
14983 |
-
lottie.installPlugin = installPlugin;
|
14984 |
-
lottie.freeze = animationManager.freeze;
|
14985 |
-
lottie.unfreeze = animationManager.unfreeze;
|
14986 |
-
lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
|
14987 |
-
lottie.__getFactory = getFactory;
|
14988 |
-
lottie.version = '5.6.6';
|
14989 |
-
|
14990 |
-
function checkReady() {
|
14991 |
-
if (document.readyState === "complete") {
|
14992 |
-
clearInterval(readyStateCheckInterval);
|
14993 |
-
searchAnimations();
|
14994 |
-
}
|
14995 |
-
}
|
14996 |
-
|
14997 |
-
function getQueryVariable(variable) {
|
14998 |
-
var vars = queryString.split('&');
|
14999 |
-
for (var i = 0; i < vars.length; i++) {
|
15000 |
-
var pair = vars[i].split('=');
|
15001 |
-
if (decodeURIComponent(pair[0]) == variable) {
|
15002 |
-
return decodeURIComponent(pair[1]);
|
15003 |
-
}
|
15004 |
-
}
|
15005 |
-
}
|
15006 |
-
var standalone = '__[STANDALONE]__';
|
15007 |
-
var animationData = '__[ANIMATIONDATA]__';
|
15008 |
-
var renderer = '';
|
15009 |
-
if (standalone) {
|
15010 |
-
var scripts = document.getElementsByTagName('script');
|
15011 |
-
var index = scripts.length - 1;
|
15012 |
-
var myScript = scripts[index] || {
|
15013 |
-
src: ''
|
15014 |
-
};
|
15015 |
-
var queryString = myScript.src.replace(/^[^\?]+\??/, '');
|
15016 |
-
renderer = getQueryVariable('renderer');
|
15017 |
-
}
|
15018 |
-
var readyStateCheckInterval = setInterval(checkReady, 100);
|
15019 |
-
|
15020 |
-
return lottie;
|
15021 |
-
}));
|
15022 |
-
|
15023 |
-
var PremiumLottieHandler = function ($scope, $) {
|
15024 |
-
|
15025 |
-
var $lottieIcons = $scope.find(".premium-lottie-animation");
|
15026 |
-
|
15027 |
-
if (!$lottieIcons.length)
|
15028 |
-
return;
|
15029 |
-
|
15030 |
-
$lottieIcons.each(function (index, item) {
|
15031 |
-
var $item = $(item);
|
15032 |
-
|
15033 |
-
if ($item.data("box-tilt")) {
|
15034 |
-
var reverse = $item.data("box-tilt-reverse");
|
15035 |
-
UniversalTilt.init({
|
15036 |
-
elements: $item.parent(),
|
15037 |
-
settings: {
|
15038 |
-
reverse: reverse
|
15039 |
-
},
|
15040 |
-
callbacks: {
|
15041 |
-
onMouseLeave: function (el) {
|
15042 |
-
el.style.boxShadow = "0 45px 100px rgba(255, 255, 255, 0)";
|
15043 |
-
},
|
15044 |
-
onDeviceMove: function (el) {
|
15045 |
-
el.style.boxShadow = "0 45px 100px rgba(255, 255, 255, 0.3)";
|
15046 |
-
}
|
15047 |
-
}
|
15048 |
-
});
|
15049 |
-
}
|
15050 |
-
|
15051 |
-
elementorFrontend.waypoint($item, function () {
|
15052 |
-
instance = new premiumLottieAnimations($item);
|
15053 |
-
instance.init();
|
15054 |
-
});
|
15055 |
-
|
15056 |
-
});
|
15057 |
-
};
|
15058 |
-
|
15059 |
-
var PremiumLottieAddonHandler = function ($scope) {
|
15060 |
-
|
15061 |
-
if (!$scope.hasClass("premium-lottie-yes"))
|
15062 |
-
return;
|
15063 |
-
|
15064 |
-
var target = $scope,
|
15065 |
-
sectionId = target.data("id"),
|
15066 |
-
settings = {},
|
15067 |
-
tempTarget = target.find('#premium-lottie-' + sectionId),
|
15068 |
-
isEditor = elementorFrontend.isEditMode() && tempTarget.length > 0,
|
15069 |
-
targetID = isEditor ? target.find('#premium-lottie-' + sectionId) : target;
|
15070 |
-
|
15071 |
-
settings = generateSettings(targetID);
|
15072 |
-
|
15073 |
-
if (!settings) {
|
15074 |
-
return false;
|
15075 |
-
}
|
15076 |
-
|
15077 |
-
elementorFrontend.waypoint($scope, function () {
|
15078 |
-
generateLottieAnimation();
|
15079 |
-
});
|
15080 |
-
|
15081 |
-
if (isEditor) {
|
15082 |
-
|
15083 |
-
var freeHandSettings = {
|
15084 |
-
repeater: 'premium_lottie_repeater',
|
15085 |
-
item: '.premium-lottie-layer',
|
15086 |
-
hor: 'premium_lottie_hor',
|
15087 |
-
ver: 'premium_lottie_ver',
|
15088 |
-
width: 'premium_lottie_size',
|
15089 |
-
tab: 'section_premium_lottie',
|
15090 |
-
offset: 0,
|
15091 |
-
widgets: ["drag"]
|
15092 |
-
},
|
15093 |
-
instance = null;
|
15094 |
-
|
15095 |
-
instance = new premiumEditorBehavior(target, freeHandSettings);
|
15096 |
-
|
15097 |
-
instance.init();
|
15098 |
-
|
15099 |
-
}
|
15100 |
-
|
15101 |
-
function generateSettings(target) {
|
15102 |
-
|
15103 |
-
var lottieSettings = target.data("pa-lottie");
|
15104 |
-
|
15105 |
-
if (!lottieSettings) {
|
15106 |
-
return false;
|
15107 |
-
}
|
15108 |
-
|
15109 |
-
settings.lottieLayers = [];
|
15110 |
-
|
15111 |
-
$.each(lottieSettings, function (index, layer) {
|
15112 |
-
settings.lottieLayers.push(layer);
|
15113 |
-
});
|
15114 |
-
|
15115 |
-
if (0 !== Object.keys(settings).length) {
|
15116 |
-
return settings;
|
15117 |
-
}
|
15118 |
-
}
|
15119 |
-
|
15120 |
-
function generateLottieAnimation() {
|
15121 |
-
|
15122 |
-
var currentDevice = elementorFrontend.getCurrentDeviceMode();
|
15123 |
-
|
15124 |
-
if (isEditor) {
|
15125 |
-
target.find(".premium-lottie-layer svg, .premium-lottie-layer canvas").remove();
|
15126 |
-
}
|
15127 |
-
|
15128 |
-
var layout = "";
|
15129 |
-
|
15130 |
-
$.each(settings.lottieLayers, function (index, layer) {
|
15131 |
-
|
15132 |
-
layer.lottie_url = 'url' === layer.source ? layer.lottie_url : layer.lottie_file.url;
|
15133 |
-
|
15134 |
-
if ("" === layer.lottie_url || !layer.show_layer_on.includes(currentDevice))
|
15135 |
-
return;
|
15136 |
-
|
15137 |
-
var renderer = layer.lottie_renderer;
|
15138 |
-
|
15139 |
-
if (!isEditor) {
|
15140 |
-
|
15141 |
-
layout +=
|
15142 |
-
'<div class="premium-lottie-layer premium-lottie-animation premium-lottie-' + renderer + ' elementor-repeater-item-' + layer._id + '"></div>';
|
15143 |
-
|
15144 |
-
target.prepend(layout);
|
15145 |
-
|
15146 |
-
layout = "";
|
15147 |
-
|
15148 |
-
}
|
15149 |
-
|
15150 |
-
var $layer = jQuery('.elementor-repeater-item-' + layer._id);
|
15151 |
-
|
15152 |
-
var loop = layer.lottie_loop,
|
15153 |
-
reverse = layer.lottie_reverse,
|
15154 |
-
trigger = layer.hover_action;
|
15155 |
-
|
15156 |
-
if ("play" !== trigger) {
|
15157 |
-
var scrollStart = layer.start_on_visible;
|
15158 |
-
}
|
15159 |
-
|
15160 |
-
var animItem = lottie.loadAnimation({
|
15161 |
-
wrapper: $layer[0],
|
15162 |
-
renderer: renderer || 'svg',
|
15163 |
-
loop: loop ? true : false,
|
15164 |
-
path: layer.lottie_url,
|
15165 |
-
autoplay: true
|
15166 |
-
});
|
15167 |
-
|
15168 |
-
if (layer.lottie_speed && 1 !== layer.lottie_speed) {
|
15169 |
-
animItem.setSpeed(layer.lottie_speed);
|
15170 |
-
}
|
15171 |
-
|
15172 |
-
if (reverse) {
|
15173 |
-
animItem.setDirection(-1);
|
15174 |
-
}
|
15175 |
-
|
15176 |
-
animItem.addEventListener('DOMLoaded', function () {
|
15177 |
-
|
15178 |
-
if ("play" === trigger || ("play" !== trigger && scrollStart)) {
|
15179 |
-
animItem.pause();
|
15180 |
-
if ("play" !== trigger) {
|
15181 |
-
initLottie("load");
|
15182 |
-
$(window).on("scroll", initLottie);
|
15183 |
-
}
|
15184 |
-
}
|
15185 |
-
|
15186 |
-
if ("none" !== trigger) {
|
15187 |
-
$layer.hover(function () {
|
15188 |
-
if ("play" === trigger) {
|
15189 |
-
animItem.play();
|
15190 |
-
} else if ("pause" === trigger) {
|
15191 |
-
animItem.pause();
|
15192 |
-
}
|
15193 |
-
}, function () {
|
15194 |
-
if ("play" === trigger) {
|
15195 |
-
animItem.pause();
|
15196 |
-
} else if ("pause" === trigger) {
|
15197 |
-
animItem.play();
|
15198 |
-
}
|
15199 |
-
});
|
15200 |
-
}
|
15201 |
-
|
15202 |
-
if ("yes" === layer.premium_lottie_parallax || layer.animate_on_scroll) {
|
15203 |
-
|
15204 |
-
var effects = [];
|
15205 |
-
|
15206 |
-
if ("yes" === layer.premium_lottie_parallax)
|
15207 |
-
effects.push("translateY");
|
15208 |
-
|
15209 |
-
|
15210 |
-
if (layer.animate_on_scroll) {
|
15211 |
-
animItem.pause();
|
15212 |
-
effects.push("animate");
|
15213 |
-
}
|
15214 |
-
|
15215 |
-
var parallaxSettings = {
|
15216 |
-
elType: 'SECTION',
|
15217 |
-
effects: effects
|
15218 |
-
},
|
15219 |
-
parallaxInstance = null;
|
15220 |
-
|
15221 |
-
|
15222 |
-
if (effects.includes('animate')) {
|
15223 |
-
parallaxSettings.animate = {
|
15224 |
-
speed: layer.premium_lottie_animate_speed.size,
|
15225 |
-
range: {
|
15226 |
-
start: layer.premium_lottie_animate_view.sizes.start,
|
15227 |
-
end: layer.premium_lottie_animate_view.sizes.end
|
15228 |
-
}
|
15229 |
-
};
|
15230 |
-
}
|
15231 |
-
|
15232 |
-
|
15233 |
-
if (effects.includes('translateY')) {
|
15234 |
-
|
15235 |
-
parallaxSettings.vscroll = {
|
15236 |
-
speed: layer.premium_lottie_parallax_speed.size || 4,
|
15237 |
-
direction: layer.premium_lottie_parallax_direction,
|
15238 |
-
range: {
|
15239 |
-
start: layer.premium_lottie_parallax_view.sizes.start,
|
15240 |
-
end: layer.premium_lottie_parallax_view.sizes.end
|
15241 |
-
}
|
15242 |
-
};
|
15243 |
-
|
15244 |
-
}
|
15245 |
-
|
15246 |
-
parallaxInstance = new premiumEffects($layer[0], parallaxSettings, animItem);
|
15247 |
-
|
15248 |
-
parallaxInstance.init();
|
15249 |
-
}
|
15250 |
-
|
15251 |
-
});
|
15252 |
-
|
15253 |
-
function initLottie(event) {
|
15254 |
-
|
15255 |
-
var vpHeight = $(window).outerHeight(),
|
15256 |
-
clientSize = true;
|
15257 |
-
|
15258 |
-
if (typeof $layer[0].getBoundingClientRect === "function") {
|
15259 |
-
|
15260 |
-
var rec = $layer[0].getBoundingClientRect();
|
15261 |
-
|
15262 |
-
var tViz = rec.top >= 0 && rec.top < vpHeight,
|
15263 |
-
bViz = rec.bottom > 0 && rec.bottom <= vpHeight,
|
15264 |
-
vVisible = false ? tViz || bViz : tViz && bViz,
|
15265 |
-
vVisible = rec.top < 0 && rec.bottom > vpHeight ? true : vVisible;
|
15266 |
-
|
15267 |
-
clientSize && vVisible ? animItem.play() : animItem.pause();
|
15268 |
-
|
15269 |
-
}
|
15270 |
-
|
15271 |
-
}
|
15272 |
-
|
15273 |
-
});
|
15274 |
-
|
15275 |
-
}
|
15276 |
-
|
15277 |
-
};
|
15278 |
-
|
15279 |
-
window.premiumLottieAnimations = function ($elem) {
|
15280 |
-
|
15281 |
-
var self = this,
|
15282 |
-
$lottie = null;
|
15283 |
-
|
15284 |
-
if ($elem.hasClass("premium-lottie-animation")) {
|
15285 |
-
$lottie = $elem;
|
15286 |
-
} else {
|
15287 |
-
$lottie = $elem.find(".premium-lottie-animation");
|
15288 |
-
}
|
15289 |
-
|
15290 |
-
self.init = function () {
|
15291 |
-
|
15292 |
-
//Check if widget has been initialized before
|
15293 |
-
if ($lottie.data('initialized')) {
|
15294 |
-
return;
|
15295 |
-
}
|
15296 |
-
|
15297 |
-
//Mark widget as initialized
|
15298 |
-
$lottie.data('initialized', true);
|
15299 |
-
|
15300 |
-
// Search for elements with the .lottie and/or .bodymovin class
|
15301 |
-
//lottie.searchAnimations();
|
15302 |
-
|
15303 |
-
var loop = $lottie.data("lottie-loop"),
|
15304 |
-
reverse = $lottie.data("lottie-reverse"),
|
15305 |
-
trigger = $lottie.data("lottie-hover"),
|
15306 |
-
speed = $lottie.data("lottie-speed"),
|
15307 |
-
scroll = $lottie.data("lottie-scroll"),
|
15308 |
-
viewPort = $lottie.data("lottie-viewport"),
|
15309 |
-
renderer = $lottie.data("lottie-render");
|
15310 |
-
|
15311 |
-
var animItem = lottie.loadAnimation({
|
15312 |
-
container: $lottie[0],
|
15313 |
-
renderer: renderer || 'svg',
|
15314 |
-
loop: loop ? true : false,
|
15315 |
-
path: $lottie.data("lottie-url"),
|
15316 |
-
autoplay: true,
|
15317 |
-
});
|
15318 |
-
|
15319 |
-
if (reverse) {
|
15320 |
-
animItem.setDirection(-1);
|
15321 |
-
}
|
15322 |
-
|
15323 |
-
if (speed && 1 !== speed) {
|
15324 |
-
animItem.setSpeed(speed);
|
15325 |
-
}
|
15326 |
-
|
15327 |
-
animItem.addEventListener('DOMLoaded', function () {
|
15328 |
-
|
15329 |
-
if (scroll || viewPort) {
|
15330 |
-
|
15331 |
-
var animateInstance = null,
|
15332 |
-
scrollSpeed = $lottie.data("scroll-speed"),
|
15333 |
-
scrollStart = $lottie.data("scroll-start"),
|
15334 |
-
scrollEnd = $lottie.data("scroll-end");
|
15335 |
-
|
15336 |
-
animItem.pause();
|
15337 |
-
|
15338 |
-
var animateSettings = {
|
15339 |
-
elType: 'SECTION',
|
15340 |
-
animate: {
|
15341 |
-
speed: viewPort ? "viewport" : scrollSpeed,
|
15342 |
-
range: {
|
15343 |
-
start: scrollStart,
|
15344 |
-
end: scrollEnd
|
15345 |
-
}
|
15346 |
-
},
|
15347 |
-
effects: ['animate']
|
15348 |
-
};
|
15349 |
-
|
15350 |
-
animateInstance = new premiumEffects($lottie[0], animateSettings, animItem);
|
15351 |
-
|
15352 |
-
animateInstance.init();
|
15353 |
-
|
15354 |
-
}
|
15355 |
-
|
15356 |
-
if (trigger) {
|
15357 |
-
animItem.pause();
|
15358 |
-
$elem.hover(function () {
|
15359 |
-
animItem.play();
|
15360 |
-
}, function () {
|
15361 |
-
animItem.pause();
|
15362 |
-
});
|
15363 |
-
}
|
15364 |
-
|
15365 |
-
|
15366 |
-
});
|
15367 |
-
|
15368 |
-
|
15369 |
-
};
|
15370 |
-
|
15371 |
-
};
|
15372 |
-
|
15373 |
-
$(window).on("elementor/frontend/init", function () {
|
15374 |
-
|
15375 |
-
elementorFrontend.hooks.addAction("frontend/element_ready/widget", PremiumLottieHandler);
|
15376 |
-
|
15377 |
-
elementorFrontend.hooks.addAction("frontend/element_ready/section", PremiumLottieAddonHandler);
|
15378 |
-
elementorFrontend.hooks.addAction("frontend/element_ready/container", PremiumLottieAddonHandler);
|
15379 |
-
|
15380 |
-
});
|
15381 |
-
|
15382 |
-
window.premiumEffects = function (element, settings, lottieInstance) {
|
15383 |
-
|
15384 |
-
var self = this,
|
15385 |
-
$el = $(element),
|
15386 |
-
scrolls = $el.data("scrolls"),
|
15387 |
-
elementSettings = settings,
|
15388 |
-
elType = elementSettings.elType;
|
15389 |
-
|
15390 |
-
self.elementRules = {};
|
15391 |
-
|
15392 |
-
self.init = function () {
|
15393 |
-
|
15394 |
-
if (scrolls || 'SECTION' === elType) {
|
15395 |
-
|
15396 |
-
if (!elementSettings.effects.length) {
|
15397 |
-
return;
|
15398 |
-
}
|
15399 |
-
|
15400 |
-
self.setDefaults();
|
15401 |
-
|
15402 |
-
elementorFrontend.elements.$window.on('scroll load', self.initScroll);
|
15403 |
-
} else {
|
15404 |
-
elementorFrontend.elements.$window.off('scroll load', self.initScroll);
|
15405 |
-
return;
|
15406 |
-
}
|
15407 |
-
|
15408 |
-
};
|
15409 |
-
|
15410 |
-
self.setDefaults = function () {
|
15411 |
-
|
15412 |
-
elementSettings.defaults = {};
|
15413 |
-
elementSettings.defaults.axis = 'y';
|
15414 |
-
|
15415 |
-
};
|
15416 |
-
|
15417 |
-
self.getPercents = function () {
|
15418 |
-
|
15419 |
-
var dimensions = self.getDimensions();
|
15420 |
-
|
15421 |
-
elementTopWindowPoint = dimensions.elementTop - pageYOffset,
|
15422 |
-
elementEntrancePoint = elementTopWindowPoint - innerHeight;
|
15423 |
-
|
15424 |
-
passedRangePercents = 100 / dimensions.range * (elementEntrancePoint * -1);
|
15425 |
-
|
15426 |
-
return passedRangePercents;
|
15427 |
-
|
15428 |
-
};
|
15429 |
-
|
15430 |
-
self.initScroll = function () {
|
15431 |
-
|
15432 |
-
self.initScrollEffects();
|
15433 |
-
|
15434 |
-
};
|
15435 |
-
|
15436 |
-
self.initScrollEffects = function () {
|
15437 |
-
|
15438 |
-
var percents = self.getPercents();
|
15439 |
-
|
15440 |
-
var elemSettings = $el.closest(".elementor-element").data("settings");
|
15441 |
-
|
15442 |
-
if (elemSettings && "fixed" === elemSettings._position) {
|
15443 |
-
|
15444 |
-
percents = self.getLottieViewportHeightPercentage();
|
15445 |
-
|
15446 |
-
}
|
15447 |
-
|
15448 |
-
if (elementSettings.effects.includes('animate')) {
|
15449 |
-
self.animate(percents, elementSettings.animate);
|
15450 |
-
}
|
15451 |
-
|
15452 |
-
if (elementSettings.effects.includes('translateY')) {
|
15453 |
-
self.transform('translateY', percents, elementSettings.vscroll);
|
15454 |
-
}
|
15455 |
-
|
15456 |
-
};
|
15457 |
-
|
15458 |
-
self.getLottieViewportHeightPercentage = function () {
|
15459 |
-
|
15460 |
-
var offsetObj = elementSettings.animate.range;
|
15461 |
-
var limitPageHeight = window.innerHeight;
|
15462 |
-
var offsetStart = offsetObj.start || 0,
|
15463 |
-
offsetEnd = offsetObj.end || 0,
|
15464 |
-
initialPageHeight = limitPageHeight || document.documentElement.scrollHeight - document.documentElement.clientHeight,
|
15465 |
-
heightOffset = initialPageHeight * offsetStart / 100,
|
15466 |
-
pageRange = initialPageHeight + heightOffset + initialPageHeight * offsetEnd / 100,
|
15467 |
-
scrollPos = document.documentElement.scrollTop + document.body.scrollTop + heightOffset;
|
15468 |
-
|
15469 |
-
return scrollPos / pageRange * 100;
|
15470 |
-
|
15471 |
-
};
|
15472 |
-
|
15473 |
-
self.getDimensions = function () {
|
15474 |
-
|
15475 |
-
var elementOffset = $el.offset();
|
15476 |
-
|
15477 |
-
var dimensions = {
|
15478 |
-
elementHeight: $el.outerHeight(),
|
15479 |
-
elementWidth: $el.outerWidth(),
|
15480 |
-
elementTop: elementOffset.top,
|
15481 |
-
elementLeft: elementOffset.left
|
15482 |
-
};
|
15483 |
-
|
15484 |
-
dimensions.range = dimensions.elementHeight + innerHeight;
|
15485 |
-
|
15486 |
-
return dimensions;
|
15487 |
-
|
15488 |
-
};
|
15489 |
-
|
15490 |
-
self.getStep = function (percents, options) {
|
15491 |
-
return -(percents - 50) * options.speed;
|
15492 |
-
|
15493 |
-
};
|
15494 |
-
|
15495 |
-
self.animate = function (percents, data) {
|
15496 |
-
|
15497 |
-
var stopFrame = lottieInstance.totalFrames;
|
15498 |
-
|
15499 |
-
if (data.range) {
|
15500 |
-
|
15501 |
-
if (data.range.start > percents) {
|
15502 |
-
percents = data.range.start;
|
15503 |
-
}
|
15504 |
-
|
15505 |
-
if (data.range.end < percents) {
|
15506 |
-
percents = data.range.end;
|
15507 |
-
}
|
15508 |
-
|
15509 |
-
}
|
15510 |
-
|
15511 |
-
var currframe = ((percents) / 100) * (stopFrame);
|
15512 |
-
|
15513 |
-
//Check if element is visible
|
15514 |
-
if (data.speed === "viewport") {
|
15515 |
-
if (data.range.start !== percents && data.range.end !== percents) {
|
15516 |
-
lottieInstance.play();
|
15517 |
-
} else {
|
15518 |
-
lottieInstance.pause();
|
15519 |
-
}
|
15520 |
-
} else {
|
15521 |
-
lottieInstance.goToAndStop(currframe, true);
|
15522 |
-
}
|
15523 |
-
|
15524 |
-
};
|
15525 |
-
|
15526 |
-
self.transform = function (action, percents, data) {
|
15527 |
-
|
15528 |
-
if ('down' === data.direction) {
|
15529 |
-
percents = 100 - percents;
|
15530 |
-
}
|
15531 |
-
|
15532 |
-
if (data.range) {
|
15533 |
-
|
15534 |
-
if (data.range.start > percents) {
|
15535 |
-
percents = data.range.start;
|
15536 |
-
}
|
15537 |
-
|
15538 |
-
if (data.range.end < percents) {
|
15539 |
-
percents = data.range.end;
|
15540 |
-
}
|
15541 |
-
|
15542 |
-
}
|
15543 |
-
|
15544 |
-
elementSettings.defaults.unit = 'px';
|
15545 |
-
|
15546 |
-
self.updateElement('transform', action, self.getStep(percents, data) + elementSettings.defaults.unit);
|
15547 |
-
|
15548 |
-
};
|
15549 |
-
|
15550 |
-
self.updateElement = function (propName, key, value) {
|
15551 |
-
|
15552 |
-
if (!self.elementRules[propName]) {
|
15553 |
-
self.elementRules[propName] = {};
|
15554 |
-
}
|
15555 |
-
|
15556 |
-
if (!self.elementRules[propName][key]) {
|
15557 |
-
self.elementRules[propName][key] = true;
|
15558 |
-
|
15559 |
-
self.updateElementRule(propName);
|
15560 |
-
}
|
15561 |
-
|
15562 |
-
var cssVarKey = '--' + key;
|
15563 |
-
|
15564 |
-
element.style.setProperty(cssVarKey, value);
|
15565 |
-
|
15566 |
-
};
|
15567 |
-
|
15568 |
-
self.updateElementRule = function (rule) {
|
15569 |
-
|
15570 |
-
var cssValue = '';
|
15571 |
-
|
15572 |
-
$.each(self.elementRules[rule], function (variableKey) {
|
15573 |
-
cssValue += variableKey + '(var(--' + variableKey + '))';
|
15574 |
-
});
|
15575 |
-
|
15576 |
-
$el.css(rule, cssValue);
|
15577 |
-
|
15578 |
-
};
|
15579 |
-
|
15580 |
-
};
|
15581 |
-
|
1 |
+
(function ($) {
|
2 |
+
|
3 |
+
(typeof navigator !== "undefined") && (function (global, factory) {
|
4 |
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
5 |
+
typeof define === 'function' && define.amd ? define(factory) :
|
6 |
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lottie = factory());
|
7 |
+
})(this, (function () {
|
8 |
+
'use strict';
|
9 |
+
|
10 |
+
var svgNS = 'http://www.w3.org/2000/svg';
|
11 |
+
var locationHref = '';
|
12 |
+
var _useWebWorker = false;
|
13 |
+
var initialDefaultFrame = -999999;
|
14 |
+
|
15 |
+
var setWebWorker = function setWebWorker(flag) {
|
16 |
+
_useWebWorker = !!flag;
|
17 |
+
};
|
18 |
+
|
19 |
+
var getWebWorker = function getWebWorker() {
|
20 |
+
return _useWebWorker;
|
21 |
+
};
|
22 |
+
|
23 |
+
var setLocationHref = function setLocationHref(value) {
|
24 |
+
locationHref = value;
|
25 |
+
};
|
26 |
+
|
27 |
+
var getLocationHref = function getLocationHref() {
|
28 |
+
return locationHref;
|
29 |
+
};
|
30 |
+
|
31 |
+
function createTag(type) {
|
32 |
+
// return {appendChild:function(){},setAttribute:function(){},style:{}}
|
33 |
+
return document.createElement(type);
|
34 |
+
}
|
35 |
+
|
36 |
+
function extendPrototype(sources, destination) {
|
37 |
+
var i;
|
38 |
+
var len = sources.length;
|
39 |
+
var sourcePrototype;
|
40 |
+
|
41 |
+
for (i = 0; i < len; i += 1) {
|
42 |
+
sourcePrototype = sources[i].prototype;
|
43 |
+
|
44 |
+
for (var attr in sourcePrototype) {
|
45 |
+
if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
function getDescriptor(object, prop) {
|
51 |
+
return Object.getOwnPropertyDescriptor(object, prop);
|
52 |
+
}
|
53 |
+
|
54 |
+
function createProxyFunction(prototype) {
|
55 |
+
function ProxyFunction() { }
|
56 |
+
|
57 |
+
ProxyFunction.prototype = prototype;
|
58 |
+
return ProxyFunction;
|
59 |
+
}
|
60 |
+
|
61 |
+
// import Howl from '../../3rd_party/howler';
|
62 |
+
var audioControllerFactory = function () {
|
63 |
+
function AudioController(audioFactory) {
|
64 |
+
this.audios = [];
|
65 |
+
this.audioFactory = audioFactory;
|
66 |
+
this._volume = 1;
|
67 |
+
this._isMuted = false;
|
68 |
+
}
|
69 |
+
|
70 |
+
AudioController.prototype = {
|
71 |
+
addAudio: function addAudio(audio) {
|
72 |
+
this.audios.push(audio);
|
73 |
+
},
|
74 |
+
pause: function pause() {
|
75 |
+
var i;
|
76 |
+
var len = this.audios.length;
|
77 |
+
|
78 |
+
for (i = 0; i < len; i += 1) {
|
79 |
+
this.audios[i].pause();
|
80 |
+
}
|
81 |
+
},
|
82 |
+
resume: function resume() {
|
83 |
+
var i;
|
84 |
+
var len = this.audios.length;
|
85 |
+
|
86 |
+
for (i = 0; i < len; i += 1) {
|
87 |
+
this.audios[i].resume();
|
88 |
+
}
|
89 |
+
},
|
90 |
+
setRate: function setRate(rateValue) {
|
91 |
+
var i;
|
92 |
+
var len = this.audios.length;
|
93 |
+
|
94 |
+
for (i = 0; i < len; i += 1) {
|
95 |
+
this.audios[i].setRate(rateValue);
|
96 |
+
}
|
97 |
+
},
|
98 |
+
createAudio: function createAudio(assetPath) {
|
99 |
+
if (this.audioFactory) {
|
100 |
+
return this.audioFactory(assetPath);
|
101 |
+
}
|
102 |
+
|
103 |
+
if (window.Howl) {
|
104 |
+
return new window.Howl({
|
105 |
+
src: [assetPath]
|
106 |
+
});
|
107 |
+
}
|
108 |
+
|
109 |
+
return {
|
110 |
+
isPlaying: false,
|
111 |
+
play: function play() {
|
112 |
+
this.isPlaying = true;
|
113 |
+
},
|
114 |
+
seek: function seek() {
|
115 |
+
this.isPlaying = false;
|
116 |
+
},
|
117 |
+
playing: function playing() { },
|
118 |
+
rate: function rate() { },
|
119 |
+
setVolume: function setVolume() { }
|
120 |
+
};
|
121 |
+
},
|
122 |
+
setAudioFactory: function setAudioFactory(audioFactory) {
|
123 |
+
this.audioFactory = audioFactory;
|
124 |
+
},
|
125 |
+
setVolume: function setVolume(value) {
|
126 |
+
this._volume = value;
|
127 |
+
|
128 |
+
this._updateVolume();
|
129 |
+
},
|
130 |
+
mute: function mute() {
|
131 |
+
this._isMuted = true;
|
132 |
+
|
133 |
+
this._updateVolume();
|
134 |
+
},
|
135 |
+
unmute: function unmute() {
|
136 |
+
this._isMuted = false;
|
137 |
+
|
138 |
+
this._updateVolume();
|
139 |
+
},
|
140 |
+
getVolume: function getVolume() {
|
141 |
+
return this._volume;
|
142 |
+
},
|
143 |
+
_updateVolume: function _updateVolume() {
|
144 |
+
var i;
|
145 |
+
var len = this.audios.length;
|
146 |
+
|
147 |
+
for (i = 0; i < len; i += 1) {
|
148 |
+
this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
|
149 |
+
}
|
150 |
+
}
|
151 |
+
};
|
152 |
+
return function () {
|
153 |
+
return new AudioController();
|
154 |
+
};
|
155 |
+
}();
|
156 |
+
|
157 |
+
var createTypedArray = function () {
|
158 |
+
function createRegularArray(type, len) {
|
159 |
+
var i = 0;
|
160 |
+
var arr = [];
|
161 |
+
var value;
|
162 |
+
|
163 |
+
switch (type) {
|
164 |
+
case 'int16':
|
165 |
+
case 'uint8c':
|
166 |
+
value = 1;
|
167 |
+
break;
|
168 |
+
|
169 |
+
default:
|
170 |
+
value = 1.1;
|
171 |
+
break;
|
172 |
+
}
|
173 |
+
|
174 |
+
for (i = 0; i < len; i += 1) {
|
175 |
+
arr.push(value);
|
176 |
+
}
|
177 |
+
|
178 |
+
return arr;
|
179 |
+
}
|
180 |
+
|
181 |
+
function createTypedArrayFactory(type, len) {
|
182 |
+
if (type === 'float32') {
|
183 |
+
return new Float32Array(len);
|
184 |
+
}
|
185 |
+
|
186 |
+
if (type === 'int16') {
|
187 |
+
return new Int16Array(len);
|
188 |
+
}
|
189 |
+
|
190 |
+
if (type === 'uint8c') {
|
191 |
+
return new Uint8ClampedArray(len);
|
192 |
+
}
|
193 |
+
|
194 |
+
return createRegularArray(type, len);
|
195 |
+
}
|
196 |
+
|
197 |
+
if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
|
198 |
+
return createTypedArrayFactory;
|
199 |
+
}
|
200 |
+
|
201 |
+
return createRegularArray;
|
202 |
+
}();
|
203 |
+
|
204 |
+
function createSizedArray(len) {
|
205 |
+
return Array.apply(null, {
|
206 |
+
length: len
|
207 |
+
});
|
208 |
+
}
|
209 |
+
|
210 |
+
function _typeof$6(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$6 = function _typeof(obj) { return typeof obj; }; } else { _typeof$6 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$6(obj); }
|
211 |
+
var subframeEnabled = true;
|
212 |
+
var expressionsPlugin = null;
|
213 |
+
var idPrefix$1 = '';
|
214 |
+
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
215 |
+
var _shouldRoundValues = false;
|
216 |
+
var bmPow = Math.pow;
|
217 |
+
var bmSqrt = Math.sqrt;
|
218 |
+
var bmFloor = Math.floor;
|
219 |
+
var bmMax = Math.max;
|
220 |
+
var bmMin = Math.min;
|
221 |
+
var BMMath = {};
|
222 |
+
|
223 |
+
(function () {
|
224 |
+
var propertyNames = ['abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'atan2', 'ceil', 'cbrt', 'expm1', 'clz32', 'cos', 'cosh', 'exp', 'floor', 'fround', 'hypot', 'imul', 'log', 'log1p', 'log2', 'log10', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc', 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2'];
|
225 |
+
var i;
|
226 |
+
var len = propertyNames.length;
|
227 |
+
|
228 |
+
for (i = 0; i < len; i += 1) {
|
229 |
+
BMMath[propertyNames[i]] = Math[propertyNames[i]];
|
230 |
+
}
|
231 |
+
})();
|
232 |
+
|
233 |
+
function ProjectInterface$1() {
|
234 |
+
return {};
|
235 |
+
}
|
236 |
+
|
237 |
+
BMMath.random = Math.random;
|
238 |
+
|
239 |
+
BMMath.abs = function (val) {
|
240 |
+
var tOfVal = _typeof$6(val);
|
241 |
+
|
242 |
+
if (tOfVal === 'object' && val.length) {
|
243 |
+
var absArr = createSizedArray(val.length);
|
244 |
+
var i;
|
245 |
+
var len = val.length;
|
246 |
+
|
247 |
+
for (i = 0; i < len; i += 1) {
|
248 |
+
absArr[i] = Math.abs(val[i]);
|
249 |
+
}
|
250 |
+
|
251 |
+
return absArr;
|
252 |
+
}
|
253 |
+
|
254 |
+
return Math.abs(val);
|
255 |
+
};
|
256 |
+
|
257 |
+
var defaultCurveSegments = 150;
|
258 |
+
var degToRads = Math.PI / 180;
|
259 |
+
var roundCorner = 0.5519;
|
260 |
+
|
261 |
+
function roundValues(flag) {
|
262 |
+
_shouldRoundValues = !!flag;
|
263 |
+
}
|
264 |
+
|
265 |
+
function bmRnd(value) {
|
266 |
+
if (_shouldRoundValues) {
|
267 |
+
return Math.round(value);
|
268 |
+
}
|
269 |
+
|
270 |
+
return value;
|
271 |
+
}
|
272 |
+
|
273 |
+
function styleDiv(element) {
|
274 |
+
element.style.position = 'absolute';
|
275 |
+
element.style.top = 0;
|
276 |
+
element.style.left = 0;
|
277 |
+
element.style.display = 'block';
|
278 |
+
element.style.transformOrigin = '0 0';
|
279 |
+
element.style.webkitTransformOrigin = '0 0';
|
280 |
+
element.style.backfaceVisibility = 'visible';
|
281 |
+
element.style.webkitBackfaceVisibility = 'visible';
|
282 |
+
element.style.transformStyle = 'preserve-3d';
|
283 |
+
element.style.webkitTransformStyle = 'preserve-3d';
|
284 |
+
element.style.mozTransformStyle = 'preserve-3d';
|
285 |
+
}
|
286 |
+
|
287 |
+
function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
|
288 |
+
this.type = type;
|
289 |
+
this.currentTime = currentTime;
|
290 |
+
this.totalTime = totalTime;
|
291 |
+
this.direction = frameMultiplier < 0 ? -1 : 1;
|
292 |
+
}
|
293 |
+
|
294 |
+
function BMCompleteEvent(type, frameMultiplier) {
|
295 |
+
this.type = type;
|
296 |
+
this.direction = frameMultiplier < 0 ? -1 : 1;
|
297 |
+
}
|
298 |
+
|
299 |
+
function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
|
300 |
+
this.type = type;
|
301 |
+
this.currentLoop = currentLoop;
|
302 |
+
this.totalLoops = totalLoops;
|
303 |
+
this.direction = frameMultiplier < 0 ? -1 : 1;
|
304 |
+
}
|
305 |
+
|
306 |
+
function BMSegmentStartEvent(type, firstFrame, totalFrames) {
|
307 |
+
this.type = type;
|
308 |
+
this.firstFrame = firstFrame;
|
309 |
+
this.totalFrames = totalFrames;
|
310 |
+
}
|
311 |
+
|
312 |
+
function BMDestroyEvent(type, target) {
|
313 |
+
this.type = type;
|
314 |
+
this.target = target;
|
315 |
+
}
|
316 |
+
|
317 |
+
function BMRenderFrameErrorEvent(nativeError, currentTime) {
|
318 |
+
this.type = 'renderFrameError';
|
319 |
+
this.nativeError = nativeError;
|
320 |
+
this.currentTime = currentTime;
|
321 |
+
}
|
322 |
+
|
323 |
+
function BMConfigErrorEvent(nativeError) {
|
324 |
+
this.type = 'configError';
|
325 |
+
this.nativeError = nativeError;
|
326 |
+
}
|
327 |
+
|
328 |
+
function BMAnimationConfigErrorEvent(type, nativeError) {
|
329 |
+
this.type = type;
|
330 |
+
this.nativeError = nativeError;
|
331 |
+
}
|
332 |
+
|
333 |
+
var createElementID = function () {
|
334 |
+
var _count = 0;
|
335 |
+
return function createID() {
|
336 |
+
_count += 1;
|
337 |
+
return idPrefix$1 + '__lottie_element_' + _count;
|
338 |
+
};
|
339 |
+
}();
|
340 |
+
|
341 |
+
function HSVtoRGB(h, s, v) {
|
342 |
+
var r;
|
343 |
+
var g;
|
344 |
+
var b;
|
345 |
+
var i;
|
346 |
+
var f;
|
347 |
+
var p;
|
348 |
+
var q;
|
349 |
+
var t;
|
350 |
+
i = Math.floor(h * 6);
|
351 |
+
f = h * 6 - i;
|
352 |
+
p = v * (1 - s);
|
353 |
+
q = v * (1 - f * s);
|
354 |
+
t = v * (1 - (1 - f) * s);
|
355 |
+
|
356 |
+
switch (i % 6) {
|
357 |
+
case 0:
|
358 |
+
r = v;
|
359 |
+
g = t;
|
360 |
+
b = p;
|
361 |
+
break;
|
362 |
+
|
363 |
+
case 1:
|
364 |
+
r = q;
|
365 |
+
g = v;
|
366 |
+
b = p;
|
367 |
+
break;
|
368 |
+
|
369 |
+
case 2:
|
370 |
+
r = p;
|
371 |
+
g = v;
|
372 |
+
b = t;
|
373 |
+
break;
|
374 |
+
|
375 |
+
case 3:
|
376 |
+
r = p;
|
377 |
+
g = q;
|
378 |
+
b = v;
|
379 |
+
break;
|
380 |
+
|
381 |
+
case 4:
|
382 |
+
r = t;
|
383 |
+
g = p;
|
384 |
+
b = v;
|
385 |
+
break;
|
386 |
+
|
387 |
+
case 5:
|
388 |
+
r = v;
|
389 |
+
g = p;
|
390 |
+
b = q;
|
391 |
+
break;
|
392 |
+
|
393 |
+
default:
|
394 |
+
break;
|
395 |
+
}
|
396 |
+
|
397 |
+
return [r, g, b];
|
398 |
+
}
|
399 |
+
|
400 |
+
function RGBtoHSV(r, g, b) {
|
401 |
+
var max = Math.max(r, g, b);
|
402 |
+
var min = Math.min(r, g, b);
|
403 |
+
var d = max - min;
|
404 |
+
var h;
|
405 |
+
var s = max === 0 ? 0 : d / max;
|
406 |
+
var v = max / 255;
|
407 |
+
|
408 |
+
switch (max) {
|
409 |
+
case min:
|
410 |
+
h = 0;
|
411 |
+
break;
|
412 |
+
|
413 |
+
case r:
|
414 |
+
h = g - b + d * (g < b ? 6 : 0);
|
415 |
+
h /= 6 * d;
|
416 |
+
break;
|
417 |
+
|
418 |
+
case g:
|
419 |
+
h = b - r + d * 2;
|
420 |
+
h /= 6 * d;
|
421 |
+
break;
|
422 |
+
|
423 |
+
case b:
|
424 |
+
h = r - g + d * 4;
|
425 |
+
h /= 6 * d;
|
426 |
+
break;
|
427 |
+
|
428 |
+
default:
|
429 |
+
break;
|
430 |
+
}
|
431 |
+
|
432 |
+
return [h, s, v];
|
433 |
+
}
|
434 |
+
|
435 |
+
function addSaturationToRGB(color, offset) {
|
436 |
+
var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
|
437 |
+
hsv[1] += offset;
|
438 |
+
|
439 |
+
if (hsv[1] > 1) {
|
440 |
+
hsv[1] = 1;
|
441 |
+
} else if (hsv[1] <= 0) {
|
442 |
+
hsv[1] = 0;
|
443 |
+
}
|
444 |
+
|
445 |
+
return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
|
446 |
+
}
|
447 |
+
|
448 |
+
function addBrightnessToRGB(color, offset) {
|
449 |
+
var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
|
450 |
+
hsv[2] += offset;
|
451 |
+
|
452 |
+
if (hsv[2] > 1) {
|
453 |
+
hsv[2] = 1;
|
454 |
+
} else if (hsv[2] < 0) {
|
455 |
+
hsv[2] = 0;
|
456 |
+
}
|
457 |
+
|
458 |
+
return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
|
459 |
+
}
|
460 |
+
|
461 |
+
function addHueToRGB(color, offset) {
|
462 |
+
var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
|
463 |
+
hsv[0] += offset / 360;
|
464 |
+
|
465 |
+
if (hsv[0] > 1) {
|
466 |
+
hsv[0] -= 1;
|
467 |
+
} else if (hsv[0] < 0) {
|
468 |
+
hsv[0] += 1;
|
469 |
+
}
|
470 |
+
|
471 |
+
return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
|
472 |
+
}
|
473 |
+
|
474 |
+
var rgbToHex = function () {
|
475 |
+
var colorMap = [];
|
476 |
+
var i;
|
477 |
+
var hex;
|
478 |
+
|
479 |
+
for (i = 0; i < 256; i += 1) {
|
480 |
+
hex = i.toString(16);
|
481 |
+
colorMap[i] = hex.length === 1 ? '0' + hex : hex;
|
482 |
+
}
|
483 |
+
|
484 |
+
return function (r, g, b) {
|
485 |
+
if (r < 0) {
|
486 |
+
r = 0;
|
487 |
+
}
|
488 |
+
|
489 |
+
if (g < 0) {
|
490 |
+
g = 0;
|
491 |
+
}
|
492 |
+
|
493 |
+
if (b < 0) {
|
494 |
+
b = 0;
|
495 |
+
}
|
496 |
+
|
497 |
+
return '#' + colorMap[r] + colorMap[g] + colorMap[b];
|
498 |
+
};
|
499 |
+
}();
|
500 |
+
|
501 |
+
var setSubframeEnabled = function setSubframeEnabled(flag) {
|
502 |
+
subframeEnabled = !!flag;
|
503 |
+
};
|
504 |
+
|
505 |
+
var getSubframeEnabled = function getSubframeEnabled() {
|
506 |
+
return subframeEnabled;
|
507 |
+
};
|
508 |
+
|
509 |
+
var setExpressionsPlugin = function setExpressionsPlugin(value) {
|
510 |
+
expressionsPlugin = value;
|
511 |
+
};
|
512 |
+
|
513 |
+
var getExpressionsPlugin = function getExpressionsPlugin() {
|
514 |
+
return expressionsPlugin;
|
515 |
+
};
|
516 |
+
|
517 |
+
var setDefaultCurveSegments = function setDefaultCurveSegments(value) {
|
518 |
+
defaultCurveSegments = value;
|
519 |
+
};
|
520 |
+
|
521 |
+
var getDefaultCurveSegments = function getDefaultCurveSegments() {
|
522 |
+
return defaultCurveSegments;
|
523 |
+
};
|
524 |
+
|
525 |
+
var setIdPrefix = function setIdPrefix(value) {
|
526 |
+
idPrefix$1 = value;
|
527 |
+
};
|
528 |
+
|
529 |
+
var getIdPrefix = function getIdPrefix() {
|
530 |
+
return idPrefix$1;
|
531 |
+
};
|
532 |
+
|
533 |
+
function createNS(type) {
|
534 |
+
// return {appendChild:function(){},setAttribute:function(){},style:{}}
|
535 |
+
return document.createElementNS(svgNS, type);
|
536 |
+
}
|
537 |
+
|
538 |
+
function _typeof$5(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$5 = function _typeof(obj) { return typeof obj; }; } else { _typeof$5 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$5(obj); }
|
539 |
+
|
540 |
+
var dataManager = function () {
|
541 |
+
var _counterId = 1;
|
542 |
+
var processes = [];
|
543 |
+
var workerFn;
|
544 |
+
var workerInstance;
|
545 |
+
var workerProxy = {
|
546 |
+
onmessage: function onmessage() { },
|
547 |
+
postMessage: function postMessage(path) {
|
548 |
+
workerFn({
|
549 |
+
data: path
|
550 |
+
});
|
551 |
+
}
|
552 |
+
};
|
553 |
+
var _workerSelf = {
|
554 |
+
postMessage: function postMessage(data) {
|
555 |
+
workerProxy.onmessage({
|
556 |
+
data: data
|
557 |
+
});
|
558 |
+
}
|
559 |
+
};
|
560 |
+
|
561 |
+
function createWorker(fn) {
|
562 |
+
if (window.Worker && window.Blob && getWebWorker()) {
|
563 |
+
var blob = new Blob(['var _workerSelf = self; self.onmessage = ', fn.toString()], {
|
564 |
+
type: 'text/javascript'
|
565 |
+
}); // var blob = new Blob(['self.onmessage = ', fn.toString()], { type: 'text/javascript' });
|
566 |
+
|
567 |
+
var url = URL.createObjectURL(blob);
|
568 |
+
return new Worker(url);
|
569 |
+
}
|
570 |
+
|
571 |
+
workerFn = fn;
|
572 |
+
return workerProxy;
|
573 |
+
}
|
574 |
+
|
575 |
+
function setupWorker() {
|
576 |
+
if (!workerInstance) {
|
577 |
+
workerInstance = createWorker(function workerStart(e) {
|
578 |
+
function dataFunctionManager() {
|
579 |
+
function completeLayers(layers, comps) {
|
580 |
+
var layerData;
|
581 |
+
var i;
|
582 |
+
var len = layers.length;
|
583 |
+
var j;
|
584 |
+
var jLen;
|
585 |
+
var k;
|
586 |
+
var kLen;
|
587 |
+
|
588 |
+
for (i = 0; i < len; i += 1) {
|
589 |
+
layerData = layers[i];
|
590 |
+
|
591 |
+
if ('ks' in layerData && !layerData.completed) {
|
592 |
+
layerData.completed = true;
|
593 |
+
|
594 |
+
if (layerData.tt) {
|
595 |
+
layers[i - 1].td = layerData.tt;
|
596 |
+
}
|
597 |
+
|
598 |
+
if (layerData.hasMask) {
|
599 |
+
var maskProps = layerData.masksProperties;
|
600 |
+
jLen = maskProps.length;
|
601 |
+
|
602 |
+
for (j = 0; j < jLen; j += 1) {
|
603 |
+
if (maskProps[j].pt.k.i) {
|
604 |
+
convertPathsToAbsoluteValues(maskProps[j].pt.k);
|
605 |
+
} else {
|
606 |
+
kLen = maskProps[j].pt.k.length;
|
607 |
+
|
608 |
+
for (k = 0; k < kLen; k += 1) {
|
609 |
+
if (maskProps[j].pt.k[k].s) {
|
610 |
+
convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
|
611 |
+
}
|
612 |
+
|
613 |
+
if (maskProps[j].pt.k[k].e) {
|
614 |
+
convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
|
615 |
+
}
|
616 |
+
}
|
617 |
+
}
|
618 |
+
}
|
619 |
+
}
|
620 |
+
|
621 |
+
if (layerData.ty === 0) {
|
622 |
+
layerData.layers = findCompLayers(layerData.refId, comps);
|
623 |
+
completeLayers(layerData.layers, comps);
|
624 |
+
} else if (layerData.ty === 4) {
|
625 |
+
completeShapes(layerData.shapes);
|
626 |
+
} else if (layerData.ty === 5) {
|
627 |
+
completeText(layerData);
|
628 |
+
}
|
629 |
+
}
|
630 |
+
}
|
631 |
+
}
|
632 |
+
|
633 |
+
function completeChars(chars, assets) {
|
634 |
+
if (chars) {
|
635 |
+
var i = 0;
|
636 |
+
var len = chars.length;
|
637 |
+
|
638 |
+
for (i = 0; i < len; i += 1) {
|
639 |
+
if (chars[i].t === 1) {
|
640 |
+
// var compData = findComp(chars[i].data.refId, assets);
|
641 |
+
chars[i].data.layers = findCompLayers(chars[i].data.refId, assets); // chars[i].data.ip = 0;
|
642 |
+
// chars[i].data.op = 99999;
|
643 |
+
// chars[i].data.st = 0;
|
644 |
+
// chars[i].data.sr = 1;
|
645 |
+
// chars[i].w = compData.w;
|
646 |
+
// chars[i].data.ks = {
|
647 |
+
// a: { k: [0, 0, 0], a: 0 },
|
648 |
+
// p: { k: [0, -compData.h, 0], a: 0 },
|
649 |
+
// r: { k: 0, a: 0 },
|
650 |
+
// s: { k: [100, 100], a: 0 },
|
651 |
+
// o: { k: 100, a: 0 },
|
652 |
+
// };
|
653 |
+
|
654 |
+
completeLayers(chars[i].data.layers, assets);
|
655 |
+
}
|
656 |
+
}
|
657 |
+
}
|
658 |
+
}
|
659 |
+
|
660 |
+
function findComp(id, comps) {
|
661 |
+
var i = 0;
|
662 |
+
var len = comps.length;
|
663 |
+
|
664 |
+
while (i < len) {
|
665 |
+
if (comps[i].id === id) {
|
666 |
+
return comps[i];
|
667 |
+
}
|
668 |
+
|
669 |
+
i += 1;
|
670 |
+
}
|
671 |
+
|
672 |
+
return null;
|
673 |
+
}
|
674 |
+
|
675 |
+
function findCompLayers(id, comps) {
|
676 |
+
var comp = findComp(id, comps);
|
677 |
+
|
678 |
+
if (comp) {
|
679 |
+
if (!comp.layers.__used) {
|
680 |
+
comp.layers.__used = true;
|
681 |
+
return comp.layers;
|
682 |
+
}
|
683 |
+
|
684 |
+
return JSON.parse(JSON.stringify(comp.layers));
|
685 |
+
}
|
686 |
+
|
687 |
+
return null;
|
688 |
+
}
|
689 |
+
|
690 |
+
function completeShapes(arr) {
|
691 |
+
var i;
|
692 |
+
var len = arr.length;
|
693 |
+
var j;
|
694 |
+
var jLen;
|
695 |
+
|
696 |
+
for (i = len - 1; i >= 0; i -= 1) {
|
697 |
+
if (arr[i].ty === 'sh') {
|
698 |
+
if (arr[i].ks.k.i) {
|
699 |
+
convertPathsToAbsoluteValues(arr[i].ks.k);
|
700 |
+
} else {
|
701 |
+
jLen = arr[i].ks.k.length;
|
702 |
+
|
703 |
+
for (j = 0; j < jLen; j += 1) {
|
704 |
+
if (arr[i].ks.k[j].s) {
|
705 |
+
convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
|
706 |
+
}
|
707 |
+
|
708 |
+
if (arr[i].ks.k[j].e) {
|
709 |
+
convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
|
710 |
+
}
|
711 |
+
}
|
712 |
+
}
|
713 |
+
} else if (arr[i].ty === 'gr') {
|
714 |
+
completeShapes(arr[i].it);
|
715 |
+
}
|
716 |
+
}
|
717 |
+
}
|
718 |
+
|
719 |
+
function convertPathsToAbsoluteValues(path) {
|
720 |
+
var i;
|
721 |
+
var len = path.i.length;
|
722 |
+
|
723 |
+
for (i = 0; i < len; i += 1) {
|
724 |
+
path.i[i][0] += path.v[i][0];
|
725 |
+
path.i[i][1] += path.v[i][1];
|
726 |
+
path.o[i][0] += path.v[i][0];
|
727 |
+
path.o[i][1] += path.v[i][1];
|
728 |
+
}
|
729 |
+
}
|
730 |
+
|
731 |
+
function checkVersion(minimum, animVersionString) {
|
732 |
+
var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
|
733 |
+
|
734 |
+
if (minimum[0] > animVersion[0]) {
|
735 |
+
return true;
|
736 |
+
}
|
737 |
+
|
738 |
+
if (animVersion[0] > minimum[0]) {
|
739 |
+
return false;
|
740 |
+
}
|
741 |
+
|
742 |
+
if (minimum[1] > animVersion[1]) {
|
743 |
+
return true;
|
744 |
+
}
|
745 |
+
|
746 |
+
if (animVersion[1] > minimum[1]) {
|
747 |
+
return false;
|
748 |
+
}
|
749 |
+
|
750 |
+
if (minimum[2] > animVersion[2]) {
|
751 |
+
return true;
|
752 |
+
}
|
753 |
+
|
754 |
+
if (animVersion[2] > minimum[2]) {
|
755 |
+
return false;
|
756 |
+
}
|
757 |
+
|
758 |
+
return null;
|
759 |
+
}
|
760 |
+
|
761 |
+
var checkText = function () {
|
762 |
+
var minimumVersion = [4, 4, 14];
|
763 |
+
|
764 |
+
function updateTextLayer(textLayer) {
|
765 |
+
var documentData = textLayer.t.d;
|
766 |
+
textLayer.t.d = {
|
767 |
+
k: [{
|
768 |
+
s: documentData,
|
769 |
+
t: 0
|
770 |
+
}]
|
771 |
+
};
|
772 |
+
}
|
773 |
+
|
774 |
+
function iterateLayers(layers) {
|
775 |
+
var i;
|
776 |
+
var len = layers.length;
|
777 |
+
|
778 |
+
for (i = 0; i < len; i += 1) {
|
779 |
+
if (layers[i].ty === 5) {
|
780 |
+
updateTextLayer(layers[i]);
|
781 |
+
}
|
782 |
+
}
|
783 |
+
}
|
784 |
+
|
785 |
+
return function (animationData) {
|
786 |
+
if (checkVersion(minimumVersion, animationData.v)) {
|
787 |
+
iterateLayers(animationData.layers);
|
788 |
+
|
789 |
+
if (animationData.assets) {
|
790 |
+
var i;
|
791 |
+
var len = animationData.assets.length;
|
792 |
+
|
793 |
+
for (i = 0; i < len; i += 1) {
|
794 |
+
if (animationData.assets[i].layers) {
|
795 |
+
iterateLayers(animationData.assets[i].layers);
|
796 |
+
}
|
797 |
+
}
|
798 |
+
}
|
799 |
+
}
|
800 |
+
};
|
801 |
+
}();
|
802 |
+
|
803 |
+
var checkChars = function () {
|
804 |
+
var minimumVersion = [4, 7, 99];
|
805 |
+
return function (animationData) {
|
806 |
+
if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
|
807 |
+
var i;
|
808 |
+
var len = animationData.chars.length;
|
809 |
+
|
810 |
+
for (i = 0; i < len; i += 1) {
|
811 |
+
var charData = animationData.chars[i];
|
812 |
+
|
813 |
+
if (charData.data && charData.data.shapes) {
|
814 |
+
completeShapes(charData.data.shapes);
|
815 |
+
charData.data.ip = 0;
|
816 |
+
charData.data.op = 99999;
|
817 |
+
charData.data.st = 0;
|
818 |
+
charData.data.sr = 1;
|
819 |
+
charData.data.ks = {
|
820 |
+
p: {
|
821 |
+
k: [0, 0],
|
822 |
+
a: 0
|
823 |
+
},
|
824 |
+
s: {
|
825 |
+
k: [100, 100],
|
826 |
+
a: 0
|
827 |
+
},
|
828 |
+
a: {
|
829 |
+
k: [0, 0],
|
830 |
+
a: 0
|
831 |
+
},
|
832 |
+
r: {
|
833 |
+
k: 0,
|
834 |
+
a: 0
|
835 |
+
},
|
836 |
+
o: {
|
837 |
+
k: 100,
|
838 |
+
a: 0
|
839 |
+
}
|
840 |
+
};
|
841 |
+
|
842 |
+
if (!animationData.chars[i].t) {
|
843 |
+
charData.data.shapes.push({
|
844 |
+
ty: 'no'
|
845 |
+
});
|
846 |
+
charData.data.shapes[0].it.push({
|
847 |
+
p: {
|
848 |
+
k: [0, 0],
|
849 |
+
a: 0
|
850 |
+
},
|
851 |
+
s: {
|
852 |
+
k: [100, 100],
|
853 |
+
a: 0
|
854 |
+
},
|
855 |
+
a: {
|
856 |
+
k: [0, 0],
|
857 |
+
a: 0
|
858 |
+
},
|
859 |
+
r: {
|
860 |
+
k: 0,
|
861 |
+
a: 0
|
862 |
+
},
|
863 |
+
o: {
|
864 |
+
k: 100,
|
865 |
+
a: 0
|
866 |
+
},
|
867 |
+
sk: {
|
868 |
+
k: 0,
|
869 |
+
a: 0
|
870 |
+
},
|
871 |
+
sa: {
|
872 |
+
k: 0,
|
873 |
+
a: 0
|
874 |
+
},
|
875 |
+
ty: 'tr'
|
876 |
+
});
|
877 |
+
}
|
878 |
+
}
|
879 |
+
}
|
880 |
+
}
|
881 |
+
};
|
882 |
+
}();
|
883 |
+
|
884 |
+
var checkPathProperties = function () {
|
885 |
+
var minimumVersion = [5, 7, 15];
|
886 |
+
|
887 |
+
function updateTextLayer(textLayer) {
|
888 |
+
var pathData = textLayer.t.p;
|
889 |
+
|
890 |
+
if (typeof pathData.a === 'number') {
|
891 |
+
pathData.a = {
|
892 |
+
a: 0,
|
893 |
+
k: pathData.a
|
894 |
+
};
|
895 |
+
}
|
896 |
+
|
897 |
+
if (typeof pathData.p === 'number') {
|
898 |
+
pathData.p = {
|
899 |
+
a: 0,
|
900 |
+
k: pathData.p
|
901 |
+
};
|
902 |
+
}
|
903 |
+
|
904 |
+
if (typeof pathData.r === 'number') {
|
905 |
+
pathData.r = {
|
906 |
+
a: 0,
|
907 |
+
k: pathData.r
|
908 |
+
};
|
909 |
+
}
|
910 |
+
}
|
911 |
+
|
912 |
+
function iterateLayers(layers) {
|
913 |
+
var i;
|
914 |
+
var len = layers.length;
|
915 |
+
|
916 |
+
for (i = 0; i < len; i += 1) {
|
917 |
+
if (layers[i].ty === 5) {
|
918 |
+
updateTextLayer(layers[i]);
|
919 |
+
}
|
920 |
+
}
|
921 |
+
}
|
922 |
+
|
923 |
+
return function (animationData) {
|
924 |
+
if (checkVersion(minimumVersion, animationData.v)) {
|
925 |
+
iterateLayers(animationData.layers);
|
926 |
+
|
927 |
+
if (animationData.assets) {
|
928 |
+
var i;
|
929 |
+
var len = animationData.assets.length;
|
930 |
+
|
931 |
+
for (i = 0; i < len; i += 1) {
|
932 |
+
if (animationData.assets[i].layers) {
|
933 |
+
iterateLayers(animationData.assets[i].layers);
|
934 |
+
}
|
935 |
+
}
|
936 |
+
}
|
937 |
+
}
|
938 |
+
};
|
939 |
+
}();
|
940 |
+
|
941 |
+
var checkColors = function () {
|
942 |
+
var minimumVersion = [4, 1, 9];
|
943 |
+
|
944 |
+
function iterateShapes(shapes) {
|
945 |
+
var i;
|
946 |
+
var len = shapes.length;
|
947 |
+
var j;
|
948 |
+
var jLen;
|
949 |
+
|
950 |
+
for (i = 0; i < len; i += 1) {
|
951 |
+
if (shapes[i].ty === 'gr') {
|
952 |
+
iterateShapes(shapes[i].it);
|
953 |
+
} else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
|
954 |
+
if (shapes[i].c.k && shapes[i].c.k[0].i) {
|
955 |
+
jLen = shapes[i].c.k.length;
|
956 |
+
|
957 |
+
for (j = 0; j < jLen; j += 1) {
|
958 |
+
if (shapes[i].c.k[j].s) {
|
959 |
+
shapes[i].c.k[j].s[0] /= 255;
|
960 |
+
shapes[i].c.k[j].s[1] /= 255;
|
961 |
+
shapes[i].c.k[j].s[2] /= 255;
|
962 |
+
shapes[i].c.k[j].s[3] /= 255;
|
963 |
+
}
|
964 |
+
|
965 |
+
if (shapes[i].c.k[j].e) {
|
966 |
+
shapes[i].c.k[j].e[0] /= 255;
|
967 |
+
shapes[i].c.k[j].e[1] /= 255;
|
968 |
+
shapes[i].c.k[j].e[2] /= 255;
|
969 |
+
shapes[i].c.k[j].e[3] /= 255;
|
970 |
+
}
|
971 |
+
}
|
972 |
+
} else {
|
973 |
+
shapes[i].c.k[0] /= 255;
|
974 |
+
shapes[i].c.k[1] /= 255;
|
975 |
+
shapes[i].c.k[2] /= 255;
|
976 |
+
shapes[i].c.k[3] /= 255;
|
977 |
+
}
|
978 |
+
}
|
979 |
+
}
|
980 |
+
}
|
981 |
+
|
982 |
+
function iterateLayers(layers) {
|
983 |
+
var i;
|
984 |
+
var len = layers.length;
|
985 |
+
|
986 |
+
for (i = 0; i < len; i += 1) {
|
987 |
+
if (layers[i].ty === 4) {
|
988 |
+
iterateShapes(layers[i].shapes);
|
989 |
+
}
|
990 |
+
}
|
991 |
+
}
|
992 |
+
|
993 |
+
return function (animationData) {
|
994 |
+
if (checkVersion(minimumVersion, animationData.v)) {
|
995 |
+
iterateLayers(animationData.layers);
|
996 |
+
|
997 |
+
if (animationData.assets) {
|
998 |
+
var i;
|
999 |
+
var len = animationData.assets.length;
|
1000 |
+
|
1001 |
+
for (i = 0; i < len; i += 1) {
|
1002 |
+
if (animationData.assets[i].layers) {
|
1003 |
+
iterateLayers(animationData.assets[i].layers);
|
1004 |
+
}
|
1005 |
+
}
|
1006 |
+
}
|
1007 |
+
}
|
1008 |
+
};
|
1009 |
+
}();
|
1010 |
+
|
1011 |
+
var checkShapes = function () {
|
1012 |
+
var minimumVersion = [4, 4, 18];
|
1013 |
+
|
1014 |
+
function completeClosingShapes(arr) {
|
1015 |
+
var i;
|
1016 |
+
var len = arr.length;
|
1017 |
+
var j;
|
1018 |
+
var jLen;
|
1019 |
+
|
1020 |
+
for (i = len - 1; i >= 0; i -= 1) {
|
1021 |
+
if (arr[i].ty === 'sh') {
|
1022 |
+
if (arr[i].ks.k.i) {
|
1023 |
+
arr[i].ks.k.c = arr[i].closed;
|
1024 |
+
} else {
|
1025 |
+
jLen = arr[i].ks.k.length;
|
1026 |
+
|
1027 |
+
for (j = 0; j < jLen; j += 1) {
|
1028 |
+
if (arr[i].ks.k[j].s) {
|
1029 |
+
arr[i].ks.k[j].s[0].c = arr[i].closed;
|
1030 |
+
}
|
1031 |
+
|
1032 |
+
if (arr[i].ks.k[j].e) {
|
1033 |
+
arr[i].ks.k[j].e[0].c = arr[i].closed;
|
1034 |
+
}
|
1035 |
+
}
|
1036 |
+
}
|
1037 |
+
} else if (arr[i].ty === 'gr') {
|
1038 |
+
completeClosingShapes(arr[i].it);
|
1039 |
+
}
|
1040 |
+
}
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
function iterateLayers(layers) {
|
1044 |
+
var layerData;
|
1045 |
+
var i;
|
1046 |
+
var len = layers.length;
|
1047 |
+
var j;
|
1048 |
+
var jLen;
|
1049 |
+
var k;
|
1050 |
+
var kLen;
|
1051 |
+
|
1052 |
+
for (i = 0; i < len; i += 1) {
|
1053 |
+
layerData = layers[i];
|
1054 |
+
|
1055 |
+
if (layerData.hasMask) {
|
1056 |
+
var maskProps = layerData.masksProperties;
|
1057 |
+
jLen = maskProps.length;
|
1058 |
+
|
1059 |
+
for (j = 0; j < jLen; j += 1) {
|
1060 |
+
if (maskProps[j].pt.k.i) {
|
1061 |
+
maskProps[j].pt.k.c = maskProps[j].cl;
|
1062 |
+
} else {
|
1063 |
+
kLen = maskProps[j].pt.k.length;
|
1064 |
+
|
1065 |
+
for (k = 0; k < kLen; k += 1) {
|
1066 |
+
if (maskProps[j].pt.k[k].s) {
|
1067 |
+
maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
if (maskProps[j].pt.k[k].e) {
|
1071 |
+
maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
|
1072 |
+
}
|
1073 |
+
}
|
1074 |
+
}
|
1075 |
+
}
|
1076 |
+
}
|
1077 |
+
|
1078 |
+
if (layerData.ty === 4) {
|
1079 |
+
completeClosingShapes(layerData.shapes);
|
1080 |
+
}
|
1081 |
+
}
|
1082 |
+
}
|
1083 |
+
|
1084 |
+
return function (animationData) {
|
1085 |
+
if (checkVersion(minimumVersion, animationData.v)) {
|
1086 |
+
iterateLayers(animationData.layers);
|
1087 |
+
|
1088 |
+
if (animationData.assets) {
|
1089 |
+
var i;
|
1090 |
+
var len = animationData.assets.length;
|
1091 |
+
|
1092 |
+
for (i = 0; i < len; i += 1) {
|
1093 |
+
if (animationData.assets[i].layers) {
|
1094 |
+
iterateLayers(animationData.assets[i].layers);
|
1095 |
+
}
|
1096 |
+
}
|
1097 |
+
}
|
1098 |
+
}
|
1099 |
+
};
|
1100 |
+
}();
|
1101 |
+
|
1102 |
+
function completeData(animationData) {
|
1103 |
+
if (animationData.__complete) {
|
1104 |
+
return;
|
1105 |
+
}
|
1106 |
+
|
1107 |
+
checkColors(animationData);
|
1108 |
+
checkText(animationData);
|
1109 |
+
checkChars(animationData);
|
1110 |
+
checkPathProperties(animationData);
|
1111 |
+
checkShapes(animationData);
|
1112 |
+
completeLayers(animationData.layers, animationData.assets);
|
1113 |
+
completeChars(animationData.chars, animationData.assets);
|
1114 |
+
animationData.__complete = true;
|
1115 |
+
}
|
1116 |
+
|
1117 |
+
function completeText(data) {
|
1118 |
+
if (data.t.a.length === 0 && !('m' in data.t.p)) {// data.singleShape = true;
|
1119 |
+
}
|
1120 |
+
}
|
1121 |
+
|
1122 |
+
var moduleOb = {};
|
1123 |
+
moduleOb.completeData = completeData;
|
1124 |
+
moduleOb.checkColors = checkColors;
|
1125 |
+
moduleOb.checkChars = checkChars;
|
1126 |
+
moduleOb.checkPathProperties = checkPathProperties;
|
1127 |
+
moduleOb.checkShapes = checkShapes;
|
1128 |
+
moduleOb.completeLayers = completeLayers;
|
1129 |
+
return moduleOb;
|
1130 |
+
}
|
1131 |
+
|
1132 |
+
if (!_workerSelf.dataManager) {
|
1133 |
+
_workerSelf.dataManager = dataFunctionManager();
|
1134 |
+
}
|
1135 |
+
|
1136 |
+
if (!_workerSelf.assetLoader) {
|
1137 |
+
_workerSelf.assetLoader = function () {
|
1138 |
+
function formatResponse(xhr) {
|
1139 |
+
// using typeof doubles the time of execution of this method,
|
1140 |
+
// so if available, it's better to use the header to validate the type
|
1141 |
+
var contentTypeHeader = xhr.getResponseHeader('content-type');
|
1142 |
+
|
1143 |
+
if (contentTypeHeader && xhr.responseType === 'json' && contentTypeHeader.indexOf('json') !== -1) {
|
1144 |
+
return xhr.response;
|
1145 |
+
}
|
1146 |
+
|
1147 |
+
if (xhr.response && _typeof$5(xhr.response) === 'object') {
|
1148 |
+
return xhr.response;
|
1149 |
+
}
|
1150 |
+
|
1151 |
+
if (xhr.response && typeof xhr.response === 'string') {
|
1152 |
+
return JSON.parse(xhr.response);
|
1153 |
+
}
|
1154 |
+
|
1155 |
+
if (xhr.responseText) {
|
1156 |
+
return JSON.parse(xhr.responseText);
|
1157 |
+
}
|
1158 |
+
|
1159 |
+
return null;
|
1160 |
+
}
|
1161 |
+
|
1162 |
+
function loadAsset(path, fullPath, callback, errorCallback) {
|
1163 |
+
var response;
|
1164 |
+
var xhr = new XMLHttpRequest(); // set responseType after calling open or IE will break.
|
1165 |
+
|
1166 |
+
try {
|
1167 |
+
// This crashes on Android WebView prior to KitKat
|
1168 |
+
xhr.responseType = 'json';
|
1169 |
+
} catch (err) { } // eslint-disable-line no-empty
|
1170 |
+
|
1171 |
+
|
1172 |
+
xhr.onreadystatechange = function () {
|
1173 |
+
if (xhr.readyState === 4) {
|
1174 |
+
if (xhr.status === 200) {
|
1175 |
+
response = formatResponse(xhr);
|
1176 |
+
callback(response);
|
1177 |
+
} else {
|
1178 |
+
try {
|
1179 |
+
response = formatResponse(xhr);
|
1180 |
+
callback(response);
|
1181 |
+
} catch (err) {
|
1182 |
+
if (errorCallback) {
|
1183 |
+
errorCallback(err);
|
1184 |
+
}
|
1185 |
+
}
|
1186 |
+
}
|
1187 |
+
}
|
1188 |
+
};
|
1189 |
+
|
1190 |
+
try {
|
1191 |
+
xhr.open('GET', path, true);
|
1192 |
+
} catch (error) {
|
1193 |
+
xhr.open('GET', fullPath + '/' + path, true);
|
1194 |
+
}
|
1195 |
+
|
1196 |
+
xhr.send();
|
1197 |
+
}
|
1198 |
+
|
1199 |
+
return {
|
1200 |
+
load: loadAsset
|
1201 |
+
};
|
1202 |
+
}();
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
if (e.data.type === 'loadAnimation') {
|
1206 |
+
_workerSelf.assetLoader.load(e.data.path, e.data.fullPath, function (data) {
|
1207 |
+
_workerSelf.dataManager.completeData(data);
|
1208 |
+
|
1209 |
+
_workerSelf.postMessage({
|
1210 |
+
id: e.data.id,
|
1211 |
+
payload: data,
|
1212 |
+
status: 'success'
|
1213 |
+
});
|
1214 |
+
}, function () {
|
1215 |
+
_workerSelf.postMessage({
|
1216 |
+
id: e.data.id,
|
1217 |
+
status: 'error'
|
1218 |
+
});
|
1219 |
+
});
|
1220 |
+
} else if (e.data.type === 'complete') {
|
1221 |
+
var animation = e.data.animation;
|
1222 |
+
|
1223 |
+
_workerSelf.dataManager.completeData(animation);
|
1224 |
+
|
1225 |
+
_workerSelf.postMessage({
|
1226 |
+
id: e.data.id,
|
1227 |
+
payload: animation,
|
1228 |
+
status: 'success'
|
1229 |
+
});
|
1230 |
+
} else if (e.data.type === 'loadData') {
|
1231 |
+
_workerSelf.assetLoader.load(e.data.path, e.data.fullPath, function (data) {
|
1232 |
+
_workerSelf.postMessage({
|
1233 |
+
id: e.data.id,
|
1234 |
+
payload: data,
|
1235 |
+
status: 'success'
|
1236 |
+
});
|
1237 |
+
}, function () {
|
1238 |
+
_workerSelf.postMessage({
|
1239 |
+
id: e.data.id,
|
1240 |
+
status: 'error'
|
1241 |
+
});
|
1242 |
+
});
|
1243 |
+
}
|
1244 |
+
});
|
1245 |
+
|
1246 |
+
workerInstance.onmessage = function (event) {
|
1247 |
+
var data = event.data;
|
1248 |
+
var id = data.id;
|
1249 |
+
var process = processes[id];
|
1250 |
+
processes[id] = null;
|
1251 |
+
|
1252 |
+
if (data.status === 'success') {
|
1253 |
+
process.onComplete(data.payload);
|
1254 |
+
} else if (process.onError) {
|
1255 |
+
process.onError();
|
1256 |
+
}
|
1257 |
+
};
|
1258 |
+
}
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
function createProcess(onComplete, onError) {
|
1262 |
+
_counterId += 1;
|
1263 |
+
var id = 'processId_' + _counterId;
|
1264 |
+
processes[id] = {
|
1265 |
+
onComplete: onComplete,
|
1266 |
+
onError: onError
|
1267 |
+
};
|
1268 |
+
return id;
|
1269 |
+
}
|
1270 |
+
|
1271 |
+
function loadAnimation(path, onComplete, onError) {
|
1272 |
+
setupWorker();
|
1273 |
+
var processId = createProcess(onComplete, onError);
|
1274 |
+
workerInstance.postMessage({
|
1275 |
+
type: 'loadAnimation',
|
1276 |
+
path: path,
|
1277 |
+
fullPath: window.location.origin + window.location.pathname,
|
1278 |
+
id: processId
|
1279 |
+
});
|
1280 |
+
}
|
1281 |
+
|
1282 |
+
function loadData(path, onComplete, onError) {
|
1283 |
+
setupWorker();
|
1284 |
+
var processId = createProcess(onComplete, onError);
|
1285 |
+
workerInstance.postMessage({
|
1286 |
+
type: 'loadData',
|
1287 |
+
path: path,
|
1288 |
+
fullPath: window.location.origin + window.location.pathname,
|
1289 |
+
id: processId
|
1290 |
+
});
|
1291 |
+
}
|
1292 |
+
|
1293 |
+
function completeAnimation(anim, onComplete, onError) {
|
1294 |
+
setupWorker();
|
1295 |
+
var processId = createProcess(onComplete, onError);
|
1296 |
+
workerInstance.postMessage({
|
1297 |
+
type: 'complete',
|
1298 |
+
animation: anim,
|
1299 |
+
id: processId
|
1300 |
+
});
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
return {
|
1304 |
+
loadAnimation: loadAnimation,
|
1305 |
+
loadData: loadData,
|
1306 |
+
completeAnimation: completeAnimation
|
1307 |
+
};
|
1308 |
+
}();
|
1309 |
+
|
1310 |
+
var ImagePreloader = function () {
|
1311 |
+
var proxyImage = function () {
|
1312 |
+
var canvas = createTag('canvas');
|
1313 |
+
canvas.width = 1;
|
1314 |
+
canvas.height = 1;
|
1315 |
+
var ctx = canvas.getContext('2d');
|
1316 |
+
ctx.fillStyle = 'rgba(0,0,0,0)';
|
1317 |
+
ctx.fillRect(0, 0, 1, 1);
|
1318 |
+
return canvas;
|
1319 |
+
}();
|
1320 |
+
|
1321 |
+
function imageLoaded() {
|
1322 |
+
this.loadedAssets += 1;
|
1323 |
+
|
1324 |
+
if (this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages) {
|
1325 |
+
if (this.imagesLoadedCb) {
|
1326 |
+
this.imagesLoadedCb(null);
|
1327 |
+
}
|
1328 |
+
}
|
1329 |
+
}
|
1330 |
+
|
1331 |
+
function footageLoaded() {
|
1332 |
+
this.loadedFootagesCount += 1;
|
1333 |
+
|
1334 |
+
if (this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages) {
|
1335 |
+
if (this.imagesLoadedCb) {
|
1336 |
+
this.imagesLoadedCb(null);
|
1337 |
+
}
|
1338 |
+
}
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
function getAssetsPath(assetData, assetsPath, originalPath) {
|
1342 |
+
var path = '';
|
1343 |
+
|
1344 |
+
if (assetData.e) {
|
1345 |
+
path = assetData.p;
|
1346 |
+
} else if (assetsPath) {
|
1347 |
+
var imagePath = assetData.p;
|
1348 |
+
|
1349 |
+
if (imagePath.indexOf('images/') !== -1) {
|
1350 |
+
imagePath = imagePath.split('/')[1];
|
1351 |
+
}
|
1352 |
+
|
1353 |
+
path = assetsPath + imagePath;
|
1354 |
+
} else {
|
1355 |
+
path = originalPath;
|
1356 |
+
path += assetData.u ? assetData.u : '';
|
1357 |
+
path += assetData.p;
|
1358 |
+
}
|
1359 |
+
|
1360 |
+
return path;
|
1361 |
+
}
|
1362 |
+
|
1363 |
+
function testImageLoaded(img) {
|
1364 |
+
var _count = 0;
|
1365 |
+
var intervalId = setInterval(function () {
|
1366 |
+
var box = img.getBBox();
|
1367 |
+
|
1368 |
+
if (box.width || _count > 500) {
|
1369 |
+
this._imageLoaded();
|
1370 |
+
|
1371 |
+
clearInterval(intervalId);
|
1372 |
+
}
|
1373 |
+
|
1374 |
+
_count += 1;
|
1375 |
+
}.bind(this), 50);
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
function createImageData(assetData) {
|
1379 |
+
var path = getAssetsPath(assetData, this.assetsPath, this.path);
|
1380 |
+
var img = createNS('image');
|
1381 |
+
|
1382 |
+
if (isSafari) {
|
1383 |
+
this.testImageLoaded(img);
|
1384 |
+
} else {
|
1385 |
+
img.addEventListener('load', this._imageLoaded, false);
|
1386 |
+
}
|
1387 |
+
|
1388 |
+
img.addEventListener('error', function () {
|
1389 |
+
ob.img = proxyImage;
|
1390 |
+
|
1391 |
+
this._imageLoaded();
|
1392 |
+
}.bind(this), false);
|
1393 |
+
img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
|
1394 |
+
|
1395 |
+
if (this._elementHelper.append) {
|
1396 |
+
this._elementHelper.append(img);
|
1397 |
+
} else {
|
1398 |
+
this._elementHelper.appendChild(img);
|
1399 |
+
}
|
1400 |
+
|
1401 |
+
var ob = {
|
1402 |
+
img: img,
|
1403 |
+
assetData: assetData
|
1404 |
+
};
|
1405 |
+
return ob;
|
1406 |
+
}
|
1407 |
+
|
1408 |
+
function createImgData(assetData) {
|
1409 |
+
var path = getAssetsPath(assetData, this.assetsPath, this.path);
|
1410 |
+
var img = createTag('img');
|
1411 |
+
img.crossOrigin = 'anonymous';
|
1412 |
+
img.addEventListener('load', this._imageLoaded, false);
|
1413 |
+
img.addEventListener('error', function () {
|
1414 |
+
ob.img = proxyImage;
|
1415 |
+
|
1416 |
+
this._imageLoaded();
|
1417 |
+
}.bind(this), false);
|
1418 |
+
img.src = path;
|
1419 |
+
var ob = {
|
1420 |
+
img: img,
|
1421 |
+
assetData: assetData
|
1422 |
+
};
|
1423 |
+
return ob;
|
1424 |
+
}
|
1425 |
+
|
1426 |
+
function createFootageData(data) {
|
1427 |
+
var ob = {
|
1428 |
+
assetData: data
|
1429 |
+
};
|
1430 |
+
var path = getAssetsPath(data, this.assetsPath, this.path);
|
1431 |
+
dataManager.loadData(path, function (footageData) {
|
1432 |
+
ob.img = footageData;
|
1433 |
+
|
1434 |
+
this._footageLoaded();
|
1435 |
+
}.bind(this), function () {
|
1436 |
+
ob.img = {};
|
1437 |
+
|
1438 |
+
this._footageLoaded();
|
1439 |
+
}.bind(this));
|
1440 |
+
return ob;
|
1441 |
+
}
|
1442 |
+
|
1443 |
+
function loadAssets(assets, cb) {
|
1444 |
+
this.imagesLoadedCb = cb;
|
1445 |
+
var i;
|
1446 |
+
var len = assets.length;
|
1447 |
+
|
1448 |
+
for (i = 0; i < len; i += 1) {
|
1449 |
+
if (!assets[i].layers) {
|
1450 |
+
if (!assets[i].t || assets[i].t === 'seq') {
|
1451 |
+
this.totalImages += 1;
|
1452 |
+
this.images.push(this._createImageData(assets[i]));
|
1453 |
+
} else if (assets[i].t === 3) {
|
1454 |
+
this.totalFootages += 1;
|
1455 |
+
this.images.push(this.createFootageData(assets[i]));
|
1456 |
+
}
|
1457 |
+
}
|
1458 |
+
}
|
1459 |
+
}
|
1460 |
+
|
1461 |
+
function setPath(path) {
|
1462 |
+
this.path = path || '';
|
1463 |
+
}
|
1464 |
+
|
1465 |
+
function setAssetsPath(path) {
|
1466 |
+
this.assetsPath = path || '';
|
1467 |
+
}
|
1468 |
+
|
1469 |
+
function getAsset(assetData) {
|
1470 |
+
var i = 0;
|
1471 |
+
var len = this.images.length;
|
1472 |
+
|
1473 |
+
while (i < len) {
|
1474 |
+
if (this.images[i].assetData === assetData) {
|
1475 |
+
return this.images[i].img;
|
1476 |
+
}
|
1477 |
+
|
1478 |
+
i += 1;
|
1479 |
+
}
|
1480 |
+
|
1481 |
+
return null;
|
1482 |
+
}
|
1483 |
+
|
1484 |
+
function destroy() {
|
1485 |
+
this.imagesLoadedCb = null;
|
1486 |
+
this.images.length = 0;
|
1487 |
+
}
|
1488 |
+
|
1489 |
+
function loadedImages() {
|
1490 |
+
return this.totalImages === this.loadedAssets;
|
1491 |
+
}
|
1492 |
+
|
1493 |
+
function loadedFootages() {
|
1494 |
+
return this.totalFootages === this.loadedFootagesCount;
|
1495 |
+
}
|
1496 |
+
|
1497 |
+
function setCacheType(type, elementHelper) {
|
1498 |
+
if (type === 'svg') {
|
1499 |
+
this._elementHelper = elementHelper;
|
1500 |
+
this._createImageData = this.createImageData.bind(this);
|
1501 |
+
} else {
|
1502 |
+
this._createImageData = this.createImgData.bind(this);
|
1503 |
+
}
|
1504 |
+
}
|
1505 |
+
|
1506 |
+
function ImagePreloaderFactory() {
|
1507 |
+
this._imageLoaded = imageLoaded.bind(this);
|
1508 |
+
this._footageLoaded = footageLoaded.bind(this);
|
1509 |
+
this.testImageLoaded = testImageLoaded.bind(this);
|
1510 |
+
this.createFootageData = createFootageData.bind(this);
|
1511 |
+
this.assetsPath = '';
|
1512 |
+
this.path = '';
|
1513 |
+
this.totalImages = 0;
|
1514 |
+
this.totalFootages = 0;
|
1515 |
+
this.loadedAssets = 0;
|
1516 |
+
this.loadedFootagesCount = 0;
|
1517 |
+
this.imagesLoadedCb = null;
|
1518 |
+
this.images = [];
|
1519 |
+
}
|
1520 |
+
|
1521 |
+
ImagePreloaderFactory.prototype = {
|
1522 |
+
loadAssets: loadAssets,
|
1523 |
+
setAssetsPath: setAssetsPath,
|
1524 |
+
setPath: setPath,
|
1525 |
+
loadedImages: loadedImages,
|
1526 |
+
loadedFootages: loadedFootages,
|
1527 |
+
destroy: destroy,
|
1528 |
+
getAsset: getAsset,
|
1529 |
+
createImgData: createImgData,
|
1530 |
+
createImageData: createImageData,
|
1531 |
+
imageLoaded: imageLoaded,
|
1532 |
+
footageLoaded: footageLoaded,
|
1533 |
+
setCacheType: setCacheType
|
1534 |
+
};
|
1535 |
+
return ImagePreloaderFactory;
|
1536 |
+
}();
|
1537 |
+
|
1538 |
+
function BaseEvent() { }
|
1539 |
+
|
1540 |
+
BaseEvent.prototype = {
|
1541 |
+
triggerEvent: function triggerEvent(eventName, args) {
|
1542 |
+
if (this._cbs[eventName]) {
|
1543 |
+
var callbacks = this._cbs[eventName];
|
1544 |
+
|
1545 |
+
for (var i = 0; i < callbacks.length; i += 1) {
|
1546 |
+
callbacks[i](args);
|
1547 |
+
}
|
1548 |
+
}
|
1549 |
+
},
|
1550 |
+
addEventListener: function addEventListener(eventName, callback) {
|
1551 |
+
if (!this._cbs[eventName]) {
|
1552 |
+
this._cbs[eventName] = [];
|
1553 |
+
}
|
1554 |
+
|
1555 |
+
this._cbs[eventName].push(callback);
|
1556 |
+
|
1557 |
+
return function () {
|
1558 |
+
this.removeEventListener(eventName, callback);
|
1559 |
+
}.bind(this);
|
1560 |
+
},
|
1561 |
+
removeEventListener: function removeEventListener(eventName, callback) {
|
1562 |
+
if (!callback) {
|
1563 |
+
this._cbs[eventName] = null;
|
1564 |
+
} else if (this._cbs[eventName]) {
|
1565 |
+
var i = 0;
|
1566 |
+
var len = this._cbs[eventName].length;
|
1567 |
+
|
1568 |
+
while (i < len) {
|
1569 |
+
if (this._cbs[eventName][i] === callback) {
|
1570 |
+
this._cbs[eventName].splice(i, 1);
|
1571 |
+
|
1572 |
+
i -= 1;
|
1573 |
+
len -= 1;
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
i += 1;
|
1577 |
+
}
|
1578 |
+
|
1579 |
+
if (!this._cbs[eventName].length) {
|
1580 |
+
this._cbs[eventName] = null;
|
1581 |
+
}
|
1582 |
+
}
|
1583 |
+
}
|
1584 |
+
};
|
1585 |
+
|
1586 |
+
var markerParser = function () {
|
1587 |
+
function parsePayloadLines(payload) {
|
1588 |
+
var lines = payload.split('\r\n');
|
1589 |
+
var keys = {};
|
1590 |
+
var line;
|
1591 |
+
var keysCount = 0;
|
1592 |
+
|
1593 |
+
for (var i = 0; i < lines.length; i += 1) {
|
1594 |
+
line = lines[i].split(':');
|
1595 |
+
|
1596 |
+
if (line.length === 2) {
|
1597 |
+
keys[line[0]] = line[1].trim();
|
1598 |
+
keysCount += 1;
|
1599 |
+
}
|
1600 |
+
}
|
1601 |
+
|
1602 |
+
if (keysCount === 0) {
|
1603 |
+
throw new Error();
|
1604 |
+
}
|
1605 |
+
|
1606 |
+
return keys;
|
1607 |
+
}
|
1608 |
+
|
1609 |
+
return function (_markers) {
|
1610 |
+
var markers = [];
|
1611 |
+
|
1612 |
+
for (var i = 0; i < _markers.length; i += 1) {
|
1613 |
+
var _marker = _markers[i];
|
1614 |
+
var markerData = {
|
1615 |
+
time: _marker.tm,
|
1616 |
+
duration: _marker.dr
|
1617 |
+
};
|
1618 |
+
|
1619 |
+
try {
|
1620 |
+
markerData.payload = JSON.parse(_markers[i].cm);
|
1621 |
+
} catch (_) {
|
1622 |
+
try {
|
1623 |
+
markerData.payload = parsePayloadLines(_markers[i].cm);
|
1624 |
+
} catch (__) {
|
1625 |
+
markerData.payload = {
|
1626 |
+
name: _markers[i].cm
|
1627 |
+
};
|
1628 |
+
}
|
1629 |
+
}
|
1630 |
+
|
1631 |
+
markers.push(markerData);
|
1632 |
+
}
|
1633 |
+
|
1634 |
+
return markers;
|
1635 |
+
};
|
1636 |
+
}();
|
1637 |
+
|
1638 |
+
var ProjectInterface = function () {
|
1639 |
+
function registerComposition(comp) {
|
1640 |
+
this.compositions.push(comp);
|
1641 |
+
}
|
1642 |
+
|
1643 |
+
return function () {
|
1644 |
+
function _thisProjectFunction(name) {
|
1645 |
+
var i = 0;
|
1646 |
+
var len = this.compositions.length;
|
1647 |
+
|
1648 |
+
while (i < len) {
|
1649 |
+
if (this.compositions[i].data && this.compositions[i].data.nm === name) {
|
1650 |
+
if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
|
1651 |
+
this.compositions[i].prepareFrame(this.currentFrame);
|
1652 |
+
}
|
1653 |
+
|
1654 |
+
return this.compositions[i].compInterface;
|
1655 |
+
}
|
1656 |
+
|
1657 |
+
i += 1;
|
1658 |
+
}
|
1659 |
+
|
1660 |
+
return null;
|
1661 |
+
}
|
1662 |
+
|
1663 |
+
_thisProjectFunction.compositions = [];
|
1664 |
+
_thisProjectFunction.currentFrame = 0;
|
1665 |
+
_thisProjectFunction.registerComposition = registerComposition;
|
1666 |
+
return _thisProjectFunction;
|
1667 |
+
};
|
1668 |
+
}();
|
1669 |
+
|
1670 |
+
var renderers = {};
|
1671 |
+
|
1672 |
+
var registerRenderer = function registerRenderer(key, value) {
|
1673 |
+
renderers[key] = value;
|
1674 |
+
};
|
1675 |
+
|
1676 |
+
function getRenderer(key) {
|
1677 |
+
return renderers[key];
|
1678 |
+
}
|
1679 |
+
|
1680 |
+
function _typeof$4(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$4 = function _typeof(obj) { return typeof obj; }; } else { _typeof$4 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$4(obj); }
|
1681 |
+
|
1682 |
+
var AnimationItem = function AnimationItem() {
|
1683 |
+
this._cbs = [];
|
1684 |
+
this.name = '';
|
1685 |
+
this.path = '';
|
1686 |
+
this.isLoaded = false;
|
1687 |
+
this.currentFrame = 0;
|
1688 |
+
this.currentRawFrame = 0;
|
1689 |
+
this.firstFrame = 0;
|
1690 |
+
this.totalFrames = 0;
|
1691 |
+
this.frameRate = 0;
|
1692 |
+
this.frameMult = 0;
|
1693 |
+
this.playSpeed = 1;
|
1694 |
+
this.playDirection = 1;
|
1695 |
+
this.playCount = 0;
|
1696 |
+
this.animationData = {};
|
1697 |
+
this.assets = [];
|
1698 |
+
this.isPaused = true;
|
1699 |
+
this.autoplay = false;
|
1700 |
+
this.loop = true;
|
1701 |
+
this.renderer = null;
|
1702 |
+
this.animationID = createElementID();
|
1703 |
+
this.assetsPath = '';
|
1704 |
+
this.timeCompleted = 0;
|
1705 |
+
this.segmentPos = 0;
|
1706 |
+
this.isSubframeEnabled = getSubframeEnabled();
|
1707 |
+
this.segments = [];
|
1708 |
+
this._idle = true;
|
1709 |
+
this._completedLoop = false;
|
1710 |
+
this.projectInterface = ProjectInterface();
|
1711 |
+
this.imagePreloader = new ImagePreloader();
|
1712 |
+
this.audioController = audioControllerFactory();
|
1713 |
+
this.markers = [];
|
1714 |
+
this.configAnimation = this.configAnimation.bind(this);
|
1715 |
+
this.onSetupError = this.onSetupError.bind(this);
|
1716 |
+
this.onSegmentComplete = this.onSegmentComplete.bind(this);
|
1717 |
+
this.drawnFrameEvent = new BMEnterFrameEvent('drawnFrame', 0, 0, 0);
|
1718 |
+
};
|
1719 |
+
|
1720 |
+
extendPrototype([BaseEvent], AnimationItem);
|
1721 |
+
|
1722 |
+
AnimationItem.prototype.setParams = function (params) {
|
1723 |
+
if (params.wrapper || params.container) {
|
1724 |
+
this.wrapper = params.wrapper || params.container;
|
1725 |
+
}
|
1726 |
+
|
1727 |
+
var animType = 'svg';
|
1728 |
+
|
1729 |
+
if (params.animType) {
|
1730 |
+
animType = params.animType;
|
1731 |
+
} else if (params.renderer) {
|
1732 |
+
animType = params.renderer;
|
1733 |
+
}
|
1734 |
+
|
1735 |
+
var RendererClass = getRenderer(animType);
|
1736 |
+
this.renderer = new RendererClass(this, params.rendererSettings);
|
1737 |
+
this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
|
1738 |
+
this.renderer.setProjectInterface(this.projectInterface);
|
1739 |
+
this.animType = animType;
|
1740 |
+
|
1741 |
+
if (params.loop === '' || params.loop === null || params.loop === undefined || params.loop === true) {
|
1742 |
+
this.loop = true;
|
1743 |
+
} else if (params.loop === false) {
|
1744 |
+
this.loop = false;
|
1745 |
+
} else {
|
1746 |
+
this.loop = parseInt(params.loop, 10);
|
1747 |
+
}
|
1748 |
+
|
1749 |
+
this.autoplay = 'autoplay' in params ? params.autoplay : true;
|
1750 |
+
this.name = params.name ? params.name : '';
|
1751 |
+
this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
|
1752 |
+
this.assetsPath = params.assetsPath;
|
1753 |
+
this.initialSegment = params.initialSegment;
|
1754 |
+
|
1755 |
+
if (params.audioFactory) {
|
1756 |
+
this.audioController.setAudioFactory(params.audioFactory);
|
1757 |
+
}
|
1758 |
+
|
1759 |
+
if (params.animationData) {
|
1760 |
+
this.setupAnimation(params.animationData);
|
1761 |
+
} else if (params.path) {
|
1762 |
+
if (params.path.lastIndexOf('\\') !== -1) {
|
1763 |
+
this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
|
1764 |
+
} else {
|
1765 |
+
this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
|
1766 |
+
}
|
1767 |
+
|
1768 |
+
this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
|
1769 |
+
this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
|
1770 |
+
dataManager.loadAnimation(params.path, this.configAnimation, this.onSetupError);
|
1771 |
+
}
|
1772 |
+
};
|
1773 |
+
|
1774 |
+
AnimationItem.prototype.onSetupError = function () {
|
1775 |
+
this.trigger('data_failed');
|
1776 |
+
};
|
1777 |
+
|
1778 |
+
AnimationItem.prototype.setupAnimation = function (data) {
|
1779 |
+
dataManager.completeAnimation(data, this.configAnimation);
|
1780 |
+
};
|
1781 |
+
|
1782 |
+
AnimationItem.prototype.setData = function (wrapper, animationData) {
|
1783 |
+
if (animationData) {
|
1784 |
+
if (_typeof$4(animationData) !== 'object') {
|
1785 |
+
animationData = JSON.parse(animationData);
|
1786 |
+
}
|
1787 |
+
}
|
1788 |
+
|
1789 |
+
var params = {
|
1790 |
+
wrapper: wrapper,
|
1791 |
+
animationData: animationData
|
1792 |
+
};
|
1793 |
+
var wrapperAttributes = wrapper.attributes;
|
1794 |
+
params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
|
1795 |
+
? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
|
1796 |
+
? wrapperAttributes.getNamedItem('data-bm-path').value : wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
|
1797 |
+
params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
|
1798 |
+
? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
|
1799 |
+
? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
|
1800 |
+
? wrapperAttributes.getNamedItem('bm-type').value : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
|
1801 |
+
? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
|
1802 |
+
var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
|
1803 |
+
? wrapperAttributes.getNamedItem('data-anim-loop').value : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
|
1804 |
+
? wrapperAttributes.getNamedItem('data-bm-loop').value : wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
|
1805 |
+
|
1806 |
+
if (loop === 'false') {
|
1807 |
+
params.loop = false;
|
1808 |
+
} else if (loop === 'true') {
|
1809 |
+
params.loop = true;
|
1810 |
+
} else if (loop !== '') {
|
1811 |
+
params.loop = parseInt(loop, 10);
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
|
1815 |
+
? wrapperAttributes.getNamedItem('data-anim-autoplay').value : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
|
1816 |
+
? wrapperAttributes.getNamedItem('data-bm-autoplay').value : wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
|
1817 |
+
params.autoplay = autoplay !== 'false';
|
1818 |
+
params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
|
1819 |
+
? wrapperAttributes.getNamedItem('data-name').value : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
|
1820 |
+
? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value : '';
|
1821 |
+
var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
|
1822 |
+
? wrapperAttributes.getNamedItem('data-anim-prerender').value : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
|
1823 |
+
? wrapperAttributes.getNamedItem('data-bm-prerender').value : wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
|
1824 |
+
|
1825 |
+
if (prerender === 'false') {
|
1826 |
+
params.prerender = false;
|
1827 |
+
}
|
1828 |
+
|
1829 |
+
this.setParams(params);
|
1830 |
+
};
|
1831 |
+
|
1832 |
+
AnimationItem.prototype.includeLayers = function (data) {
|
1833 |
+
if (data.op > this.animationData.op) {
|
1834 |
+
this.animationData.op = data.op;
|
1835 |
+
this.totalFrames = Math.floor(data.op - this.animationData.ip);
|
1836 |
+
}
|
1837 |
+
|
1838 |
+
var layers = this.animationData.layers;
|
1839 |
+
var i;
|
1840 |
+
var len = layers.length;
|
1841 |
+
var newLayers = data.layers;
|
1842 |
+
var j;
|
1843 |
+
var jLen = newLayers.length;
|
1844 |
+
|
1845 |
+
for (j = 0; j < jLen; j += 1) {
|
1846 |
+
i = 0;
|
1847 |
+
|
1848 |
+
while (i < len) {
|
1849 |
+
if (layers[i].id === newLayers[j].id) {
|
1850 |
+
layers[i] = newLayers[j];
|
1851 |
+
break;
|
1852 |
+
}
|
1853 |
+
|
1854 |
+
i += 1;
|
1855 |
+
}
|
1856 |
+
}
|
1857 |
+
|
1858 |
+
if (data.chars || data.fonts) {
|
1859 |
+
this.renderer.globalData.fontManager.addChars(data.chars);
|
1860 |
+
this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
|
1861 |
+
}
|
1862 |
+
|
1863 |
+
if (data.assets) {
|
1864 |
+
len = data.assets.length;
|
1865 |
+
|
1866 |
+
for (i = 0; i < len; i += 1) {
|
1867 |
+
this.animationData.assets.push(data.assets[i]);
|
1868 |
+
}
|
1869 |
+
}
|
1870 |
+
|
1871 |
+
this.animationData.__complete = false;
|
1872 |
+
dataManager.completeAnimation(this.animationData, this.onSegmentComplete);
|
1873 |
+
};
|
1874 |
+
|
1875 |
+
AnimationItem.prototype.onSegmentComplete = function (data) {
|
1876 |
+
this.animationData = data;
|
1877 |
+
var expressionsPlugin = getExpressionsPlugin();
|
1878 |
+
|
1879 |
+
if (expressionsPlugin) {
|
1880 |
+
expressionsPlugin.initExpressions(this);
|
1881 |
+
}
|
1882 |
+
|
1883 |
+
this.loadNextSegment();
|
1884 |
+
};
|
1885 |
+
|
1886 |
+
AnimationItem.prototype.loadNextSegment = function () {
|
1887 |
+
var segments = this.animationData.segments;
|
1888 |
+
|
1889 |
+
if (!segments || segments.length === 0 || !this.autoloadSegments) {
|
1890 |
+
this.trigger('data_ready');
|
1891 |
+
this.timeCompleted = this.totalFrames;
|
1892 |
+
return;
|
1893 |
+
}
|
1894 |
+
|
1895 |
+
var segment = segments.shift();
|
1896 |
+
this.timeCompleted = segment.time * this.frameRate;
|
1897 |
+
var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
|
1898 |
+
this.segmentPos += 1;
|
1899 |
+
dataManager.loadData(segmentPath, this.includeLayers.bind(this), function () {
|
1900 |
+
this.trigger('data_failed');
|
1901 |
+
}.bind(this));
|
1902 |
+
};
|
1903 |
+
|
1904 |
+
AnimationItem.prototype.loadSegments = function () {
|
1905 |
+
var segments = this.animationData.segments;
|
1906 |
+
|
1907 |
+
if (!segments) {
|
1908 |
+
this.timeCompleted = this.totalFrames;
|
1909 |
+
}
|
1910 |
+
|
1911 |
+
this.loadNextSegment();
|
1912 |
+
};
|
1913 |
+
|
1914 |
+
AnimationItem.prototype.imagesLoaded = function () {
|
1915 |
+
this.trigger('loaded_images');
|
1916 |
+
this.checkLoaded();
|
1917 |
+
};
|
1918 |
+
|
1919 |
+
AnimationItem.prototype.preloadImages = function () {
|
1920 |
+
this.imagePreloader.setAssetsPath(this.assetsPath);
|
1921 |
+
this.imagePreloader.setPath(this.path);
|
1922 |
+
this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
|
1923 |
+
};
|
1924 |
+
|
1925 |
+
AnimationItem.prototype.configAnimation = function (animData) {
|
1926 |
+
if (!this.renderer) {
|
1927 |
+
return;
|
1928 |
+
}
|
1929 |
+
|
1930 |
+
try {
|
1931 |
+
this.animationData = animData;
|
1932 |
+
|
1933 |
+
if (this.initialSegment) {
|
1934 |
+
this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
|
1935 |
+
this.firstFrame = Math.round(this.initialSegment[0]);
|
1936 |
+
} else {
|
1937 |
+
this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
|
1938 |
+
this.firstFrame = Math.round(this.animationData.ip);
|
1939 |
+
}
|
1940 |
+
|
1941 |
+
this.renderer.configAnimation(animData);
|
1942 |
+
|
1943 |
+
if (!animData.assets) {
|
1944 |
+
animData.assets = [];
|
1945 |
+
}
|
1946 |
+
|
1947 |
+
this.assets = this.animationData.assets;
|
1948 |
+
this.frameRate = this.animationData.fr;
|
1949 |
+
this.frameMult = this.animationData.fr / 1000;
|
1950 |
+
this.renderer.searchExtraCompositions(animData.assets);
|
1951 |
+
this.markers = markerParser(animData.markers || []);
|
1952 |
+
this.trigger('config_ready');
|
1953 |
+
this.preloadImages();
|
1954 |
+
this.loadSegments();
|
1955 |
+
this.updaFrameModifier();
|
1956 |
+
this.waitForFontsLoaded();
|
1957 |
+
|
1958 |
+
if (this.isPaused) {
|
1959 |
+
this.audioController.pause();
|
1960 |
+
}
|
1961 |
+
} catch (error) {
|
1962 |
+
this.triggerConfigError(error);
|
1963 |
+
}
|
1964 |
+
};
|
1965 |
+
|
1966 |
+
AnimationItem.prototype.waitForFontsLoaded = function () {
|
1967 |
+
if (!this.renderer) {
|
1968 |
+
return;
|
1969 |
+
}
|
1970 |
+
|
1971 |
+
if (this.renderer.globalData.fontManager.isLoaded) {
|
1972 |
+
this.checkLoaded();
|
1973 |
+
} else {
|
1974 |
+
setTimeout(this.waitForFontsLoaded.bind(this), 20);
|
1975 |
+
}
|
1976 |
+
};
|
1977 |
+
|
1978 |
+
AnimationItem.prototype.checkLoaded = function () {
|
1979 |
+
if (!this.isLoaded && this.renderer.globalData.fontManager.isLoaded && (this.imagePreloader.loadedImages() || this.renderer.rendererType !== 'canvas') && this.imagePreloader.loadedFootages()) {
|
1980 |
+
this.isLoaded = true;
|
1981 |
+
var expressionsPlugin = getExpressionsPlugin();
|
1982 |
+
|
1983 |
+
if (expressionsPlugin) {
|
1984 |
+
expressionsPlugin.initExpressions(this);
|
1985 |
+
}
|
1986 |
+
|
1987 |
+
this.renderer.initItems();
|
1988 |
+
setTimeout(function () {
|
1989 |
+
this.trigger('DOMLoaded');
|
1990 |
+
}.bind(this), 0);
|
1991 |
+
this.gotoFrame();
|
1992 |
+
|
1993 |
+
if (this.autoplay) {
|
1994 |
+
this.play();
|
1995 |
+
}
|
1996 |
+
}
|
1997 |
+
};
|
1998 |
+
|
1999 |
+
AnimationItem.prototype.resize = function () {
|
2000 |
+
this.renderer.updateContainerSize();
|
2001 |
+
};
|
2002 |
+
|
2003 |
+
AnimationItem.prototype.setSubframe = function (flag) {
|
2004 |
+
this.isSubframeEnabled = !!flag;
|
2005 |
+
};
|
2006 |
+
|
2007 |
+
AnimationItem.prototype.gotoFrame = function () {
|
2008 |
+
this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
|
2009 |
+
|
2010 |
+
if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
|
2011 |
+
this.currentFrame = this.timeCompleted;
|
2012 |
+
}
|
2013 |
+
|
2014 |
+
this.trigger('enterFrame');
|
2015 |
+
this.renderFrame();
|
2016 |
+
this.trigger('drawnFrame');
|
2017 |
+
};
|
2018 |
+
|
2019 |
+
AnimationItem.prototype.renderFrame = function () {
|
2020 |
+
if (this.isLoaded === false || !this.renderer) {
|
2021 |
+
return;
|
2022 |
+
}
|
2023 |
+
|
2024 |
+
try {
|
2025 |
+
this.renderer.renderFrame(this.currentFrame + this.firstFrame);
|
2026 |
+
} catch (error) {
|
2027 |
+
this.triggerRenderFrameError(error);
|
2028 |
+
}
|
2029 |
+
};
|
2030 |
+
|
2031 |
+
AnimationItem.prototype.play = function (name) {
|
2032 |
+
if (name && this.name !== name) {
|
2033 |
+
return;
|
2034 |
+
}
|
2035 |
+
|
2036 |
+
if (this.isPaused === true) {
|
2037 |
+
this.isPaused = false;
|
2038 |
+
this.trigger('_pause');
|
2039 |
+
this.audioController.resume();
|
2040 |
+
|
2041 |
+
if (this._idle) {
|
2042 |
+
this._idle = false;
|
2043 |
+
this.trigger('_active');
|
2044 |
+
}
|
2045 |
+
}
|
2046 |
+
};
|
2047 |
+
|
2048 |
+
AnimationItem.prototype.pause = function (name) {
|
2049 |
+
if (name && this.name !== name) {
|
2050 |
+
return;
|
2051 |
+
}
|
2052 |
+
|
2053 |
+
if (this.isPaused === false) {
|
2054 |
+
this.isPaused = true;
|
2055 |
+
this.trigger('_play');
|
2056 |
+
this._idle = true;
|
2057 |
+
this.trigger('_idle');
|
2058 |
+
this.audioController.pause();
|
2059 |
+
}
|
2060 |
+
};
|
2061 |
+
|
2062 |
+
AnimationItem.prototype.togglePause = function (name) {
|
2063 |
+
if (name && this.name !== name) {
|
2064 |
+
return;
|
2065 |
+
}
|
2066 |
+
|
2067 |
+
if (this.isPaused === true) {
|
2068 |
+
this.play();
|
2069 |
+
} else {
|
2070 |
+
this.pause();
|
2071 |
+
}
|
2072 |
+
};
|
2073 |
+
|
2074 |
+
AnimationItem.prototype.stop = function (name) {
|
2075 |
+
if (name && this.name !== name) {
|
2076 |
+
return;
|
2077 |
+
}
|
2078 |
+
|
2079 |
+
this.pause();
|
2080 |
+
this.playCount = 0;
|
2081 |
+
this._completedLoop = false;
|
2082 |
+
this.setCurrentRawFrameValue(0);
|
2083 |
+
};
|
2084 |
+
|
2085 |
+
AnimationItem.prototype.getMarkerData = function (markerName) {
|
2086 |
+
var marker;
|
2087 |
+
|
2088 |
+
for (var i = 0; i < this.markers.length; i += 1) {
|
2089 |
+
marker = this.markers[i];
|
2090 |
+
|
2091 |
+
if (marker.payload && marker.payload.name === markerName) {
|
2092 |
+
return marker;
|
2093 |
+
}
|
2094 |
+
}
|
2095 |
+
|
2096 |
+
return null;
|
2097 |
+
};
|
2098 |
+
|
2099 |
+
AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
|
2100 |
+
if (name && this.name !== name) {
|
2101 |
+
return;
|
2102 |
+
}
|
2103 |
+
|
2104 |
+
var numValue = Number(value);
|
2105 |
+
|
2106 |
+
if (isNaN(numValue)) {
|
2107 |
+
var marker = this.getMarkerData(value);
|
2108 |
+
|
2109 |
+
if (marker) {
|
2110 |
+
this.goToAndStop(marker.time, true);
|
2111 |
+
}
|
2112 |
+
} else if (isFrame) {
|
2113 |
+
this.setCurrentRawFrameValue(value);
|
2114 |
+
} else {
|
2115 |
+
this.setCurrentRawFrameValue(value * this.frameModifier);
|
2116 |
+
}
|
2117 |
+
|
2118 |
+
this.pause();
|
2119 |
+
};
|
2120 |
+
|
2121 |
+
AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
|
2122 |
+
if (name && this.name !== name) {
|
2123 |
+
return;
|
2124 |
+
}
|
2125 |
+
|
2126 |
+
var numValue = Number(value);
|
2127 |
+
|
2128 |
+
if (isNaN(numValue)) {
|
2129 |
+
var marker = this.getMarkerData(value);
|
2130 |
+
|
2131 |
+
if (marker) {
|
2132 |
+
if (!marker.duration) {
|
2133 |
+
this.goToAndStop(marker.time, true);
|
2134 |
+
} else {
|
2135 |
+
this.playSegments([marker.time, marker.time + marker.duration], true);
|
2136 |
+
}
|
2137 |
+
}
|
2138 |
+
} else {
|
2139 |
+
this.goToAndStop(numValue, isFrame, name);
|
2140 |
+
}
|
2141 |
+
|
2142 |
+
this.play();
|
2143 |
+
};
|
2144 |
+
|
2145 |
+
AnimationItem.prototype.advanceTime = function (value) {
|
2146 |
+
if (this.isPaused === true || this.isLoaded === false) {
|
2147 |
+
return;
|
2148 |
+
}
|
2149 |
+
|
2150 |
+
var nextValue = this.currentRawFrame + value * this.frameModifier;
|
2151 |
+
var _isComplete = false; // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
|
2152 |
+
// If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
|
2153 |
+
|
2154 |
+
if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
|
2155 |
+
if (!this.loop || this.playCount === this.loop) {
|
2156 |
+
if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
|
2157 |
+
_isComplete = true;
|
2158 |
+
nextValue = this.totalFrames - 1;
|
2159 |
+
}
|
2160 |
+
} else if (nextValue >= this.totalFrames) {
|
2161 |
+
this.playCount += 1;
|
2162 |
+
|
2163 |
+
if (!this.checkSegments(nextValue % this.totalFrames)) {
|
2164 |
+
this.setCurrentRawFrameValue(nextValue % this.totalFrames);
|
2165 |
+
this._completedLoop = true;
|
2166 |
+
this.trigger('loopComplete');
|
2167 |
+
}
|
2168 |
+
} else {
|
2169 |
+
this.setCurrentRawFrameValue(nextValue);
|
2170 |
+
}
|
2171 |
+
} else if (nextValue < 0) {
|
2172 |
+
if (!this.checkSegments(nextValue % this.totalFrames)) {
|
2173 |
+
if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
|
2174 |
+
// eslint-disable-line no-plusplus
|
2175 |
+
this.setCurrentRawFrameValue(this.totalFrames + nextValue % this.totalFrames);
|
2176 |
+
|
2177 |
+
if (!this._completedLoop) {
|
2178 |
+
this._completedLoop = true;
|
2179 |
+
} else {
|
2180 |
+
this.trigger('loopComplete');
|
2181 |
+
}
|
2182 |
+
} else {
|
2183 |
+
_isComplete = true;
|
2184 |
+
nextValue = 0;
|
2185 |
+
}
|
2186 |
+
}
|
2187 |
+
} else {
|
2188 |
+
this.setCurrentRawFrameValue(nextValue);
|
2189 |
+
}
|
2190 |
+
|
2191 |
+
if (_isComplete) {
|
2192 |
+
this.setCurrentRawFrameValue(nextValue);
|
2193 |
+
this.pause();
|
2194 |
+
this.trigger('complete');
|
2195 |
+
}
|
2196 |
+
};
|
2197 |
+
|
2198 |
+
AnimationItem.prototype.adjustSegment = function (arr, offset) {
|
2199 |
+
this.playCount = 0;
|
2200 |
+
|
2201 |
+
if (arr[1] < arr[0]) {
|
2202 |
+
if (this.frameModifier > 0) {
|
2203 |
+
if (this.playSpeed < 0) {
|
2204 |
+
this.setSpeed(-this.playSpeed);
|
2205 |
+
} else {
|
2206 |
+
this.setDirection(-1);
|
2207 |
+
}
|
2208 |
+
}
|
2209 |
+
|
2210 |
+
this.totalFrames = arr[0] - arr[1];
|
2211 |
+
this.timeCompleted = this.totalFrames;
|
2212 |
+
this.firstFrame = arr[1];
|
2213 |
+
this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
|
2214 |
+
} else if (arr[1] > arr[0]) {
|
2215 |
+
if (this.frameModifier < 0) {
|
2216 |
+
if (this.playSpeed < 0) {
|
2217 |
+
this.setSpeed(-this.playSpeed);
|
2218 |
+
} else {
|
2219 |
+
this.setDirection(1);
|
2220 |
+
}
|
2221 |
+
}
|
2222 |
+
|
2223 |
+
this.totalFrames = arr[1] - arr[0];
|
2224 |
+
this.timeCompleted = this.totalFrames;
|
2225 |
+
this.firstFrame = arr[0];
|
2226 |
+
this.setCurrentRawFrameValue(0.001 + offset);
|
2227 |
+
}
|
2228 |
+
|
2229 |
+
this.trigger('segmentStart');
|
2230 |
+
};
|
2231 |
+
|
2232 |
+
AnimationItem.prototype.setSegment = function (init, end) {
|
2233 |
+
var pendingFrame = -1;
|
2234 |
+
|
2235 |
+
if (this.isPaused) {
|
2236 |
+
if (this.currentRawFrame + this.firstFrame < init) {
|
2237 |
+
pendingFrame = init;
|
2238 |
+
} else if (this.currentRawFrame + this.firstFrame > end) {
|
2239 |
+
pendingFrame = end - init;
|
2240 |
+
}
|
2241 |
+
}
|
2242 |
+
|
2243 |
+
this.firstFrame = init;
|
2244 |
+
this.totalFrames = end - init;
|
2245 |
+
this.timeCompleted = this.totalFrames;
|
2246 |
+
|
2247 |
+
if (pendingFrame !== -1) {
|
2248 |
+
this.goToAndStop(pendingFrame, true);
|
2249 |
+
}
|
2250 |
+
};
|
2251 |
+
|
2252 |
+
AnimationItem.prototype.playSegments = function (arr, forceFlag) {
|
2253 |
+
if (forceFlag) {
|
2254 |
+
this.segments.length = 0;
|
2255 |
+
}
|
2256 |
+
|
2257 |
+
if (_typeof$4(arr[0]) === 'object') {
|
2258 |
+
var i;
|
2259 |
+
var len = arr.length;
|
2260 |
+
|
2261 |
+
for (i = 0; i < len; i += 1) {
|
2262 |
+
this.segments.push(arr[i]);
|
2263 |
+
}
|
2264 |
+
} else {
|
2265 |
+
this.segments.push(arr);
|
2266 |
+
}
|
2267 |
+
|
2268 |
+
if (this.segments.length && forceFlag) {
|
2269 |
+
this.adjustSegment(this.segments.shift(), 0);
|
2270 |
+
}
|
2271 |
+
|
2272 |
+
if (this.isPaused) {
|
2273 |
+
this.play();
|
2274 |
+
}
|
2275 |
+
};
|
2276 |
+
|
2277 |
+
AnimationItem.prototype.resetSegments = function (forceFlag) {
|
2278 |
+
this.segments.length = 0;
|
2279 |
+
this.segments.push([this.animationData.ip, this.animationData.op]);
|
2280 |
+
|
2281 |
+
if (forceFlag) {
|
2282 |
+
this.checkSegments(0);
|
2283 |
+
}
|
2284 |
+
};
|
2285 |
+
|
2286 |
+
AnimationItem.prototype.checkSegments = function (offset) {
|
2287 |
+
if (this.segments.length) {
|
2288 |
+
this.adjustSegment(this.segments.shift(), offset);
|
2289 |
+
return true;
|
2290 |
+
}
|
2291 |
+
|
2292 |
+
return false;
|
2293 |
+
};
|
2294 |
+
|
2295 |
+
AnimationItem.prototype.destroy = function (name) {
|
2296 |
+
if (name && this.name !== name || !this.renderer) {
|
2297 |
+
return;
|
2298 |
+
}
|
2299 |
+
|
2300 |
+
this.renderer.destroy();
|
2301 |
+
this.imagePreloader.destroy();
|
2302 |
+
this.trigger('destroy');
|
2303 |
+
this._cbs = null;
|
2304 |
+
this.onEnterFrame = null;
|
2305 |
+
this.onLoopComplete = null;
|
2306 |
+
this.onComplete = null;
|
2307 |
+
this.onSegmentStart = null;
|
2308 |
+
this.onDestroy = null;
|
2309 |
+
this.renderer = null;
|
2310 |
+
this.renderer = null;
|
2311 |
+
this.imagePreloader = null;
|
2312 |
+
this.projectInterface = null;
|
2313 |
+
};
|
2314 |
+
|
2315 |
+
AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
|
2316 |
+
this.currentRawFrame = value;
|
2317 |
+
this.gotoFrame();
|
2318 |
+
};
|
2319 |
+
|
2320 |
+
AnimationItem.prototype.setSpeed = function (val) {
|
2321 |
+
this.playSpeed = val;
|
2322 |
+
this.updaFrameModifier();
|
2323 |
+
};
|
2324 |
+
|
2325 |
+
AnimationItem.prototype.setDirection = function (val) {
|
2326 |
+
this.playDirection = val < 0 ? -1 : 1;
|
2327 |
+
this.updaFrameModifier();
|
2328 |
+
};
|
2329 |
+
|
2330 |
+
AnimationItem.prototype.setVolume = function (val, name) {
|
2331 |
+
if (name && this.name !== name) {
|
2332 |
+
return;
|
2333 |
+
}
|
2334 |
+
|
2335 |
+
this.audioController.setVolume(val);
|
2336 |
+
};
|
2337 |
+
|
2338 |
+
AnimationItem.prototype.getVolume = function () {
|
2339 |
+
return this.audioController.getVolume();
|
2340 |
+
};
|
2341 |
+
|
2342 |
+
AnimationItem.prototype.mute = function (name) {
|
2343 |
+
if (name && this.name !== name) {
|
2344 |
+
return;
|
2345 |
+
}
|
2346 |
+
|
2347 |
+
this.audioController.mute();
|
2348 |
+
};
|
2349 |
+
|
2350 |
+
AnimationItem.prototype.unmute = function (name) {
|
2351 |
+
if (name && this.name !== name) {
|
2352 |
+
return;
|
2353 |
+
}
|
2354 |
+
|
2355 |
+
this.audioController.unmute();
|
2356 |
+
};
|
2357 |
+
|
2358 |
+
AnimationItem.prototype.updaFrameModifier = function () {
|
2359 |
+
this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
|
2360 |
+
this.audioController.setRate(this.playSpeed * this.playDirection);
|
2361 |
+
};
|
2362 |
+
|
2363 |
+
AnimationItem.prototype.getPath = function () {
|
2364 |
+
return this.path;
|
2365 |
+
};
|
2366 |
+
|
2367 |
+
AnimationItem.prototype.getAssetsPath = function (assetData) {
|
2368 |
+
var path = '';
|
2369 |
+
|
2370 |
+
if (assetData.e) {
|
2371 |
+
path = assetData.p;
|
2372 |
+
} else if (this.assetsPath) {
|
2373 |
+
var imagePath = assetData.p;
|
2374 |
+
|
2375 |
+
if (imagePath.indexOf('images/') !== -1) {
|
2376 |
+
imagePath = imagePath.split('/')[1];
|
2377 |
+
}
|
2378 |
+
|
2379 |
+
path = this.assetsPath + imagePath;
|
2380 |
+
} else {
|
2381 |
+
path = this.path;
|
2382 |
+
path += assetData.u ? assetData.u : '';
|
2383 |
+
path += assetData.p;
|
2384 |
+
}
|
2385 |
+
|
2386 |
+
return path;
|
2387 |
+
};
|
2388 |
+
|
2389 |
+
AnimationItem.prototype.getAssetData = function (id) {
|
2390 |
+
var i = 0;
|
2391 |
+
var len = this.assets.length;
|
2392 |
+
|
2393 |
+
while (i < len) {
|
2394 |
+
if (id === this.assets[i].id) {
|
2395 |
+
return this.assets[i];
|
2396 |
+
}
|
2397 |
+
|
2398 |
+
i += 1;
|
2399 |
+
}
|
2400 |
+
|
2401 |
+
return null;
|
2402 |
+
};
|
2403 |
+
|
2404 |
+
AnimationItem.prototype.hide = function () {
|
2405 |
+
this.renderer.hide();
|
2406 |
+
};
|
2407 |
+
|
2408 |
+
AnimationItem.prototype.show = function () {
|
2409 |
+
this.renderer.show();
|
2410 |
+
};
|
2411 |
+
|
2412 |
+
AnimationItem.prototype.getDuration = function (isFrame) {
|
2413 |
+
return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
|
2414 |
+
};
|
2415 |
+
|
2416 |
+
AnimationItem.prototype.updateDocumentData = function (path, documentData, index) {
|
2417 |
+
try {
|
2418 |
+
var element = this.renderer.getElementByPath(path);
|
2419 |
+
element.updateDocumentData(documentData, index);
|
2420 |
+
} catch (error) {// TODO: decide how to handle catch case
|
2421 |
+
}
|
2422 |
+
};
|
2423 |
+
|
2424 |
+
AnimationItem.prototype.trigger = function (name) {
|
2425 |
+
if (this._cbs && this._cbs[name]) {
|
2426 |
+
switch (name) {
|
2427 |
+
case 'enterFrame':
|
2428 |
+
this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
|
2429 |
+
break;
|
2430 |
+
|
2431 |
+
case 'drawnFrame':
|
2432 |
+
this.drawnFrameEvent.currentTime = this.currentFrame;
|
2433 |
+
this.drawnFrameEvent.totalTime = this.totalFrames;
|
2434 |
+
this.drawnFrameEvent.direction = this.frameModifier;
|
2435 |
+
this.triggerEvent(name, this.drawnFrameEvent);
|
2436 |
+
break;
|
2437 |
+
|
2438 |
+
case 'loopComplete':
|
2439 |
+
this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
|
2440 |
+
break;
|
2441 |
+
|
2442 |
+
case 'complete':
|
2443 |
+
this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
|
2444 |
+
break;
|
2445 |
+
|
2446 |
+
case 'segmentStart':
|
2447 |
+
this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
|
2448 |
+
break;
|
2449 |
+
|
2450 |
+
case 'destroy':
|
2451 |
+
this.triggerEvent(name, new BMDestroyEvent(name, this));
|
2452 |
+
break;
|
2453 |
+
|
2454 |
+
default:
|
2455 |
+
this.triggerEvent(name);
|
2456 |
+
}
|
2457 |
+
}
|
2458 |
+
|
2459 |
+
if (name === 'enterFrame' && this.onEnterFrame) {
|
2460 |
+
this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
|
2461 |
+
}
|
2462 |
+
|
2463 |
+
if (name === 'loopComplete' && this.onLoopComplete) {
|
2464 |
+
this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
|
2465 |
+
}
|
2466 |
+
|
2467 |
+
if (name === 'complete' && this.onComplete) {
|
2468 |
+
this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
|
2469 |
+
}
|
2470 |
+
|
2471 |
+
if (name === 'segmentStart' && this.onSegmentStart) {
|
2472 |
+
this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
|
2473 |
+
}
|
2474 |
+
|
2475 |
+
if (name === 'destroy' && this.onDestroy) {
|
2476 |
+
this.onDestroy.call(this, new BMDestroyEvent(name, this));
|
2477 |
+
}
|
2478 |
+
};
|
2479 |
+
|
2480 |
+
AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
|
2481 |
+
var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
|
2482 |
+
this.triggerEvent('error', error);
|
2483 |
+
|
2484 |
+
if (this.onError) {
|
2485 |
+
this.onError.call(this, error);
|
2486 |
+
}
|
2487 |
+
};
|
2488 |
+
|
2489 |
+
AnimationItem.prototype.triggerConfigError = function (nativeError) {
|
2490 |
+
var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
|
2491 |
+
this.triggerEvent('error', error);
|
2492 |
+
|
2493 |
+
if (this.onError) {
|
2494 |
+
this.onError.call(this, error);
|
2495 |
+
}
|
2496 |
+
};
|
2497 |
+
|
2498 |
+
var animationManager = function () {
|
2499 |
+
var moduleOb = {};
|
2500 |
+
var registeredAnimations = [];
|
2501 |
+
var initTime = 0;
|
2502 |
+
var len = 0;
|
2503 |
+
var playingAnimationsNum = 0;
|
2504 |
+
var _stopped = true;
|
2505 |
+
var _isFrozen = false;
|
2506 |
+
|
2507 |
+
function removeElement(ev) {
|
2508 |
+
var i = 0;
|
2509 |
+
var animItem = ev.target;
|
2510 |
+
|
2511 |
+
while (i < len) {
|
2512 |
+
if (registeredAnimations[i].animation === animItem) {
|
2513 |
+
registeredAnimations.splice(i, 1);
|
2514 |
+
i -= 1;
|
2515 |
+
len -= 1;
|
2516 |
+
|
2517 |
+
if (!animItem.isPaused) {
|
2518 |
+
subtractPlayingCount();
|
2519 |
+
}
|
2520 |
+
}
|
2521 |
+
|
2522 |
+
i += 1;
|
2523 |
+
}
|
2524 |
+
}
|
2525 |
+
|
2526 |
+
function registerAnimation(element, animationData) {
|
2527 |
+
if (!element) {
|
2528 |
+
return null;
|
2529 |
+
}
|
2530 |
+
|
2531 |
+
var i = 0;
|
2532 |
+
|
2533 |
+
while (i < len) {
|
2534 |
+
if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
|
2535 |
+
return registeredAnimations[i].animation;
|
2536 |
+
}
|
2537 |
+
|
2538 |
+
i += 1;
|
2539 |
+
}
|
2540 |
+
|
2541 |
+
var animItem = new AnimationItem();
|
2542 |
+
setupAnimation(animItem, element);
|
2543 |
+
animItem.setData(element, animationData);
|
2544 |
+
return animItem;
|
2545 |
+
}
|
2546 |
+
|
2547 |
+
function getRegisteredAnimations() {
|
2548 |
+
var i;
|
2549 |
+
var lenAnims = registeredAnimations.length;
|
2550 |
+
var animations = [];
|
2551 |
+
|
2552 |
+
for (i = 0; i < lenAnims; i += 1) {
|
2553 |
+
animations.push(registeredAnimations[i].animation);
|
2554 |
+
}
|
2555 |
+
|
2556 |
+
return animations;
|
2557 |
+
}
|
2558 |
+
|
2559 |
+
function addPlayingCount() {
|
2560 |
+
playingAnimationsNum += 1;
|
2561 |
+
activate();
|
2562 |
+
}
|
2563 |
+
|
2564 |
+
function subtractPlayingCount() {
|
2565 |
+
playingAnimationsNum -= 1;
|
2566 |
+
}
|
2567 |
+
|
2568 |
+
function setupAnimation(animItem, element) {
|
2569 |
+
animItem.addEventListener('destroy', removeElement);
|
2570 |
+
animItem.addEventListener('_active', addPlayingCount);
|
2571 |
+
animItem.addEventListener('_idle', subtractPlayingCount);
|
2572 |
+
registeredAnimations.push({
|
2573 |
+
elem: element,
|
2574 |
+
animation: animItem
|
2575 |
+
});
|
2576 |
+
len += 1;
|
2577 |
+
}
|
2578 |
+
|
2579 |
+
function loadAnimation(params) {
|
2580 |
+
var animItem = new AnimationItem();
|
2581 |
+
setupAnimation(animItem, null);
|
2582 |
+
animItem.setParams(params);
|
2583 |
+
return animItem;
|
2584 |
+
}
|
2585 |
+
|
2586 |
+
function setSpeed(val, animation) {
|
2587 |
+
var i;
|
2588 |
+
|
2589 |
+
for (i = 0; i < len; i += 1) {
|
2590 |
+
registeredAnimations[i].animation.setSpeed(val, animation);
|
2591 |
+
}
|
2592 |
+
}
|
2593 |
+
|
2594 |
+
function setDirection(val, animation) {
|
2595 |
+
var i;
|
2596 |
+
|
2597 |
+
for (i = 0; i < len; i += 1) {
|
2598 |
+
registeredAnimations[i].animation.setDirection(val, animation);
|
2599 |
+
}
|
2600 |
+
}
|
2601 |
+
|
2602 |
+
function play(animation) {
|
2603 |
+
var i;
|
2604 |
+
|
2605 |
+
for (i = 0; i < len; i += 1) {
|
2606 |
+
registeredAnimations[i].animation.play(animation);
|
2607 |
+
}
|
2608 |
+
}
|
2609 |
+
|
2610 |
+
function resume(nowTime) {
|
2611 |
+
var elapsedTime = nowTime - initTime;
|
2612 |
+
var i;
|
2613 |
+
|
2614 |
+
for (i = 0; i < len; i += 1) {
|
2615 |
+
registeredAnimations[i].animation.advanceTime(elapsedTime);
|
2616 |
+
}
|
2617 |
+
|
2618 |
+
initTime = nowTime;
|
2619 |
+
|
2620 |
+
if (playingAnimationsNum && !_isFrozen) {
|
2621 |
+
window.requestAnimationFrame(resume);
|
2622 |
+
} else {
|
2623 |
+
_stopped = true;
|
2624 |
+
}
|
2625 |
+
}
|
2626 |
+
|
2627 |
+
function first(nowTime) {
|
2628 |
+
initTime = nowTime;
|
2629 |
+
window.requestAnimationFrame(resume);
|
2630 |
+
}
|
2631 |
+
|
2632 |
+
function pause(animation) {
|
2633 |
+
var i;
|
2634 |
+
|
2635 |
+
for (i = 0; i < len; i += 1) {
|
2636 |
+
registeredAnimations[i].animation.pause(animation);
|
2637 |
+
}
|
2638 |
+
}
|
2639 |
+
|
2640 |
+
function goToAndStop(value, isFrame, animation) {
|
2641 |
+
var i;
|
2642 |
+
|
2643 |
+
for (i = 0; i < len; i += 1) {
|
2644 |
+
registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
|
2645 |
+
}
|
2646 |
+
}
|
2647 |
+
|
2648 |
+
function stop(animation) {
|
2649 |
+
var i;
|
2650 |
+
|
2651 |
+
for (i = 0; i < len; i += 1) {
|
2652 |
+
registeredAnimations[i].animation.stop(animation);
|
2653 |
+
}
|
2654 |
+
}
|
2655 |
+
|
2656 |
+
function togglePause(animation) {
|
2657 |
+
var i;
|
2658 |
+
|
2659 |
+
for (i = 0; i < len; i += 1) {
|
2660 |
+
registeredAnimations[i].animation.togglePause(animation);
|
2661 |
+
}
|
2662 |
+
}
|
2663 |
+
|
2664 |
+
function destroy(animation) {
|
2665 |
+
var i;
|
2666 |
+
|
2667 |
+
for (i = len - 1; i >= 0; i -= 1) {
|
2668 |
+
registeredAnimations[i].animation.destroy(animation);
|
2669 |
+
}
|
2670 |
+
}
|
2671 |
+
|
2672 |
+
function searchAnimations(animationData, standalone, renderer) {
|
2673 |
+
var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')), [].slice.call(document.getElementsByClassName('bodymovin')));
|
2674 |
+
var i;
|
2675 |
+
var lenAnims = animElements.length;
|
2676 |
+
|
2677 |
+
for (i = 0; i < lenAnims; i += 1) {
|
2678 |
+
if (renderer) {
|
2679 |
+
animElements[i].setAttribute('data-bm-type', renderer);
|
2680 |
+
}
|
2681 |
+
|
2682 |
+
registerAnimation(animElements[i], animationData);
|
2683 |
+
}
|
2684 |
+
|
2685 |
+
if (standalone && lenAnims === 0) {
|
2686 |
+
if (!renderer) {
|
2687 |
+
renderer = 'svg';
|
2688 |
+
}
|
2689 |
+
|
2690 |
+
var body = document.getElementsByTagName('body')[0];
|
2691 |
+
body.innerText = '';
|
2692 |
+
var div = createTag('div');
|
2693 |
+
div.style.width = '100%';
|
2694 |
+
div.style.height = '100%';
|
2695 |
+
div.setAttribute('data-bm-type', renderer);
|
2696 |
+
body.appendChild(div);
|
2697 |
+
registerAnimation(div, animationData);
|
2698 |
+
}
|
2699 |
+
}
|
2700 |
+
|
2701 |
+
function resize() {
|
2702 |
+
var i;
|
2703 |
+
|
2704 |
+
for (i = 0; i < len; i += 1) {
|
2705 |
+
registeredAnimations[i].animation.resize();
|
2706 |
+
}
|
2707 |
+
}
|
2708 |
+
|
2709 |
+
function activate() {
|
2710 |
+
if (!_isFrozen && playingAnimationsNum) {
|
2711 |
+
if (_stopped) {
|
2712 |
+
window.requestAnimationFrame(first);
|
2713 |
+
_stopped = false;
|
2714 |
+
}
|
2715 |
+
}
|
2716 |
+
}
|
2717 |
+
|
2718 |
+
function freeze() {
|
2719 |
+
_isFrozen = true;
|
2720 |
+
}
|
2721 |
+
|
2722 |
+
function unfreeze() {
|
2723 |
+
_isFrozen = false;
|
2724 |
+
activate();
|
2725 |
+
}
|
2726 |
+
|
2727 |
+
function setVolume(val, animation) {
|
2728 |
+
var i;
|
2729 |
+
|
2730 |
+
for (i = 0; i < len; i += 1) {
|
2731 |
+
registeredAnimations[i].animation.setVolume(val, animation);
|
2732 |
+
}
|
2733 |
+
}
|
2734 |
+
|
2735 |
+
function mute(animation) {
|
2736 |
+
var i;
|
2737 |
+
|
2738 |
+
for (i = 0; i < len; i += 1) {
|
2739 |
+
registeredAnimations[i].animation.mute(animation);
|
2740 |
+
}
|
2741 |
+
}
|
2742 |
+
|
2743 |
+
function unmute(animation) {
|
2744 |
+
var i;
|
2745 |
+
|
2746 |
+
for (i = 0; i < len; i += 1) {
|
2747 |
+
registeredAnimations[i].animation.unmute(animation);
|
2748 |
+
}
|
2749 |
+
}
|
2750 |
+
|
2751 |
+
moduleOb.registerAnimation = registerAnimation;
|
2752 |
+
moduleOb.loadAnimation = loadAnimation;
|
2753 |
+
moduleOb.setSpeed = setSpeed;
|
2754 |
+
moduleOb.setDirection = setDirection;
|
2755 |
+
moduleOb.play = play;
|
2756 |
+
moduleOb.pause = pause;
|
2757 |
+
moduleOb.stop = stop;
|
2758 |
+
moduleOb.togglePause = togglePause;
|
2759 |
+
moduleOb.searchAnimations = searchAnimations;
|
2760 |
+
moduleOb.resize = resize; // moduleOb.start = start;
|
2761 |
+
|
2762 |
+
moduleOb.goToAndStop = goToAndStop;
|
2763 |
+
moduleOb.destroy = destroy;
|
2764 |
+
moduleOb.freeze = freeze;
|
2765 |
+
moduleOb.unfreeze = unfreeze;
|
2766 |
+
moduleOb.setVolume = setVolume;
|
2767 |
+
moduleOb.mute = mute;
|
2768 |
+
moduleOb.unmute = unmute;
|
2769 |
+
moduleOb.getRegisteredAnimations = getRegisteredAnimations;
|
2770 |
+
return moduleOb;
|
2771 |
+
}();
|
2772 |
+
|
2773 |
+
/* eslint-disable */
|
2774 |
+
var BezierFactory = function () {
|
2775 |
+
/**
|
2776 |
+
* BezierEasing - use bezier curve for transition easing function
|
2777 |
+
* by Gaëtan Renaudeau 2014 - 2015 – MIT License
|
2778 |
+
*
|
2779 |
+
* Credits: is based on Firefox's nsSMILKeySpline.cpp
|
2780 |
+
* Usage:
|
2781 |
+
* var spline = BezierEasing([ 0.25, 0.1, 0.25, 1.0 ])
|
2782 |
+
* spline.get(x) => returns the easing value | x must be in [0, 1] range
|
2783 |
+
*
|
2784 |
+
*/
|
2785 |
+
var ob = {};
|
2786 |
+
ob.getBezierEasing = getBezierEasing;
|
2787 |
+
var beziers = {};
|
2788 |
+
|
2789 |
+
function getBezierEasing(a, b, c, d, nm) {
|
2790 |
+
var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
|
2791 |
+
|
2792 |
+
if (beziers[str]) {
|
2793 |
+
return beziers[str];
|
2794 |
+
}
|
2795 |
+
|
2796 |
+
var bezEasing = new BezierEasing([a, b, c, d]);
|
2797 |
+
beziers[str] = bezEasing;
|
2798 |
+
return bezEasing;
|
2799 |
+
} // These values are established by empiricism with tests (tradeoff: performance VS precision)
|
2800 |
+
|
2801 |
+
|
2802 |
+
var NEWTON_ITERATIONS = 4;
|
2803 |
+
var NEWTON_MIN_SLOPE = 0.001;
|
2804 |
+
var SUBDIVISION_PRECISION = 0.0000001;
|
2805 |
+
var SUBDIVISION_MAX_ITERATIONS = 10;
|
2806 |
+
var kSplineTableSize = 11;
|
2807 |
+
var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
2808 |
+
var float32ArraySupported = typeof Float32Array === 'function';
|
2809 |
+
|
2810 |
+
function A(aA1, aA2) {
|
2811 |
+
return 1.0 - 3.0 * aA2 + 3.0 * aA1;
|
2812 |
+
}
|
2813 |
+
|
2814 |
+
function B(aA1, aA2) {
|
2815 |
+
return 3.0 * aA2 - 6.0 * aA1;
|
2816 |
+
}
|
2817 |
+
|
2818 |
+
function C(aA1) {
|
2819 |
+
return 3.0 * aA1;
|
2820 |
+
} // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
2821 |
+
|
2822 |
+
|
2823 |
+
function calcBezier(aT, aA1, aA2) {
|
2824 |
+
return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
|
2825 |
+
} // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
|
2826 |
+
|
2827 |
+
|
2828 |
+
function getSlope(aT, aA1, aA2) {
|
2829 |
+
return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
|
2830 |
+
}
|
2831 |
+
|
2832 |
+
function binarySubdivide(aX, aA, aB, mX1, mX2) {
|
2833 |
+
var currentX,
|
2834 |
+
currentT,
|
2835 |
+
i = 0;
|
2836 |
+
|
2837 |
+
do {
|
2838 |
+
currentT = aA + (aB - aA) / 2.0;
|
2839 |
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
2840 |
+
|
2841 |
+
if (currentX > 0.0) {
|
2842 |
+
aB = currentT;
|
2843 |
+
} else {
|
2844 |
+
aA = currentT;
|
2845 |
+
}
|
2846 |
+
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
2847 |
+
|
2848 |
+
return currentT;
|
2849 |
+
}
|
2850 |
+
|
2851 |
+
function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
|
2852 |
+
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
|
2853 |
+
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
2854 |
+
if (currentSlope === 0.0) return aGuessT;
|
2855 |
+
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
2856 |
+
aGuessT -= currentX / currentSlope;
|
2857 |
+
}
|
2858 |
+
|
2859 |
+
return aGuessT;
|
2860 |
+
}
|
2861 |
+
/**
|
2862 |
+
* points is an array of [ mX1, mY1, mX2, mY2 ]
|
2863 |
+
*/
|
2864 |
+
|
2865 |
+
|
2866 |
+
function BezierEasing(points) {
|
2867 |
+
this._p = points;
|
2868 |
+
this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
2869 |
+
this._precomputed = false;
|
2870 |
+
this.get = this.get.bind(this);
|
2871 |
+
}
|
2872 |
+
|
2873 |
+
BezierEasing.prototype = {
|
2874 |
+
get: function get(x) {
|
2875 |
+
var mX1 = this._p[0],
|
2876 |
+
mY1 = this._p[1],
|
2877 |
+
mX2 = this._p[2],
|
2878 |
+
mY2 = this._p[3];
|
2879 |
+
if (!this._precomputed) this._precompute();
|
2880 |
+
if (mX1 === mY1 && mX2 === mY2) return x; // linear
|
2881 |
+
// Because JavaScript number are imprecise, we should guarantee the extremes are right.
|
2882 |
+
|
2883 |
+
if (x === 0) return 0;
|
2884 |
+
if (x === 1) return 1;
|
2885 |
+
return calcBezier(this._getTForX(x), mY1, mY2);
|
2886 |
+
},
|
2887 |
+
// Private part
|
2888 |
+
_precompute: function _precompute() {
|
2889 |
+
var mX1 = this._p[0],
|
2890 |
+
mY1 = this._p[1],
|
2891 |
+
mX2 = this._p[2],
|
2892 |
+
mY2 = this._p[3];
|
2893 |
+
this._precomputed = true;
|
2894 |
+
|
2895 |
+
if (mX1 !== mY1 || mX2 !== mY2) {
|
2896 |
+
this._calcSampleValues();
|
2897 |
+
}
|
2898 |
+
},
|
2899 |
+
_calcSampleValues: function _calcSampleValues() {
|
2900 |
+
var mX1 = this._p[0],
|
2901 |
+
mX2 = this._p[2];
|
2902 |
+
|
2903 |
+
for (var i = 0; i < kSplineTableSize; ++i) {
|
2904 |
+
this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
2905 |
+
}
|
2906 |
+
},
|
2907 |
+
|
2908 |
+
/**
|
2909 |
+
* getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
|
2910 |
+
*/
|
2911 |
+
_getTForX: function _getTForX(aX) {
|
2912 |
+
var mX1 = this._p[0],
|
2913 |
+
mX2 = this._p[2],
|
2914 |
+
mSampleValues = this._mSampleValues;
|
2915 |
+
var intervalStart = 0.0;
|
2916 |
+
var currentSample = 1;
|
2917 |
+
var lastSample = kSplineTableSize - 1;
|
2918 |
+
|
2919 |
+
for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
|
2920 |
+
intervalStart += kSampleStepSize;
|
2921 |
+
}
|
2922 |
+
|
2923 |
+
--currentSample; // Interpolate to provide an initial guess for t
|
2924 |
+
|
2925 |
+
var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
|
2926 |
+
var guessForT = intervalStart + dist * kSampleStepSize;
|
2927 |
+
var initialSlope = getSlope(guessForT, mX1, mX2);
|
2928 |
+
|
2929 |
+
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
2930 |
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
2931 |
+
}
|
2932 |
+
|
2933 |
+
if (initialSlope === 0.0) {
|
2934 |
+
return guessForT;
|
2935 |
+
}
|
2936 |
+
|
2937 |
+
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
2938 |
+
}
|
2939 |
+
};
|
2940 |
+
return ob;
|
2941 |
+
}();
|
2942 |
+
|
2943 |
+
var pooling = function () {
|
2944 |
+
function _double(arr) {
|
2945 |
+
return arr.concat(createSizedArray(arr.length));
|
2946 |
+
}
|
2947 |
+
|
2948 |
+
return {
|
2949 |
+
"double": _double
|
2950 |
+
};
|
2951 |
+
}();
|
2952 |
+
|
2953 |
+
var poolFactory = function () {
|
2954 |
+
return function (initialLength, _create, _release) {
|
2955 |
+
var _length = 0;
|
2956 |
+
var _maxLength = initialLength;
|
2957 |
+
var pool = createSizedArray(_maxLength);
|
2958 |
+
var ob = {
|
2959 |
+
newElement: newElement,
|
2960 |
+
release: release
|
2961 |
+
};
|
2962 |
+
|
2963 |
+
function newElement() {
|
2964 |
+
var element;
|
2965 |
+
|
2966 |
+
if (_length) {
|
2967 |
+
_length -= 1;
|
2968 |
+
element = pool[_length];
|
2969 |
+
} else {
|
2970 |
+
element = _create();
|
2971 |
+
}
|
2972 |
+
|
2973 |
+
return element;
|
2974 |
+
}
|
2975 |
+
|
2976 |
+
function release(element) {
|
2977 |
+
if (_length === _maxLength) {
|
2978 |
+
pool = pooling["double"](pool);
|
2979 |
+
_maxLength *= 2;
|
2980 |
+
}
|
2981 |
+
|
2982 |
+
if (_release) {
|
2983 |
+
_release(element);
|
2984 |
+
}
|
2985 |
+
|
2986 |
+
pool[_length] = element;
|
2987 |
+
_length += 1;
|
2988 |
+
}
|
2989 |
+
|
2990 |
+
return ob;
|
2991 |
+
};
|
2992 |
+
}();
|
2993 |
+
|
2994 |
+
var bezierLengthPool = function () {
|
2995 |
+
function create() {
|
2996 |
+
return {
|
2997 |
+
addedLength: 0,
|
2998 |
+
percents: createTypedArray('float32', getDefaultCurveSegments()),
|
2999 |
+
lengths: createTypedArray('float32', getDefaultCurveSegments())
|
3000 |
+
};
|
3001 |
+
}
|
3002 |
+
|
3003 |
+
return poolFactory(8, create);
|
3004 |
+
}();
|
3005 |
+
|
3006 |
+
var segmentsLengthPool = function () {
|
3007 |
+
function create() {
|
3008 |
+
return {
|
3009 |
+
lengths: [],
|
3010 |
+
totalLength: 0
|
3011 |
+
};
|
3012 |
+
}
|
3013 |
+
|
3014 |
+
function release(element) {
|
3015 |
+
var i;
|
3016 |
+
var len = element.lengths.length;
|
3017 |
+
|
3018 |
+
for (i = 0; i < len; i += 1) {
|
3019 |
+
bezierLengthPool.release(element.lengths[i]);
|
3020 |
+
}
|
3021 |
+
|
3022 |
+
element.lengths.length = 0;
|
3023 |
+
}
|
3024 |
+
|
3025 |
+
return poolFactory(8, create, release);
|
3026 |
+
}();
|
3027 |
+
|
3028 |
+
function bezFunction() {
|
3029 |
+
var math = Math;
|
3030 |
+
|
3031 |
+
function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
|
3032 |
+
var det1 = x1 * y2 + y1 * x3 + x2 * y3 - x3 * y2 - y3 * x1 - x2 * y1;
|
3033 |
+
return det1 > -0.001 && det1 < 0.001;
|
3034 |
+
}
|
3035 |
+
|
3036 |
+
function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
|
3037 |
+
if (z1 === 0 && z2 === 0 && z3 === 0) {
|
3038 |
+
return pointOnLine2D(x1, y1, x2, y2, x3, y3);
|
3039 |
+
}
|
3040 |
+
|
3041 |
+
var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
|
3042 |
+
var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
|
3043 |
+
var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
|
3044 |
+
var diffDist;
|
3045 |
+
|
3046 |
+
if (dist1 > dist2) {
|
3047 |
+
if (dist1 > dist3) {
|
3048 |
+
diffDist = dist1 - dist2 - dist3;
|
3049 |
+
} else {
|
3050 |
+
diffDist = dist3 - dist2 - dist1;
|
3051 |
+
}
|
3052 |
+
} else if (dist3 > dist2) {
|
3053 |
+
diffDist = dist3 - dist2 - dist1;
|
3054 |
+
} else {
|
3055 |
+
diffDist = dist2 - dist1 - dist3;
|
3056 |
+
}
|
3057 |
+
|
3058 |
+
return diffDist > -0.0001 && diffDist < 0.0001;
|
3059 |
+
}
|
3060 |
+
|
3061 |
+
var getBezierLength = function () {
|
3062 |
+
return function (pt1, pt2, pt3, pt4) {
|
3063 |
+
var curveSegments = getDefaultCurveSegments();
|
3064 |
+
var k;
|
3065 |
+
var i;
|
3066 |
+
var len;
|
3067 |
+
var ptCoord;
|
3068 |
+
var perc;
|
3069 |
+
var addedLength = 0;
|
3070 |
+
var ptDistance;
|
3071 |
+
var point = [];
|
3072 |
+
var lastPoint = [];
|
3073 |
+
var lengthData = bezierLengthPool.newElement();
|
3074 |
+
len = pt3.length;
|
3075 |
+
|
3076 |
+
for (k = 0; k < curveSegments; k += 1) {
|
3077 |
+
perc = k / (curveSegments - 1);
|
3078 |
+
ptDistance = 0;
|
3079 |
+
|
3080 |
+
for (i = 0; i < len; i += 1) {
|
3081 |
+
ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * pt3[i] + 3 * (1 - perc) * bmPow(perc, 2) * pt4[i] + bmPow(perc, 3) * pt2[i];
|
3082 |
+
point[i] = ptCoord;
|
3083 |
+
|
3084 |
+
if (lastPoint[i] !== null) {
|
3085 |
+
ptDistance += bmPow(point[i] - lastPoint[i], 2);
|
3086 |
+
}
|
3087 |
+
|
3088 |
+
lastPoint[i] = point[i];
|
3089 |
+
}
|
3090 |
+
|
3091 |
+
if (ptDistance) {
|
3092 |
+
ptDistance = bmSqrt(ptDistance);
|
3093 |
+
addedLength += ptDistance;
|
3094 |
+
}
|
3095 |
+
|
3096 |
+
lengthData.percents[k] = perc;
|
3097 |
+
lengthData.lengths[k] = addedLength;
|
3098 |
+
}
|
3099 |
+
|
3100 |
+
lengthData.addedLength = addedLength;
|
3101 |
+
return lengthData;
|
3102 |
+
};
|
3103 |
+
}();
|
3104 |
+
|
3105 |
+
function getSegmentsLength(shapeData) {
|
3106 |
+
var segmentsLength = segmentsLengthPool.newElement();
|
3107 |
+
var closed = shapeData.c;
|
3108 |
+
var pathV = shapeData.v;
|
3109 |
+
var pathO = shapeData.o;
|
3110 |
+
var pathI = shapeData.i;
|
3111 |
+
var i;
|
3112 |
+
var len = shapeData._length;
|
3113 |
+
var lengths = segmentsLength.lengths;
|
3114 |
+
var totalLength = 0;
|
3115 |
+
|
3116 |
+
for (i = 0; i < len - 1; i += 1) {
|
3117 |
+
lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
|
3118 |
+
totalLength += lengths[i].addedLength;
|
3119 |
+
}
|
3120 |
+
|
3121 |
+
if (closed && len) {
|
3122 |
+
lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
|
3123 |
+
totalLength += lengths[i].addedLength;
|
3124 |
+
}
|
3125 |
+
|
3126 |
+
segmentsLength.totalLength = totalLength;
|
3127 |
+
return segmentsLength;
|
3128 |
+
}
|
3129 |
+
|
3130 |
+
function BezierData(length) {
|
3131 |
+
this.segmentLength = 0;
|
3132 |
+
this.points = new Array(length);
|
3133 |
+
}
|
3134 |
+
|
3135 |
+
function PointData(partial, point) {
|
3136 |
+
this.partialLength = partial;
|
3137 |
+
this.point = point;
|
3138 |
+
}
|
3139 |
+
|
3140 |
+
var buildBezierData = function () {
|
3141 |
+
var storedData = {};
|
3142 |
+
return function (pt1, pt2, pt3, pt4) {
|
3143 |
+
var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
|
3144 |
+
|
3145 |
+
if (!storedData[bezierName]) {
|
3146 |
+
var curveSegments = getDefaultCurveSegments();
|
3147 |
+
var k;
|
3148 |
+
var i;
|
3149 |
+
var len;
|
3150 |
+
var ptCoord;
|
3151 |
+
var perc;
|
3152 |
+
var addedLength = 0;
|
3153 |
+
var ptDistance;
|
3154 |
+
var point;
|
3155 |
+
var lastPoint = null;
|
3156 |
+
|
3157 |
+
if (pt1.length === 2 && (pt1[0] !== pt2[0] || pt1[1] !== pt2[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt1[0] + pt3[0], pt1[1] + pt3[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt2[0] + pt4[0], pt2[1] + pt4[1])) {
|
3158 |
+
curveSegments = 2;
|
3159 |
+
}
|
3160 |
+
|
3161 |
+
var bezierData = new BezierData(curveSegments);
|
3162 |
+
len = pt3.length;
|
3163 |
+
|
3164 |
+
for (k = 0; k < curveSegments; k += 1) {
|
3165 |
+
point = createSizedArray(len);
|
3166 |
+
perc = k / (curveSegments - 1);
|
3167 |
+
ptDistance = 0;
|
3168 |
+
|
3169 |
+
for (i = 0; i < len; i += 1) {
|
3170 |
+
ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * (pt1[i] + pt3[i]) + 3 * (1 - perc) * bmPow(perc, 2) * (pt2[i] + pt4[i]) + bmPow(perc, 3) * pt2[i];
|
3171 |
+
point[i] = ptCoord;
|
3172 |
+
|
3173 |
+
if (lastPoint !== null) {
|
3174 |
+
ptDistance += bmPow(point[i] - lastPoint[i], 2);
|
3175 |
+
}
|
3176 |
+
}
|
3177 |
+
|
3178 |
+
ptDistance = bmSqrt(ptDistance);
|
3179 |
+
addedLength += ptDistance;
|
3180 |
+
bezierData.points[k] = new PointData(ptDistance, point);
|
3181 |
+
lastPoint = point;
|
3182 |
+
}
|
3183 |
+
|
3184 |
+
bezierData.segmentLength = addedLength;
|
3185 |
+
storedData[bezierName] = bezierData;
|
3186 |
+
}
|
3187 |
+
|
3188 |
+
return storedData[bezierName];
|
3189 |
+
};
|
3190 |
+
}();
|
3191 |
+
|
3192 |
+
function getDistancePerc(perc, bezierData) {
|
3193 |
+
var percents = bezierData.percents;
|
3194 |
+
var lengths = bezierData.lengths;
|
3195 |
+
var len = percents.length;
|
3196 |
+
var initPos = bmFloor((len - 1) * perc);
|
3197 |
+
var lengthPos = perc * bezierData.addedLength;
|
3198 |
+
var lPerc = 0;
|
3199 |
+
|
3200 |
+
if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
|
3201 |
+
return percents[initPos];
|
3202 |
+
}
|
3203 |
+
|
3204 |
+
var dir = lengths[initPos] > lengthPos ? -1 : 1;
|
3205 |
+
var flag = true;
|
3206 |
+
|
3207 |
+
while (flag) {
|
3208 |
+
if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
|
3209 |
+
lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
|
3210 |
+
flag = false;
|
3211 |
+
} else {
|
3212 |
+
initPos += dir;
|
3213 |
+
}
|
3214 |
+
|
3215 |
+
if (initPos < 0 || initPos >= len - 1) {
|
3216 |
+
// FIX for TypedArrays that don't store floating point values with enough accuracy
|
3217 |
+
if (initPos === len - 1) {
|
3218 |
+
return percents[initPos];
|
3219 |
+
}
|
3220 |
+
|
3221 |
+
flag = false;
|
3222 |
+
}
|
3223 |
+
}
|
3224 |
+
|
3225 |
+
return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
|
3226 |
+
}
|
3227 |
+
|
3228 |
+
function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
|
3229 |
+
var t1 = getDistancePerc(percent, bezierData);
|
3230 |
+
var u1 = 1 - t1;
|
3231 |
+
var ptX = math.round((u1 * u1 * u1 * pt1[0] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[0] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[0] + t1 * t1 * t1 * pt2[0]) * 1000) / 1000;
|
3232 |
+
var ptY = math.round((u1 * u1 * u1 * pt1[1] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[1] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[1] + t1 * t1 * t1 * pt2[1]) * 1000) / 1000;
|
3233 |
+
return [ptX, ptY];
|
3234 |
+
}
|
3235 |
+
|
3236 |
+
var bezierSegmentPoints = createTypedArray('float32', 8);
|
3237 |
+
|
3238 |
+
function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
|
3239 |
+
if (startPerc < 0) {
|
3240 |
+
startPerc = 0;
|
3241 |
+
} else if (startPerc > 1) {
|
3242 |
+
startPerc = 1;
|
3243 |
+
}
|
3244 |
+
|
3245 |
+
var t0 = getDistancePerc(startPerc, bezierData);
|
3246 |
+
endPerc = endPerc > 1 ? 1 : endPerc;
|
3247 |
+
var t1 = getDistancePerc(endPerc, bezierData);
|
3248 |
+
var i;
|
3249 |
+
var len = pt1.length;
|
3250 |
+
var u0 = 1 - t0;
|
3251 |
+
var u1 = 1 - t1;
|
3252 |
+
var u0u0u0 = u0 * u0 * u0;
|
3253 |
+
var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
|
3254 |
+
|
3255 |
+
var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
|
3256 |
+
|
3257 |
+
var t0t0t0 = t0 * t0 * t0; //
|
3258 |
+
|
3259 |
+
var u0u0u1 = u0 * u0 * u1;
|
3260 |
+
var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
|
3261 |
+
|
3262 |
+
var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
|
3263 |
+
|
3264 |
+
var t0t0t1 = t0 * t0 * t1; //
|
3265 |
+
|
3266 |
+
var u0u1u1 = u0 * u1 * u1;
|
3267 |
+
var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
|
3268 |
+
|
3269 |
+
var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
|
3270 |
+
|
3271 |
+
var t0t1t1 = t0 * t1 * t1; //
|
3272 |
+
|
3273 |
+
var u1u1u1 = u1 * u1 * u1;
|
3274 |
+
var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
|
3275 |
+
|
3276 |
+
var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
|
3277 |
+
|
3278 |
+
var t1t1t1 = t1 * t1 * t1;
|
3279 |
+
|
3280 |
+
for (i = 0; i < len; i += 1) {
|
3281 |
+
bezierSegmentPoints[i * 4] = math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase
|
3282 |
+
|
3283 |
+
bezierSegmentPoints[i * 4 + 1] = math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase
|
3284 |
+
|
3285 |
+
bezierSegmentPoints[i * 4 + 2] = math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase
|
3286 |
+
|
3287 |
+
bezierSegmentPoints[i * 4 + 3] = math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase
|
3288 |
+
}
|
3289 |
+
|
3290 |
+
return bezierSegmentPoints;
|
3291 |
+
}
|
3292 |
+
|
3293 |
+
return {
|
3294 |
+
getSegmentsLength: getSegmentsLength,
|
3295 |
+
getNewSegment: getNewSegment,
|
3296 |
+
getPointInSegment: getPointInSegment,
|
3297 |
+
buildBezierData: buildBezierData,
|
3298 |
+
pointOnLine2D: pointOnLine2D,
|
3299 |
+
pointOnLine3D: pointOnLine3D
|
3300 |
+
};
|
3301 |
+
}
|
3302 |
+
|
3303 |
+
var bez = bezFunction();
|
3304 |
+
|
3305 |
+
var PropertyFactory = function () {
|
3306 |
+
var initFrame = initialDefaultFrame;
|
3307 |
+
var mathAbs = Math.abs;
|
3308 |
+
|
3309 |
+
function interpolateValue(frameNum, caching) {
|
3310 |
+
var offsetTime = this.offsetTime;
|
3311 |
+
var newValue;
|
3312 |
+
|
3313 |
+
if (this.propType === 'multidimensional') {
|
3314 |
+
newValue = createTypedArray('float32', this.pv.length);
|
3315 |
+
}
|
3316 |
+
|
3317 |
+
var iterationIndex = caching.lastIndex;
|
3318 |
+
var i = iterationIndex;
|
3319 |
+
var len = this.keyframes.length - 1;
|
3320 |
+
var flag = true;
|
3321 |
+
var keyData;
|
3322 |
+
var nextKeyData;
|
3323 |
+
var keyframeMetadata;
|
3324 |
+
|
3325 |
+
while (flag) {
|
3326 |
+
keyData = this.keyframes[i];
|
3327 |
+
nextKeyData = this.keyframes[i + 1];
|
3328 |
+
|
3329 |
+
if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
|
3330 |
+
if (keyData.h) {
|
3331 |
+
keyData = nextKeyData;
|
3332 |
+
}
|
3333 |
+
|
3334 |
+
iterationIndex = 0;
|
3335 |
+
break;
|
3336 |
+
}
|
3337 |
+
|
3338 |
+
if (nextKeyData.t - offsetTime > frameNum) {
|
3339 |
+
iterationIndex = i;
|
3340 |
+
break;
|
3341 |
+
}
|
3342 |
+
|
3343 |
+
if (i < len - 1) {
|
3344 |
+
i += 1;
|
3345 |
+
} else {
|
3346 |
+
iterationIndex = 0;
|
3347 |
+
flag = false;
|
3348 |
+
}
|
3349 |
+
}
|
3350 |
+
|
3351 |
+
keyframeMetadata = this.keyframesMetadata[i] || {};
|
3352 |
+
var k;
|
3353 |
+
var kLen;
|
3354 |
+
var perc;
|
3355 |
+
var jLen;
|
3356 |
+
var j;
|
3357 |
+
var fnc;
|
3358 |
+
var nextKeyTime = nextKeyData.t - offsetTime;
|
3359 |
+
var keyTime = keyData.t - offsetTime;
|
3360 |
+
var endValue;
|
3361 |
+
|
3362 |
+
if (keyData.to) {
|
3363 |
+
if (!keyframeMetadata.bezierData) {
|
3364 |
+
keyframeMetadata.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
|
3365 |
+
}
|
3366 |
+
|
3367 |
+
var bezierData = keyframeMetadata.bezierData;
|
3368 |
+
|
3369 |
+
if (frameNum >= nextKeyTime || frameNum < keyTime) {
|
3370 |
+
var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
|
3371 |
+
kLen = bezierData.points[ind].point.length;
|
3372 |
+
|
3373 |
+
for (k = 0; k < kLen; k += 1) {
|
3374 |
+
newValue[k] = bezierData.points[ind].point[k];
|
3375 |
+
} // caching._lastKeyframeIndex = -1;
|
3376 |
+
|
3377 |
+
} else {
|
3378 |
+
if (keyframeMetadata.__fnct) {
|
3379 |
+
fnc = keyframeMetadata.__fnct;
|
3380 |
+
} else {
|
3381 |
+
fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
|
3382 |
+
keyframeMetadata.__fnct = fnc;
|
3383 |
+
}
|
3384 |
+
|
3385 |
+
perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
|
3386 |
+
var distanceInLine = bezierData.segmentLength * perc;
|
3387 |
+
var segmentPerc;
|
3388 |
+
var addedLength = caching.lastFrame < frameNum && caching._lastKeyframeIndex === i ? caching._lastAddedLength : 0;
|
3389 |
+
j = caching.lastFrame < frameNum && caching._lastKeyframeIndex === i ? caching._lastPoint : 0;
|
3390 |
+
flag = true;
|
3391 |
+
jLen = bezierData.points.length;
|
3392 |
+
|
3393 |
+
while (flag) {
|
3394 |
+
addedLength += bezierData.points[j].partialLength;
|
3395 |
+
|
3396 |
+
if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
|
3397 |
+
kLen = bezierData.points[j].point.length;
|
3398 |
+
|
3399 |
+
for (k = 0; k < kLen; k += 1) {
|
3400 |
+
newValue[k] = bezierData.points[j].point[k];
|
3401 |
+
}
|
3402 |
+
|
3403 |
+
break;
|
3404 |
+
} else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
|
3405 |
+
segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
|
3406 |
+
kLen = bezierData.points[j].point.length;
|
3407 |
+
|
3408 |
+
for (k = 0; k < kLen; k += 1) {
|
3409 |
+
newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
|
3410 |
+
}
|
3411 |
+
|
3412 |
+
break;
|
3413 |
+
}
|
3414 |
+
|
3415 |
+
if (j < jLen - 1) {
|
3416 |
+
j += 1;
|
3417 |
+
} else {
|
3418 |
+
flag = false;
|
3419 |
+
}
|
3420 |
+
}
|
3421 |
+
|
3422 |
+
caching._lastPoint = j;
|
3423 |
+
caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
|
3424 |
+
caching._lastKeyframeIndex = i;
|
3425 |
+
}
|
3426 |
+
} else {
|
3427 |
+
var outX;
|
3428 |
+
var outY;
|
3429 |
+
var inX;
|
3430 |
+
var inY;
|
3431 |
+
var keyValue;
|
3432 |
+
len = keyData.s.length;
|
3433 |
+
endValue = nextKeyData.s || keyData.e;
|
3434 |
+
|
3435 |
+
if (this.sh && keyData.h !== 1) {
|
3436 |
+
if (frameNum >= nextKeyTime) {
|
3437 |
+
newValue[0] = endValue[0];
|
3438 |
+
newValue[1] = endValue[1];
|
3439 |
+
newValue[2] = endValue[2];
|
3440 |
+
} else if (frameNum <= keyTime) {
|
3441 |
+
newValue[0] = keyData.s[0];
|
3442 |
+
newValue[1] = keyData.s[1];
|
3443 |
+
newValue[2] = keyData.s[2];
|
3444 |
+
} else {
|
3445 |
+
var quatStart = createQuaternion(keyData.s);
|
3446 |
+
var quatEnd = createQuaternion(endValue);
|
3447 |
+
var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
|
3448 |
+
quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
|
3449 |
+
}
|
3450 |
+
} else {
|
3451 |
+
for (i = 0; i < len; i += 1) {
|
3452 |
+
if (keyData.h !== 1) {
|
3453 |
+
if (frameNum >= nextKeyTime) {
|
3454 |
+
perc = 1;
|
3455 |
+
} else if (frameNum < keyTime) {
|
3456 |
+
perc = 0;
|
3457 |
+
} else {
|
3458 |
+
if (keyData.o.x.constructor === Array) {
|
3459 |
+
if (!keyframeMetadata.__fnct) {
|
3460 |
+
keyframeMetadata.__fnct = [];
|
3461 |
+
}
|
3462 |
+
|
3463 |
+
if (!keyframeMetadata.__fnct[i]) {
|
3464 |
+
outX = keyData.o.x[i] === undefined ? keyData.o.x[0] : keyData.o.x[i];
|
3465 |
+
outY = keyData.o.y[i] === undefined ? keyData.o.y[0] : keyData.o.y[i];
|
3466 |
+
inX = keyData.i.x[i] === undefined ? keyData.i.x[0] : keyData.i.x[i];
|
3467 |
+
inY = keyData.i.y[i] === undefined ? keyData.i.y[0] : keyData.i.y[i];
|
3468 |
+
fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
|
3469 |
+
keyframeMetadata.__fnct[i] = fnc;
|
3470 |
+
} else {
|
3471 |
+
fnc = keyframeMetadata.__fnct[i];
|
3472 |
+
}
|
3473 |
+
} else if (!keyframeMetadata.__fnct) {
|
3474 |
+
outX = keyData.o.x;
|
3475 |
+
outY = keyData.o.y;
|
3476 |
+
inX = keyData.i.x;
|
3477 |
+
inY = keyData.i.y;
|
3478 |
+
fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
|
3479 |
+
keyData.keyframeMetadata = fnc;
|
3480 |
+
} else {
|
3481 |
+
fnc = keyframeMetadata.__fnct;
|
3482 |
+
}
|
3483 |
+
|
3484 |
+
perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
|
3485 |
+
}
|
3486 |
+
}
|
3487 |
+
|
3488 |
+
endValue = nextKeyData.s || keyData.e;
|
3489 |
+
keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
|
3490 |
+
|
3491 |
+
if (this.propType === 'multidimensional') {
|
3492 |
+
newValue[i] = keyValue;
|
3493 |
+
} else {
|
3494 |
+
newValue = keyValue;
|
3495 |
+
}
|
3496 |
+
}
|
3497 |
+
}
|
3498 |
+
}
|
3499 |
+
|
3500 |
+
caching.lastIndex = iterationIndex;
|
3501 |
+
return newValue;
|
3502 |
+
} // based on @Toji's https://github.com/toji/gl-matrix/
|
3503 |
+
|
3504 |
+
|
3505 |
+
function slerp(a, b, t) {
|
3506 |
+
var out = [];
|
3507 |
+
var ax = a[0];
|
3508 |
+
var ay = a[1];
|
3509 |
+
var az = a[2];
|
3510 |
+
var aw = a[3];
|
3511 |
+
var bx = b[0];
|
3512 |
+
var by = b[1];
|
3513 |
+
var bz = b[2];
|
3514 |
+
var bw = b[3];
|
3515 |
+
var omega;
|
3516 |
+
var cosom;
|
3517 |
+
var sinom;
|
3518 |
+
var scale0;
|
3519 |
+
var scale1;
|
3520 |
+
cosom = ax * bx + ay * by + az * bz + aw * bw;
|
3521 |
+
|
3522 |
+
if (cosom < 0.0) {
|
3523 |
+
cosom = -cosom;
|
3524 |
+
bx = -bx;
|
3525 |
+
by = -by;
|
3526 |
+
bz = -bz;
|
3527 |
+
bw = -bw;
|
3528 |
+
}
|
3529 |
+
|
3530 |
+
if (1.0 - cosom > 0.000001) {
|
3531 |
+
omega = Math.acos(cosom);
|
3532 |
+
sinom = Math.sin(omega);
|
3533 |
+
scale0 = Math.sin((1.0 - t) * omega) / sinom;
|
3534 |
+
scale1 = Math.sin(t * omega) / sinom;
|
3535 |
+
} else {
|
3536 |
+
scale0 = 1.0 - t;
|
3537 |
+
scale1 = t;
|
3538 |
+
}
|
3539 |
+
|
3540 |
+
out[0] = scale0 * ax + scale1 * bx;
|
3541 |
+
out[1] = scale0 * ay + scale1 * by;
|
3542 |
+
out[2] = scale0 * az + scale1 * bz;
|
3543 |
+
out[3] = scale0 * aw + scale1 * bw;
|
3544 |
+
return out;
|
3545 |
+
}
|
3546 |
+
|
3547 |
+
function quaternionToEuler(out, quat) {
|
3548 |
+
var qx = quat[0];
|
3549 |
+
var qy = quat[1];
|
3550 |
+
var qz = quat[2];
|
3551 |
+
var qw = quat[3];
|
3552 |
+
var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
|
3553 |
+
var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
|
3554 |
+
var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
|
3555 |
+
out[0] = heading / degToRads;
|
3556 |
+
out[1] = attitude / degToRads;
|
3557 |
+
out[2] = bank / degToRads;
|
3558 |
+
}
|
3559 |
+
|
3560 |
+
function createQuaternion(values) {
|
3561 |
+
var heading = values[0] * degToRads;
|
3562 |
+
var attitude = values[1] * degToRads;
|
3563 |
+
var bank = values[2] * degToRads;
|
3564 |
+
var c1 = Math.cos(heading / 2);
|
3565 |
+
var c2 = Math.cos(attitude / 2);
|
3566 |
+
var c3 = Math.cos(bank / 2);
|
3567 |
+
var s1 = Math.sin(heading / 2);
|
3568 |
+
var s2 = Math.sin(attitude / 2);
|
3569 |
+
var s3 = Math.sin(bank / 2);
|
3570 |
+
var w = c1 * c2 * c3 - s1 * s2 * s3;
|
3571 |
+
var x = s1 * s2 * c3 + c1 * c2 * s3;
|
3572 |
+
var y = s1 * c2 * c3 + c1 * s2 * s3;
|
3573 |
+
var z = c1 * s2 * c3 - s1 * c2 * s3;
|
3574 |
+
return [x, y, z, w];
|
3575 |
+
}
|
3576 |
+
|
3577 |
+
function getValueAtCurrentTime() {
|
3578 |
+
var frameNum = this.comp.renderedFrame - this.offsetTime;
|
3579 |
+
var initTime = this.keyframes[0].t - this.offsetTime;
|
3580 |
+
var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
|
3581 |
+
|
3582 |
+
if (!(frameNum === this._caching.lastFrame || this._caching.lastFrame !== initFrame && (this._caching.lastFrame >= endTime && frameNum >= endTime || this._caching.lastFrame < initTime && frameNum < initTime))) {
|
3583 |
+
if (this._caching.lastFrame >= frameNum) {
|
3584 |
+
this._caching._lastKeyframeIndex = -1;
|
3585 |
+
this._caching.lastIndex = 0;
|
3586 |
+
}
|
3587 |
+
|
3588 |
+
var renderResult = this.interpolateValue(frameNum, this._caching);
|
3589 |
+
this.pv = renderResult;
|
3590 |
+
}
|
3591 |
+
|
3592 |
+
this._caching.lastFrame = frameNum;
|
3593 |
+
return this.pv;
|
3594 |
+
}
|
3595 |
+
|
3596 |
+
function setVValue(val) {
|
3597 |
+
var multipliedValue;
|
3598 |
+
|
3599 |
+
if (this.propType === 'unidimensional') {
|
3600 |
+
multipliedValue = val * this.mult;
|
3601 |
+
|
3602 |
+
if (mathAbs(this.v - multipliedValue) > 0.00001) {
|
3603 |
+
this.v = multipliedValue;
|
3604 |
+
this._mdf = true;
|
3605 |
+
}
|
3606 |
+
} else {
|
3607 |
+
var i = 0;
|
3608 |
+
var len = this.v.length;
|
3609 |
+
|
3610 |
+
while (i < len) {
|
3611 |
+
multipliedValue = val[i] * this.mult;
|
3612 |
+
|
3613 |
+
if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
|
3614 |
+
this.v[i] = multipliedValue;
|
3615 |
+
this._mdf = true;
|
3616 |
+
}
|
3617 |
+
|
3618 |
+
i += 1;
|
3619 |
+
}
|
3620 |
+
}
|
3621 |
+
}
|
3622 |
+
|
3623 |
+
function processEffectsSequence() {
|
3624 |
+
if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
|
3625 |
+
return;
|
3626 |
+
}
|
3627 |
+
|
3628 |
+
if (this.lock) {
|
3629 |
+
this.setVValue(this.pv);
|
3630 |
+
return;
|
3631 |
+
}
|
3632 |
+
|
3633 |
+
this.lock = true;
|
3634 |
+
this._mdf = this._isFirstFrame;
|
3635 |
+
var i;
|
3636 |
+
var len = this.effectsSequence.length;
|
3637 |
+
var finalValue = this.kf ? this.pv : this.data.k;
|
3638 |
+
|
3639 |
+
for (i = 0; i < len; i += 1) {
|
3640 |
+
finalValue = this.effectsSequence[i](finalValue);
|
3641 |
+
}
|
3642 |
+
|
3643 |
+
this.setVValue(finalValue);
|
3644 |
+
this._isFirstFrame = false;
|
3645 |
+
this.lock = false;
|
3646 |
+
this.frameId = this.elem.globalData.frameId;
|
3647 |
+
}
|
3648 |
+
|
3649 |
+
function addEffect(effectFunction) {
|
3650 |
+
this.effectsSequence.push(effectFunction);
|
3651 |
+
this.container.addDynamicProperty(this);
|
3652 |
+
}
|
3653 |
+
|
3654 |
+
function ValueProperty(elem, data, mult, container) {
|
3655 |
+
this.propType = 'unidimensional';
|
3656 |
+
this.mult = mult || 1;
|
3657 |
+
this.data = data;
|
3658 |
+
this.v = mult ? data.k * mult : data.k;
|
3659 |
+
this.pv = data.k;
|
3660 |
+
this._mdf = false;
|
3661 |
+
this.elem = elem;
|
3662 |
+
this.container = container;
|
3663 |
+
this.comp = elem.comp;
|
3664 |
+
this.k = false;
|
3665 |
+
this.kf = false;
|
3666 |
+
this.vel = 0;
|
3667 |
+
this.effectsSequence = [];
|
3668 |
+
this._isFirstFrame = true;
|
3669 |
+
this.getValue = processEffectsSequence;
|
3670 |
+
this.setVValue = setVValue;
|
3671 |
+
this.addEffect = addEffect;
|
3672 |
+
}
|
3673 |
+
|
3674 |
+
function MultiDimensionalProperty(elem, data, mult, container) {
|
3675 |
+
this.propType = 'multidimensional';
|
3676 |
+
this.mult = mult || 1;
|
3677 |
+
this.data = data;
|
3678 |
+
this._mdf = false;
|
3679 |
+
this.elem = elem;
|
3680 |
+
this.container = container;
|
3681 |
+
this.comp = elem.comp;
|
3682 |
+
this.k = false;
|
3683 |
+
this.kf = false;
|
3684 |
+
this.frameId = -1;
|
3685 |
+
var i;
|
3686 |
+
var len = data.k.length;
|
3687 |
+
this.v = createTypedArray('float32', len);
|
3688 |
+
this.pv = createTypedArray('float32', len);
|
3689 |
+
this.vel = createTypedArray('float32', len);
|
3690 |
+
|
3691 |
+
for (i = 0; i < len; i += 1) {
|
3692 |
+
this.v[i] = data.k[i] * this.mult;
|
3693 |
+
this.pv[i] = data.k[i];
|
3694 |
+
}
|
3695 |
+
|
3696 |
+
this._isFirstFrame = true;
|
3697 |
+
this.effectsSequence = [];
|
3698 |
+
this.getValue = processEffectsSequence;
|
3699 |
+
this.setVValue = setVValue;
|
3700 |
+
this.addEffect = addEffect;
|
3701 |
+
}
|
3702 |
+
|
3703 |
+
function KeyframedValueProperty(elem, data, mult, container) {
|
3704 |
+
this.propType = 'unidimensional';
|
3705 |
+
this.keyframes = data.k;
|
3706 |
+
this.keyframesMetadata = [];
|
3707 |
+
this.offsetTime = elem.data.st;
|
3708 |
+
this.frameId = -1;
|
3709 |
+
this._caching = {
|
3710 |
+
lastFrame: initFrame,
|
3711 |
+
lastIndex: 0,
|
3712 |
+
value: 0,
|
3713 |
+
_lastKeyframeIndex: -1
|
3714 |
+
};
|
3715 |
+
this.k = true;
|
3716 |
+
this.kf = true;
|
3717 |
+
this.data = data;
|
3718 |
+
this.mult = mult || 1;
|
3719 |
+
this.elem = elem;
|
3720 |
+
this.container = container;
|
3721 |
+
this.comp = elem.comp;
|
3722 |
+
this.v = initFrame;
|
3723 |
+
this.pv = initFrame;
|
3724 |
+
this._isFirstFrame = true;
|
3725 |
+
this.getValue = processEffectsSequence;
|
3726 |
+
this.setVValue = setVValue;
|
3727 |
+
this.interpolateValue = interpolateValue;
|
3728 |
+
this.effectsSequence = [getValueAtCurrentTime.bind(this)];
|
3729 |
+
this.addEffect = addEffect;
|
3730 |
+
}
|
3731 |
+
|
3732 |
+
function KeyframedMultidimensionalProperty(elem, data, mult, container) {
|
3733 |
+
this.propType = 'multidimensional';
|
3734 |
+
var i;
|
3735 |
+
var len = data.k.length;
|
3736 |
+
var s;
|
3737 |
+
var e;
|
3738 |
+
var to;
|
3739 |
+
var ti;
|
3740 |
+
|
3741 |
+
for (i = 0; i < len - 1; i += 1) {
|
3742 |
+
if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
|
3743 |
+
s = data.k[i].s;
|
3744 |
+
e = data.k[i + 1].s;
|
3745 |
+
to = data.k[i].to;
|
3746 |
+
ti = data.k[i].ti;
|
3747 |
+
|
3748 |
+
if (s.length === 2 && !(s[0] === e[0] && s[1] === e[1]) && bez.pointOnLine2D(s[0], s[1], e[0], e[1], s[0] + to[0], s[1] + to[1]) && bez.pointOnLine2D(s[0], s[1], e[0], e[1], e[0] + ti[0], e[1] + ti[1]) || s.length === 3 && !(s[0] === e[0] && s[1] === e[1] && s[2] === e[2]) && bez.pointOnLine3D(s[0], s[1], s[2], e[0], e[1], e[2], s[0] + to[0], s[1] + to[1], s[2] + to[2]) && bez.pointOnLine3D(s[0], s[1], s[2], e[0], e[1], e[2], e[0] + ti[0], e[1] + ti[1], e[2] + ti[2])) {
|
3749 |
+
data.k[i].to = null;
|
3750 |
+
data.k[i].ti = null;
|
3751 |
+
}
|
3752 |
+
|
3753 |
+
if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
|
3754 |
+
if (s.length === 2 || s[2] === e[2] && to[2] === 0 && ti[2] === 0) {
|
3755 |
+
data.k[i].to = null;
|
3756 |
+
data.k[i].ti = null;
|
3757 |
+
}
|
3758 |
+
}
|
3759 |
+
}
|
3760 |
+
}
|
3761 |
+
|
3762 |
+
this.effectsSequence = [getValueAtCurrentTime.bind(this)];
|
3763 |
+
this.data = data;
|
3764 |
+
this.keyframes = data.k;
|
3765 |
+
this.keyframesMetadata = [];
|
3766 |
+
this.offsetTime = elem.data.st;
|
3767 |
+
this.k = true;
|
3768 |
+
this.kf = true;
|
3769 |
+
this._isFirstFrame = true;
|
3770 |
+
this.mult = mult || 1;
|
3771 |
+
this.elem = elem;
|
3772 |
+
this.container = container;
|
3773 |
+
this.comp = elem.comp;
|
3774 |
+
this.getValue = processEffectsSequence;
|
3775 |
+
this.setVValue = setVValue;
|
3776 |
+
this.interpolateValue = interpolateValue;
|
3777 |
+
this.frameId = -1;
|
3778 |
+
var arrLen = data.k[0].s.length;
|
3779 |
+
this.v = createTypedArray('float32', arrLen);
|
3780 |
+
this.pv = createTypedArray('float32', arrLen);
|
3781 |
+
|
3782 |
+
for (i = 0; i < arrLen; i += 1) {
|
3783 |
+
this.v[i] = initFrame;
|
3784 |
+
this.pv[i] = initFrame;
|
3785 |
+
}
|
3786 |
+
|
3787 |
+
this._caching = {
|
3788 |
+
lastFrame: initFrame,
|
3789 |
+
lastIndex: 0,
|
3790 |
+
value: createTypedArray('float32', arrLen)
|
3791 |
+
};
|
3792 |
+
this.addEffect = addEffect;
|
3793 |
+
}
|
3794 |
+
|
3795 |
+
function getProp(elem, data, type, mult, container) {
|
3796 |
+
var p;
|
3797 |
+
|
3798 |
+
if (!data.k.length) {
|
3799 |
+
p = new ValueProperty(elem, data, mult, container);
|
3800 |
+
} else if (typeof data.k[0] === 'number') {
|
3801 |
+
p = new MultiDimensionalProperty(elem, data, mult, container);
|
3802 |
+
} else {
|
3803 |
+
switch (type) {
|
3804 |
+
case 0:
|
3805 |
+
p = new KeyframedValueProperty(elem, data, mult, container);
|
3806 |
+
break;
|
3807 |
+
|
3808 |
+
case 1:
|
3809 |
+
p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
|
3810 |
+
break;
|
3811 |
+
|
3812 |
+
default:
|
3813 |
+
break;
|
3814 |
+
}
|
3815 |
+
}
|
3816 |
+
|
3817 |
+
if (p.effectsSequence.length) {
|
3818 |
+
container.addDynamicProperty(p);
|
3819 |
+
}
|
3820 |
+
|
3821 |
+
return p;
|
3822 |
+
}
|
3823 |
+
|
3824 |
+
var ob = {
|
3825 |
+
getProp: getProp
|
3826 |
+
};
|
3827 |
+
return ob;
|
3828 |
+
}();
|
3829 |
+
|
3830 |
+
function DynamicPropertyContainer() { }
|
3831 |
+
|
3832 |
+
DynamicPropertyContainer.prototype = {
|
3833 |
+
addDynamicProperty: function addDynamicProperty(prop) {
|
3834 |
+
if (this.dynamicProperties.indexOf(prop) === -1) {
|
3835 |
+
this.dynamicProperties.push(prop);
|
3836 |
+
this.container.addDynamicProperty(this);
|
3837 |
+
this._isAnimated = true;
|
3838 |
+
}
|
3839 |
+
},
|
3840 |
+
iterateDynamicProperties: function iterateDynamicProperties() {
|
3841 |
+
this._mdf = false;
|
3842 |
+
var i;
|
3843 |
+
var len = this.dynamicProperties.length;
|
3844 |
+
|
3845 |
+
for (i = 0; i < len; i += 1) {
|
3846 |
+
this.dynamicProperties[i].getValue();
|
3847 |
+
|
3848 |
+
if (this.dynamicProperties[i]._mdf) {
|
3849 |
+
this._mdf = true;
|
3850 |
+
}
|
3851 |
+
}
|
3852 |
+
},
|
3853 |
+
initDynamicPropertyContainer: function initDynamicPropertyContainer(container) {
|
3854 |
+
this.container = container;
|
3855 |
+
this.dynamicProperties = [];
|
3856 |
+
this._mdf = false;
|
3857 |
+
this._isAnimated = false;
|
3858 |
+
}
|
3859 |
+
};
|
3860 |
+
|
3861 |
+
var pointPool = function () {
|
3862 |
+
function create() {
|
3863 |
+
return createTypedArray('float32', 2);
|
3864 |
+
}
|
3865 |
+
|
3866 |
+
return poolFactory(8, create);
|
3867 |
+
}();
|
3868 |
+
|
3869 |
+
function ShapePath() {
|
3870 |
+
this.c = false;
|
3871 |
+
this._length = 0;
|
3872 |
+
this._maxLength = 8;
|
3873 |
+
this.v = createSizedArray(this._maxLength);
|
3874 |
+
this.o = createSizedArray(this._maxLength);
|
3875 |
+
this.i = createSizedArray(this._maxLength);
|
3876 |
+
}
|
3877 |
+
|
3878 |
+
ShapePath.prototype.setPathData = function (closed, len) {
|
3879 |
+
this.c = closed;
|
3880 |
+
this.setLength(len);
|
3881 |
+
var i = 0;
|
3882 |
+
|
3883 |
+
while (i < len) {
|
3884 |
+
this.v[i] = pointPool.newElement();
|
3885 |
+
this.o[i] = pointPool.newElement();
|
3886 |
+
this.i[i] = pointPool.newElement();
|
3887 |
+
i += 1;
|
3888 |
+
}
|
3889 |
+
};
|
3890 |
+
|
3891 |
+
ShapePath.prototype.setLength = function (len) {
|
3892 |
+
while (this._maxLength < len) {
|
3893 |
+
this.doubleArrayLength();
|
3894 |
+
}
|
3895 |
+
|
3896 |
+
this._length = len;
|
3897 |
+
};
|
3898 |
+
|
3899 |
+
ShapePath.prototype.doubleArrayLength = function () {
|
3900 |
+
this.v = this.v.concat(createSizedArray(this._maxLength));
|
3901 |
+
this.i = this.i.concat(createSizedArray(this._maxLength));
|
3902 |
+
this.o = this.o.concat(createSizedArray(this._maxLength));
|
3903 |
+
this._maxLength *= 2;
|
3904 |
+
};
|
3905 |
+
|
3906 |
+
ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
|
3907 |
+
var arr;
|
3908 |
+
this._length = Math.max(this._length, pos + 1);
|
3909 |
+
|
3910 |
+
if (this._length >= this._maxLength) {
|
3911 |
+
this.doubleArrayLength();
|
3912 |
+
}
|
3913 |
+
|
3914 |
+
switch (type) {
|
3915 |
+
case 'v':
|
3916 |
+
arr = this.v;
|
3917 |
+
break;
|
3918 |
+
|
3919 |
+
case 'i':
|
3920 |
+
arr = this.i;
|
3921 |
+
break;
|
3922 |
+
|
3923 |
+
case 'o':
|
3924 |
+
arr = this.o;
|
3925 |
+
break;
|
3926 |
+
|
3927 |
+
default:
|
3928 |
+
arr = [];
|
3929 |
+
break;
|
3930 |
+
}
|
3931 |
+
|
3932 |
+
if (!arr[pos] || arr[pos] && !replace) {
|
3933 |
+
arr[pos] = pointPool.newElement();
|
3934 |
+
}
|
3935 |
+
|
3936 |
+
arr[pos][0] = x;
|
3937 |
+
arr[pos][1] = y;
|
3938 |
+
};
|
3939 |
+
|
3940 |
+
ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
|
3941 |
+
this.setXYAt(vX, vY, 'v', pos, replace);
|
3942 |
+
this.setXYAt(oX, oY, 'o', pos, replace);
|
3943 |
+
this.setXYAt(iX, iY, 'i', pos, replace);
|
3944 |
+
};
|
3945 |
+
|
3946 |
+
ShapePath.prototype.reverse = function () {
|
3947 |
+
var newPath = new ShapePath();
|
3948 |
+
newPath.setPathData(this.c, this._length);
|
3949 |
+
var vertices = this.v;
|
3950 |
+
var outPoints = this.o;
|
3951 |
+
var inPoints = this.i;
|
3952 |
+
var init = 0;
|
3953 |
+
|
3954 |
+
if (this.c) {
|
3955 |
+
newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
|
3956 |
+
init = 1;
|
3957 |
+
}
|
3958 |
+
|
3959 |
+
var cnt = this._length - 1;
|
3960 |
+
var len = this._length;
|
3961 |
+
var i;
|
3962 |
+
|
3963 |
+
for (i = init; i < len; i += 1) {
|
3964 |
+
newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
|
3965 |
+
cnt -= 1;
|
3966 |
+
}
|
3967 |
+
|
3968 |
+
return newPath;
|
3969 |
+
};
|
3970 |
+
|
3971 |
+
var shapePool = function () {
|
3972 |
+
function create() {
|
3973 |
+
return new ShapePath();
|
3974 |
+
}
|
3975 |
+
|
3976 |
+
function release(shapePath) {
|
3977 |
+
var len = shapePath._length;
|
3978 |
+
var i;
|
3979 |
+
|
3980 |
+
for (i = 0; i < len; i += 1) {
|
3981 |
+
pointPool.release(shapePath.v[i]);
|
3982 |
+
pointPool.release(shapePath.i[i]);
|
3983 |
+
pointPool.release(shapePath.o[i]);
|
3984 |
+
shapePath.v[i] = null;
|
3985 |
+
shapePath.i[i] = null;
|
3986 |
+
shapePath.o[i] = null;
|
3987 |
+
}
|
3988 |
+
|
3989 |
+
shapePath._length = 0;
|
3990 |
+
shapePath.c = false;
|
3991 |
+
}
|
3992 |
+
|
3993 |
+
function clone(shape) {
|
3994 |
+
var cloned = factory.newElement();
|
3995 |
+
var i;
|
3996 |
+
var len = shape._length === undefined ? shape.v.length : shape._length;
|
3997 |
+
cloned.setLength(len);
|
3998 |
+
cloned.c = shape.c;
|
3999 |
+
|
4000 |
+
for (i = 0; i < len; i += 1) {
|
4001 |
+
cloned.setTripleAt(shape.v[i][0], shape.v[i][1], shape.o[i][0], shape.o[i][1], shape.i[i][0], shape.i[i][1], i);
|
4002 |
+
}
|
4003 |
+
|
4004 |
+
return cloned;
|
4005 |
+
}
|
4006 |
+
|
4007 |
+
var factory = poolFactory(4, create, release);
|
4008 |
+
factory.clone = clone;
|
4009 |
+
return factory;
|
4010 |
+
}();
|
4011 |
+
|
4012 |
+
function ShapeCollection() {
|
4013 |
+
this._length = 0;
|
4014 |
+
this._maxLength = 4;
|
4015 |
+
this.shapes = createSizedArray(this._maxLength);
|
4016 |
+
}
|
4017 |
+
|
4018 |
+
ShapeCollection.prototype.addShape = function (shapeData) {
|
4019 |
+
if (this._length === this._maxLength) {
|
4020 |
+
this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
|
4021 |
+
this._maxLength *= 2;
|
4022 |
+
}
|
4023 |
+
|
4024 |
+
this.shapes[this._length] = shapeData;
|
4025 |
+
this._length += 1;
|
4026 |
+
};
|
4027 |
+
|
4028 |
+
ShapeCollection.prototype.releaseShapes = function () {
|
4029 |
+
var i;
|
4030 |
+
|
4031 |
+
for (i = 0; i < this._length; i += 1) {
|
4032 |
+
shapePool.release(this.shapes[i]);
|
4033 |
+
}
|
4034 |
+
|
4035 |
+
this._length = 0;
|
4036 |
+
};
|
4037 |
+
|
4038 |
+
var shapeCollectionPool = function () {
|
4039 |
+
var ob = {
|
4040 |
+
newShapeCollection: newShapeCollection,
|
4041 |
+
release: release
|
4042 |
+
};
|
4043 |
+
var _length = 0;
|
4044 |
+
var _maxLength = 4;
|
4045 |
+
var pool = createSizedArray(_maxLength);
|
4046 |
+
|
4047 |
+
function newShapeCollection() {
|
4048 |
+
var shapeCollection;
|
4049 |
+
|
4050 |
+
if (_length) {
|
4051 |
+
_length -= 1;
|
4052 |
+
shapeCollection = pool[_length];
|
4053 |
+
} else {
|
4054 |
+
shapeCollection = new ShapeCollection();
|
4055 |
+
}
|
4056 |
+
|
4057 |
+
return shapeCollection;
|
4058 |
+
}
|
4059 |
+
|
4060 |
+
function release(shapeCollection) {
|
4061 |
+
var i;
|
4062 |
+
var len = shapeCollection._length;
|
4063 |
+
|
4064 |
+
for (i = 0; i < len; i += 1) {
|
4065 |
+
shapePool.release(shapeCollection.shapes[i]);
|
4066 |
+
}
|
4067 |
+
|
4068 |
+
shapeCollection._length = 0;
|
4069 |
+
|
4070 |
+
if (_length === _maxLength) {
|
4071 |
+
pool = pooling["double"](pool);
|
4072 |
+
_maxLength *= 2;
|
4073 |
+
}
|
4074 |
+
|
4075 |
+
pool[_length] = shapeCollection;
|
4076 |
+
_length += 1;
|
4077 |
+
}
|
4078 |
+
|
4079 |
+
return ob;
|
4080 |
+
}();
|
4081 |
+
|
4082 |
+
var ShapePropertyFactory = function () {
|
4083 |
+
var initFrame = -999999;
|
4084 |
+
|
4085 |
+
function interpolateShape(frameNum, previousValue, caching) {
|
4086 |
+
var iterationIndex = caching.lastIndex;
|
4087 |
+
var keyPropS;
|
4088 |
+
var keyPropE;
|
4089 |
+
var isHold;
|
4090 |
+
var j;
|
4091 |
+
var k;
|
4092 |
+
var jLen;
|
4093 |
+
var kLen;
|
4094 |
+
var perc;
|
4095 |
+
var vertexValue;
|
4096 |
+
var kf = this.keyframes;
|
4097 |
+
|
4098 |
+
if (frameNum < kf[0].t - this.offsetTime) {
|
4099 |
+
keyPropS = kf[0].s[0];
|
4100 |
+
isHold = true;
|
4101 |
+
iterationIndex = 0;
|
4102 |
+
} else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
|
4103 |
+
keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
|
4104 |
+
/* if(kf[kf.length - 1].s){
|
4105 |
+
keyPropS = kf[kf.length - 1].s[0];
|
4106 |
+
}else{
|
4107 |
+
keyPropS = kf[kf.length - 2].e[0];
|
4108 |
+
} */
|
4109 |
+
|
4110 |
+
isHold = true;
|
4111 |
+
} else {
|
4112 |
+
var i = iterationIndex;
|
4113 |
+
var len = kf.length - 1;
|
4114 |
+
var flag = true;
|
4115 |
+
var keyData;
|
4116 |
+
var nextKeyData;
|
4117 |
+
var keyframeMetadata;
|
4118 |
+
|
4119 |
+
while (flag) {
|
4120 |
+
keyData = kf[i];
|
4121 |
+
nextKeyData = kf[i + 1];
|
4122 |
+
|
4123 |
+
if (nextKeyData.t - this.offsetTime > frameNum) {
|
4124 |
+
break;
|
4125 |
+
}
|
4126 |
+
|
4127 |
+
if (i < len - 1) {
|
4128 |
+
i += 1;
|
4129 |
+
} else {
|
4130 |
+
flag = false;
|
4131 |
+
}
|
4132 |
+
}
|
4133 |
+
|
4134 |
+
keyframeMetadata = this.keyframesMetadata[i] || {};
|
4135 |
+
isHold = keyData.h === 1;
|
4136 |
+
iterationIndex = i;
|
4137 |
+
|
4138 |
+
if (!isHold) {
|
4139 |
+
if (frameNum >= nextKeyData.t - this.offsetTime) {
|
4140 |
+
perc = 1;
|
4141 |
+
} else if (frameNum < keyData.t - this.offsetTime) {
|
4142 |
+
perc = 0;
|
4143 |
+
} else {
|
4144 |
+
var fnc;
|
4145 |
+
|
4146 |
+
if (keyframeMetadata.__fnct) {
|
4147 |
+
fnc = keyframeMetadata.__fnct;
|
4148 |
+
} else {
|
4149 |
+
fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
|
4150 |
+
keyframeMetadata.__fnct = fnc;
|
4151 |
+
}
|
4152 |
+
|
4153 |
+
perc = fnc((frameNum - (keyData.t - this.offsetTime)) / (nextKeyData.t - this.offsetTime - (keyData.t - this.offsetTime)));
|
4154 |
+
}
|
4155 |
+
|
4156 |
+
keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
|
4157 |
+
}
|
4158 |
+
|
4159 |
+
keyPropS = keyData.s[0];
|
4160 |
+
}
|
4161 |
+
|
4162 |
+
jLen = previousValue._length;
|
4163 |
+
kLen = keyPropS.i[0].length;
|
4164 |
+
caching.lastIndex = iterationIndex;
|
4165 |
+
|
4166 |
+
for (j = 0; j < jLen; j += 1) {
|
4167 |
+
for (k = 0; k < kLen; k += 1) {
|
4168 |
+
vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
|
4169 |
+
previousValue.i[j][k] = vertexValue;
|
4170 |
+
vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
|
4171 |
+
previousValue.o[j][k] = vertexValue;
|
4172 |
+
vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
|
4173 |
+
previousValue.v[j][k] = vertexValue;
|
4174 |
+
}
|
4175 |
+
}
|
4176 |
+
}
|
4177 |
+
|
4178 |
+
function interpolateShapeCurrentTime() {
|
4179 |
+
var frameNum = this.comp.renderedFrame - this.offsetTime;
|
4180 |
+
var initTime = this.keyframes[0].t - this.offsetTime;
|
4181 |
+
var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
|
4182 |
+
var lastFrame = this._caching.lastFrame;
|
4183 |
+
|
4184 |
+
if (!(lastFrame !== initFrame && (lastFrame < initTime && frameNum < initTime || lastFrame > endTime && frameNum > endTime))) {
|
4185 |
+
/// /
|
4186 |
+
this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
|
4187 |
+
this.interpolateShape(frameNum, this.pv, this._caching); /// /
|
4188 |
+
}
|
4189 |
+
|
4190 |
+
this._caching.lastFrame = frameNum;
|
4191 |
+
return this.pv;
|
4192 |
+
}
|
4193 |
+
|
4194 |
+
function resetShape() {
|
4195 |
+
this.paths = this.localShapeCollection;
|
4196 |
+
}
|
4197 |
+
|
4198 |
+
function shapesEqual(shape1, shape2) {
|
4199 |
+
if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
|
4200 |
+
return false;
|
4201 |
+
}
|
4202 |
+
|
4203 |
+
var i;
|
4204 |
+
var len = shape1._length;
|
4205 |
+
|
4206 |
+
for (i = 0; i < len; i += 1) {
|
4207 |
+
if (shape1.v[i][0] !== shape2.v[i][0] || shape1.v[i][1] !== shape2.v[i][1] || shape1.o[i][0] !== shape2.o[i][0] || shape1.o[i][1] !== shape2.o[i][1] || shape1.i[i][0] !== shape2.i[i][0] || shape1.i[i][1] !== shape2.i[i][1]) {
|
4208 |
+
return false;
|
4209 |
+
}
|
4210 |
+
}
|
4211 |
+
|
4212 |
+
return true;
|
4213 |
+
}
|
4214 |
+
|
4215 |
+
function setVValue(newPath) {
|
4216 |
+
if (!shapesEqual(this.v, newPath)) {
|
4217 |
+
this.v = shapePool.clone(newPath);
|
4218 |
+
this.localShapeCollection.releaseShapes();
|
4219 |
+
this.localShapeCollection.addShape(this.v);
|
4220 |
+
this._mdf = true;
|
4221 |
+
this.paths = this.localShapeCollection;
|
4222 |
+
}
|
4223 |
+
}
|
4224 |
+
|
4225 |
+
function processEffectsSequence() {
|
4226 |
+
if (this.elem.globalData.frameId === this.frameId) {
|
4227 |
+
return;
|
4228 |
+
}
|
4229 |
+
|
4230 |
+
if (!this.effectsSequence.length) {
|
4231 |
+
this._mdf = false;
|
4232 |
+
return;
|
4233 |
+
}
|
4234 |
+
|
4235 |
+
if (this.lock) {
|
4236 |
+
this.setVValue(this.pv);
|
4237 |
+
return;
|
4238 |
+
}
|
4239 |
+
|
4240 |
+
this.lock = true;
|
4241 |
+
this._mdf = false;
|
4242 |
+
var finalValue;
|
4243 |
+
|
4244 |
+
if (this.kf) {
|
4245 |
+
finalValue = this.pv;
|
4246 |
+
} else if (this.data.ks) {
|
4247 |
+
finalValue = this.data.ks.k;
|
4248 |
+
} else {
|
4249 |
+
finalValue = this.data.pt.k;
|
4250 |
+
}
|
4251 |
+
|
4252 |
+
var i;
|
4253 |
+
var len = this.effectsSequence.length;
|
4254 |
+
|
4255 |
+
for (i = 0; i < len; i += 1) {
|
4256 |
+
finalValue = this.effectsSequence[i](finalValue);
|
4257 |
+
}
|
4258 |
+
|
4259 |
+
this.setVValue(finalValue);
|
4260 |
+
this.lock = false;
|
4261 |
+
this.frameId = this.elem.globalData.frameId;
|
4262 |
+
}
|
4263 |
+
|
4264 |
+
function ShapeProperty(elem, data, type) {
|
4265 |
+
this.propType = 'shape';
|
4266 |
+
this.comp = elem.comp;
|
4267 |
+
this.container = elem;
|
4268 |
+
this.elem = elem;
|
4269 |
+
this.data = data;
|
4270 |
+
this.k = false;
|
4271 |
+
this.kf = false;
|
4272 |
+
this._mdf = false;
|
4273 |
+
var pathData = type === 3 ? data.pt.k : data.ks.k;
|
4274 |
+
this.v = shapePool.clone(pathData);
|
4275 |
+
this.pv = shapePool.clone(this.v);
|
4276 |
+
this.localShapeCollection = shapeCollectionPool.newShapeCollection();
|
4277 |
+
this.paths = this.localShapeCollection;
|
4278 |
+
this.paths.addShape(this.v);
|
4279 |
+
this.reset = resetShape;
|
4280 |
+
this.effectsSequence = [];
|
4281 |
+
}
|
4282 |
+
|
4283 |
+
function addEffect(effectFunction) {
|
4284 |
+
this.effectsSequence.push(effectFunction);
|
4285 |
+
this.container.addDynamicProperty(this);
|
4286 |
+
}
|
4287 |
+
|
4288 |
+
ShapeProperty.prototype.interpolateShape = interpolateShape;
|
4289 |
+
ShapeProperty.prototype.getValue = processEffectsSequence;
|
4290 |
+
ShapeProperty.prototype.setVValue = setVValue;
|
4291 |
+
ShapeProperty.prototype.addEffect = addEffect;
|
4292 |
+
|
4293 |
+
function KeyframedShapeProperty(elem, data, type) {
|
4294 |
+
this.propType = 'shape';
|
4295 |
+
this.comp = elem.comp;
|
4296 |
+
this.elem = elem;
|
4297 |
+
this.container = elem;
|
4298 |
+
this.offsetTime = elem.data.st;
|
4299 |
+
this.keyframes = type === 3 ? data.pt.k : data.ks.k;
|
4300 |
+
this.keyframesMetadata = [];
|
4301 |
+
this.k = true;
|
4302 |
+
this.kf = true;
|
4303 |
+
var len = this.keyframes[0].s[0].i.length;
|
4304 |
+
this.v = shapePool.newElement();
|
4305 |
+
this.v.setPathData(this.keyframes[0].s[0].c, len);
|
4306 |
+
this.pv = shapePool.clone(this.v);
|
4307 |
+
this.localShapeCollection = shapeCollectionPool.newShapeCollection();
|
4308 |
+
this.paths = this.localShapeCollection;
|
4309 |
+
this.paths.addShape(this.v);
|
4310 |
+
this.lastFrame = initFrame;
|
4311 |
+
this.reset = resetShape;
|
4312 |
+
this._caching = {
|
4313 |
+
lastFrame: initFrame,
|
4314 |
+
lastIndex: 0
|
4315 |
+
};
|
4316 |
+
this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
|
4317 |
+
}
|
4318 |
+
|
4319 |
+
KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
|
4320 |
+
KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
|
4321 |
+
KeyframedShapeProperty.prototype.setVValue = setVValue;
|
4322 |
+
KeyframedShapeProperty.prototype.addEffect = addEffect;
|
4323 |
+
|
4324 |
+
var EllShapeProperty = function () {
|
4325 |
+
var cPoint = roundCorner;
|
4326 |
+
|
4327 |
+
function EllShapePropertyFactory(elem, data) {
|
4328 |
+
this.v = shapePool.newElement();
|
4329 |
+
this.v.setPathData(true, 4);
|
4330 |
+
this.localShapeCollection = shapeCollectionPool.newShapeCollection();
|
4331 |
+
this.paths = this.localShapeCollection;
|
4332 |
+
this.localShapeCollection.addShape(this.v);
|
4333 |
+
this.d = data.d;
|
4334 |
+
this.elem = elem;
|
4335 |
+
this.comp = elem.comp;
|
4336 |
+
this.frameId = -1;
|
4337 |
+
this.initDynamicPropertyContainer(elem);
|
4338 |
+
this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
|
4339 |
+
this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
|
4340 |
+
|
4341 |
+
if (this.dynamicProperties.length) {
|
4342 |
+
this.k = true;
|
4343 |
+
} else {
|
4344 |
+
this.k = false;
|
4345 |
+
this.convertEllToPath();
|
4346 |
+
}
|
4347 |
+
}
|
4348 |
+
|
4349 |
+
EllShapePropertyFactory.prototype = {
|
4350 |
+
reset: resetShape,
|
4351 |
+
getValue: function getValue() {
|
4352 |
+
if (this.elem.globalData.frameId === this.frameId) {
|
4353 |
+
return;
|
4354 |
+
}
|
4355 |
+
|
4356 |
+
this.frameId = this.elem.globalData.frameId;
|
4357 |
+
this.iterateDynamicProperties();
|
4358 |
+
|
4359 |
+
if (this._mdf) {
|
4360 |
+
this.convertEllToPath();
|
4361 |
+
}
|
4362 |
+
},
|
4363 |
+
convertEllToPath: function convertEllToPath() {
|
4364 |
+
var p0 = this.p.v[0];
|
4365 |
+
var p1 = this.p.v[1];
|
4366 |
+
var s0 = this.s.v[0] / 2;
|
4367 |
+
var s1 = this.s.v[1] / 2;
|
4368 |
+
|
4369 |
+
var _cw = this.d !== 3;
|
4370 |
+
|
4371 |
+
var _v = this.v;
|
4372 |
+
_v.v[0][0] = p0;
|
4373 |
+
_v.v[0][1] = p1 - s1;
|
4374 |
+
_v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
|
4375 |
+
_v.v[1][1] = p1;
|
4376 |
+
_v.v[2][0] = p0;
|
4377 |
+
_v.v[2][1] = p1 + s1;
|
4378 |
+
_v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
|
4379 |
+
_v.v[3][1] = p1;
|
4380 |
+
_v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
|
4381 |
+
_v.i[0][1] = p1 - s1;
|
4382 |
+
_v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
|
4383 |
+
_v.i[1][1] = p1 - s1 * cPoint;
|
4384 |
+
_v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
|
4385 |
+
_v.i[2][1] = p1 + s1;
|
4386 |
+
_v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
|
4387 |
+
_v.i[3][1] = p1 + s1 * cPoint;
|
4388 |
+
_v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
|
4389 |
+
_v.o[0][1] = p1 - s1;
|
4390 |
+
_v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
|
4391 |
+
_v.o[1][1] = p1 + s1 * cPoint;
|
4392 |
+
_v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
|
4393 |
+
_v.o[2][1] = p1 + s1;
|
4394 |
+
_v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
|
4395 |
+
_v.o[3][1] = p1 - s1 * cPoint;
|
4396 |
+
}
|
4397 |
+
};
|
4398 |
+
extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
|
4399 |
+
return EllShapePropertyFactory;
|
4400 |
+
}();
|
4401 |
+
|
4402 |
+
var StarShapeProperty = function () {
|
4403 |
+
function StarShapePropertyFactory(elem, data) {
|
4404 |
+
this.v = shapePool.newElement();
|
4405 |
+
this.v.setPathData(true, 0);
|
4406 |
+
this.elem = elem;
|
4407 |
+
this.comp = elem.comp;
|
4408 |
+
this.data = data;
|
4409 |
+
this.frameId = -1;
|
4410 |
+
this.d = data.d;
|
4411 |
+
this.initDynamicPropertyContainer(elem);
|
4412 |
+
|
4413 |
+
if (data.sy === 1) {
|
4414 |
+
this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
|
4415 |
+
this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
|
4416 |
+
this.convertToPath = this.convertStarToPath;
|
4417 |
+
} else {
|
4418 |
+
this.convertToPath = this.convertPolygonToPath;
|
4419 |
+
}
|
4420 |
+
|
4421 |
+
this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
|
4422 |
+
this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
|
4423 |
+
this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
|
4424 |
+
this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
|
4425 |
+
this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
|
4426 |
+
this.localShapeCollection = shapeCollectionPool.newShapeCollection();
|
4427 |
+
this.localShapeCollection.addShape(this.v);
|
4428 |
+
this.paths = this.localShapeCollection;
|
4429 |
+
|
4430 |
+
if (this.dynamicProperties.length) {
|
4431 |
+
this.k = true;
|
4432 |
+
} else {
|
4433 |
+
this.k = false;
|
4434 |
+
this.convertToPath();
|
4435 |
+
}
|
4436 |
+
}
|
4437 |
+
|
4438 |
+
StarShapePropertyFactory.prototype = {
|
4439 |
+
reset: resetShape,
|
4440 |
+
getValue: function getValue() {
|
4441 |
+
if (this.elem.globalData.frameId === this.frameId) {
|
4442 |
+
return;
|
4443 |
+
}
|
4444 |
+
|
4445 |
+
this.frameId = this.elem.globalData.frameId;
|
4446 |
+
this.iterateDynamicProperties();
|
4447 |
+
|
4448 |
+
if (this._mdf) {
|
4449 |
+
this.convertToPath();
|
4450 |
+
}
|
4451 |
+
},
|
4452 |
+
convertStarToPath: function convertStarToPath() {
|
4453 |
+
var numPts = Math.floor(this.pt.v) * 2;
|
4454 |
+
var angle = Math.PI * 2 / numPts;
|
4455 |
+
/* this.v.v.length = numPts;
|
4456 |
+
this.v.i.length = numPts;
|
4457 |
+
this.v.o.length = numPts; */
|
4458 |
+
|
4459 |
+
var longFlag = true;
|
4460 |
+
var longRad = this.or.v;
|
4461 |
+
var shortRad = this.ir.v;
|
4462 |
+
var longRound = this.os.v;
|
4463 |
+
var shortRound = this.is.v;
|
4464 |
+
var longPerimSegment = 2 * Math.PI * longRad / (numPts * 2);
|
4465 |
+
var shortPerimSegment = 2 * Math.PI * shortRad / (numPts * 2);
|
4466 |
+
var i;
|
4467 |
+
var rad;
|
4468 |
+
var roundness;
|
4469 |
+
var perimSegment;
|
4470 |
+
var currentAng = -Math.PI / 2;
|
4471 |
+
currentAng += this.r.v;
|
4472 |
+
var dir = this.data.d === 3 ? -1 : 1;
|
4473 |
+
this.v._length = 0;
|
4474 |
+
|
4475 |
+
for (i = 0; i < numPts; i += 1) {
|
4476 |
+
rad = longFlag ? longRad : shortRad;
|
4477 |
+
roundness = longFlag ? longRound : shortRound;
|
4478 |
+
perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
|
4479 |
+
var x = rad * Math.cos(currentAng);
|
4480 |
+
var y = rad * Math.sin(currentAng);
|
4481 |
+
var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
|
4482 |
+
var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
|
4483 |
+
x += +this.p.v[0];
|
4484 |
+
y += +this.p.v[1];
|
4485 |
+
this.v.setTripleAt(x, y, x - ox * perimSegment * roundness * dir, y - oy * perimSegment * roundness * dir, x + ox * perimSegment * roundness * dir, y + oy * perimSegment * roundness * dir, i, true);
|
4486 |
+
/* this.v.v[i] = [x,y];
|
4487 |
+
this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
|
4488 |
+
this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
|
4489 |
+
this.v._length = numPts; */
|
4490 |
+
|
4491 |
+
longFlag = !longFlag;
|
4492 |
+
currentAng += angle * dir;
|
4493 |
+
}
|
4494 |
+
},
|
4495 |
+
convertPolygonToPath: function convertPolygonToPath() {
|
4496 |
+
var numPts = Math.floor(this.pt.v);
|
4497 |
+
var angle = Math.PI * 2 / numPts;
|
4498 |
+
var rad = this.or.v;
|
4499 |
+
var roundness = this.os.v;
|
4500 |
+
var perimSegment = 2 * Math.PI * rad / (numPts * 4);
|
4501 |
+
var i;
|
4502 |
+
var currentAng = -Math.PI * 0.5;
|
4503 |
+
var dir = this.data.d === 3 ? -1 : 1;
|
4504 |
+
currentAng += this.r.v;
|
4505 |
+
this.v._length = 0;
|
4506 |
+
|
4507 |
+
for (i = 0; i < numPts; i += 1) {
|
4508 |
+
var x = rad * Math.cos(currentAng);
|
4509 |
+
var y = rad * Math.sin(currentAng);
|
4510 |
+
var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
|
4511 |
+
var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
|
4512 |
+
x += +this.p.v[0];
|
4513 |
+
y += +this.p.v[1];
|
4514 |
+
this.v.setTripleAt(x, y, x - ox * perimSegment * roundness * dir, y - oy * perimSegment * roundness * dir, x + ox * perimSegment * roundness * dir, y + oy * perimSegment * roundness * dir, i, true);
|
4515 |
+
currentAng += angle * dir;
|
4516 |
+
}
|
4517 |
+
|
4518 |
+
this.paths.length = 0;
|
4519 |
+
this.paths[0] = this.v;
|
4520 |
+
}
|
4521 |
+
};
|
4522 |
+
extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
|
4523 |
+
return StarShapePropertyFactory;
|
4524 |
+
}();
|
4525 |
+
|
4526 |
+
var RectShapeProperty = function () {
|
4527 |
+
function RectShapePropertyFactory(elem, data) {
|
4528 |
+
this.v = shapePool.newElement();
|
4529 |
+
this.v.c = true;
|
4530 |
+
this.localShapeCollection = shapeCollectionPool.newShapeCollection();
|
4531 |
+
this.localShapeCollection.addShape(this.v);
|
4532 |
+
this.paths = this.localShapeCollection;
|
4533 |
+
this.elem = elem;
|
4534 |
+
this.comp = elem.comp;
|
4535 |
+
this.frameId = -1;
|
4536 |
+
this.d = data.d;
|
4537 |
+
this.initDynamicPropertyContainer(elem);
|
4538 |
+
this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
|
4539 |
+
this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
|
4540 |
+
this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
|
4541 |
+
|
4542 |
+
if (this.dynamicProperties.length) {
|
4543 |
+
this.k = true;
|
4544 |
+
} else {
|
4545 |
+
this.k = false;
|
4546 |
+
this.convertRectToPath();
|
4547 |
+
}
|
4548 |
+
}
|
4549 |
+
|
4550 |
+
RectShapePropertyFactory.prototype = {
|
4551 |
+
convertRectToPath: function convertRectToPath() {
|
4552 |
+
var p0 = this.p.v[0];
|
4553 |
+
var p1 = this.p.v[1];
|
4554 |
+
var v0 = this.s.v[0] / 2;
|
4555 |
+
var v1 = this.s.v[1] / 2;
|
4556 |
+
var round = bmMin(v0, v1, this.r.v);
|
4557 |
+
var cPoint = round * (1 - roundCorner);
|
4558 |
+
this.v._length = 0;
|
4559 |
+
|
4560 |
+
if (this.d === 2 || this.d === 1) {
|
4561 |
+
this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
|
4562 |
+
this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
|
4563 |
+
|
4564 |
+
if (round !== 0) {
|
4565 |
+
this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
|
4566 |
+
this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
|
4567 |
+
this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
|
4568 |
+
this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
|
4569 |
+
this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
|
4570 |
+
this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
|
4571 |
+
} else {
|
4572 |
+
this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
|
4573 |
+
this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
|
4574 |
+
}
|
4575 |
+
} else {
|
4576 |
+
this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
|
4577 |
+
|
4578 |
+
if (round !== 0) {
|
4579 |
+
this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
|
4580 |
+
this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
|
4581 |
+
this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
|
4582 |
+
this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
|
4583 |
+
this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
|
4584 |
+
this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
|
4585 |
+
this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
|
4586 |
+
} else {
|
4587 |
+
this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
|
4588 |
+
this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
|
4589 |
+
this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
|
4590 |
+
}
|
4591 |
+
}
|
4592 |
+
},
|
4593 |
+
getValue: function getValue() {
|
4594 |
+
if (this.elem.globalData.frameId === this.frameId) {
|
4595 |
+
return;
|
4596 |
+
}
|
4597 |
+
|
4598 |
+
this.frameId = this.elem.globalData.frameId;
|
4599 |
+
this.iterateDynamicProperties();
|
4600 |
+
|
4601 |
+
if (this._mdf) {
|
4602 |
+
this.convertRectToPath();
|
4603 |
+
}
|
4604 |
+
},
|
4605 |
+
reset: resetShape
|
4606 |
+
};
|
4607 |
+
extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
|
4608 |
+
return RectShapePropertyFactory;
|
4609 |
+
}();
|
4610 |
+
|
4611 |
+
function getShapeProp(elem, data, type) {
|
4612 |
+
var prop;
|
4613 |
+
|
4614 |
+
if (type === 3 || type === 4) {
|
4615 |
+
var dataProp = type === 3 ? data.pt : data.ks;
|
4616 |
+
var keys = dataProp.k;
|
4617 |
+
|
4618 |
+
if (keys.length) {
|
4619 |
+
prop = new KeyframedShapeProperty(elem, data, type);
|
4620 |
+
} else {
|
4621 |
+
prop = new ShapeProperty(elem, data, type);
|
4622 |
+
}
|
4623 |
+
} else if (type === 5) {
|
4624 |
+
prop = new RectShapeProperty(elem, data);
|
4625 |
+
} else if (type === 6) {
|
4626 |
+
prop = new EllShapeProperty(elem, data);
|
4627 |
+
} else if (type === 7) {
|
4628 |
+
prop = new StarShapeProperty(elem, data);
|
4629 |
+
}
|
4630 |
+
|
4631 |
+
if (prop.k) {
|
4632 |
+
elem.addDynamicProperty(prop);
|
4633 |
+
}
|
4634 |
+
|
4635 |
+
return prop;
|
4636 |
+
}
|
4637 |
+
|
4638 |
+
function getConstructorFunction() {
|
4639 |
+
return ShapeProperty;
|
4640 |
+
}
|
4641 |
+
|
4642 |
+
function getKeyframedConstructorFunction() {
|
4643 |
+
return KeyframedShapeProperty;
|
4644 |
+
}
|
4645 |
+
|
4646 |
+
var ob = {};
|
4647 |
+
ob.getShapeProp = getShapeProp;
|
4648 |
+
ob.getConstructorFunction = getConstructorFunction;
|
4649 |
+
ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
|
4650 |
+
return ob;
|
4651 |
+
}();
|
4652 |
+
|
4653 |
+
/*!
|
4654 |
+
Transformation Matrix v2.0
|
4655 |
+
(c) Epistemex 2014-2015
|
4656 |
+
www.epistemex.com
|
4657 |
+
By Ken Fyrstenberg
|
4658 |
+
Contributions by leeoniya.
|
4659 |
+
License: MIT, header required.
|
4660 |
+
*/
|
4661 |
+
|
4662 |
+
/**
|
4663 |
+
* 2D transformation matrix object initialized with identity matrix.
|
4664 |
+
*
|
4665 |
+
* The matrix can synchronize a canvas context by supplying the context
|
4666 |
+
* as an argument, or later apply current absolute transform to an
|
4667 |
+
* existing context.
|
4668 |
+
*
|
4669 |
+
* All values are handled as floating point values.
|
4670 |
+
*
|
4671 |
+
* @param {CanvasRenderingContext2D} [context] - Optional context to sync with Matrix
|
4672 |
+
* @prop {number} a - scale x
|
4673 |
+
* @prop {number} b - shear y
|
4674 |
+
* @prop {number} c - shear x
|
4675 |
+
* @prop {number} d - scale y
|
4676 |
+
* @prop {number} e - translate x
|
4677 |
+
* @prop {number} f - translate y
|
4678 |
+
* @prop {CanvasRenderingContext2D|null} [context=null] - set or get current canvas context
|
4679 |
+
* @constructor
|
4680 |
+
*/
|
4681 |
+
|
4682 |
+
var Matrix = function () {
|
4683 |
+
var _cos = Math.cos;
|
4684 |
+
var _sin = Math.sin;
|
4685 |
+
var _tan = Math.tan;
|
4686 |
+
var _rnd = Math.round;
|
4687 |
+
|
4688 |
+
function reset() {
|
4689 |
+
this.props[0] = 1;
|
4690 |
+
this.props[1] = 0;
|
4691 |
+
this.props[2] = 0;
|
4692 |
+
this.props[3] = 0;
|
4693 |
+
this.props[4] = 0;
|
4694 |
+
this.props[5] = 1;
|
4695 |
+
this.props[6] = 0;
|
4696 |
+
this.props[7] = 0;
|
4697 |
+
this.props[8] = 0;
|
4698 |
+
this.props[9] = 0;
|
4699 |
+
this.props[10] = 1;
|
4700 |
+
this.props[11] = 0;
|
4701 |
+
this.props[12] = 0;
|
4702 |
+
this.props[13] = 0;
|
4703 |
+
this.props[14] = 0;
|
4704 |
+
this.props[15] = 1;
|
4705 |
+
return this;
|
4706 |
+
}
|
4707 |
+
|
4708 |
+
function rotate(angle) {
|
4709 |
+
if (angle === 0) {
|
4710 |
+
return this;
|
4711 |
+
}
|
4712 |
+
|
4713 |
+
var mCos = _cos(angle);
|
4714 |
+
|
4715 |
+
var mSin = _sin(angle);
|
4716 |
+
|
4717 |
+
return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
4718 |
+
}
|
4719 |
+
|
4720 |
+
function rotateX(angle) {
|
4721 |
+
if (angle === 0) {
|
4722 |
+
return this;
|
4723 |
+
}
|
4724 |
+
|
4725 |
+
var mCos = _cos(angle);
|
4726 |
+
|
4727 |
+
var mSin = _sin(angle);
|
4728 |
+
|
4729 |
+
return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
|
4730 |
+
}
|
4731 |
+
|
4732 |
+
function rotateY(angle) {
|
4733 |
+
if (angle === 0) {
|
4734 |
+
return this;
|
4735 |
+
}
|
4736 |
+
|
4737 |
+
var mCos = _cos(angle);
|
4738 |
+
|
4739 |
+
var mSin = _sin(angle);
|
4740 |
+
|
4741 |
+
return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
|
4742 |
+
}
|
4743 |
+
|
4744 |
+
function rotateZ(angle) {
|
4745 |
+
if (angle === 0) {
|
4746 |
+
return this;
|
4747 |
+
}
|
4748 |
+
|
4749 |
+
var mCos = _cos(angle);
|
4750 |
+
|
4751 |
+
var mSin = _sin(angle);
|
4752 |
+
|
4753 |
+
return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
4754 |
+
}
|
4755 |
+
|
4756 |
+
function shear(sx, sy) {
|
4757 |
+
return this._t(1, sy, sx, 1, 0, 0);
|
4758 |
+
}
|
4759 |
+
|
4760 |
+
function skew(ax, ay) {
|
4761 |
+
return this.shear(_tan(ax), _tan(ay));
|
4762 |
+
}
|
4763 |
+
|
4764 |
+
function skewFromAxis(ax, angle) {
|
4765 |
+
var mCos = _cos(angle);
|
4766 |
+
|
4767 |
+
var mSin = _sin(angle);
|
4768 |
+
|
4769 |
+
return this._t(mCos, mSin, 0, 0, -mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(1, 0, 0, 0, _tan(ax), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); // return this._t(mCos, mSin, -mSin, mCos, 0, 0)._t(1, 0, _tan(ax), 1, 0, 0)._t(mCos, -mSin, mSin, mCos, 0, 0);
|
4770 |
+
}
|
4771 |
+
|
4772 |
+
function scale(sx, sy, sz) {
|
4773 |
+
if (!sz && sz !== 0) {
|
4774 |
+
sz = 1;
|
4775 |
+
}
|
4776 |
+
|
4777 |
+
if (sx === 1 && sy === 1 && sz === 1) {
|
4778 |
+
return this;
|
4779 |
+
}
|
4780 |
+
|
4781 |
+
return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
|
4782 |
+
}
|
4783 |
+
|
4784 |
+
function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
|
4785 |
+
this.props[0] = a;
|
4786 |
+
this.props[1] = b;
|
4787 |
+
this.props[2] = c;
|
4788 |
+
this.props[3] = d;
|
4789 |
+
this.props[4] = e;
|
4790 |
+
this.props[5] = f;
|
4791 |
+
this.props[6] = g;
|
4792 |
+
this.props[7] = h;
|
4793 |
+
this.props[8] = i;
|
4794 |
+
this.props[9] = j;
|
4795 |
+
this.props[10] = k;
|
4796 |
+
this.props[11] = l;
|
4797 |
+
this.props[12] = m;
|
4798 |
+
this.props[13] = n;
|
4799 |
+
this.props[14] = o;
|
4800 |
+
this.props[15] = p;
|
4801 |
+
return this;
|
4802 |
+
}
|
4803 |
+
|
4804 |
+
function translate(tx, ty, tz) {
|
4805 |
+
tz = tz || 0;
|
4806 |
+
|
4807 |
+
if (tx !== 0 || ty !== 0 || tz !== 0) {
|
4808 |
+
return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
|
4809 |
+
}
|
4810 |
+
|
4811 |
+
return this;
|
4812 |
+
}
|
4813 |
+
|
4814 |
+
function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
|
4815 |
+
var _p = this.props;
|
4816 |
+
|
4817 |
+
if (a2 === 1 && b2 === 0 && c2 === 0 && d2 === 0 && e2 === 0 && f2 === 1 && g2 === 0 && h2 === 0 && i2 === 0 && j2 === 0 && k2 === 1 && l2 === 0) {
|
4818 |
+
// NOTE: commenting this condition because TurboFan deoptimizes code when present
|
4819 |
+
// if(m2 !== 0 || n2 !== 0 || o2 !== 0){
|
4820 |
+
_p[12] = _p[12] * a2 + _p[15] * m2;
|
4821 |
+
_p[13] = _p[13] * f2 + _p[15] * n2;
|
4822 |
+
_p[14] = _p[14] * k2 + _p[15] * o2;
|
4823 |
+
_p[15] *= p2; // }
|
4824 |
+
|
4825 |
+
this._identityCalculated = false;
|
4826 |
+
return this;
|
4827 |
+
}
|
4828 |
+
|
4829 |
+
var a1 = _p[0];
|
4830 |
+
var b1 = _p[1];
|
4831 |
+
var c1 = _p[2];
|
4832 |
+
var d1 = _p[3];
|
4833 |
+
var e1 = _p[4];
|
4834 |
+
var f1 = _p[5];
|
4835 |
+
var g1 = _p[6];
|
4836 |
+
var h1 = _p[7];
|
4837 |
+
var i1 = _p[8];
|
4838 |
+
var j1 = _p[9];
|
4839 |
+
var k1 = _p[10];
|
4840 |
+
var l1 = _p[11];
|
4841 |
+
var m1 = _p[12];
|
4842 |
+
var n1 = _p[13];
|
4843 |
+
var o1 = _p[14];
|
4844 |
+
var p1 = _p[15];
|
4845 |
+
/* matrix order (canvas compatible):
|
4846 |
+
* ace
|
4847 |
+
* bdf
|
4848 |
+
* 001
|
4849 |
+
*/
|
4850 |
+
|
4851 |
+
_p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
|
4852 |
+
_p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
|
4853 |
+
_p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
|
4854 |
+
_p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
|
4855 |
+
_p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
|
4856 |
+
_p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
|
4857 |
+
_p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
|
4858 |
+
_p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
|
4859 |
+
_p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
|
4860 |
+
_p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
|
4861 |
+
_p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
|
4862 |
+
_p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
|
4863 |
+
_p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
|
4864 |
+
_p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
|
4865 |
+
_p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
|
4866 |
+
_p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
|
4867 |
+
this._identityCalculated = false;
|
4868 |
+
return this;
|
4869 |
+
}
|
4870 |
+
|
4871 |
+
function isIdentity() {
|
4872 |
+
if (!this._identityCalculated) {
|
4873 |
+
this._identity = !(this.props[0] !== 1 || this.props[1] !== 0 || this.props[2] !== 0 || this.props[3] !== 0 || this.props[4] !== 0 || this.props[5] !== 1 || this.props[6] !== 0 || this.props[7] !== 0 || this.props[8] !== 0 || this.props[9] !== 0 || this.props[10] !== 1 || this.props[11] !== 0 || this.props[12] !== 0 || this.props[13] !== 0 || this.props[14] !== 0 || this.props[15] !== 1);
|
4874 |
+
this._identityCalculated = true;
|
4875 |
+
}
|
4876 |
+
|
4877 |
+
return this._identity;
|
4878 |
+
}
|
4879 |
+
|
4880 |
+
function equals(matr) {
|
4881 |
+
var i = 0;
|
4882 |
+
|
4883 |
+
while (i < 16) {
|
4884 |
+
if (matr.props[i] !== this.props[i]) {
|
4885 |
+
return false;
|
4886 |
+
}
|
4887 |
+
|
4888 |
+
i += 1;
|
4889 |
+
}
|
4890 |
+
|
4891 |
+
return true;
|
4892 |
+
}
|
4893 |
+
|
4894 |
+
function clone(matr) {
|
4895 |
+
var i;
|
4896 |
+
|
4897 |
+
for (i = 0; i < 16; i += 1) {
|
4898 |
+
matr.props[i] = this.props[i];
|
4899 |
+
}
|
4900 |
+
|
4901 |
+
return matr;
|
4902 |
+
}
|
4903 |
+
|
4904 |
+
function cloneFromProps(props) {
|
4905 |
+
var i;
|
4906 |
+
|
4907 |
+
for (i = 0; i < 16; i += 1) {
|
4908 |
+
this.props[i] = props[i];
|
4909 |
+
}
|
4910 |
+
}
|
4911 |
+
|
4912 |
+
function applyToPoint(x, y, z) {
|
4913 |
+
return {
|
4914 |
+
x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
|
4915 |
+
y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
|
4916 |
+
z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
|
4917 |
+
};
|
4918 |
+
/* return {
|
4919 |
+
x: x * me.a + y * me.c + me.e,
|
4920 |
+
y: x * me.b + y * me.d + me.f
|
4921 |
+
}; */
|
4922 |
+
}
|
4923 |
+
|
4924 |
+
function applyToX(x, y, z) {
|
4925 |
+
return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
|
4926 |
+
}
|
4927 |
+
|
4928 |
+
function applyToY(x, y, z) {
|
4929 |
+
return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
|
4930 |
+
}
|
4931 |
+
|
4932 |
+
function applyToZ(x, y, z) {
|
4933 |
+
return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
|
4934 |
+
}
|
4935 |
+
|
4936 |
+
function getInverseMatrix() {
|
4937 |
+
var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
|
4938 |
+
var a = this.props[5] / determinant;
|
4939 |
+
var b = -this.props[1] / determinant;
|
4940 |
+
var c = -this.props[4] / determinant;
|
4941 |
+
var d = this.props[0] / determinant;
|
4942 |
+
var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
|
4943 |
+
var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
|
4944 |
+
var inverseMatrix = new Matrix();
|
4945 |
+
inverseMatrix.props[0] = a;
|
4946 |
+
inverseMatrix.props[1] = b;
|
4947 |
+
inverseMatrix.props[4] = c;
|
4948 |
+
inverseMatrix.props[5] = d;
|
4949 |
+
inverseMatrix.props[12] = e;
|
4950 |
+
inverseMatrix.props[13] = f;
|
4951 |
+
return inverseMatrix;
|
4952 |
+
}
|
4953 |
+
|
4954 |
+
function inversePoint(pt) {
|
4955 |
+
var inverseMatrix = this.getInverseMatrix();
|
4956 |
+
return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
|
4957 |
+
}
|
4958 |
+
|
4959 |
+
function inversePoints(pts) {
|
4960 |
+
var i;
|
4961 |
+
var len = pts.length;
|
4962 |
+
var retPts = [];
|
4963 |
+
|
4964 |
+
for (i = 0; i < len; i += 1) {
|
4965 |
+
retPts[i] = inversePoint(pts[i]);
|
4966 |
+
}
|
4967 |
+
|
4968 |
+
return retPts;
|
4969 |
+
}
|
4970 |
+
|
4971 |
+
function applyToTriplePoints(pt1, pt2, pt3) {
|
4972 |
+
var arr = createTypedArray('float32', 6);
|
4973 |
+
|
4974 |
+
if (this.isIdentity()) {
|
4975 |
+
arr[0] = pt1[0];
|
4976 |
+
arr[1] = pt1[1];
|
4977 |
+
arr[2] = pt2[0];
|
4978 |
+
arr[3] = pt2[1];
|
4979 |
+
arr[4] = pt3[0];
|
4980 |
+
arr[5] = pt3[1];
|
4981 |
+
} else {
|
4982 |
+
var p0 = this.props[0];
|
4983 |
+
var p1 = this.props[1];
|
4984 |
+
var p4 = this.props[4];
|
4985 |
+
var p5 = this.props[5];
|
4986 |
+
var p12 = this.props[12];
|
4987 |
+
var p13 = this.props[13];
|
4988 |
+
arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
|
4989 |
+
arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
|
4990 |
+
arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
|
4991 |
+
arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
|
4992 |
+
arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
|
4993 |
+
arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
|
4994 |
+
}
|
4995 |
+
|
4996 |
+
return arr;
|
4997 |
+
}
|
4998 |
+
|
4999 |
+
function applyToPointArray(x, y, z) {
|
5000 |
+
var arr;
|
5001 |
+
|
5002 |
+
if (this.isIdentity()) {
|
5003 |
+
arr = [x, y, z];
|
5004 |
+
} else {
|
5005 |
+
arr = [x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12], x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13], x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]];
|
5006 |
+
}
|
5007 |
+
|
5008 |
+
return arr;
|
5009 |
+
}
|
5010 |
+
|
5011 |
+
function applyToPointStringified(x, y) {
|
5012 |
+
if (this.isIdentity()) {
|
5013 |
+
return x + ',' + y;
|
5014 |
+
}
|
5015 |
+
|
5016 |
+
var _p = this.props;
|
5017 |
+
return Math.round((x * _p[0] + y * _p[4] + _p[12]) * 100) / 100 + ',' + Math.round((x * _p[1] + y * _p[5] + _p[13]) * 100) / 100;
|
5018 |
+
}
|
5019 |
+
|
5020 |
+
function toCSS() {
|
5021 |
+
// Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed.
|
5022 |
+
|
5023 |
+
/* if(this.isIdentity()) {
|
5024 |
+
return '';
|
5025 |
+
} */
|
5026 |
+
var i = 0;
|
5027 |
+
var props = this.props;
|
5028 |
+
var cssValue = 'matrix3d(';
|
5029 |
+
var v = 10000;
|
5030 |
+
|
5031 |
+
while (i < 16) {
|
5032 |
+
cssValue += _rnd(props[i] * v) / v;
|
5033 |
+
cssValue += i === 15 ? ')' : ',';
|
5034 |
+
i += 1;
|
5035 |
+
}
|
5036 |
+
|
5037 |
+
return cssValue;
|
5038 |
+
}
|
5039 |
+
|
5040 |
+
function roundMatrixProperty(val) {
|
5041 |
+
var v = 10000;
|
5042 |
+
|
5043 |
+
if (val < 0.000001 && val > 0 || val > -0.000001 && val < 0) {
|
5044 |
+
return _rnd(val * v) / v;
|
5045 |
+
}
|
5046 |
+
|
5047 |
+
return val;
|
5048 |
+
}
|
5049 |
+
|
5050 |
+
function to2dCSS() {
|
5051 |
+
// Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed.
|
5052 |
+
|
5053 |
+
/* if(this.isIdentity()) {
|
5054 |
+
return '';
|
5055 |
+
} */
|
5056 |
+
var props = this.props;
|
5057 |
+
|
5058 |
+
var _a = roundMatrixProperty(props[0]);
|
5059 |
+
|
5060 |
+
var _b = roundMatrixProperty(props[1]);
|
5061 |
+
|
5062 |
+
var _c = roundMatrixProperty(props[4]);
|
5063 |
+
|
5064 |
+
var _d = roundMatrixProperty(props[5]);
|
5065 |
+
|
5066 |
+
var _e = roundMatrixProperty(props[12]);
|
5067 |
+
|
5068 |
+
var _f = roundMatrixProperty(props[13]);
|
5069 |
+
|
5070 |
+
return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
|
5071 |
+
}
|
5072 |
+
|
5073 |
+
return function () {
|
5074 |
+
this.reset = reset;
|
5075 |
+
this.rotate = rotate;
|
5076 |
+
this.rotateX = rotateX;
|
5077 |
+
this.rotateY = rotateY;
|
5078 |
+
this.rotateZ = rotateZ;
|
5079 |
+
this.skew = skew;
|
5080 |
+
this.skewFromAxis = skewFromAxis;
|
5081 |
+
this.shear = shear;
|
5082 |
+
this.scale = scale;
|
5083 |
+
this.setTransform = setTransform;
|
5084 |
+
this.translate = translate;
|
5085 |
+
this.transform = transform;
|
5086 |
+
this.applyToPoint = applyToPoint;
|
5087 |
+
this.applyToX = applyToX;
|
5088 |
+
this.applyToY = applyToY;
|
5089 |
+
this.applyToZ = applyToZ;
|
5090 |
+
this.applyToPointArray = applyToPointArray;
|
5091 |
+
this.applyToTriplePoints = applyToTriplePoints;
|
5092 |
+
this.applyToPointStringified = applyToPointStringified;
|
5093 |
+
this.toCSS = toCSS;
|
5094 |
+
this.to2dCSS = to2dCSS;
|
5095 |
+
this.clone = clone;
|
5096 |
+
this.cloneFromProps = cloneFromProps;
|
5097 |
+
this.equals = equals;
|
5098 |
+
this.inversePoints = inversePoints;
|
5099 |
+
this.inversePoint = inversePoint;
|
5100 |
+
this.getInverseMatrix = getInverseMatrix;
|
5101 |
+
this._t = this.transform;
|
5102 |
+
this.isIdentity = isIdentity;
|
5103 |
+
this._identity = true;
|
5104 |
+
this._identityCalculated = false;
|
5105 |
+
this.props = createTypedArray('float32', 16);
|
5106 |
+
this.reset();
|
5107 |
+
};
|
5108 |
+
}();
|
5109 |
+
|
5110 |
+
function _typeof$3(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$3 = function _typeof(obj) { return typeof obj; }; } else { _typeof$3 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$3(obj); }
|
5111 |
+
var lottie = {};
|
5112 |
+
var standalone = '__[STANDALONE]__';
|
5113 |
+
var animationData = '__[ANIMATIONDATA]__';
|
5114 |
+
var renderer = '';
|
5115 |
+
|
5116 |
+
function setLocation(href) {
|
5117 |
+
setLocationHref(href);
|
5118 |
+
}
|
5119 |
+
|
5120 |
+
function searchAnimations() {
|
5121 |
+
if (standalone === true) {
|
5122 |
+
animationManager.searchAnimations(animationData, standalone, renderer);
|
5123 |
+
} else {
|
5124 |
+
animationManager.searchAnimations();
|
5125 |
+
}
|
5126 |
+
}
|
5127 |
+
|
5128 |
+
function setSubframeRendering(flag) {
|
5129 |
+
setSubframeEnabled(flag);
|
5130 |
+
}
|
5131 |
+
|
5132 |
+
function setPrefix(prefix) {
|
5133 |
+
setIdPrefix(prefix);
|
5134 |
+
}
|
5135 |
+
|
5136 |
+
function loadAnimation(params) {
|
5137 |
+
if (standalone === true) {
|
5138 |
+
params.animationData = JSON.parse(animationData);
|
5139 |
+
}
|
5140 |
+
|
5141 |
+
return animationManager.loadAnimation(params);
|
5142 |
+
}
|
5143 |
+
|
5144 |
+
function setQuality(value) {
|
5145 |
+
if (typeof value === 'string') {
|
5146 |
+
switch (value) {
|
5147 |
+
case 'high':
|
5148 |
+
setDefaultCurveSegments(200);
|
5149 |
+
break;
|
5150 |
+
|
5151 |
+
default:
|
5152 |
+
case 'medium':
|
5153 |
+
setDefaultCurveSegments(50);
|
5154 |
+
break;
|
5155 |
+
|
5156 |
+
case 'low':
|
5157 |
+
setDefaultCurveSegments(10);
|
5158 |
+
break;
|
5159 |
+
}
|
5160 |
+
} else if (!isNaN(value) && value > 1) {
|
5161 |
+
setDefaultCurveSegments(value);
|
5162 |
+
}
|
5163 |
+
|
5164 |
+
if (getDefaultCurveSegments() >= 50) {
|
5165 |
+
roundValues(false);
|
5166 |
+
} else {
|
5167 |
+
roundValues(true);
|
5168 |
+
}
|
5169 |
+
}
|
5170 |
+
|
5171 |
+
function inBrowser() {
|
5172 |
+
return typeof navigator !== 'undefined';
|
5173 |
+
}
|
5174 |
+
|
5175 |
+
function installPlugin(type, plugin) {
|
5176 |
+
if (type === 'expressions') {
|
5177 |
+
setExpressionsPlugin(plugin);
|
5178 |
+
}
|
5179 |
+
}
|
5180 |
+
|
5181 |
+
function getFactory(name) {
|
5182 |
+
switch (name) {
|
5183 |
+
case 'propertyFactory':
|
5184 |
+
return PropertyFactory;
|
5185 |
+
|
5186 |
+
case 'shapePropertyFactory':
|
5187 |
+
return ShapePropertyFactory;
|
5188 |
+
|
5189 |
+
case 'matrix':
|
5190 |
+
return Matrix;
|
5191 |
+
|
5192 |
+
default:
|
5193 |
+
return null;
|
5194 |
+
}
|
5195 |
+
}
|
5196 |
+
|
5197 |
+
lottie.play = animationManager.play;
|
5198 |
+
lottie.pause = animationManager.pause;
|
5199 |
+
lottie.setLocationHref = setLocation;
|
5200 |
+
lottie.togglePause = animationManager.togglePause;
|
5201 |
+
lottie.setSpeed = animationManager.setSpeed;
|
5202 |
+
lottie.setDirection = animationManager.setDirection;
|
5203 |
+
lottie.stop = animationManager.stop;
|
5204 |
+
lottie.searchAnimations = searchAnimations;
|
5205 |
+
lottie.registerAnimation = animationManager.registerAnimation;
|
5206 |
+
lottie.loadAnimation = loadAnimation;
|
5207 |
+
lottie.setSubframeRendering = setSubframeRendering;
|
5208 |
+
lottie.resize = animationManager.resize; // lottie.start = start;
|
5209 |
+
|
5210 |
+
lottie.goToAndStop = animationManager.goToAndStop;
|
5211 |
+
lottie.destroy = animationManager.destroy;
|
5212 |
+
lottie.setQuality = setQuality;
|
5213 |
+
lottie.inBrowser = inBrowser;
|
5214 |
+
lottie.installPlugin = installPlugin;
|
5215 |
+
lottie.freeze = animationManager.freeze;
|
5216 |
+
lottie.unfreeze = animationManager.unfreeze;
|
5217 |
+
lottie.setVolume = animationManager.setVolume;
|
5218 |
+
lottie.mute = animationManager.mute;
|
5219 |
+
lottie.unmute = animationManager.unmute;
|
5220 |
+
lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
|
5221 |
+
lottie.useWebWorker = setWebWorker;
|
5222 |
+
lottie.setIDPrefix = setPrefix;
|
5223 |
+
lottie.__getFactory = getFactory;
|
5224 |
+
lottie.version = '5.9.6';
|
5225 |
+
|
5226 |
+
function checkReady() {
|
5227 |
+
if (document.readyState === 'complete') {
|
5228 |
+
clearInterval(readyStateCheckInterval);
|
5229 |
+
searchAnimations();
|
5230 |
+
}
|
5231 |
+
}
|
5232 |
+
|
5233 |
+
function getQueryVariable(variable) {
|
5234 |
+
var vars = queryString.split('&');
|
5235 |
+
|
5236 |
+
for (var i = 0; i < vars.length; i += 1) {
|
5237 |
+
var pair = vars[i].split('=');
|
5238 |
+
|
5239 |
+
if (decodeURIComponent(pair[0]) == variable) {
|
5240 |
+
// eslint-disable-line eqeqeq
|
5241 |
+
return decodeURIComponent(pair[1]);
|
5242 |
+
}
|
5243 |
+
}
|
5244 |
+
|
5245 |
+
return null;
|
5246 |
+
}
|
5247 |
+
|
5248 |
+
var queryString = '';
|
5249 |
+
|
5250 |
+
if (standalone) {
|
5251 |
+
var scripts = document.getElementsByTagName('script');
|
5252 |
+
var index = scripts.length - 1;
|
5253 |
+
var myScript = scripts[index] || {
|
5254 |
+
src: ''
|
5255 |
+
};
|
5256 |
+
queryString = myScript.src ? myScript.src.replace(/^[^\?]+\??/, '') : ''; // eslint-disable-line no-useless-escape
|
5257 |
+
|
5258 |
+
renderer = getQueryVariable('renderer');
|
5259 |
+
}
|
5260 |
+
|
5261 |
+
var readyStateCheckInterval = setInterval(checkReady, 100); // this adds bodymovin to the window object for backwards compatibility
|
5262 |
+
|
5263 |
+
try {
|
5264 |
+
if (!((typeof exports === "undefined" ? "undefined" : _typeof$3(exports)) === 'object' && typeof module !== 'undefined') && !(typeof define === 'function' && define.amd) // eslint-disable-line no-undef
|
5265 |
+
) {
|
5266 |
+
window.bodymovin = lottie;
|
5267 |
+
}
|
5268 |
+
} catch (err) {//
|
5269 |
+
}
|
5270 |
+
|
5271 |
+
var ShapeModifiers = function () {
|
5272 |
+
var ob = {};
|
5273 |
+
var modifiers = {};
|
5274 |
+
ob.registerModifier = registerModifier;
|
5275 |
+
ob.getModifier = getModifier;
|
5276 |
+
|
5277 |
+
function registerModifier(nm, factory) {
|
5278 |
+
if (!modifiers[nm]) {
|
5279 |
+
modifiers[nm] = factory;
|
5280 |
+
}
|
5281 |
+
}
|
5282 |
+
|
5283 |
+
function getModifier(nm, elem, data) {
|
5284 |
+
return new modifiers[nm](elem, data);
|
5285 |
+
}
|
5286 |
+
|
5287 |
+
return ob;
|
5288 |
+
}();
|
5289 |
+
|
5290 |
+
function ShapeModifier() { }
|
5291 |
+
|
5292 |
+
ShapeModifier.prototype.initModifierProperties = function () { };
|
5293 |
+
|
5294 |
+
ShapeModifier.prototype.addShapeToModifier = function () { };
|
5295 |
+
|
5296 |
+
ShapeModifier.prototype.addShape = function (data) {
|
5297 |
+
if (!this.closed) {
|
5298 |
+
// Adding shape to dynamic properties. It covers the case where a shape has no effects applied, to reset it's _mdf state on every tick.
|
5299 |
+
data.sh.container.addDynamicProperty(data.sh);
|
5300 |
+
var shapeData = {
|
5301 |
+
shape: data.sh,
|
5302 |
+
data: data,
|
5303 |
+
localShapeCollection: shapeCollectionPool.newShapeCollection()
|
5304 |
+
};
|
5305 |
+
this.shapes.push(shapeData);
|
5306 |
+
this.addShapeToModifier(shapeData);
|
5307 |
+
|
5308 |
+
if (this._isAnimated) {
|
5309 |
+
data.setAsAnimated();
|
5310 |
+
}
|
5311 |
+
}
|
5312 |
+
};
|
5313 |
+
|
5314 |
+
ShapeModifier.prototype.init = function (elem, data) {
|
5315 |
+
this.shapes = [];
|
5316 |
+
this.elem = elem;
|
5317 |
+
this.initDynamicPropertyContainer(elem);
|
5318 |
+
this.initModifierProperties(elem, data);
|
5319 |
+
this.frameId = initialDefaultFrame;
|
5320 |
+
this.closed = false;
|
5321 |
+
this.k = false;
|
5322 |
+
|
5323 |
+
if (this.dynamicProperties.length) {
|
5324 |
+
this.k = true;
|
5325 |
+
} else {
|
5326 |
+
this.getValue(true);
|
5327 |
+
}
|
5328 |
+
};
|
5329 |
+
|
5330 |
+
ShapeModifier.prototype.processKeys = function () {
|
5331 |
+
if (this.elem.globalData.frameId === this.frameId) {
|
5332 |
+
return;
|
5333 |
+
}
|
5334 |
+
|
5335 |
+
this.frameId = this.elem.globalData.frameId;
|
5336 |
+
this.iterateDynamicProperties();
|
5337 |
+
};
|
5338 |
+
|
5339 |
+
extendPrototype([DynamicPropertyContainer], ShapeModifier);
|
5340 |
+
|
5341 |
+
function TrimModifier() { }
|
5342 |
+
|
5343 |
+
extendPrototype([ShapeModifier], TrimModifier);
|
5344 |
+
|
5345 |
+
TrimModifier.prototype.initModifierProperties = function (elem, data) {
|
5346 |
+
this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
|
5347 |
+
this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
|
5348 |
+
this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
|
5349 |
+
this.sValue = 0;
|
5350 |
+
this.eValue = 0;
|
5351 |
+
this.getValue = this.processKeys;
|
5352 |
+
this.m = data.m;
|
5353 |
+
this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
|
5354 |
+
};
|
5355 |
+
|
5356 |
+
TrimModifier.prototype.addShapeToModifier = function (shapeData) {
|
5357 |
+
shapeData.pathsData = [];
|
5358 |
+
};
|
5359 |
+
|
5360 |
+
TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
|
5361 |
+
var segments = [];
|
5362 |
+
|
5363 |
+
if (e <= 1) {
|
5364 |
+
segments.push({
|
5365 |
+
s: s,
|
5366 |
+
e: e
|
5367 |
+
});
|
5368 |
+
} else if (s >= 1) {
|
5369 |
+
segments.push({
|
5370 |
+
s: s - 1,
|
5371 |
+
e: e - 1
|
5372 |
+
});
|
5373 |
+
} else {
|
5374 |
+
segments.push({
|
5375 |
+
s: s,
|
5376 |
+
e: 1
|
5377 |
+
});
|
5378 |
+
segments.push({
|
5379 |
+
s: 0,
|
5380 |
+
e: e - 1
|
5381 |
+
});
|
5382 |
+
}
|
5383 |
+
|
5384 |
+
var shapeSegments = [];
|
5385 |
+
var i;
|
5386 |
+
var len = segments.length;
|
5387 |
+
var segmentOb;
|
5388 |
+
|
5389 |
+
for (i = 0; i < len; i += 1) {
|
5390 |
+
segmentOb = segments[i];
|
5391 |
+
|
5392 |
+
if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
|
5393 |
+
var shapeS;
|
5394 |
+
var shapeE;
|
5395 |
+
|
5396 |
+
if (segmentOb.s * totalModifierLength <= addedLength) {
|
5397 |
+
shapeS = 0;
|
5398 |
+
} else {
|
5399 |
+
shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
|
5400 |
+
}
|
5401 |
+
|
5402 |
+
if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
|
5403 |
+
shapeE = 1;
|
5404 |
+
} else {
|
5405 |
+
shapeE = (segmentOb.e * totalModifierLength - addedLength) / shapeLength;
|
5406 |
+
}
|
5407 |
+
|
5408 |
+
shapeSegments.push([shapeS, shapeE]);
|
5409 |
+
}
|
5410 |
+
}
|
5411 |
+
|
5412 |
+
if (!shapeSegments.length) {
|
5413 |
+
shapeSegments.push([0, 0]);
|
5414 |
+
}
|
5415 |
+
|
5416 |
+
return shapeSegments;
|
5417 |
+
};
|
5418 |
+
|
5419 |
+
TrimModifier.prototype.releasePathsData = function (pathsData) {
|
5420 |
+
var i;
|
5421 |
+
var len = pathsData.length;
|
5422 |
+
|
5423 |
+
for (i = 0; i < len; i += 1) {
|
5424 |
+
segmentsLengthPool.release(pathsData[i]);
|
5425 |
+
}
|
5426 |
+
|
5427 |
+
pathsData.length = 0;
|
5428 |
+
return pathsData;
|
5429 |
+
};
|
5430 |
+
|
5431 |
+
TrimModifier.prototype.processShapes = function (_isFirstFrame) {
|
5432 |
+
var s;
|
5433 |
+
var e;
|
5434 |
+
|
5435 |
+
if (this._mdf || _isFirstFrame) {
|
5436 |
+
var o = this.o.v % 360 / 360;
|
5437 |
+
|
5438 |
+
if (o < 0) {
|
5439 |
+
o += 1;
|
5440 |
+
}
|
5441 |
+
|
5442 |
+
if (this.s.v > 1) {
|
5443 |
+
s = 1 + o;
|
5444 |
+
} else if (this.s.v < 0) {
|
5445 |
+
s = 0 + o;
|
5446 |
+
} else {
|
5447 |
+
s = this.s.v + o;
|
5448 |
+
}
|
5449 |
+
|
5450 |
+
if (this.e.v > 1) {
|
5451 |
+
e = 1 + o;
|
5452 |
+
} else if (this.e.v < 0) {
|
5453 |
+
e = 0 + o;
|
5454 |
+
} else {
|
5455 |
+
e = this.e.v + o;
|
5456 |
+
}
|
5457 |
+
|
5458 |
+
if (s > e) {
|
5459 |
+
var _s = s;
|
5460 |
+
s = e;
|
5461 |
+
e = _s;
|
5462 |
+
}
|
5463 |
+
|
5464 |
+
s = Math.round(s * 10000) * 0.0001;
|
5465 |
+
e = Math.round(e * 10000) * 0.0001;
|
5466 |
+
this.sValue = s;
|
5467 |
+
this.eValue = e;
|
5468 |
+
} else {
|
5469 |
+
s = this.sValue;
|
5470 |
+
e = this.eValue;
|
5471 |
+
}
|
5472 |
+
|
5473 |
+
var shapePaths;
|
5474 |
+
var i;
|
5475 |
+
var len = this.shapes.length;
|
5476 |
+
var j;
|
5477 |
+
var jLen;
|
5478 |
+
var pathsData;
|
5479 |
+
var pathData;
|
5480 |
+
var totalShapeLength;
|
5481 |
+
var totalModifierLength = 0;
|
5482 |
+
|
5483 |
+
if (e === s) {
|
5484 |
+
for (i = 0; i < len; i += 1) {
|
5485 |
+
this.shapes[i].localShapeCollection.releaseShapes();
|
5486 |
+
this.shapes[i].shape._mdf = true;
|
5487 |
+
this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
|
5488 |
+
|
5489 |
+
if (this._mdf) {
|
5490 |
+
this.shapes[i].pathsData.length = 0;
|
5491 |
+
}
|
5492 |
+
}
|
5493 |
+
} else if (!(e === 1 && s === 0 || e === 0 && s === 1)) {
|
5494 |
+
var segments = [];
|
5495 |
+
var shapeData;
|
5496 |
+
var localShapeCollection;
|
5497 |
+
|
5498 |
+
for (i = 0; i < len; i += 1) {
|
5499 |
+
shapeData = this.shapes[i]; // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
|
5500 |
+
|
5501 |
+
if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
|
5502 |
+
shapeData.shape.paths = shapeData.localShapeCollection;
|
5503 |
+
} else {
|
5504 |
+
shapePaths = shapeData.shape.paths;
|
5505 |
+
jLen = shapePaths._length;
|
5506 |
+
totalShapeLength = 0;
|
5507 |
+
|
5508 |
+
if (!shapeData.shape._mdf && shapeData.pathsData.length) {
|
5509 |
+
totalShapeLength = shapeData.totalShapeLength;
|
5510 |
+
} else {
|
5511 |
+
pathsData = this.releasePathsData(shapeData.pathsData);
|
5512 |
+
|
5513 |
+
for (j = 0; j < jLen; j += 1) {
|
5514 |
+
pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
|
5515 |
+
pathsData.push(pathData);
|
5516 |
+
totalShapeLength += pathData.totalLength;
|
5517 |
+
}
|
5518 |
+
|
5519 |
+
shapeData.totalShapeLength = totalShapeLength;
|
5520 |
+
shapeData.pathsData = pathsData;
|
5521 |
+
}
|
5522 |
+
|
5523 |
+
totalModifierLength += totalShapeLength;
|
5524 |
+
shapeData.shape._mdf = true;
|
5525 |
+
}
|
5526 |
+
}
|
5527 |
+
|
5528 |
+
var shapeS = s;
|
5529 |
+
var shapeE = e;
|
5530 |
+
var addedLength = 0;
|
5531 |
+
var edges;
|
5532 |
+
|
5533 |
+
for (i = len - 1; i >= 0; i -= 1) {
|
5534 |
+
shapeData = this.shapes[i];
|
5535 |
+
|
5536 |
+
if (shapeData.shape._mdf) {
|
5537 |
+
localShapeCollection = shapeData.localShapeCollection;
|
5538 |
+
localShapeCollection.releaseShapes(); // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
|
5539 |
+
|
5540 |
+
if (this.m === 2 && len > 1) {
|
5541 |
+
edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
|
5542 |
+
addedLength += shapeData.totalShapeLength;
|
5543 |
+
} else {
|
5544 |
+
edges = [[shapeS, shapeE]];
|
5545 |
+
}
|
5546 |
+
|
5547 |
+
jLen = edges.length;
|
5548 |
+
|
5549 |
+
for (j = 0; j < jLen; j += 1) {
|
5550 |
+
shapeS = edges[j][0];
|
5551 |
+
shapeE = edges[j][1];
|
5552 |
+
segments.length = 0;
|
5553 |
+
|
5554 |
+
if (shapeE <= 1) {
|
5555 |
+
segments.push({
|
5556 |
+
s: shapeData.totalShapeLength * shapeS,
|
5557 |
+
e: shapeData.totalShapeLength * shapeE
|
5558 |
+
});
|
5559 |
+
} else if (shapeS >= 1) {
|
5560 |
+
segments.push({
|
5561 |
+
s: shapeData.totalShapeLength * (shapeS - 1),
|
5562 |
+
e: shapeData.totalShapeLength * (shapeE - 1)
|
5563 |
+
});
|
5564 |
+
} else {
|
5565 |
+
segments.push({
|
5566 |
+
s: shapeData.totalShapeLength * shapeS,
|
5567 |
+
e: shapeData.totalShapeLength
|
5568 |
+
});
|
5569 |
+
segments.push({
|
5570 |
+
s: 0,
|
5571 |
+
e: shapeData.totalShapeLength * (shapeE - 1)
|
5572 |
+
});
|
5573 |
+
}
|
5574 |
+
|
5575 |
+
var newShapesData = this.addShapes(shapeData, segments[0]);
|
5576 |
+
|
5577 |
+
if (segments[0].s !== segments[0].e) {
|
5578 |
+
if (segments.length > 1) {
|
5579 |
+
var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
|
5580 |
+
|
5581 |
+
if (lastShapeInCollection.c) {
|
5582 |
+
var lastShape = newShapesData.pop();
|
5583 |
+
this.addPaths(newShapesData, localShapeCollection);
|
5584 |
+
newShapesData = this.addShapes(shapeData, segments[1], lastShape);
|
5585 |
+
} else {
|
5586 |
+
this.addPaths(newShapesData, localShapeCollection);
|
5587 |
+
newShapesData = this.addShapes(shapeData, segments[1]);
|
5588 |
+
}
|
5589 |
+
}
|
5590 |
+
|
5591 |
+
this.addPaths(newShapesData, localShapeCollection);
|
5592 |
+
}
|
5593 |
+
}
|
5594 |
+
|
5595 |
+
shapeData.shape.paths = localShapeCollection;
|
5596 |
+
}
|
5597 |
+
}
|
5598 |
+
} else if (this._mdf) {
|
5599 |
+
for (i = 0; i < len; i += 1) {
|
5600 |
+
// Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
|
5601 |
+
// Don't remove this even if it's losing cached info.
|
5602 |
+
this.shapes[i].pathsData.length = 0;
|
5603 |
+
this.shapes[i].shape._mdf = true;
|
5604 |
+
}
|
5605 |
+
}
|
5606 |
+
};
|
5607 |
+
|
5608 |
+
TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
|
5609 |
+
var i;
|
5610 |
+
var len = newPaths.length;
|
5611 |
+
|
5612 |
+
for (i = 0; i < len; i += 1) {
|
5613 |
+
localShapeCollection.addShape(newPaths[i]);
|
5614 |
+
}
|
5615 |
+
};
|
5616 |
+
|
5617 |
+
TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
|
5618 |
+
shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
|
5619 |
+
shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
|
5620 |
+
|
5621 |
+
if (newShape) {
|
5622 |
+
shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
|
5623 |
+
}
|
5624 |
+
|
5625 |
+
shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
|
5626 |
+
};
|
5627 |
+
|
5628 |
+
TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
|
5629 |
+
shapePath.setXYAt(points[1], points[5], 'o', pos);
|
5630 |
+
shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
|
5631 |
+
|
5632 |
+
if (newShape) {
|
5633 |
+
shapePath.setXYAt(points[0], points[4], 'v', pos);
|
5634 |
+
}
|
5635 |
+
|
5636 |
+
shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
|
5637 |
+
};
|
5638 |
+
|
5639 |
+
TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
|
5640 |
+
var pathsData = shapeData.pathsData;
|
5641 |
+
var shapePaths = shapeData.shape.paths.shapes;
|
5642 |
+
var i;
|
5643 |
+
var len = shapeData.shape.paths._length;
|
5644 |
+
var j;
|
5645 |
+
var jLen;
|
5646 |
+
var addedLength = 0;
|
5647 |
+
var currentLengthData;
|
5648 |
+
var segmentCount;
|
5649 |
+
var lengths;
|
5650 |
+
var segment;
|
5651 |
+
var shapes = [];
|
5652 |
+
var initPos;
|
5653 |
+
var newShape = true;
|
5654 |
+
|
5655 |
+
if (!shapePath) {
|
5656 |
+
shapePath = shapePool.newElement();
|
5657 |
+
segmentCount = 0;
|
5658 |
+
initPos = 0;
|
5659 |
+
} else {
|
5660 |
+
segmentCount = shapePath._length;
|
5661 |
+
initPos = shapePath._length;
|
5662 |
+
}
|
5663 |
+
|
5664 |
+
shapes.push(shapePath);
|
5665 |
+
|
5666 |
+
for (i = 0; i < len; i += 1) {
|
5667 |
+
lengths = pathsData[i].lengths;
|
5668 |
+
shapePath.c = shapePaths[i].c;
|
5669 |
+
jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
|
5670 |
+
|
5671 |
+
for (j = 1; j < jLen; j += 1) {
|
5672 |
+
currentLengthData = lengths[j - 1];
|
5673 |
+
|
5674 |
+
if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
|
5675 |
+
addedLength += currentLengthData.addedLength;
|
5676 |
+
shapePath.c = false;
|
5677 |
+
} else if (addedLength > shapeSegment.e) {
|
5678 |
+
shapePath.c = false;
|
5679 |
+
break;
|
5680 |
+
} else {
|
5681 |
+
if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
|
5682 |
+
this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
|
5683 |
+
newShape = false;
|
5684 |
+
} else {
|
5685 |
+
segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[j], shapePaths[i].o[j - 1], shapePaths[i].i[j], (shapeSegment.s - addedLength) / currentLengthData.addedLength, (shapeSegment.e - addedLength) / currentLengthData.addedLength, lengths[j - 1]);
|
5686 |
+
this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
|
5687 |
+
|
5688 |
+
newShape = false;
|
5689 |
+
shapePath.c = false;
|
5690 |
+
}
|
5691 |
+
|
5692 |
+
addedLength += currentLengthData.addedLength;
|
5693 |
+
segmentCount += 1;
|
5694 |
+
}
|
5695 |
+
}
|
5696 |
+
|
5697 |
+
if (shapePaths[i].c && lengths.length) {
|
5698 |
+
currentLengthData = lengths[j - 1];
|
5699 |
+
|
5700 |
+
if (addedLength <= shapeSegment.e) {
|
5701 |
+
var segmentLength = lengths[j - 1].addedLength;
|
5702 |
+
|
5703 |
+
if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
|
5704 |
+
this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
|
5705 |
+
newShape = false;
|
5706 |
+
} else {
|
5707 |
+
segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[0], shapePaths[i].o[j - 1], shapePaths[i].i[0], (shapeSegment.s - addedLength) / segmentLength, (shapeSegment.e - addedLength) / segmentLength, lengths[j - 1]);
|
5708 |
+
this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
|
5709 |
+
|
5710 |
+
newShape = false;
|
5711 |
+
shapePath.c = false;
|
5712 |
+
}
|
5713 |
+
} else {
|
5714 |
+
shapePath.c = false;
|
5715 |
+
}
|
5716 |
+
|
5717 |
+
addedLength += currentLengthData.addedLength;
|
5718 |
+
segmentCount += 1;
|
5719 |
+
}
|
5720 |
+
|
5721 |
+
if (shapePath._length) {
|
5722 |
+
shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
|
5723 |
+
shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
|
5724 |
+
}
|
5725 |
+
|
5726 |
+
if (addedLength > shapeSegment.e) {
|
5727 |
+
break;
|
5728 |
+
}
|
5729 |
+
|
5730 |
+
if (i < len - 1) {
|
5731 |
+
shapePath = shapePool.newElement();
|
5732 |
+
newShape = true;
|
5733 |
+
shapes.push(shapePath);
|
5734 |
+
segmentCount = 0;
|
5735 |
+
}
|
5736 |
+
}
|
5737 |
+
|
5738 |
+
return shapes;
|
5739 |
+
};
|
5740 |
+
|
5741 |
+
function PuckerAndBloatModifier() { }
|
5742 |
+
|
5743 |
+
extendPrototype([ShapeModifier], PuckerAndBloatModifier);
|
5744 |
+
|
5745 |
+
PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
|
5746 |
+
this.getValue = this.processKeys;
|
5747 |
+
this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
|
5748 |
+
this._isAnimated = !!this.amount.effectsSequence.length;
|
5749 |
+
};
|
5750 |
+
|
5751 |
+
PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
|
5752 |
+
var percent = amount / 100;
|
5753 |
+
var centerPoint = [0, 0];
|
5754 |
+
var pathLength = path._length;
|
5755 |
+
var i = 0;
|
5756 |
+
|
5757 |
+
for (i = 0; i < pathLength; i += 1) {
|
5758 |
+
centerPoint[0] += path.v[i][0];
|
5759 |
+
centerPoint[1] += path.v[i][1];
|
5760 |
+
}
|
5761 |
+
|
5762 |
+
centerPoint[0] /= pathLength;
|
5763 |
+
centerPoint[1] /= pathLength;
|
5764 |
+
var clonedPath = shapePool.newElement();
|
5765 |
+
clonedPath.c = path.c;
|
5766 |
+
var vX;
|
5767 |
+
var vY;
|
5768 |
+
var oX;
|
5769 |
+
var oY;
|
5770 |
+
var iX;
|
5771 |
+
var iY;
|
5772 |
+
|
5773 |
+
for (i = 0; i < pathLength; i += 1) {
|
5774 |
+
vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
|
5775 |
+
vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
|
5776 |
+
oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
|
5777 |
+
oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
|
5778 |
+
iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
|
5779 |
+
iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
|
5780 |
+
clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
|
5781 |
+
}
|
5782 |
+
|
5783 |
+
return clonedPath;
|
5784 |
+
};
|
5785 |
+
|
5786 |
+
PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
|
5787 |
+
var shapePaths;
|
5788 |
+
var i;
|
5789 |
+
var len = this.shapes.length;
|
5790 |
+
var j;
|
5791 |
+
var jLen;
|
5792 |
+
var amount = this.amount.v;
|
5793 |
+
|
5794 |
+
if (amount !== 0) {
|
5795 |
+
var shapeData;
|
5796 |
+
var localShapeCollection;
|
5797 |
+
|
5798 |
+
for (i = 0; i < len; i += 1) {
|
5799 |
+
shapeData = this.shapes[i];
|
5800 |
+
localShapeCollection = shapeData.localShapeCollection;
|
5801 |
+
|
5802 |
+
if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
|
5803 |
+
localShapeCollection.releaseShapes();
|
5804 |
+
shapeData.shape._mdf = true;
|
5805 |
+
shapePaths = shapeData.shape.paths.shapes;
|
5806 |
+
jLen = shapeData.shape.paths._length;
|
5807 |
+
|
5808 |
+
for (j = 0; j < jLen; j += 1) {
|
5809 |
+
localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
|
5810 |
+
}
|
5811 |
+
}
|
5812 |
+
|
5813 |
+
shapeData.shape.paths = shapeData.localShapeCollection;
|
5814 |
+
}
|
5815 |
+
}
|
5816 |
+
|
5817 |
+
if (!this.dynamicProperties.length) {
|
5818 |
+
this._mdf = false;
|
5819 |
+
}
|
5820 |
+
};
|
5821 |
+
|
5822 |
+
var TransformPropertyFactory = function () {
|
5823 |
+
var defaultVector = [0, 0];
|
5824 |
+
|
5825 |
+
function applyToMatrix(mat) {
|
5826 |
+
var _mdf = this._mdf;
|
5827 |
+
this.iterateDynamicProperties();
|
5828 |
+
this._mdf = this._mdf || _mdf;
|
5829 |
+
|
5830 |
+
if (this.a) {
|
5831 |
+
mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
|
5832 |
+
}
|
5833 |
+
|
5834 |
+
if (this.s) {
|
5835 |
+
mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
|
5836 |
+
}
|
5837 |
+
|
5838 |
+
if (this.sk) {
|
5839 |
+
mat.skewFromAxis(-this.sk.v, this.sa.v);
|
5840 |
+
}
|
5841 |
+
|
5842 |
+
if (this.r) {
|
5843 |
+
mat.rotate(-this.r.v);
|
5844 |
+
} else {
|
5845 |
+
mat.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
|
5846 |
+
}
|
5847 |
+
|
5848 |
+
if (this.data.p.s) {
|
5849 |
+
if (this.data.p.z) {
|
5850 |
+
mat.translate(this.px.v, this.py.v, -this.pz.v);
|
5851 |
+
} else {
|
5852 |
+
mat.translate(this.px.v, this.py.v, 0);
|
5853 |
+
}
|
5854 |
+
} else {
|
5855 |
+
mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
|
5856 |
+
}
|
5857 |
+
}
|
5858 |
+
|
5859 |
+
function processKeys(forceRender) {
|
5860 |
+
if (this.elem.globalData.frameId === this.frameId) {
|
5861 |
+
return;
|
5862 |
+
}
|
5863 |
+
|
5864 |
+
if (this._isDirty) {
|
5865 |
+
this.precalculateMatrix();
|
5866 |
+
this._isDirty = false;
|
5867 |
+
}
|
5868 |
+
|
5869 |
+
this.iterateDynamicProperties();
|
5870 |
+
|
5871 |
+
if (this._mdf || forceRender) {
|
5872 |
+
var frameRate;
|
5873 |
+
this.v.cloneFromProps(this.pre.props);
|
5874 |
+
|
5875 |
+
if (this.appliedTransformations < 1) {
|
5876 |
+
this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
|
5877 |
+
}
|
5878 |
+
|
5879 |
+
if (this.appliedTransformations < 2) {
|
5880 |
+
this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
|
5881 |
+
}
|
5882 |
+
|
5883 |
+
if (this.sk && this.appliedTransformations < 3) {
|
5884 |
+
this.v.skewFromAxis(-this.sk.v, this.sa.v);
|
5885 |
+
}
|
5886 |
+
|
5887 |
+
if (this.r && this.appliedTransformations < 4) {
|
5888 |
+
this.v.rotate(-this.r.v);
|
5889 |
+
} else if (!this.r && this.appliedTransformations < 4) {
|
5890 |
+
this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
|
5891 |
+
}
|
5892 |
+
|
5893 |
+
if (this.autoOriented) {
|
5894 |
+
var v1;
|
5895 |
+
var v2;
|
5896 |
+
frameRate = this.elem.globalData.frameRate;
|
5897 |
+
|
5898 |
+
if (this.p && this.p.keyframes && this.p.getValueAtTime) {
|
5899 |
+
if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
|
5900 |
+
v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
|
5901 |
+
v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
|
5902 |
+
} else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
|
5903 |
+
v1 = this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / frameRate, 0);
|
5904 |
+
v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
|
5905 |
+
} else {
|
5906 |
+
v1 = this.p.pv;
|
5907 |
+
v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
|
5908 |
+
}
|
5909 |
+
} else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
|
5910 |
+
v1 = [];
|
5911 |
+
v2 = [];
|
5912 |
+
var px = this.px;
|
5913 |
+
var py = this.py;
|
5914 |
+
|
5915 |
+
if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
|
5916 |
+
v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
|
5917 |
+
v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
|
5918 |
+
v2[0] = px.getValueAtTime(px.keyframes[0].t / frameRate, 0);
|
5919 |
+
v2[1] = py.getValueAtTime(py.keyframes[0].t / frameRate, 0);
|
5920 |
+
} else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
|
5921 |
+
v1[0] = px.getValueAtTime(px.keyframes[px.keyframes.length - 1].t / frameRate, 0);
|
5922 |
+
v1[1] = py.getValueAtTime(py.keyframes[py.keyframes.length - 1].t / frameRate, 0);
|
5923 |
+
v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
|
5924 |
+
v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
|
5925 |
+
} else {
|
5926 |
+
v1 = [px.pv, py.pv];
|
5927 |
+
v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
|
5928 |
+
v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
|
5929 |
+
}
|
5930 |
+
} else {
|
5931 |
+
v2 = defaultVector;
|
5932 |
+
v1 = v2;
|
5933 |
+
}
|
5934 |
+
|
5935 |
+
this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
|
5936 |
+
}
|
5937 |
+
|
5938 |
+
if (this.data.p && this.data.p.s) {
|
5939 |
+
if (this.data.p.z) {
|
5940 |
+
this.v.translate(this.px.v, this.py.v, -this.pz.v);
|
5941 |
+
} else {
|
5942 |
+
this.v.translate(this.px.v, this.py.v, 0);
|
5943 |
+
}
|
5944 |
+
} else {
|
5945 |
+
this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
|
5946 |
+
}
|
5947 |
+
}
|
5948 |
+
|
5949 |
+
this.frameId = this.elem.globalData.frameId;
|
5950 |
+
}
|
5951 |
+
|
5952 |
+
function precalculateMatrix() {
|
5953 |
+
if (!this.a.k) {
|
5954 |
+
this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
|
5955 |
+
this.appliedTransformations = 1;
|
5956 |
+
} else {
|
5957 |
+
return;
|
5958 |
+
}
|
5959 |
+
|
5960 |
+
if (!this.s.effectsSequence.length) {
|
5961 |
+
this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
|
5962 |
+
this.appliedTransformations = 2;
|
5963 |
+
} else {
|
5964 |
+
return;
|
5965 |
+
}
|
5966 |
+
|
5967 |
+
if (this.sk) {
|
5968 |
+
if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
|
5969 |
+
this.pre.skewFromAxis(-this.sk.v, this.sa.v);
|
5970 |
+
this.appliedTransformations = 3;
|
5971 |
+
} else {
|
5972 |
+
return;
|
5973 |
+
}
|
5974 |
+
}
|
5975 |
+
|
5976 |
+
if (this.r) {
|
5977 |
+
if (!this.r.effectsSequence.length) {
|
5978 |
+
this.pre.rotate(-this.r.v);
|
5979 |
+
this.appliedTransformations = 4;
|
5980 |
+
}
|
5981 |
+
} else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
|
5982 |
+
this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
|
5983 |
+
this.appliedTransformations = 4;
|
5984 |
+
}
|
5985 |
+
}
|
5986 |
+
|
5987 |
+
function autoOrient() {//
|
5988 |
+
// var prevP = this.getValueAtTime();
|
5989 |
+
}
|
5990 |
+
|
5991 |
+
function addDynamicProperty(prop) {
|
5992 |
+
this._addDynamicProperty(prop);
|
5993 |
+
|
5994 |
+
this.elem.addDynamicProperty(prop);
|
5995 |
+
this._isDirty = true;
|
5996 |
+
}
|
5997 |
+
|
5998 |
+
function TransformProperty(elem, data, container) {
|
5999 |
+
this.elem = elem;
|
6000 |
+
this.frameId = -1;
|
6001 |
+
this.propType = 'transform';
|
6002 |
+
this.data = data;
|
6003 |
+
this.v = new Matrix(); // Precalculated matrix with non animated properties
|
6004 |
+
|
6005 |
+
this.pre = new Matrix();
|
6006 |
+
this.appliedTransformations = 0;
|
6007 |
+
this.initDynamicPropertyContainer(container || elem);
|
6008 |
+
|
6009 |
+
if (data.p && data.p.s) {
|
6010 |
+
this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
|
6011 |
+
this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
|
6012 |
+
|
6013 |
+
if (data.p.z) {
|
6014 |
+
this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
|
6015 |
+
}
|
6016 |
+
} else {
|
6017 |
+
this.p = PropertyFactory.getProp(elem, data.p || {
|
6018 |
+
k: [0, 0, 0]
|
6019 |
+
}, 1, 0, this);
|
6020 |
+
}
|
6021 |
+
|
6022 |
+
if (data.rx) {
|
6023 |
+
this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
|
6024 |
+
this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
|
6025 |
+
this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
|
6026 |
+
|
6027 |
+
if (data.or.k[0].ti) {
|
6028 |
+
var i;
|
6029 |
+
var len = data.or.k.length;
|
6030 |
+
|
6031 |
+
for (i = 0; i < len; i += 1) {
|
6032 |
+
data.or.k[i].to = null;
|
6033 |
+
data.or.k[i].ti = null;
|
6034 |
+
}
|
6035 |
+
}
|
6036 |
+
|
6037 |
+
this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this); // sh Indicates it needs to be capped between -180 and 180
|
6038 |
+
|
6039 |
+
this.or.sh = true;
|
6040 |
+
} else {
|
6041 |
+
this.r = PropertyFactory.getProp(elem, data.r || {
|
6042 |
+
k: 0
|
6043 |
+
}, 0, degToRads, this);
|
6044 |
+
}
|
6045 |
+
|
6046 |
+
if (data.sk) {
|
6047 |
+
this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
|
6048 |
+
this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
|
6049 |
+
}
|
6050 |
+
|
6051 |
+
this.a = PropertyFactory.getProp(elem, data.a || {
|
6052 |
+
k: [0, 0, 0]
|
6053 |
+
}, 1, 0, this);
|
6054 |
+
this.s = PropertyFactory.getProp(elem, data.s || {
|
6055 |
+
k: [100, 100, 100]
|
6056 |
+
}, 1, 0.01, this); // Opacity is not part of the transform properties, that's why it won't use this.dynamicProperties. That way transforms won't get updated if opacity changes.
|
6057 |
+
|
6058 |
+
if (data.o) {
|
6059 |
+
this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
|
6060 |
+
} else {
|
6061 |
+
this.o = {
|
6062 |
+
_mdf: false,
|
6063 |
+
v: 1
|
6064 |
+
};
|
6065 |
+
}
|
6066 |
+
|
6067 |
+
this._isDirty = true;
|
6068 |
+
|
6069 |
+
if (!this.dynamicProperties.length) {
|
6070 |
+
this.getValue(true);
|
6071 |
+
}
|
6072 |
+
}
|
6073 |
+
|
6074 |
+
TransformProperty.prototype = {
|
6075 |
+
applyToMatrix: applyToMatrix,
|
6076 |
+
getValue: processKeys,
|
6077 |
+
precalculateMatrix: precalculateMatrix,
|
6078 |
+
autoOrient: autoOrient
|
6079 |
+
};
|
6080 |
+
extendPrototype([DynamicPropertyContainer], TransformProperty);
|
6081 |
+
TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
|
6082 |
+
TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
|
6083 |
+
|
6084 |
+
function getTransformProperty(elem, data, container) {
|
6085 |
+
return new TransformProperty(elem, data, container);
|
6086 |
+
}
|
6087 |
+
|
6088 |
+
return {
|
6089 |
+
getTransformProperty: getTransformProperty
|
6090 |
+
};
|
6091 |
+
}();
|
6092 |
+
|
6093 |
+
function RepeaterModifier() { }
|
6094 |
+
|
6095 |
+
extendPrototype([ShapeModifier], RepeaterModifier);
|
6096 |
+
|
6097 |
+
RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
|
6098 |
+
this.getValue = this.processKeys;
|
6099 |
+
this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
|
6100 |
+
this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
|
6101 |
+
this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
|
6102 |
+
this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
|
6103 |
+
this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
|
6104 |
+
this.data = data;
|
6105 |
+
|
6106 |
+
if (!this.dynamicProperties.length) {
|
6107 |
+
this.getValue(true);
|
6108 |
+
}
|
6109 |
+
|
6110 |
+
this._isAnimated = !!this.dynamicProperties.length;
|
6111 |
+
this.pMatrix = new Matrix();
|
6112 |
+
this.rMatrix = new Matrix();
|
6113 |
+
this.sMatrix = new Matrix();
|
6114 |
+
this.tMatrix = new Matrix();
|
6115 |
+
this.matrix = new Matrix();
|
6116 |
+
};
|
6117 |
+
|
6118 |
+
RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
|
6119 |
+
var dir = inv ? -1 : 1;
|
6120 |
+
var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
|
6121 |
+
var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
|
6122 |
+
pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
|
6123 |
+
rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
|
6124 |
+
rMatrix.rotate(-transform.r.v * dir * perc);
|
6125 |
+
rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
|
6126 |
+
sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
|
6127 |
+
sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
|
6128 |
+
sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
|
6129 |
+
};
|
6130 |
+
|
6131 |
+
RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
|
6132 |
+
this.elem = elem;
|
6133 |
+
this.arr = arr;
|
6134 |
+
this.pos = pos;
|
6135 |
+
this.elemsData = elemsData;
|
6136 |
+
this._currentCopies = 0;
|
6137 |
+
this._elements = [];
|
6138 |
+
this._groups = [];
|
6139 |
+
this.frameId = -1;
|
6140 |
+
this.initDynamicPropertyContainer(elem);
|
6141 |
+
this.initModifierProperties(elem, arr[pos]);
|
6142 |
+
|
6143 |
+
while (pos > 0) {
|
6144 |
+
pos -= 1; // this._elements.unshift(arr.splice(pos,1)[0]);
|
6145 |
+
|
6146 |
+
this._elements.unshift(arr[pos]);
|
6147 |
+
}
|
6148 |
+
|
6149 |
+
if (this.dynamicProperties.length) {
|
6150 |
+
this.k = true;
|
6151 |
+
} else {
|
6152 |
+
this.getValue(true);
|
6153 |
+
}
|
6154 |
+
};
|
6155 |
+
|
6156 |
+
RepeaterModifier.prototype.resetElements = function (elements) {
|
6157 |
+
var i;
|
6158 |
+
var len = elements.length;
|
6159 |
+
|
6160 |
+
for (i = 0; i < len; i += 1) {
|
6161 |
+
elements[i]._processed = false;
|
6162 |
+
|
6163 |
+
if (elements[i].ty === 'gr') {
|
6164 |
+
this.resetElements(elements[i].it);
|
6165 |
+
}
|
6166 |
+
}
|
6167 |
+
};
|
6168 |
+
|
6169 |
+
RepeaterModifier.prototype.cloneElements = function (elements) {
|
6170 |
+
var newElements = JSON.parse(JSON.stringify(elements));
|
6171 |
+
this.resetElements(newElements);
|
6172 |
+
return newElements;
|
6173 |
+
};
|
6174 |
+
|
6175 |
+
RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
|
6176 |
+
var i;
|
6177 |
+
var len = elements.length;
|
6178 |
+
|
6179 |
+
for (i = 0; i < len; i += 1) {
|
6180 |
+
elements[i]._render = renderFlag;
|
6181 |
+
|
6182 |
+
if (elements[i].ty === 'gr') {
|
6183 |
+
this.changeGroupRender(elements[i].it, renderFlag);
|
6184 |
+
}
|
6185 |
+
}
|
6186 |
+
};
|
6187 |
+
|
6188 |
+
RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
|
6189 |
+
var items;
|
6190 |
+
var itemsTransform;
|
6191 |
+
var i;
|
6192 |
+
var dir;
|
6193 |
+
var cont;
|
6194 |
+
var hasReloaded = false;
|
6195 |
+
|
6196 |
+
if (this._mdf || _isFirstFrame) {
|
6197 |
+
var copies = Math.ceil(this.c.v);
|
6198 |
+
|
6199 |
+
if (this._groups.length < copies) {
|
6200 |
+
while (this._groups.length < copies) {
|
6201 |
+
var group = {
|
6202 |
+
it: this.cloneElements(this._elements),
|
6203 |
+
ty: 'gr'
|
6204 |
+
};
|
6205 |
+
group.it.push({
|
6206 |
+
a: {
|
6207 |
+
a: 0,
|
6208 |
+
ix: 1,
|
6209 |
+
k: [0, 0]
|
6210 |
+
},
|
6211 |
+
nm: 'Transform',
|
6212 |
+
o: {
|
6213 |
+
a: 0,
|
6214 |
+
ix: 7,
|
6215 |
+
k: 100
|
6216 |
+
},
|
6217 |
+
p: {
|
6218 |
+
a: 0,
|
6219 |
+
ix: 2,
|
6220 |
+
k: [0, 0]
|
6221 |
+
},
|
6222 |
+
r: {
|
6223 |
+
a: 1,
|
6224 |
+
ix: 6,
|
6225 |
+
k: [{
|
6226 |
+
s: 0,
|
6227 |
+
e: 0,
|
6228 |
+
t: 0
|
6229 |
+
}, {
|
6230 |
+
s: 0,
|
6231 |
+
e: 0,
|
6232 |
+
t: 1
|
6233 |
+
}]
|
6234 |
+
},
|
6235 |
+
s: {
|
6236 |
+
a: 0,
|
6237 |
+
ix: 3,
|
6238 |
+
k: [100, 100]
|
6239 |
+
},
|
6240 |
+
sa: {
|
6241 |
+
a: 0,
|
6242 |
+
ix: 5,
|
6243 |
+
k: 0
|
6244 |
+
},
|
6245 |
+
sk: {
|
6246 |
+
a: 0,
|
6247 |
+
ix: 4,
|
6248 |
+
k: 0
|
6249 |
+
},
|
6250 |
+
ty: 'tr'
|
6251 |
+
});
|
6252 |
+
this.arr.splice(0, 0, group);
|
6253 |
+
|
6254 |
+
this._groups.splice(0, 0, group);
|
6255 |
+
|
6256 |
+
this._currentCopies += 1;
|
6257 |
+
}
|
6258 |
+
|
6259 |
+
this.elem.reloadShapes();
|
6260 |
+
hasReloaded = true;
|
6261 |
+
}
|
6262 |
+
|
6263 |
+
cont = 0;
|
6264 |
+
var renderFlag;
|
6265 |
+
|
6266 |
+
for (i = 0; i <= this._groups.length - 1; i += 1) {
|
6267 |
+
renderFlag = cont < copies;
|
6268 |
+
this._groups[i]._render = renderFlag;
|
6269 |
+
this.changeGroupRender(this._groups[i].it, renderFlag);
|
6270 |
+
|
6271 |
+
if (!renderFlag) {
|
6272 |
+
var elems = this.elemsData[i].it;
|
6273 |
+
var transformData = elems[elems.length - 1];
|
6274 |
+
|
6275 |
+
if (transformData.transform.op.v !== 0) {
|
6276 |
+
transformData.transform.op._mdf = true;
|
6277 |
+
transformData.transform.op.v = 0;
|
6278 |
+
} else {
|
6279 |
+
transformData.transform.op._mdf = false;
|
6280 |
+
}
|
6281 |
+
}
|
6282 |
+
|
6283 |
+
cont += 1;
|
6284 |
+
}
|
6285 |
+
|
6286 |
+
this._currentCopies = copies; /// /
|
6287 |
+
|
6288 |
+
var offset = this.o.v;
|
6289 |
+
var offsetModulo = offset % 1;
|
6290 |
+
var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
|
6291 |
+
var pProps = this.pMatrix.props;
|
6292 |
+
var rProps = this.rMatrix.props;
|
6293 |
+
var sProps = this.sMatrix.props;
|
6294 |
+
this.pMatrix.reset();
|
6295 |
+
this.rMatrix.reset();
|
6296 |
+
this.sMatrix.reset();
|
6297 |
+
this.tMatrix.reset();
|
6298 |
+
this.matrix.reset();
|
6299 |
+
var iteration = 0;
|
6300 |
+
|
6301 |
+
if (offset > 0) {
|
6302 |
+
while (iteration < roundOffset) {
|
6303 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
|
6304 |
+
iteration += 1;
|
6305 |
+
}
|
6306 |
+
|
6307 |
+
if (offsetModulo) {
|
6308 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
|
6309 |
+
iteration += offsetModulo;
|
6310 |
+
}
|
6311 |
+
} else if (offset < 0) {
|
6312 |
+
while (iteration > roundOffset) {
|
6313 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
|
6314 |
+
iteration -= 1;
|
6315 |
+
}
|
6316 |
+
|
6317 |
+
if (offsetModulo) {
|
6318 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
|
6319 |
+
iteration -= offsetModulo;
|
6320 |
+
}
|
6321 |
+
}
|
6322 |
+
|
6323 |
+
i = this.data.m === 1 ? 0 : this._currentCopies - 1;
|
6324 |
+
dir = this.data.m === 1 ? 1 : -1;
|
6325 |
+
cont = this._currentCopies;
|
6326 |
+
var j;
|
6327 |
+
var jLen;
|
6328 |
+
|
6329 |
+
while (cont) {
|
6330 |
+
items = this.elemsData[i].it;
|
6331 |
+
itemsTransform = items[items.length - 1].transform.mProps.v.props;
|
6332 |
+
jLen = itemsTransform.length;
|
6333 |
+
items[items.length - 1].transform.mProps._mdf = true;
|
6334 |
+
items[items.length - 1].transform.op._mdf = true;
|
6335 |
+
items[items.length - 1].transform.op.v = this._currentCopies === 1 ? this.so.v : this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
|
6336 |
+
|
6337 |
+
if (iteration !== 0) {
|
6338 |
+
if (i !== 0 && dir === 1 || i !== this._currentCopies - 1 && dir === -1) {
|
6339 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
|
6340 |
+
}
|
6341 |
+
|
6342 |
+
this.matrix.transform(rProps[0], rProps[1], rProps[2], rProps[3], rProps[4], rProps[5], rProps[6], rProps[7], rProps[8], rProps[9], rProps[10], rProps[11], rProps[12], rProps[13], rProps[14], rProps[15]);
|
6343 |
+
this.matrix.transform(sProps[0], sProps[1], sProps[2], sProps[3], sProps[4], sProps[5], sProps[6], sProps[7], sProps[8], sProps[9], sProps[10], sProps[11], sProps[12], sProps[13], sProps[14], sProps[15]);
|
6344 |
+
this.matrix.transform(pProps[0], pProps[1], pProps[2], pProps[3], pProps[4], pProps[5], pProps[6], pProps[7], pProps[8], pProps[9], pProps[10], pProps[11], pProps[12], pProps[13], pProps[14], pProps[15]);
|
6345 |
+
|
6346 |
+
for (j = 0; j < jLen; j += 1) {
|
6347 |
+
itemsTransform[j] = this.matrix.props[j];
|
6348 |
+
}
|
6349 |
+
|
6350 |
+
this.matrix.reset();
|
6351 |
+
} else {
|
6352 |
+
this.matrix.reset();
|
6353 |
+
|
6354 |
+
for (j = 0; j < jLen; j += 1) {
|
6355 |
+
itemsTransform[j] = this.matrix.props[j];
|
6356 |
+
}
|
6357 |
+
}
|
6358 |
+
|
6359 |
+
iteration += 1;
|
6360 |
+
cont -= 1;
|
6361 |
+
i += dir;
|
6362 |
+
}
|
6363 |
+
} else {
|
6364 |
+
cont = this._currentCopies;
|
6365 |
+
i = 0;
|
6366 |
+
dir = 1;
|
6367 |
+
|
6368 |
+
while (cont) {
|
6369 |
+
items = this.elemsData[i].it;
|
6370 |
+
itemsTransform = items[items.length - 1].transform.mProps.v.props;
|
6371 |
+
items[items.length - 1].transform.mProps._mdf = false;
|
6372 |
+
items[items.length - 1].transform.op._mdf = false;
|
6373 |
+
cont -= 1;
|
6374 |
+
i += dir;
|
6375 |
+
}
|
6376 |
+
}
|
6377 |
+
|
6378 |
+
return hasReloaded;
|
6379 |
+
};
|
6380 |
+
|
6381 |
+
RepeaterModifier.prototype.addShape = function () { };
|
6382 |
+
|
6383 |
+
function RoundCornersModifier() { }
|
6384 |
+
|
6385 |
+
extendPrototype([ShapeModifier], RoundCornersModifier);
|
6386 |
+
|
6387 |
+
RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
|
6388 |
+
this.getValue = this.processKeys;
|
6389 |
+
this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
|
6390 |
+
this._isAnimated = !!this.rd.effectsSequence.length;
|
6391 |
+
};
|
6392 |
+
|
6393 |
+
RoundCornersModifier.prototype.processPath = function (path, round) {
|
6394 |
+
var clonedPath = shapePool.newElement();
|
6395 |
+
clonedPath.c = path.c;
|
6396 |
+
var i;
|
6397 |
+
var len = path._length;
|
6398 |
+
var currentV;
|
6399 |
+
var currentI;
|
6400 |
+
var currentO;
|
6401 |
+
var closerV;
|
6402 |
+
var distance;
|
6403 |
+
var newPosPerc;
|
6404 |
+
var index = 0;
|
6405 |
+
var vX;
|
6406 |
+
var vY;
|
6407 |
+
var oX;
|
6408 |
+
var oY;
|
6409 |
+
var iX;
|
6410 |
+
var iY;
|
6411 |
+
|
6412 |
+
for (i = 0; i < len; i += 1) {
|
6413 |
+
currentV = path.v[i];
|
6414 |
+
currentO = path.o[i];
|
6415 |
+
currentI = path.i[i];
|
6416 |
+
|
6417 |
+
if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
|
6418 |
+
if ((i === 0 || i === len - 1) && !path.c) {
|
6419 |
+
clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
|
6420 |
+
/* clonedPath.v[index] = currentV;
|
6421 |
+
clonedPath.o[index] = currentO;
|
6422 |
+
clonedPath.i[index] = currentI; */
|
6423 |
+
|
6424 |
+
index += 1;
|
6425 |
+
} else {
|
6426 |
+
if (i === 0) {
|
6427 |
+
closerV = path.v[len - 1];
|
6428 |
+
} else {
|
6429 |
+
closerV = path.v[i - 1];
|
6430 |
+
}
|
6431 |
+
|
6432 |
+
distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
|
6433 |
+
newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
|
6434 |
+
iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
|
6435 |
+
vX = iX;
|
6436 |
+
iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
|
6437 |
+
vY = iY;
|
6438 |
+
oX = vX - (vX - currentV[0]) * roundCorner;
|
6439 |
+
oY = vY - (vY - currentV[1]) * roundCorner;
|
6440 |
+
clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
|
6441 |
+
index += 1;
|
6442 |
+
|
6443 |
+
if (i === len - 1) {
|
6444 |
+
closerV = path.v[0];
|
6445 |
+
} else {
|
6446 |
+
closerV = path.v[i + 1];
|
6447 |
+
}
|
6448 |
+
|
6449 |
+
distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
|
6450 |
+
newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
|
6451 |
+
oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
|
6452 |
+
vX = oX;
|
6453 |
+
oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
|
6454 |
+
vY = oY;
|
6455 |
+
iX = vX - (vX - currentV[0]) * roundCorner;
|
6456 |
+
iY = vY - (vY - currentV[1]) * roundCorner;
|
6457 |
+
clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
|
6458 |
+
index += 1;
|
6459 |
+
}
|
6460 |
+
} else {
|
6461 |
+
clonedPath.setTripleAt(path.v[i][0], path.v[i][1], path.o[i][0], path.o[i][1], path.i[i][0], path.i[i][1], index);
|
6462 |
+
index += 1;
|
6463 |
+
}
|
6464 |
+
}
|
6465 |
+
|
6466 |
+
return clonedPath;
|
6467 |
+
};
|
6468 |
+
|
6469 |
+
RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
|
6470 |
+
var shapePaths;
|
6471 |
+
var i;
|
6472 |
+
var len = this.shapes.length;
|
6473 |
+
var j;
|
6474 |
+
var jLen;
|
6475 |
+
var rd = this.rd.v;
|
6476 |
+
|
6477 |
+
if (rd !== 0) {
|
6478 |
+
var shapeData;
|
6479 |
+
var localShapeCollection;
|
6480 |
+
|
6481 |
+
for (i = 0; i < len; i += 1) {
|
6482 |
+
shapeData = this.shapes[i];
|
6483 |
+
localShapeCollection = shapeData.localShapeCollection;
|
6484 |
+
|
6485 |
+
if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
|
6486 |
+
localShapeCollection.releaseShapes();
|
6487 |
+
shapeData.shape._mdf = true;
|
6488 |
+
shapePaths = shapeData.shape.paths.shapes;
|
6489 |
+
jLen = shapeData.shape.paths._length;
|
6490 |
+
|
6491 |
+
for (j = 0; j < jLen; j += 1) {
|
6492 |
+
localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
|
6493 |
+
}
|
6494 |
+
}
|
6495 |
+
|
6496 |
+
shapeData.shape.paths = shapeData.localShapeCollection;
|
6497 |
+
}
|
6498 |
+
}
|
6499 |
+
|
6500 |
+
if (!this.dynamicProperties.length) {
|
6501 |
+
this._mdf = false;
|
6502 |
+
}
|
6503 |
+
};
|
6504 |
+
|
6505 |
+
function getFontProperties(fontData) {
|
6506 |
+
var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
|
6507 |
+
var fWeight = 'normal';
|
6508 |
+
var fStyle = 'normal';
|
6509 |
+
var len = styles.length;
|
6510 |
+
var styleName;
|
6511 |
+
|
6512 |
+
for (var i = 0; i < len; i += 1) {
|
6513 |
+
styleName = styles[i].toLowerCase();
|
6514 |
+
|
6515 |
+
switch (styleName) {
|
6516 |
+
case 'italic':
|
6517 |
+
fStyle = 'italic';
|
6518 |
+
break;
|
6519 |
+
|
6520 |
+
case 'bold':
|
6521 |
+
fWeight = '700';
|
6522 |
+
break;
|
6523 |
+
|
6524 |
+
case 'black':
|
6525 |
+
fWeight = '900';
|
6526 |
+
break;
|
6527 |
+
|
6528 |
+
case 'medium':
|
6529 |
+
fWeight = '500';
|
6530 |
+
break;
|
6531 |
+
|
6532 |
+
case 'regular':
|
6533 |
+
case 'normal':
|
6534 |
+
fWeight = '400';
|
6535 |
+
break;
|
6536 |
+
|
6537 |
+
case 'light':
|
6538 |
+
case 'thin':
|
6539 |
+
fWeight = '200';
|
6540 |
+
break;
|
6541 |
+
|
6542 |
+
default:
|
6543 |
+
break;
|
6544 |
+
}
|
6545 |
+
}
|
6546 |
+
|
6547 |
+
return {
|
6548 |
+
style: fStyle,
|
6549 |
+
weight: fontData.fWeight || fWeight
|
6550 |
+
};
|
6551 |
+
}
|
6552 |
+
|
6553 |
+
var FontManager = function () {
|
6554 |
+
var maxWaitingTime = 5000;
|
6555 |
+
var emptyChar = {
|
6556 |
+
w: 0,
|
6557 |
+
size: 0,
|
6558 |
+
shapes: [],
|
6559 |
+
data: {
|
6560 |
+
shapes: []
|
6561 |
+
}
|
6562 |
+
};
|
6563 |
+
var combinedCharacters = []; // Hindi characters
|
6564 |
+
|
6565 |
+
combinedCharacters = combinedCharacters.concat([2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403]);
|
6566 |
+
var surrogateModifiers = ['d83cdffb', 'd83cdffc', 'd83cdffd', 'd83cdffe', 'd83cdfff'];
|
6567 |
+
var zeroWidthJoiner = [65039, 8205];
|
6568 |
+
|
6569 |
+
function trimFontOptions(font) {
|
6570 |
+
var familyArray = font.split(',');
|
6571 |
+
var i;
|
6572 |
+
var len = familyArray.length;
|
6573 |
+
var enabledFamilies = [];
|
6574 |
+
|
6575 |
+
for (i = 0; i < len; i += 1) {
|
6576 |
+
if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
|
6577 |
+
enabledFamilies.push(familyArray[i]);
|
6578 |
+
}
|
6579 |
+
}
|
6580 |
+
|
6581 |
+
return enabledFamilies.join(',');
|
6582 |
+
}
|
6583 |
+
|
6584 |
+
function setUpNode(font, family) {
|
6585 |
+
var parentNode = createTag('span'); // Node is invisible to screen readers.
|
6586 |
+
|
6587 |
+
parentNode.setAttribute('aria-hidden', true);
|
6588 |
+
parentNode.style.fontFamily = family;
|
6589 |
+
var node = createTag('span'); // Characters that vary significantly among different fonts
|
6590 |
+
|
6591 |
+
node.innerText = 'giItT1WQy@!-/#'; // Visible - so we can measure it - but not on the screen
|
6592 |
+
|
6593 |
+
parentNode.style.position = 'absolute';
|
6594 |
+
parentNode.style.left = '-10000px';
|
6595 |
+
parentNode.style.top = '-10000px'; // Large font size makes even subtle changes obvious
|
6596 |
+
|
6597 |
+
parentNode.style.fontSize = '300px'; // Reset any font properties
|
6598 |
+
|
6599 |
+
parentNode.style.fontVariant = 'normal';
|
6600 |
+
parentNode.style.fontStyle = 'normal';
|
6601 |
+
parentNode.style.fontWeight = 'normal';
|
6602 |
+
parentNode.style.letterSpacing = '0';
|
6603 |
+
parentNode.appendChild(node);
|
6604 |
+
document.body.appendChild(parentNode); // Remember width with no applied web font
|
6605 |
+
|
6606 |
+
var width = node.offsetWidth;
|
6607 |
+
node.style.fontFamily = trimFontOptions(font) + ', ' + family;
|
6608 |
+
return {
|
6609 |
+
node: node,
|
6610 |
+
w: width,
|
6611 |
+
parent: parentNode
|
6612 |
+
};
|
6613 |
+
}
|
6614 |
+
|
6615 |
+
function checkLoadedFonts() {
|
6616 |
+
var i;
|
6617 |
+
var len = this.fonts.length;
|
6618 |
+
var node;
|
6619 |
+
var w;
|
6620 |
+
var loadedCount = len;
|
6621 |
+
|
6622 |
+
for (i = 0; i < len; i += 1) {
|
6623 |
+
if (this.fonts[i].loaded) {
|
6624 |
+
loadedCount -= 1;
|
6625 |
+
} else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
|
6626 |
+
this.fonts[i].loaded = true;
|
6627 |
+
} else {
|
6628 |
+
node = this.fonts[i].monoCase.node;
|
6629 |
+
w = this.fonts[i].monoCase.w;
|
6630 |
+
|
6631 |
+
if (node.offsetWidth !== w) {
|
6632 |
+
loadedCount -= 1;
|
6633 |
+
this.fonts[i].loaded = true;
|
6634 |
+
} else {
|
6635 |
+
node = this.fonts[i].sansCase.node;
|
6636 |
+
w = this.fonts[i].sansCase.w;
|
6637 |
+
|
6638 |
+
if (node.offsetWidth !== w) {
|
6639 |
+
loadedCount -= 1;
|
6640 |
+
this.fonts[i].loaded = true;
|
6641 |
+
}
|
6642 |
+
}
|
6643 |
+
|
6644 |
+
if (this.fonts[i].loaded) {
|
6645 |
+
this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
|
6646 |
+
this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
|
6647 |
+
}
|
6648 |
+
}
|
6649 |
+
}
|
6650 |
+
|
6651 |
+
if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
|
6652 |
+
setTimeout(this.checkLoadedFontsBinded, 20);
|
6653 |
+
} else {
|
6654 |
+
setTimeout(this.setIsLoadedBinded, 10);
|
6655 |
+
}
|
6656 |
+
}
|
6657 |
+
|
6658 |
+
function createHelper(fontData, def) {
|
6659 |
+
var engine = document.body && def ? 'svg' : 'canvas';
|
6660 |
+
var helper;
|
6661 |
+
var fontProps = getFontProperties(fontData);
|
6662 |
+
|
6663 |
+
if (engine === 'svg') {
|
6664 |
+
var tHelper = createNS('text');
|
6665 |
+
tHelper.style.fontSize = '100px'; // tHelper.style.fontFamily = fontData.fFamily;
|
6666 |
+
|
6667 |
+
tHelper.setAttribute('font-family', fontData.fFamily);
|
6668 |
+
tHelper.setAttribute('font-style', fontProps.style);
|
6669 |
+
tHelper.setAttribute('font-weight', fontProps.weight);
|
6670 |
+
tHelper.textContent = '1';
|
6671 |
+
|
6672 |
+
if (fontData.fClass) {
|
6673 |
+
tHelper.style.fontFamily = 'inherit';
|
6674 |
+
tHelper.setAttribute('class', fontData.fClass);
|
6675 |
+
} else {
|
6676 |
+
tHelper.style.fontFamily = fontData.fFamily;
|
6677 |
+
}
|
6678 |
+
|
6679 |
+
def.appendChild(tHelper);
|
6680 |
+
helper = tHelper;
|
6681 |
+
} else {
|
6682 |
+
var tCanvasHelper = new OffscreenCanvas(500, 500).getContext('2d');
|
6683 |
+
tCanvasHelper.font = fontProps.style + ' ' + fontProps.weight + ' 100px ' + fontData.fFamily;
|
6684 |
+
helper = tCanvasHelper;
|
6685 |
+
}
|
6686 |
+
|
6687 |
+
function measure(text) {
|
6688 |
+
if (engine === 'svg') {
|
6689 |
+
helper.textContent = text;
|
6690 |
+
return helper.getComputedTextLength();
|
6691 |
+
}
|
6692 |
+
|
6693 |
+
return helper.measureText(text).width;
|
6694 |
+
}
|
6695 |
+
|
6696 |
+
return {
|
6697 |
+
measureText: measure
|
6698 |
+
};
|
6699 |
+
}
|
6700 |
+
|
6701 |
+
function addFonts(fontData, defs) {
|
6702 |
+
if (!fontData) {
|
6703 |
+
this.isLoaded = true;
|
6704 |
+
return;
|
6705 |
+
}
|
6706 |
+
|
6707 |
+
if (this.chars) {
|
6708 |
+
this.isLoaded = true;
|
6709 |
+
this.fonts = fontData.list;
|
6710 |
+
return;
|
6711 |
+
}
|
6712 |
+
|
6713 |
+
if (!document.body) {
|
6714 |
+
this.isLoaded = true;
|
6715 |
+
fontData.list.forEach(function (data) {
|
6716 |
+
data.helper = createHelper(data);
|
6717 |
+
data.cache = {};
|
6718 |
+
});
|
6719 |
+
this.fonts = fontData.list;
|
6720 |
+
return;
|
6721 |
+
}
|
6722 |
+
|
6723 |
+
var fontArr = fontData.list;
|
6724 |
+
var i;
|
6725 |
+
var len = fontArr.length;
|
6726 |
+
var _pendingFonts = len;
|
6727 |
+
|
6728 |
+
for (i = 0; i < len; i += 1) {
|
6729 |
+
var shouldLoadFont = true;
|
6730 |
+
var loadedSelector;
|
6731 |
+
var j;
|
6732 |
+
fontArr[i].loaded = false;
|
6733 |
+
fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
|
6734 |
+
fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
|
6735 |
+
|
6736 |
+
if (!fontArr[i].fPath) {
|
6737 |
+
fontArr[i].loaded = true;
|
6738 |
+
_pendingFonts -= 1;
|
6739 |
+
} else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
|
6740 |
+
loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
|
6741 |
+
|
6742 |
+
if (loadedSelector.length > 0) {
|
6743 |
+
shouldLoadFont = false;
|
6744 |
+
}
|
6745 |
+
|
6746 |
+
if (shouldLoadFont) {
|
6747 |
+
var s = createTag('style');
|
6748 |
+
s.setAttribute('f-forigin', fontArr[i].fOrigin);
|
6749 |
+
s.setAttribute('f-origin', fontArr[i].origin);
|
6750 |
+
s.setAttribute('f-family', fontArr[i].fFamily);
|
6751 |
+
s.type = 'text/css';
|
6752 |
+
s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
|
6753 |
+
defs.appendChild(s);
|
6754 |
+
}
|
6755 |
+
} else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
|
6756 |
+
loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
|
6757 |
+
|
6758 |
+
for (j = 0; j < loadedSelector.length; j += 1) {
|
6759 |
+
if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
|
6760 |
+
// Font is already loaded
|
6761 |
+
shouldLoadFont = false;
|
6762 |
+
}
|
6763 |
+
}
|
6764 |
+
|
6765 |
+
if (shouldLoadFont) {
|
6766 |
+
var l = createTag('link');
|
6767 |
+
l.setAttribute('f-forigin', fontArr[i].fOrigin);
|
6768 |
+
l.setAttribute('f-origin', fontArr[i].origin);
|
6769 |
+
l.type = 'text/css';
|
6770 |
+
l.rel = 'stylesheet';
|
6771 |
+
l.href = fontArr[i].fPath;
|
6772 |
+
document.body.appendChild(l);
|
6773 |
+
}
|
6774 |
+
} else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
|
6775 |
+
loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
|
6776 |
+
|
6777 |
+
for (j = 0; j < loadedSelector.length; j += 1) {
|
6778 |
+
if (fontArr[i].fPath === loadedSelector[j].src) {
|
6779 |
+
// Font is already loaded
|
6780 |
+
shouldLoadFont = false;
|
6781 |
+
}
|
6782 |
+
}
|
6783 |
+
|
6784 |
+
if (shouldLoadFont) {
|
6785 |
+
var sc = createTag('link');
|
6786 |
+
sc.setAttribute('f-forigin', fontArr[i].fOrigin);
|
6787 |
+
sc.setAttribute('f-origin', fontArr[i].origin);
|
6788 |
+
sc.setAttribute('rel', 'stylesheet');
|
6789 |
+
sc.setAttribute('href', fontArr[i].fPath);
|
6790 |
+
defs.appendChild(sc);
|
6791 |
+
}
|
6792 |
+
}
|
6793 |
+
|
6794 |
+
fontArr[i].helper = createHelper(fontArr[i], defs);
|
6795 |
+
fontArr[i].cache = {};
|
6796 |
+
this.fonts.push(fontArr[i]);
|
6797 |
+
}
|
6798 |
+
|
6799 |
+
if (_pendingFonts === 0) {
|
6800 |
+
this.isLoaded = true;
|
6801 |
+
} else {
|
6802 |
+
// On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
|
6803 |
+
// Adding this timeout seems to fix it
|
6804 |
+
setTimeout(this.checkLoadedFonts.bind(this), 100);
|
6805 |
+
}
|
6806 |
+
}
|
6807 |
+
|
6808 |
+
function addChars(chars) {
|
6809 |
+
if (!chars) {
|
6810 |
+
return;
|
6811 |
+
}
|
6812 |
+
|
6813 |
+
if (!this.chars) {
|
6814 |
+
this.chars = [];
|
6815 |
+
}
|
6816 |
+
|
6817 |
+
var i;
|
6818 |
+
var len = chars.length;
|
6819 |
+
var j;
|
6820 |
+
var jLen = this.chars.length;
|
6821 |
+
var found;
|
6822 |
+
|
6823 |
+
for (i = 0; i < len; i += 1) {
|
6824 |
+
j = 0;
|
6825 |
+
found = false;
|
6826 |
+
|
6827 |
+
while (j < jLen) {
|
6828 |
+
if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
|
6829 |
+
found = true;
|
6830 |
+
}
|
6831 |
+
|
6832 |
+
j += 1;
|
6833 |
+
}
|
6834 |
+
|
6835 |
+
if (!found) {
|
6836 |
+
this.chars.push(chars[i]);
|
6837 |
+
jLen += 1;
|
6838 |
+
}
|
6839 |
+
}
|
6840 |
+
}
|
6841 |
+
|
6842 |
+
function getCharData(_char, style, font) {
|
6843 |
+
var i = 0;
|
6844 |
+
var len = this.chars.length;
|
6845 |
+
|
6846 |
+
while (i < len) {
|
6847 |
+
if (this.chars[i].ch === _char && this.chars[i].style === style && this.chars[i].fFamily === font) {
|
6848 |
+
return this.chars[i];
|
6849 |
+
}
|
6850 |
+
|
6851 |
+
i += 1;
|
6852 |
+
}
|
6853 |
+
|
6854 |
+
if ((typeof _char === 'string' && _char.charCodeAt(0) !== 13 || !_char) && console && console.warn // eslint-disable-line no-console
|
6855 |
+
&& !this._warned) {
|
6856 |
+
this._warned = true;
|
6857 |
+
// console.warn('Missing character from exported characters list: ', _char, style, font); // eslint-disable-line no-console
|
6858 |
+
}
|
6859 |
+
|
6860 |
+
return emptyChar;
|
6861 |
+
}
|
6862 |
+
|
6863 |
+
function measureText(_char2, fontName, size) {
|
6864 |
+
var fontData = this.getFontByName(fontName);
|
6865 |
+
|
6866 |
+
var index = _char2.charCodeAt(0);
|
6867 |
+
|
6868 |
+
if (!fontData.cache[index + 1]) {
|
6869 |
+
var tHelper = fontData.helper;
|
6870 |
+
|
6871 |
+
if (_char2 === ' ') {
|
6872 |
+
var doubleSize = tHelper.measureText('|' + _char2 + '|');
|
6873 |
+
var singleSize = tHelper.measureText('||');
|
6874 |
+
fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
|
6875 |
+
} else {
|
6876 |
+
fontData.cache[index + 1] = tHelper.measureText(_char2) / 100;
|
6877 |
+
}
|
6878 |
+
}
|
6879 |
+
|
6880 |
+
return fontData.cache[index + 1] * size;
|
6881 |
+
}
|
6882 |
+
|
6883 |
+
function getFontByName(name) {
|
6884 |
+
var i = 0;
|
6885 |
+
var len = this.fonts.length;
|
6886 |
+
|
6887 |
+
while (i < len) {
|
6888 |
+
if (this.fonts[i].fName === name) {
|
6889 |
+
return this.fonts[i];
|
6890 |
+
}
|
6891 |
+
|
6892 |
+
i += 1;
|
6893 |
+
}
|
6894 |
+
|
6895 |
+
return this.fonts[0];
|
6896 |
+
}
|
6897 |
+
|
6898 |
+
function isModifier(firstCharCode, secondCharCode) {
|
6899 |
+
var sum = firstCharCode.toString(16) + secondCharCode.toString(16);
|
6900 |
+
return surrogateModifiers.indexOf(sum) !== -1;
|
6901 |
+
}
|
6902 |
+
|
6903 |
+
function isZeroWidthJoiner(firstCharCode, secondCharCode) {
|
6904 |
+
if (!secondCharCode) {
|
6905 |
+
return firstCharCode === zeroWidthJoiner[1];
|
6906 |
+
}
|
6907 |
+
|
6908 |
+
return firstCharCode === zeroWidthJoiner[0] && secondCharCode === zeroWidthJoiner[1];
|
6909 |
+
}
|
6910 |
+
|
6911 |
+
function isCombinedCharacter(_char3) {
|
6912 |
+
return combinedCharacters.indexOf(_char3) !== -1;
|
6913 |
+
}
|
6914 |
+
|
6915 |
+
function setIsLoaded() {
|
6916 |
+
this.isLoaded = true;
|
6917 |
+
}
|
6918 |
+
|
6919 |
+
var Font = function Font() {
|
6920 |
+
this.fonts = [];
|
6921 |
+
this.chars = null;
|
6922 |
+
this.typekitLoaded = 0;
|
6923 |
+
this.isLoaded = false;
|
6924 |
+
this._warned = false;
|
6925 |
+
this.initTime = Date.now();
|
6926 |
+
this.setIsLoadedBinded = this.setIsLoaded.bind(this);
|
6927 |
+
this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
|
6928 |
+
};
|
6929 |
+
|
6930 |
+
Font.isModifier = isModifier;
|
6931 |
+
Font.isZeroWidthJoiner = isZeroWidthJoiner;
|
6932 |
+
Font.isCombinedCharacter = isCombinedCharacter;
|
6933 |
+
var fontPrototype = {
|
6934 |
+
addChars: addChars,
|
6935 |
+
addFonts: addFonts,
|
6936 |
+
getCharData: getCharData,
|
6937 |
+
getFontByName: getFontByName,
|
6938 |
+
measureText: measureText,
|
6939 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|