Version Description
- New Widget: Data Table
- Enhancement: Added Typography & Align options to Content Switcher
- Fixed: Filterable Gallery height bug fix
Download this release
Release Info
Developer | wpvibes |
Plugin | Elementor Addon Elements |
Version | 1.11 |
Comparing to | |
See all releases |
Code changes from version 1.10 to 1.11
- assets/css/eae.css +167 -1
- assets/css/eae.min.css +1 -1
- assets/js/eae.js +55 -1
- assets/js/eae.min.js +1 -1
- assets/lib/lottie/lottie.js +14561 -0
- assets/lib/lottie/lottie.min.js +19 -0
- assets/lib/tablesorter/tablesorter.js +441 -0
assets/css/eae.css
CHANGED
@@ -3949,7 +3949,7 @@ article.eae-ct-wrapper {
|
|
3949 |
.eae-ct-wrapper tr:last-child {
|
3950 |
background: none !important;
|
3951 |
}
|
3952 |
-
tbody tr:nth-child(2) {
|
3953 |
background: none !important;
|
3954 |
}
|
3955 |
@media (min-width: 767px) {
|
@@ -5976,9 +5976,175 @@ body.rtl .eae-cs-layout-skin4 input:checked + .eae-content-toggle-switcher:befor
|
|
5976 |
|
5977 |
|
5978 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5979 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5980 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5981 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5982 |
|
5983 |
|
5984 |
|
3949 |
.eae-ct-wrapper tr:last-child {
|
3950 |
background: none !important;
|
3951 |
}
|
3952 |
+
.eae-ct-wrapper tbody tr:nth-child(2) {
|
3953 |
background: none !important;
|
3954 |
}
|
3955 |
@media (min-width: 767px) {
|
5976 |
|
5977 |
|
5978 |
|
5979 |
+
/* Data Table */
|
5980 |
+
.eae-table{
|
5981 |
+
width: 100%;
|
5982 |
+
height: auto;
|
5983 |
+
margin: 0;
|
5984 |
+
padding: 0;
|
5985 |
+
border: none;
|
5986 |
+
border-collapse: collapse;
|
5987 |
+
}
|
5988 |
+
.eae-table tr{
|
5989 |
+
border-style: none;
|
5990 |
+
}
|
5991 |
+
.eae-table__body_row_column{
|
5992 |
+
border: none;
|
5993 |
+
overflow: hidden;
|
5994 |
+
}
|
5995 |
+
.eae-table__head_column{
|
5996 |
+
transition: all .3s ease-in-out;
|
5997 |
+
}
|
5998 |
+
.eae-table__body_row_column{
|
5999 |
+
transition: all .3s ease-in-out;
|
6000 |
+
}
|
6001 |
+
|
6002 |
+
/* thead icon */
|
6003 |
+
.eae-head-icon{
|
6004 |
+
vertical-align: middle;
|
6005 |
+
}
|
6006 |
+
.eae-table__head-column-wrapper .eae-head-img{
|
6007 |
+
width: 50px;
|
6008 |
+
display: inline-block;
|
6009 |
+
}
|
6010 |
+
.eae-table__head-column-wrapper .eae-lottie-animation svg{
|
6011 |
+
width: 70px !important;
|
6012 |
+
line-height: 0;
|
6013 |
+
}
|
6014 |
+
.eae-head-icon-before{
|
6015 |
+
margin-right: 5px;
|
6016 |
+
}
|
6017 |
+
.eae-head-icon-after{
|
6018 |
+
margin-left: 5px;
|
6019 |
+
}
|
6020 |
+
|
6021 |
+
/* tbody icon */
|
6022 |
+
.eae-table__col-inner{
|
6023 |
+
display: block;
|
6024 |
+
}
|
6025 |
+
.eae-body-icon{
|
6026 |
+
vertical-align: middle;
|
6027 |
+
}
|
6028 |
+
.eae-table__body-column-wrapper .eae-body-image{
|
6029 |
+
width: 70px;
|
6030 |
+
display: inline-block;
|
6031 |
+
}
|
6032 |
+
.eae-table__body-column-wrapper .eae-table-lottie-animation svg{
|
6033 |
+
width: 70px !important;
|
6034 |
+
line-height: 0;
|
6035 |
+
}
|
6036 |
+
.eae-body-icon-before{
|
6037 |
+
margin-right: 5px;
|
6038 |
+
}
|
6039 |
+
.eae-body-icon-after{
|
6040 |
+
margin-left: 5px;
|
6041 |
+
}
|
6042 |
+
.eae-table-body__text{
|
6043 |
+
vertical-align: middle;
|
6044 |
+
}
|
6045 |
+
|
6046 |
+
|
6047 |
+
/* Table Search */
|
6048 |
+
.eae-table .eae-table-search-hide{
|
6049 |
+
display: none;
|
6050 |
+
}
|
6051 |
+
.eae-table-search-wrap{
|
6052 |
+
padding: 0;
|
6053 |
+
margin: 0;
|
6054 |
+
margin-bottom: 10px;
|
6055 |
+
}
|
6056 |
+
|
6057 |
+
.eae-search-wrap{
|
6058 |
+
padding: 0;
|
6059 |
+
margin: 0;
|
6060 |
+
width: 50%;
|
6061 |
+
display: inline-flex;
|
6062 |
+
align-items: center;
|
6063 |
+
box-sizing: border-box;
|
6064 |
+
overflow: hidden;
|
6065 |
+
align-items: center;
|
6066 |
+
}
|
6067 |
|
6068 |
+
.eae-table-search-wrap .eae-table-search-field{
|
6069 |
+
margin: 0;
|
6070 |
+
padding: 0;
|
6071 |
+
border: 0;
|
6072 |
+
outline: none;
|
6073 |
+
background-color: #eceeef;
|
6074 |
+
width: 100%;
|
6075 |
+
font-size: 15px;
|
6076 |
+
color: #7A7A7A;
|
6077 |
+
padding: 10px;
|
6078 |
+
line-height: 0;
|
6079 |
+
display: inline-block;
|
6080 |
+
box-sizing: border-box;
|
6081 |
+
}
|
6082 |
|
6083 |
+
.eae-table-search-wrap .eae-table-search-field:focus{
|
6084 |
+
background-color: #eceeef;
|
6085 |
+
}
|
6086 |
+
::placeholder{
|
6087 |
+
opacity: 0.5;
|
6088 |
+
}
|
6089 |
+
.search-icon{
|
6090 |
+
background-color: #eceeef;
|
6091 |
+
padding: 0;
|
6092 |
+
margin: 0;
|
6093 |
+
padding: 10px;
|
6094 |
+
}
|
6095 |
+
.search-icon i{
|
6096 |
+
color: #7A7A7A73;
|
6097 |
+
display: flex;
|
6098 |
+
align-items: center;
|
6099 |
+
left: 0px;
|
6100 |
+
font-size: 20px;
|
6101 |
+
}
|
6102 |
|
6103 |
+
/* Sorting icon */
|
6104 |
+
.eae-table__sortable .eae-table__sortable-head{
|
6105 |
+
cursor: pointer;
|
6106 |
+
}
|
6107 |
+
|
6108 |
+
.eae-table__head__wrapper{
|
6109 |
+
display: flex;
|
6110 |
+
justify-content: center;
|
6111 |
+
align-items: center;
|
6112 |
+
}
|
6113 |
+
|
6114 |
+
.eae-sort-icon{
|
6115 |
+
padding: 0;
|
6116 |
+
margin: 0;
|
6117 |
+
align-self: center;
|
6118 |
+
}
|
6119 |
+
.eae-table__head-column-wrapper{
|
6120 |
+
flex-grow: 3;
|
6121 |
+
display: inline-block;
|
6122 |
+
width: 100%;
|
6123 |
+
}
|
6124 |
+
.eae-icon-sort-icon{
|
6125 |
+
vertical-align: middle;
|
6126 |
+
display: inline-block;
|
6127 |
+
}
|
6128 |
+
.eae-icon{
|
6129 |
+
padding: 0;
|
6130 |
+
margin: 0;
|
6131 |
+
}
|
6132 |
+
.eae-table__head__wrapper .eae-sort-icon .eae-icon{
|
6133 |
+
font-size: 25px;
|
6134 |
+
}
|
6135 |
+
|
6136 |
+
.eae-table__sortable .eae-table__head__wrapper .eae-sort-icon-down,
|
6137 |
+
.eae-table__sortable .eae-table__head__wrapper .eae-sort-icon-up{
|
6138 |
+
display: none;
|
6139 |
+
}
|
6140 |
+
.eae-table__sortable .eae-table__sort-Desc .eae-table__head__wrapper .eae-icon-sort-icon,
|
6141 |
+
.eae-table__sortable .eae-table__sort-Asc .eae-table__head__wrapper .eae-icon-sort-icon{
|
6142 |
+
display: none;
|
6143 |
+
}
|
6144 |
+
.eae-table__sortable .eae-table__sort-Desc .eae-table__head__wrapper .eae-sort-icon-down,
|
6145 |
+
.eae-table__sortable .eae-table__sort-Asc .eae-table__head__wrapper .eae-sort-icon-up{
|
6146 |
+
display: block;
|
6147 |
+
}
|
6148 |
|
6149 |
|
6150 |
|
assets/css/eae.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.elementor-widget-wts-textseparator .elementor-widget-container{overflow:hidden}.wts-eae-textseparator{align-items:center;display:flex;flex-flow:row nowrap;margin:auto}body.rtl .wts-eae-textseparator{flex-direction:row-reverse}.eae-separator-icon-inner i{height:1em;width:1em;text-align:center;position:relative;display:block}.eae-separator-icon-inner i:before{position:absolute;left:50%;-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-o-transform:translateX(-50%);transform:translateX(-50%)}.wts-eae-textseparator .eae-sep-holder{flex:1 1 auto;height:1px;min-width:10%;position:relative}.wts-eae-textseparator .eae-sep-holder .eae-sep-lines{border-top-width:1px;display:block;height:1px;position:relative;top:1px;width:100%}.eae-separator-title{margin:0;-moz-box-flex:0;flex:0 1 auto;line-height:1em;margin:0;overflow-wrap:break-word}.sep-align-right .sep-right{display:none}.sep-align-left .sep-left{display:none}.eae-icon-view-stacked i{color:#fff}.eae-icon-view-framed .eae-separator-icon-inner{border:1px solid}.eae-icon-shape-circle .eae-separator-icon-inner{border-radius:50%}.eae-separator-icon-wrapper,.eae-separator-title{margin:0 5px!important}.eae-separator-icon-inner{line-height:1}.wts-price-box-wrapper .eae-pt-heading,.wts-price-box-wrapper .eae-pt-sub-heading{margin:5px 0;text-align:center}.plan-price-shape{display:table;height:6em;margin:auto;width:6em}.eae-pt-price-box-shape-circle .plan-price-shape,.eae-pt-price-box-shape-square .plan-price-shape{border:1px solid}.eae-pt-price-box-shape-circle .plan-price-shape{border-radius:50%}.plan-price-block{padding:10px 0}.plan-price-shape-inner{display:table-cell;vertical-align:middle;padding:10px}.plan-price-shape-inner>span{display:block;font-size:1em;text-align:center}.eae-pt-feature-list{list-style:outside none none;text-align:center;margin:10px 0}.eae-pt-button-wrapper>a{text-align:center;display:inline-block;line-height:1}.eae-pt-button-wrapper{text-align:center}.wts-price-box-wrapper .heading-wrapper,.wts-price-box-wrapper .plan-features-wrapper{padding:10px 5px}.eae-pt-button-wrapper{padding:15px 0}.eae-pt-button-wrapper a{padding:5px 15px;border-radius:3px}.eae-pt-align-icon-right{float:right}.strike-feature{text-decoration:line-through}.eae-flip-box{width:100%;text-align:center}.eae-flip-box-wrapper{display:inline-block;width:100%}.eae-flip-box-inner{width:100%;height:200px;position:relative;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;-ms-transform-style:preserve-3d;transform-style:preserve-3d}.eae-flip-box-inner .eae-flip-box-back,.eae-flip-box-inner .eae-flip-box-front{width:100%;height:100%;position:absolute;top:0;left:0;text-align:center;padding:10px;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:all .6s ease 0s;-moz-transition:all .6s ease 0s;-ms-transition:all .6s ease 0s;-o-transition:all .6s ease 0s;transition:all .6s ease 0s}.eae-flip-box-front{z-index:2}.eae-flip-box-back{z-index:1}.eae-fb-animate-vertical .eae-flip-box-inner .eae-flip-box-front{-webkit-transform:perspective(1000px) rotateX(0);-ms-transform:perspective(1000px) rotateX(0);transform:perspective(1000px) rotateX(0)}.eae-fb-animate-vertical .eae-flip-box-inner .eae-flip-box-back{-webkit-transform:perspective(1000px) rotateX(180deg);transform:perspective(1000px) rotateX(180deg);-ms-transform:perspective(1000px) rotateX(180deg)}.eae-fb-animate-vertical .eae-flip-box-inner:hover .eae-flip-box-front{-webkit-transform:perspective(1000px) rotateX(180deg);transform:perspective(1000px) rotateX(180deg);-ms-transform:perspective(1000px) rotateX(180deg)}.eae-fb-animate-vertical .eae-flip-box-inner:hover .eae-flip-box-back{-webkit-transform:perspective(1000px) rotateX(0);transform:perspective(1000px) rotateX(0);-ms-transform:perspective(1000px) rotateX(0)}.eae-fb-animate-horizontal .eae-flip-box-inner .eae-flip-box-front{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0);-ms-transform:perspective(1000px) rotateY(0)}.eae-fb-animate-horizontal .eae-flip-box-inner .eae-flip-box-back{-webkit-transform:perspective(1000px) rotateY(180deg);transform:perspective(1000px) rotateY(180deg);-ms-transform:perspective(1000px) rotateY(180deg)}.eae-fb-animate-horizontal .eae-flip-box-inner:hover .eae-flip-box-front{-webkit-transform:perspective(1000px) rotateY(180deg);transform:perspective(1000px) rotateY(180deg);-ms-transform:perspective(1000px) rotateY(180deg)}.eae-fb-animate-horizontal .eae-flip-box-inner:hover .eae-flip-box-back{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0);-ms-transform:perspective(1000px) rotateY(0)}.eae-fb-animate-fade .eae-flip-box-inner .eae-flip-box-front{opacity:1}.eae-fb-animate-fade .eae-flip-box-inner .eae-flip-box-back{opacity:0}.eae-fb-animate-fade .eae-flip-box-inner:hover .eae-flip-box-front{opacity:0}.eae-fb-animate-fade .eae-flip-box-inner:hover .eae-flip-box-back{opacity:1}.eae-flip-box-wrapper:focus .eae-flip-box-back,.eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:2}.eae-flip-box-wrapper:focus .eae-flip-box-front,.eae-flip-box-wrapper:hover .eae-flip-box-front{z-index:1}.fade .eae-flip-box-wrapper .eae-flip-box-front{opacity:1;transition:1s}.fade .eae-flip-box-wrapper .eae-flip-box-back{opacity:0;transition:1s}.fade .eae-flip-box-wrapper:focus .eae-flip-box-front,.fade .eae-flip-box-wrapper:hover .eae-flip-box-front{opacity:0}.fade .eae-flip-box-wrapper:focus .eae-flip-box-back,.fade .eae-flip-box-wrapper:hover .eae-flip-box-back{opacity:1}.eae-fb-animate-flip .eae-flip-box-wrapper{perspective:800px}.eae-fb-animate-flip .eae-flip-box-inner{transform-style:preserve-3d;transform:rotateX(0) rotateY(0) rotateZ(0);transition:1s}.eae-fb-animate-flip .eae-flip-box-front{transform:translate3d(0,0,1px)}.eae-fb-animate-flip .eae-flip-box-back{transform:rotateY(180deg) translate3d(0,0,0)}.eae-fb-animate-flip .eae-flip-box-wrapper:focus .eae-flip-box-inner,.eae-fb-animate-flip .eae-flip-box-wrapper:hover .eae-flip-box-inner{transform:rotateY(180deg)}.up .eae-flip-box-front{transform:translate3d(0,0,1px)}.up .eae-flip-box-back{transform:rotateX(180deg) translate3d(0,0,0)}.up .eae-flip-box-wrapper:focus .eae-flip-box-inner,.up .eae-flip-box-wrapper:hover .eae-flip-box-inner{transform:rotateX(180deg)}.box .eae-flip-box-front{transform:translate3d(0,0,100px) scale(.85,.85)}.box .eae-flip-box-back{transform:rotateY(180deg) translate3d(0,0,100px) scale(.85,.85)}.box.up .eae-flip-box-back{transform:rotateX(180deg) translate3d(0,0,100px) scale(.85,.85)}.hideback .eae-flip-box-back,.hideback .eae-flip-box-front{backface-visibility:hidden}.eae-fb-animate-nananana .eae-flip-box-wrapper:focus .eae-flip-box-front,.eae-fb-animate-nananana .eae-flip-box-wrapper:hover .eae-flip-box-front{z-index:10;animation:batman 1s 2 alternate linear}.eae-fb-animate-flipcard .eae-flip-box-back,.eae-fb-animate-flipcard .eae-flip-box-front{transition:transform .4s ease;transform-origin:center center -150px;-webkit-transform-origin:center center -150px}.flipcard-rotate-top-down .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-top-down .eae-flip-box-back{transform:perspective(0) rotateX(90deg) rotateY(0) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-top-down .eae-flip-box-wrapper:hover .eae-flip-box-front{transform:perspective(0) rotateX(-90deg) rotateY(0) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-top-down .eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:99999;transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-down-top .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-down-top .eae-flip-box-back{transform:perspective(0) rotateX(-90deg) rotateY(0) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-down-top .eae-flip-box-wrapper:hover .eae-flip-box-front{transform:perspective(0) rotateX(90deg) rotateY(0) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-down-top .eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:99999;transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-left-right .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-left-right .eae-flip-box-back{transform:perspective(0) rotateX(0) rotateY(-90deg) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-left-right .eae-flip-box-wrapper:hover .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(90deg) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-left-right .eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:99999;transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-right-left .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-right-left .eae-flip-box-back{transform:perspective(0) rotateX(0) rotateY(90deg) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-right-left .eae-flip-box-wrapper:hover .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(-90deg) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-right-left .eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:99999;transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}@keyframes batman{0%{transform:scale(1,1) rotateZ(0)}100%{transform:scale(0,0) rotateZ(720deg);opacity:0}}.eae-flip-box-back i,.eae-flip-box-front i{font-size:32px;height:1em;width:1em;position:relative;display:block}.eae-flip-box-back i:before,.eae-flip-box-front i:before{position:absolute;left:50%;-webkit-transform:translate(-50%);-moz-transform:translate(-50%);-ms-transform:translate(-50%);-o-transform:translate(-50%);transform:translate(-50%)}.eae-fb-icon-view-framed{border:1px solid #92be43}.eae-fb-icon-shape-circle{border-radius:50%}.eae-flip-box-wrapper .icon-wrapper{display:inline-block;padding:10px;line-height:1}.eae-flip-box-wrapper .back-icon-title,.eae-flip-box-wrapper .front-icon-title{margin:10px auto;color:#fff}.eae-flip-box-wrapper .flipbox-content{display:block;position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%)}.flipbox-content p{margin-bottom:10px}.eae-fb-button{display:inline-block;padding:5px 10px}.eae-flip-box-front{background:#a0ce4e}.eae-flip-box-back{background:#73b9dc}@media only screen and (max-width:768px){.eae-flip-box-back,.eae-flip-box-front,.flipbox-content{cursor:pointer;overflow:visible!important;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}}.elementor-widget-wts-shape-separator svg{display:block}.wts-eae-pl-wrapper ul{margin:0}.wts-eae-pl-wrapper ul li{list-style:none;overflow:hidden;margin-bottom:10px}.eae-pl-img-align-none .eae-pl-image-wrapper a{text-align:center}.eae-pl-title{margin:0}.eae-pl-title a{display:block}.eae-pl-readmore a{display:inline-block;border-radius:2px;color:#fff;padding:4px 8px}.eae-at-animation-text-wrapper{display:inline-block;position:relative;text-align:left}.eae-at-animation-text-wrapper .eae-at-animation-text{display:inline-block;position:absolute;white-space:nowrap;left:0;top:0}[data-elementor-device-mode=mobile] .eae-at-animation-text{white-space:normal}.eae-at-animation-text-wrapper .eae-at-animation-text.is-visible{position:relative}.no-js .eae-at-animation-text-wrapper .eae-at-animation-text{opacity:0}.no-js .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible{opacity:1}.eae-animtext-wrapper{font-size:40px}.eae-st-rest-text{display:inline-block}.eae-st-split-text{display:inline-block}body.rtl .eae-st-transform-text-title{display:flex;flex-direction:row-reverse}body.rtl .eae-text-align-left .eae-st-transform-text-title{justify-content:flex-start}body.rtl .eae-text-align-right .eae-st-transform-text-title{justify-content:flex-end}body.rtl .eae-text-align-center .eae-st-transform-text-title{justify-content:center}.eae-at-animation.type .eae-at-animation-text-wrapper{vertical-align:bottom;overflow:hidden}.eae-at-animation.type .eae-at-animation-text-wrapper::after{content:"";position:absolute;right:0;top:50%;bottom:auto;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);height:90%;width:1px}.eae-at-animation.type .eae-at-animation-text-wrapper.waiting::after{-webkit-animation:cd-pulse 1s infinite;-moz-animation:cd-pulse 1s infinite;animation:cd-pulse 1s infinite}.eae-at-animation.type .eae-at-animation-text-wrapper.selected::after{visibility:hidden}.eae-at-animation.type .eae-at-animation-text{visibility:hidden}.eae-at-animation.type .eae-at-animation-text.is-visible{visibility:visible}.eae-at-animation.type i{position:absolute;visibility:hidden}.eae-at-animation.type i.in{position:relative;visibility:visible}@-webkit-keyframes cd-pulse{0%{-webkit-transform:translateY(-50%) scale(1);opacity:1}40%{-webkit-transform:translateY(-50%) scale(.9);opacity:0}100%{-webkit-transform:translateY(-50%) scale(0);opacity:0}}@-moz-keyframes cd-pulse{0%{-moz-transform:translateY(-50%) scale(1);opacity:1}40%{-moz-transform:translateY(-50%) scale(.9);opacity:0}100%{-moz-transform:translateY(-50%) scale(0);opacity:0}}@keyframes cd-pulse{0%{-webkit-transform:translateY(-50%) scale(1);-moz-transform:translateY(-50%) scale(1);-ms-transform:translateY(-50%) scale(1);-o-transform:translateY(-50%) scale(1);transform:translateY(-50%) scale(1);opacity:1}40%{-webkit-transform:translateY(-50%) scale(.9);-moz-transform:translateY(-50%) scale(.9);-ms-transform:translateY(-50%) scale(.9);-o-transform:translateY(-50%) scale(.9);transform:translateY(-50%) scale(.9);opacity:0}100%{-webkit-transform:translateY(-50%) scale(0);-moz-transform:translateY(-50%) scale(0);-ms-transform:translateY(-50%) scale(0);-o-transform:translateY(-50%) scale(0);transform:translateY(-50%) scale(0);opacity:0}}.eae-img-comp-container{width:100%;position:relative;text-align:center}.eae-img-comp-container img{vertical-align:middle}.eae-img-comp-img{position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;transform:translateZ(0);backface-visibility:hidden}.eae-img-comp-img img{display:block;max-width:100%;width:100%}.eae-img-comp-slider{position:absolute;z-index:9;width:40px;height:40px;background-color:#2196f3;opacity:1;border-radius:50%}.icon-horizontal{cursor:ew-resize}.icon-vertical{cursor:n-resize}.mode-horizontal .eae-img-comp-overlay img{position:absolute;left:0;top:0;display:block;width:auto;height:100%!important;max-width:none!important}.mode-vertical .eae-img-comp-overlay img{position:absolute;left:0;top:0;display:block;width:100%;height:auto!important;max-width:none!important}.eae-img-comp-slider svg,.eae-slider-icon{top:50%;transform:translateY(-50%) translateX(-50%);position:absolute;left:50%;color:#fff}.elementor-widget-wts-ab-image{text-align:center}.elementor-widget-wts-ab-image .elementor-widget-container{display:inline-block;margin:0 auto!important;overflow:hidden}.eae-text-before{position:absolute!important;padding:10px;transition:transform .3s .7s,opacity .3s .7s;color:#d36118;z-index:0;background:rgba(255,255,255,.5);margin:20px}.eae-text-after{position:absolute!important;padding:10px;transition:transform .3s .7s,opacity .3s .7s;color:#d36118;z-index:0;background:rgba(255,255,255,.5);margin:20px}.divTest{display:inline-block;background-color:#00a0d2;padding:20px}.eae-particle-wrapper{position:absolute;left:0;top:0}.eae-particle-wrapper.eae-particle-area{width:100%;height:100%}body:not(.elementor-editor-active) .eae-particle-wrapper{width:100%;height:100%}body:not(.elementor-editor-active) .eae-particle-wrapper .particles-js-canvas-el{height:100%;position:absolute;z-index:0}.eae-section-bs{position:absolute;width:100%;height:100%;top:0}.eae-section-bs-inner{width:100%;height:100%!important}.eae-popup.mfp-bg{top:0;left:0;width:100%;height:100%;z-index:1042;overflow:hidden;position:fixed;background:#0b0b0b;opacity:.8}.eae-popup-link{padding:12px 24px;color:#fff;display:inline-flex;line-height:1}.eae-popup-link svg{fill:#fff}.eae-popup-link:hover{color:#fff}.eae-popup.mfp-wrap{top:0;left:0;width:100%;height:100%;z-index:1043;position:fixed;outline:0!important;-webkit-backface-visibility:hidden}.eae-popup .mfp-container{text-align:center;position:absolute;width:100%;height:100%;left:0;top:0;padding:0 8px;box-sizing:border-box}.eae-popup .mfp-container:before{content:"";display:inline-block;height:100%;vertical-align:middle}.eae-popup .mfp-align-top .mfp-container:before{display:none}.eae-popup .mfp-content{position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:1045}.eae-modal-content{padding:20px}.eae-pop-btn-align-left .eae-popup-wrapper{text-align:left}.eae-pop-btn-align-right .eae-popup-wrapper{text-align:right}.eae-pop-btn-align-center .eae-popup-wrapper{text-align:center}.eae-pop-btn-align-justify .eae-popup-wrapper{text-align:center}.eae-pop-btn-align-justify .eae-popup-wrapper a{display:block}.eae-popup .mfp-ajax-holder .mfp-content,.eae-popup .mfp-inline-holder .mfp-content{width:50%;background-color:#fff;cursor:auto;overflow:hidden}.eae-popup .mfp-ajax-cur{cursor:progress}.eae-popup .mfp-zoom-out-cur,.eae-popup .mfp-zoom-out-cur .mfp-image-holder .eae-close{cursor:-moz-zoom-out;cursor:-webkit-zoom-out;cursor:zoom-out}.eae-popup .mfp-zoom{cursor:pointer;cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.eae-popup.mfp-auto-cursor .mfp-content{cursor:auto}.eae-popup .eae-close,.eae-popup .mfp-arrow,.eae-popup .mfp-counter,.eae-popup .mfp-preloader{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none!important}.eae-popup .mfp-preloader{color:#ccc;position:absolute;top:50%;width:auto;text-align:center;margin-top:-.8em;left:8px;right:8px;z-index:1044}.eae-popup .mfp-preloader a{color:#ccc}.eae-popup .mfp-preloader a:hover{color:#fff}.mfp-s-ready .mfp-preloader{display:none}.mfp-s-error .mfp-content{display:none}button.eae-close,button.mfp-arrow{overflow:visible;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;display:block;outline:0;padding:0;z-index:1046;box-shadow:none;touch-action:manipulation}button::-moz-focus-inner{padding:0;border:0}.eae-popup .eae-close{width:28px;height:28px;line-height:1em;position:absolute;right:10px;top:10px;text-decoration:none;text-align:center;opacity:1;color:#fff;font-size:28px;z-index:1500}.eae-close:focus,.eae-close:hover{opacity:1;cursor:pointer}.eae-close:active{top:1px}.eae-close:before{top:50%;left:50%;position:absolute;transform:translate(-50%,-50%)}.eae-popup.eae-close-btn-in .eae-close{color:#fff}.mfp-iframe-holder .eae-close,.mfp-image-holder .eae-close{color:#fff;right:-6px;text-align:right;padding-right:6px;width:100%}.mfp-counter{position:absolute;top:0;right:0;color:#ccc;font-size:12px;line-height:18px;white-space:nowrap}.mfp-arrow{position:absolute;opacity:.65;margin:0;top:50%;margin-top:-55px;padding:0;width:90px;height:110px;-webkit-tap-highlight-color:transparent}.mfp-arrow:active{margin-top:-54px}.mfp-arrow:focus,.mfp-arrow:hover{opacity:1}.mfp-arrow:after,.mfp-arrow:before{content:"";display:block;width:0;height:0;position:absolute;left:0;top:0;margin-top:35px;margin-left:35px;border:medium inset transparent}.mfp-arrow:after{border-top-width:13px;border-bottom-width:13px;top:8px}.mfp-arrow:before{border-top-width:21px;border-bottom-width:21px;opacity:.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after{border-right:17px solid #fff;margin-left:31px}.mfp-arrow-left:before{margin-left:25px;border-right:27px solid #3f3f3f}.mfp-arrow-right{right:0}.mfp-arrow-right:after{border-left:17px solid #fff;margin-left:39px}.mfp-arrow-right:before{border-left:27px solid #3f3f3f}.mfp-iframe-holder{padding-top:40px;padding-bottom:40px}.mfp-iframe-holder .mfp-content{line-height:0;width:100%;max-width:900px}.mfp-iframe-holder .eae-close{top:-40px}.mfp-iframe-scaler{width:100%;height:0;overflow:hidden;padding-top:56.25%}.mfp-iframe-scaler iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;box-shadow:0 0 8px rgba(0,0,0,.6);background:#000}img.mfp-img{width:auto;max-width:100%;height:auto;display:block;line-height:0;box-sizing:border-box;padding:40px 0 40px;margin:0 auto}.eae-popup .mfp-figure{line-height:0}.eae-popup .mfp-figure:after{content:"";position:absolute;left:0;top:40px;bottom:40px;display:block;right:0;width:auto;height:auto;z-index:-1;box-shadow:0 0 8px rgba(0,0,0,.6);background:#444}.eae-popup .mfp-figure small{color:#bdbdbd;display:block;font-size:12px;line-height:14px}.eae-popup .mfp-figure figure{margin:0}.eae-popup .mfp-bottom-bar{margin-top:-36px;position:absolute;top:100%;left:0;width:100%;cursor:auto}.eae-popup .mfp-title{text-align:left;line-height:1;word-wrap:break-word;color:#fff;background-color:#4054b2;padding:20px 20px 20px 20px}.eae-popup .mfp-image-holder .mfp-content{max-width:100%}.eae-popup .mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-width:800px) and (orientation:landscape),screen and (max-height:300px){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{top:0;bottom:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:rgba(0,0,0,.6);bottom:0;margin:0;top:auto;padding:3px 5px;position:fixed;box-sizing:border-box}.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .eae-close{top:0;right:0;width:35px;height:35px;line-height:35px;background:rgba(0,0,0,.6);position:fixed;text-align:center;padding:0}}.elementor-element.eae-animated-gradient-yes,.elementor-element.eae-animated-gradient-yes .animated-gradient{background-size:400% 400%!important;-webkit-animation:AnimateGradient 15s ease-in-out infinite;-moz-animation:AnimateGradient 15s ease-in-out infinite;animation:AnimateGradient 15s ease-in-out infinite}.animated-gradient{position:absolute;top:0;left:0;height:100%;width:100%}@-webkit-keyframes AnimateGradient{0%{background-position:0 50%}50%{background-position:100% 50%}100%{background-position:0 50%}}@-moz-keyframes AnimateGradient{0%{background-position:0 50%}50%{background-position:100% 50%}100%{background-position:0 50%}}@keyframes AnimateGradient{0%{background-position:0 50%}50%{background-position:100% 50%}100%{background-position:0 50%}}.eae-swiper-outer-wrapper .swiper-slide{height:auto;overflow:inherit}.eae-swiper-outer-wrapper .swiper-slide-wrapper,.eae-swiper-outer-wrapper .testimonial-wrapper{height:100%}.eae-grid{display:flex;flex-wrap:wrap;flex-direction:row}.eae-masonry- .eae-grid-item{position:relative;height:100%}.eae-masonry- .eae-grid-item .testimonial-wrapper{height:100%}.eae-grid-container{transition:.1s all ease}.eae-grid-container{display:inline-block}.wrapper .content{margin:10px 0}.skin-2.testimonial-wrapper{display:flex;flex-direction:column;background-color:#9c989821;min-height:300px;padding:10px 20px;box-shadow:0 0 5px rgba(0,0,0,.15);color:#696969}.skin-2 .content-wrapper{padding:10px;position:relative;background-color:#fff;border-radius:10px;color:#77778e}.skin-2 i.after-content,.skin-2 i.before-content{position:absolute}.skin-2 i.before-content{top:10px;left:20px}.skin-2 i.after-content{bottom:10px;right:20px}.skin-2 blockquote{position:relative;font-size:14px;padding:10px;font-weight:500;text-align:left;margin:0;line-height:1.6em;font-style:italic}.skin-2 blockquote::after,.skin-2 blockquote::before{font-family:FontAwesome;content:"\201C";position:absolute;font-size:50px;opacity:.3;font-style:normal}.skin-2 blockquote::before{top:10px;left:20px}.skin-2 blockquote::after{content:"\201D";right:20px}.skin-2 .image-wrapper{position:relative;max-width:100%;text-align:center}.skin-2 img{width:100px;border-radius:25%}.skin-2 .detail-wrapper{text-align:center}.skin-2 .company,.skin-2 .designation,.skin-2 .rating-wrapper,.skin-2 .title{padding:5px 0}.skin-2 .rating-wrapper{color:navy}.skin-2 .title{font-weight:800;color:#000}.skin-2 blockquote p{margin:10px 0!important}.skin-1.testimonial-wrapper{display:flex;flex-direction:column;background-color:#fff;box-shadow:0 0 5px rgba(0,0,0,.15);color:#000}.skin-1 .content-wrapper{order:0}.skin-1 .image-wrapper{order:1;text-align:center;margin:15px 0}.skin-1 .detail-wrapper{order:2}.skin-1 .content-wrapper{padding:10px;position:relative}.skin-1 i.after-content,.skin-1 i.before-content{position:absolute}.skin-1 i.before-content{top:10px;left:20px}.skin-1 i.after-content{bottom:10px;right:20px}.skin-1 blockquote{position:relative;background-color:#fff;font-size:14px;padding:10px;font-weight:500;text-align:left;margin:0;line-height:1.6em;font-style:italic}.skin-1 blockquote::after,.skin-1 blockquote::before{font-family:FontAwesome;content:"\201C";position:absolute;font-size:50px;opacity:.3;font-style:normal}.skin-1 blockquote::before{top:10px;left:20px}.skin-1 blockquote::after{content:"\201D";right:20px}.skin-1 .image-wrapper{position:relative;max-width:100%}.skin-1 img{width:100px;height:auto;border-radius:50%}.skin-1 .detail-wrapper{display:flex;flex-direction:row-reverse;justify-content:space-between;padding:10px;background-color:rgba(157,163,156,.18)}.skin-1 .designation,.skin-1 .rating-wrapper,.skin-1 .title{margin:0 5px}.skin-1 .title-wrapper{display:flex;flex-direction:row}.skin-1 .rating-wrapper{color:#fecc1f}.skin-4.testimonial-wrapper{flex-direction:column;display:flex;background-color:#bfbfb6bd;min-height:300px;padding:10px 0;box-shadow:0 0 5px rgba(0,0,0,.15);color:#77778e}.skin-4 .content-wrapper{padding:10px;position:relative}.skin-4 .content-wrapper{order:2;color:#3c3c3c}.skin-4 i.after-content,.skin-4 i.before-content{position:absolute}.skin-4 i.before-content{top:10px;left:20px}.skin-4 i.after-content{bottom:10px;right:20px}.skin-4 blockquote{position:relative;font-size:14px;padding:10px;font-weight:500;text-align:left;margin:0;line-height:1.6em;font-style:italic}.skin-4 blockquote::after,.skin-4 blockquote::before{font-family:FontAwesome;content:"\201C";position:absolute;font-size:50px;opacity:.3;font-style:normal}.skin-4 blockquote::before{top:10px;left:20px}.skin-4 blockquote::after{content:"\201D";right:20px}.skin-4 .image-wrapper{position:relative;max-width:100%;text-align:center}.skin-4 img{width:100px;border-radius:50%}.skin-4 .detail-wrapper{text-align:center}.skin-2 .designation,.skin-2 .title,.skin-4 .rating-wrapper{padding:5px 0}.skin-4 .rating-wrapper{color:#690a69}.skin-4 .title{font-weight:800;color:#000}.skin-3.testimonial-wrapper{display:flex;flex-direction:row;background-color:#9c989821;box-shadow:0 0 5px rgba(0,0,0,.15);color:#000;overflow:hidden}.skin-3 .content-section{display:flex;flex-direction:column;align-self:center}.skin-3 .content-wrapper{padding:10px;position:relative}.skin-2 i.after-content,.skin-3 i.before-content{position:absolute}.skin-3 i.before-content{top:10px;left:20px}.skin-3 i.after-content{bottom:10px;right:20px}.skin-3 blockquote{position:relative;font-size:18px;padding:10px;font-weight:500;text-align:left;margin:0;line-height:1.6em;font-style:italic}.skin-3 blockquote::after,.skin-3 blockquote::before{font-family:FontAwesome;content:"\201C";position:absolute;font-size:50px;opacity:.3;font-style:normal}.skin-3 blockquote::before{top:10px;left:20px}.skin-3 blockquote::after{content:"\201D";right:20px}.skin-3 .image-wrapper{position:relative;max-width:30%;max-height:250px;text-align:center;align-self:center}.skin-3 img{width:100%}.testimonial-wrapper .skin-3 .eae-person-avatar{border-radius:50%}.skin-3 .detail-wrapper{text-align:left;padding-left:20px}.skin-3 .designation,.skin-3 .rating-wrapper,.skin-3 .title{padding:3px 0}.skin-3 .rating-wrapper{color:#800040}.skin-3 .title{font-weight:800}.eae-swiper-outer-wrapper .swiper-button-prev{-webkit-mask:url(arrow-left.svg) no-repeat 100% 100%;mask:url(arrow-left.svg) no-repeat 100% 100%;-webkit-mask-size:cover;mask-size:cover;background-image:none;background-color:#007aff;transform:translateY(-50%);margin-top:0}.eae-swiper-outer-wrapper .swiper-container-rtl .swiper-button-prev{-webkit-mask:url(arrow-right.svg) no-repeat 100% 100%;mask:url(arrow-right.svg) no-repeat 100% 100%}.eae-swiper-outer-wrapper .swiper-button-next{-webkit-mask:url(arrow-right.svg) no-repeat 100% 100%;mask:url(arrow-right.svg) no-repeat 100% 100%;-webkit-mask-size:cover;mask-size:cover;background-image:none;background-color:#007aff;transform:translateY(-50%);margin-top:0}.eae-swiper-outer-wrapper .swiper-container-rtl .swiper-button-next{-webkit-mask:url(arrow-left.svg) no-repeat 100% 100%;mask:url(arrow-left.svg) no-repeat 100% 100%}.elementor-widget-wts-testimonial-slider .eae-swiper-outer-wrapper .swiper-button-next,.elementor-widget-wts-testimonial-slider .eae-swiper-outer-wrapper .swiper-button-prev{-webkit-mask:none;mask:none;-webkit-mask-size:unset;mask-size:unset;background-image:none;background-color:unset;width:auto;height:auto;transform:translateY(-50%);margin-top:0}.swiper-container .swiper-button-next i,.swiper-container .swiper-button-prev i{width:1em;height:1em;text-align:center;position:relative}.elementor-widget-wts-testimonial-slider .eae-swiper-outer-wrapper .eae-swiper-button-wrapper{position:absolute;height:auto;line-height:0}.eae-hpos-right.eae-vpos-top .eae-swiper-button-wrapper{bottom:auto;top:0;width:auto;right:0}.eae-vpos-top.eae-hpos-left .eae-swiper-button-wrapper{bottom:auto;top:0;width:auto;left:0}.eeae-hpos-right.eae-vpos-bottom .eae-swiper-button-wrapper{bottom:0;top:auto;width:auto;right:0}.eae-vpos-bottom.eae-hpos-left .eae-swiper-button-wrapper{bottom:0;top:auto;width:auto;left:0}.eae-hpos-right.eae-vpos-middle .eae-swiper-button-wrapper{bottom:auto;top:50%;width:auto;right:0}.eae-hpos-left.eae-vpos-middle .eae-swiper-button-wrapper{bottom:auto;top:50%;width:auto;left:0}.eae-hpos-left .swiper-button-next,.eae-hpos-left .swiper-button-prev,.eae-hpos-right .swiper-button-next,.eae-hpos-right .swiper-button-prev{position:relative;display:inline-block;right:auto;left:auto}.eae-hpos-right.eae-vpos-bottom .swiper-button-next,.eae-hpos-right.eae-vpos-bottom .swiper-button-prev{top:auto;bottom:0;transform:unset}.eae-hpos-right.eae-vpos-top .swiper-button-next,.eae-hpos-right.eae-vpos-top .swiper-button-prev{top:0;bottom:auto;transform:unset}.eae-hpos-left.eae-vpos-top .swiper-button-next,.eae-hpos-left.eae-vpos-top .swiper-button-prev{top:0;bottom:auto;transform:unset}.eae-hpos-left.eae-vpos-bottom .swiper-button-next,.eae-hpos-left.eae-vpos-bottom .swiper-button-prev{top:auto;bottom:0;transform:unset}.eae-hpos-center.eae-vpos-bottom .swiper-button-next,.eae-hpos-center.eae-vpos-bottom .swiper-button-prev{top:auto;bottom:0;transform:unset}.eae-hpos-center.eae-vpos-top .swiper-button-next,.eae-hpos-center.eae-vpos-top .swiper-button-prev{top:0;bottom:auto;transform:unset}@media all and (max-width:900px){.mfp-arrow{-webkit-transform:scale(.75);transform:scale(.75)}.mfp-arrow-left{-webkit-transform-origin:0;transform-origin:0}.mfp-arrow-right{-webkit-transform-origin:100%;transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}.eae-info-circle{position:relative;width:90%;margin:0 auto;border-radius:50%;display:block}.eae-info-circle:before{content:"";display:block;position:absolute;top:4%;left:4%;width:92%;height:92%;border-radius:50%;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;pointer-events:none}.eae-info-circle:after{content:"";display:block;padding-top:100%}.eae-info-circle .eae-ic-icon-wrap{position:absolute;display:inline-block;top:50%;left:50%;z-index:2;line-height:1em;vertical-align:middle;overflow:hidden;max-width:100%}.eae-info-circle .eae-info-circle-item{top:0;left:0;width:100%;height:100%;display:block}.eae-info-circle .eae-info-circle-item.eae-active .eae-info-circle-item__content-wrap{visibility:visible;opacity:1;display:flex}.eae-info-circle .eae-info-circle-item__content-wrap{visibility:visible;display:none;height:91%;width:91%;opacity:0;top:50%;transform:translateY(-50%) translateX(-50%);position:absolute;left:50%;border-radius:50%;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.eae-info-circle .eae-info-circle-item__content-wrap:before{content:"";display:inline-block;height:100%;vertical-align:middle}.eae-info-circle .eae-info-circle-item__content{display:inline-block;top:50%;transform:translateY(-50%) translateX(-50%);position:absolute;left:50%;vertical-align:middle;z-index:1;max-height:100%;overflow:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;text-align:center;width:75%}@media screen and (max-width:767px){.eae-info-circle.eae-info-circle .eae-info-circle-item__content-wrap:before{display:none}.eae-info-circle:after,.eae-info-circle:before{display:none}.eae-info-circle{width:100%!important}.eae-info-circle-wrapper:after,.eae-info-circle-wrapper:before{display:none}.eae-info-circle .eae-ic-icon-wrap{display:block;text-align:center;position:relative!important;left:unset!important;margin-left:0!important;margin-top:0!important;margin-bottom:10px}.eae-info-circle-item{position:relative!important;border-radius:0!important;padding:0;margin:10px 0}.eae-info-circle .eae-info-circle-item__content-wrap{visibility:visible;opacity:1!important;display:flex!important;border-radius:0!important;border:none!important;margin:0!important;padding-right:0!important;padding-left:0!important;padding-bottom:0!important;width:100%;height:auto;line-height:1.5em;position:relative;top:unset;left:unset;transform:unset}.eae-info-circle .eae-info-circle-item__content{position:relative;top:unset;left:unset;transform:unset;width:100%;padding:10px}}.eae-icon-wrap i{height:1.25em;width:1.25em;line-height:1.25em;display:block}.eae-icon-wrap i img{top:50%;left:50%;transform:translateX(-50%) translateY(-50%);position:absolute}.eae-icon{display:inline-block;text-align:center;vertical-align:middle;max-width:100%;overflow:hidden;padding:10px}.eae-icon-shape-circle:not(.elementor-element){border-radius:50%}.eae-icon-view-framed:not(.elementor-element){border-width:1px;border-style:solid}.eae-icon-wrapper{display:flex}.eae-icon-wrapper .eae-icon{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);line-height:1}.eae-timeline{position:relative;display:inline-block;width:100%}.eae-timline-progress-bar{width:4px;background-color:#f45b69;top:0;bottom:50px;position:absolute;transform:translateX(-50%)}.eae-timeline-item{position:relative;display:flex;flex-direction:row;padding-bottom:50px}.eae-timeline-item:last-child{padding-bottom:0!important}.eae-tl-top .eae-timeline-item{align-items:flex-start}.eae-tl-top .eae-tl-item-content::before{top:10px}.eae-timeline-item.image-position-row .eae-tl-item-image,.eae-timeline-item.image-position-row-reverse .eae-tl-item-image{margin-top:0;margin-bottom:0}.eae-tl-item-meta-wrapper-inner{display:none}.eae-tl-bottom .eae-timeline-item{align-items:flex-end}.eae-tl-bottom .eae-tl-item-content::before{bottom:10px}.eae-tl-center .eae-timeline-item{align-items:center}.eae-tl-center .eae-tl-item-content::before{bottom:calc(50% - 5px)}.eae-layout-center .eae-timline-progress-bar{left:50%}.eae-layout-center .eae-timeline-item:nth-child(odd){flex-direction:row-reverse}.eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-item-meta-wrapper{margin-right:0;margin-left:0;justify-content:flex-start}body.rtl[data-elementor-device-mode=tablet] .eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-content-wrapper,body:not(.rtl)[data-elementor-device-mode=tablet] .eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-content-wrapper{padding-right:20px;padding-left:0}body.rtl[data-elementor-device-mode=tablet] .eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-content-wrapper,body:not(.rtl)[data-elementor-device-mode=tablet] .eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-content-wrapper{padding-right:0;padding-left:20px}body:not(.rtl) .eae-layout-left .eae-tl-content-wrapper{padding-right:10px;padding-left:20px}body.rtl .eae-layout-left .eae-tl-content-wrapper{padding-right:20px;padding-left:10px}.eae-layout-left .eae-timline-progress-bar{display:none}.eae-layout-left .eae-tl-item-meta-wrapper{display:none}.eae-layout-left .eae-tl-item-meta-wrapper-inner{display:block}.eae-layout-right .eae-timline-progress-bar{display:none}body:not(.rtl) .eae-layout-right .eae-tl-content-wrapper{padding-right:20px;padding-left:10px}body.rtl .eae-layout-right .eae-tl-content-wrapper{padding-right:10px;padding-left:20px}.eae-layout-right .eae-tl-icon-wrapper{order:3}.eae-layout-right .eae-tl-item-meta-wrapper{display:none}.eae-layout-right .eae-tl-item-meta-wrapper-inner{display:block}.eae-tl-item-meta-wrapper{flex-grow:1;order:0;flex-basis:50%;flex-direction:initial;justify-content:flex-end;display:flex;align-items:center;margin-right:0}.eae-tl-item-meta{padding:0 20px}.eae-tl-icon-wrapper{height:auto;width:auto;flex-grow:0;flex-shrink:0;order:1;margin-left:0;margin-right:0;min-width:10px;min-height:10px;border-radius:999px;position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.eae-tl-content-wrapper{flex-grow:1;order:2;flex-basis:50%;position:relative;padding-right:0;padding-left:20px}.eae-tl-item-content{background:#f4f4f4;padding:25px;overflow:hidden;text-align:center;display:flex;flex-direction:row}.eae-tl-content{display:inline-block;position:relative;padding:10px;width:100%;color:#000}.eae-timeline-item.custom-image-style-yes.image-position-row .eae-content-inner,.eae-timeline-item.custom-image-style-yes.image-position-row-reverse .eae-content-inner,.image-position-row .eae-timeline .eae-timeline-item:not(.custom-image-style-yes) .eae-content-inner,.image-position-row-reverse .eae-timeline .eae-timeline-item:not(.custom-image-style-yes) .eae-content-inner{position:relative;left:50%;top:50%;transform:translate(-50%,-50%);line-height:1;width:100%}.custom-image-style-.image-position-row .eae-content-inner,.custom-image-style-.image-position-row-reverse .eae-content-inner,.custom-image-style-no.image-position-row .eae-content-inner,.custom-image-style-no.image-position-row-reverse .eae-content-inner{left:unset;top:unset;transform:unset}.eae-tl-item-image{display:inline-block}.image-position-row .eae-tl-item-image img,.image-position-row-reverse .eae-tl-item-image img{object-fit:cover;height:100%!important}.image-position-row .eae-tl-item-image,.image-position-row-reverse .eae-tl-item-image{margin:0}.image-position-column .eae-tl-item-image{margin:auto}.custom-image-style-.image-position-column .eae-tl-item-image,.custom-image-style-no.image-position-column .eae-tl-item-image{margin:0 auto}.eae-pb-inner-line{width:100%;background-color:#3d5ac3}.eae-tl-item-content::before{content:"";position:absolute;width:0;height:0;border-style:solid;border-width:8px 16px 8px 0;border-color:transparent #f4f4f4 transparent transparent}.eae-icon-wrapper{display:flex}.elementor-widget-bpel-timeline .eae-icon-wrapper{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);line-height:1}.eae-tl-read-more{display:inline-block;padding:5px;border:2px solid #000}.image-position-row .eae-timeline.eae-timeline-alternate-yes .eae-timeline-item:nth-child(odd):not(.custom-image-style-yes) .eae-tl-item-content{flex-direction:row-reverse!important}.image-position-row-reverse .eae-timeline.eae-timeline-alternate-yes .eae-timeline-item:nth-child(odd):not(.custom-image-style-yes) .eae-tl-item-content{flex-direction:row!important}@media screen and (min-width:1024px){.eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-content-wrapper,body.rtl .eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-content-wrapper{padding-right:20px;padding-left:0}.eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-content-wrapper,body.rtl .eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-content-wrapper{padding-right:0;padding-left:20px}.eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,.eae-layout-right .eae-tl-item-content::before,body.rtl .eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-item-content::before,body.rtl .eae-layout-left .eae-tl-item-content::before{right:4px;left:unset;border-width:8px 0 8px 16px;border-color:transparent transparent transparent #f4f4f4}.eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-item-content::before,.eae-layout-left .eae-tl-item-content::before,body.rtl .eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,body.rtl .eae-layout-right .eae-tl-item-content::before{left:4px;right:unset;border-width:8px 16px 8px 0;border-color:transparent #f4f4f4 transparent transparent}}@media screen and (max-width:1023px) and (min-width:768px){.image-position-row .eae-timeline.eae-timeline-alternate-yes .eae-timeline-item:nth-child(odd):not(.custom-image-style-yes) .eae-tl-item-content{flex-direction:row-reverse!important}.image-position-row-reverse .eae-timeline.eae-timeline-alternate-yes .eae-timeline-item:nth-child(odd):not(.custom-image-style-yes) .eae-tl-item-content{flex-direction:row!important}.eae-tl-res-style-mobile-tablet .eae-tl-item-meta-wrapper{display:none}.eae-tl-res-style-mobile-tablet .eae-tl-item-meta-wrapper-inner{display:block}.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item{flex-direction:row!important}.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item{flex-direction:row-reverse!important}.eae-layout-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before,.eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(even) .eae-tl-item-content::before,body.rtl .eae-layout-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-layout-right .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-layout-right .eae-tl-item-content::before,body.rtl .eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,body:not(.rtl) .eae-layout-left .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-left .eae-tl-item-content::before{left:4px!important;border-width:8px 16px 8px 0!important;border-color:transparent #f4f4f4 transparent transparent!important}body.rtl .eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before{left:4px!important;right:unset!important;border-width:8px 16px 8px 0!important;border-color:transparent #f4f4f4 transparent transparent!important}.eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,body.rtl .eae-layout-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-layout-left .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-layout-left .eae-tl-item-content::before,body.rtl .eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(even) .eae-tl-item-content::before,body:not(.rtl) .eae-layout-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-right .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before{right:4px!important;border-width:8px 0 8px 16px!important;border-color:transparent transparent transparent #f4f4f4!important}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper,body.rtl .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper{padding-right:0!important;padding-left:20px!important}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper,body.rtl .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper{padding-right:20px!important;padding-left:0!important}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timline-progress-bar{left:13px}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timline-progress-bar{left:calc(100% - 13px)}}@media screen and (max-width:767px){.eae-tl-item-meta-wrapper{display:none}.eae-tl-item-meta-wrapper-inner{display:block}.elementor-widget-bpel-timeline:not(.image-position-column) .eae-timeline .eae-tl-item-content{flex-direction:column-reverse!important}.eae-tl-item-image,.elementor-widget-bpel-timeline:not(.image-position-column) .eae-tl-content{width:100%!important}.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item,.eae-tl-res-style-mobile.eae-tl-res-layout-left .eae-timeline-item{flex-direction:row!important}.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item,.eae-tl-res-style-mobile.eae-tl-res-layout-right .eae-timeline-item{flex-direction:row-reverse!important}.eae-timeline.eae-layout-center.eae-tl-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,.eae-timeline.eae-layout-center.eae-tl-center.eae-tl-res-style-mobile.eae-tl-res-layout-left .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,body.rtl .eae-timeline.eae-layout-right .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-timeline.eae-tl-res-style-mobile.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-left .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before{left:4px!important;border-width:8px 16px 8px 0!important;border-color:transparent #f4f4f4 transparent transparent!important}body.rtl .eae-layout-left .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-tl-res-style-mobile.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before{right:4px!important;border-width:8px 0 8px 16px!important;border-color:transparent transparent transparent #f4f4f4!important}.eae-timeline.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper body.rtl .eae-timeline.eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper,body:not(.rtl) .eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper{padding-right:0!important;padding-left:20px!important}body.rtl .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper,body.rtl .eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper,body:not(.rtl) .eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper{padding-right:20px!important;padding-left:0!important}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timline-progress-bar,.eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-left .eae-timline-progress-bar{left:13px}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timline-progress-bar,.eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-right .eae-timline-progress-bar{left:calc(100% - 13px)}body.rtl .eae-layout-center.eae-timeline.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper .eae-tl-item-content::before{left:4px;right:unset}body.rtl .eae-layout-center.eae-timeline.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper .eae-tl-item-content::before{left:unset;right:4px;border-width:8px 0 8px 16px!important;border-color:transparent transparent transparent #f4f4f4!important}}[data-element_type="eae-evergreen-timer.skin1"] .eae-evergreen-wrapper{display:block;text-align:center}[data-element_type="eae-evergreen-timer.skin1"] #eaeclockdiv{font-family:sans-serif;color:#fff;display:inline-block;font-weight:100;text-align:center;font-size:30px}[data-element_type="eae-evergreen-timer.skin1"] .eae-time-wrapper{padding:10px;border-radius:3px;background:#00bf96;display:inline-block;overflow:hidden}[data-element_type="eae-evergreen-timer.skin1"] #eaeclockdiv div>span{padding:15px;width:100%;background:#00816a;display:inline-block}[data-element_type="eae-evergreen-timer.skin1"] .smalltext{padding:7px;font-size:16px}[data-element_type="eae-evergreen-timer.skin1"] .eae-egt-hide{display:none}.eae-egt-message{display:none}@media screen and (max-width:767px){[data-element_type="eae-evergreen-timer.skin1"] #eaeclockdiv div>span{padding:5px}[data-element_type="eae-evergreen-timer.skin1"] .eae-time-wrapper{padding:5px}}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden;backface-visibility:hidden}[data-element_type="eae-evergreen-timer.skin2"] .eae-evergreen-wrapper{display:inline-block;width:100%;text-align:center;margin:auto}[data-element_type="eae-evergreen-timer.skin2"] .timer-container{display:inline-block}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper a{cursor:pointer;text-decoration:none;color:#ccc}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper a:hover{color:#fff}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul{list-style:none}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper.clearfix:after,[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper.clearfix:before{content:" ";display:table}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper.clearfix:after{clear:both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper{font:normal 11px "Helvetica Neue",Helvetica,sans-serif;-webkit-user-select:none}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-meridium{background:0 0!important;box-shadow:0 0 0!important;font-size:36px!important}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-meridium a{color:#313333}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper{text-align:center;position:relative;width:100%;margin:1em}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper:after,[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper:before{content:" ";display:table}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper:after{clear:both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul{position:relative;float:left;margin:5px;width:60px;height:90px;font-size:80px;font-weight:700;line-height:87px;border-radius:6px;background:#000}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:87px;text-decoration:none!important}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li:first-child{z-index:2}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;-moz-perspective:200px;perspective:200px;margin:0!important;overflow:visible!important;cursor:default!important}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;-moz-transform-origin:50% 100%;-ms-transform-origin:50% 100%;-o-transform-origin:50% 100%;transform-origin:50% 100%;top:0}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.up:after{content:"";position:absolute;top:44px;left:0;z-index:5;width:100%;height:3px;background-color:#000;background-color:rgba(0,0,0,.4)}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-ms-transform-origin:50% 0;-o-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div div.inn{position:absolute;left:0;z-index:1;width:100%;height:200%;color:#ccc;text-shadow:0 1px 2px #000;text-align:center;background-color:#333;border-radius:6px;font-size:70px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.up div.inn{top:0}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.down div.inn{bottom:0}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-before{z-index:3}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,.7)}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-active{-webkit-animation:asd 10ms .49s linear both;-moz-animation:asd 10ms .49s linear both;animation:asd 10ms .49s linear both;z-index:5}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider{float:left;display:inline-block;position:relative;width:20px;height:100px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider:first-child{width:0}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-dot{display:block;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,.5);left:5px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider .flip-clock-label{position:absolute;top:-1.5em;right:-86px;color:#000;text-shadow:none}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider.minutes .flip-clock-label{right:-88px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider.seconds .flip-clock-label{right:-91px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-dot.top{top:30%}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-dot.bottom{bottom:30%}@-webkit-keyframes asd{0%{z-index:2}100%{z-index:4}}@-moz-keyframes asd{0%{z-index:2}100%{z-index:4}}@-o-keyframes asd{0%{z-index:2}100%{z-index:4}}@keyframes asd{0%{z-index:2}100%{z-index:4}}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-active .down{z-index:2;-webkit-animation:turn .5s .5s linear both;-moz-animation:turn .5s .5s linear both;animation:turn .5s .5s linear both}@-webkit-keyframes turn{0%{-webkit-transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0)}}@-moz-keyframes turn{0%{-moz-transform:rotateX(90deg)}100%{-moz-transform:rotateX(0)}}@-o-keyframes turn{0%{-o-transform:rotateX(90deg)}100%{-o-transform:rotateX(0)}}@keyframes turn{0%{transform:rotateX(90deg)}100%{transform:rotateX(0)}}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-before .up{z-index:2;-webkit-animation:turn2 .5s linear both;-moz-animation:turn2 .5s linear both;animation:turn2 .5s linear both}@-webkit-keyframes turn2{0%{-webkit-transform:rotateX(0)}100%{-webkit-transform:rotateX(-90deg)}}@-moz-keyframes turn2{0%{-moz-transform:rotateX(0)}100%{-moz-transform:rotateX(-90deg)}}@-o-keyframes turn2{0%{-o-transform:rotateX(0)}100%{-o-transform:rotateX(-90deg)}}@keyframes turn2{0%{transform:rotateX(0)}100%{transform:rotateX(-90deg)}}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li.flip-clock-active{z-index:3}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-before .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,#000));background:linear,top,rgba(0,0,0,.1) 0,#000 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:linear,to bottom,rgba(0,0,0,.1) 0,#000 100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-active .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,#000));background:linear,top,rgba(0,0,0,.1) 0,#000 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:linear,to bottom,rgba(0,0,0,.1) 0,#000 100%;-webkit-animation:hide .5s .3s linear both;-moz-animation:hide .5s .3s linear both;animation:hide .5s .3s linear both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-before .down .shadow{background:-moz-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#000),color-stop(100%,rgba(0,0,0,.1)));background:linear,top,#000 0,rgba(0,0,0,.1) 100%;background:-o-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:-ms-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:linear,to bottom,#000 0,rgba(0,0,0,.1) 100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-active .down .shadow{background:-moz-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#000),color-stop(100%,rgba(0,0,0,.1)));background:linear,top,#000 0,rgba(0,0,0,.1) 100%;background:-o-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:-ms-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:linear,to bottom,#000 0,rgba(0,0,0,.1) 100%;-webkit-animation:hide .5s .3s linear both;-moz-animation:hide .5s .3s linear both;animation:hide .5s .2s linear both}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@-moz-keyframes show{0%{opacity:0}100%{opacity:1}}@-o-keyframes show{0%{opacity:0}100%{opacity:1}}@keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@-moz-keyframes hide{0%{opacity:1}100%{opacity:0}}@-o-keyframes hide{0%{opacity:1}100%{opacity:0}}@keyframes hide{0%{opacity:1}100%{opacity:0}}@media screen and (max-width:767px){[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider{width:15px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-dot{height:5px;width:5px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul{height:40px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider{height:50px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li{line-height:37px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div div.inn{font-size:24px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul{margin:2px}}[data-element_type="eae-evergreen-timer.skin3"] #timer{font-family:sans-serif;color:#fff;display:inline-block;font-weight:100;text-align:center;font-size:30px}[data-element_type="eae-evergreen-timer.skin3"] .desc{display:flex;justify-content:center}[data-element_type="eae-evergreen-timer.skin3"].eae-egt-content-align-right .desc{justify-content:flex-end}[data-element_type="eae-evergreen-timer.skin3"].eae-egt-content-align-left .desc{justify-content:flex-start}[data-element_type="eae-evergreen-timer.skin3"] .desc .egt-time-text{display:inline-block;padding:0 50px 0 50px}[data-element_type="eae-evergreen-timer.skin3"] .eae-time-wrapper{padding:50px;border-radius:3px;background:#00bf96;display:inline-block;overflow:hidden;margin:5px;line-height:1em}[data-element_type="eae-evergreen-timer.skin3"] #timer span:nth-child(1){background:khaki}[data-element_type="eae-evergreen-timer.skin3"] #timer span:nth-child(2){background:#cd5c5c}[data-element_type="eae-evergreen-timer.skin3"] #timer span:nth-child(3){background:#5f9ea0}[data-element_type="eae-evergreen-timer.skin3"] #timer span:nth-child(4){background:#6495ed}[data-element_type="eae-evergreen-timer.skin3"] .fade{animation:flip .7s ease forwards}@keyframes flip{0%{transform:rotateY(0) scaleY(1.1);opacity:.5}50%{transform:rotateY(180deg) scaleY(1.3);opacity:0}100%{transform:rotateY(0);opacity:1}}@media screen and (max-width:767px){[data-element_type="eae-evergreen-timer.skin3"] #timer span{font-size:22px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider .flip-clock-label{top:-1.5em;right:-42px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider.minutes .flip-clock-label{right:-48px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider.seconds .flip-clock-label{right:-51px}}[data-element_type="eae-evergreen-timer.skin4"] .eae-evergreen-wrapper{width:100%}[data-element_type="eae-evergreen-timer.skin4"] .container{margin:0 auto}[data-element_type="eae-evergreen-timer.skin4"] .special{position:relative;width:840px;height:47px}[data-element_type="eae-evergreen-timer.skin4"] #counter{position:absolute;z-index:4000}[data-element_type="eae-evergreen-timer.skin4"] .digit-separator{position:relative;float:left;width:17px;height:44px;overflow:hidden;background-image:url(../digit-sep-svg.svg);background-repeat:no-repeat;background-position:0 0;background-color:#4054b2}[data-element_type="eae-evergreen-timer.skin4"] .digit{background-image:url(../digits-svg-alpha.svg);background-color:#4054b2}.eae-ct-wrapper *{box-sizing:border-box;margin:0;outline:0}article.eae-ct-wrapper{width:100%;max-width:1000px;margin:0 auto;position:relative}.eae-ct-wrapper tbody tr.eae-ct-header td,.eae-ct-wrapper th{position:relative}.eae-ct-wrapper ul{display:none;top:0;z-index:10;padding-bottom:14px}.eae-ct-wrapper li{list-style:none;flex:1;position:relative}.eae-ct-wrapper li:hover{cursor:pointer}.eae-ct-wrapper .eae-ct-heading{width:100%;padding:10px;background:#fff;font-size:20px;font-weight:700;height:60px;color:#999;text-align:center}.eae-ct-wrapper li.eae-ct-heading .eae-ct-heading-inner{position:absolute;align-self:center;top:50%;left:50%;transform:translate(-50%,-50%);width:100%}.eae-ct-wrapper li.eae-ct-heading.active{background:#f5f5f5}.eae-ct-wrapper table{border-collapse:collapse;table-layout:fixed;width:100%}.eae-ct-wrapper th{background:#f5f5f5;display:none}.eae-ct-wrapper td,.eae-ct-wrapper th{height:53px;vertical-align:middle}.eae-ct-wrapper table{border:none}.eae-ct-wrapper table td,.eae-ct-wrapper table th{border:none}.eae-ct-wrapper table tr td:first-child,.eae-ct-wrapper table tr td:last-child,.eae-ct-wrapper td,.eae-ct-wrapper th{padding:10px;empty-cells:show}.eae-ct-wrapper td,.eae-ct-wrapper th{text-align:center}.eae-ct-wrapper td+td,.eae-ct-wrapper th+th{text-align:center}.eae-ct-wrapper tr:first-child{background:0 0!important}.eae-ct-wrapper ul li:nth-child(1){display:table-cell}.eae-ct-wrapper tr td:nth-child(2){display:table-cell}.eae-ct-wrapper td:nth-child(1){display:table-cell}.eae-ct-wrapper td{display:none}.eae-ct-wrapper .sep{background:#f5f5f5;font-weight:700}.eae-ct-price-wrapper{display:flex;justify-content:center}.eae-ct-tt-type-icon .eae-ct-feature .tooltip{float:right}.eae-ct-wrapper .tooltiptext::before{content:"";border-width:5px 5px 0 5px;border-color:#fff;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;bottom:-10px;width:0;height:0;border-style:solid;position:absolute;margin:5px;left:42%}.eae-ct-wrapper .eae-ct-price{font-size:28px;font-weight:700;line-height:1em}.eae-ct-wrapper .eae-ct-currency{align-self:flex-start;margin-right:3px}.eae-ct-wrapper .eae-ct-fractional-price{align-self:flex-start;margin-left:3px}.eae-ct-wrapper .eae-ct-duration{align-self:flex-start}.eae-ct-wrapper .eae-ct-original-price{margin-right:5px;text-decoration:line-through;align-self:flex-end}.eae-ct-wrapper .tick{font-size:18px;color:#2ca01c}.feature-heading-blank.eae-ct-wrapper .hide{border:unset!important;background:unset!important}.eae-ct-wrapper .hide.eae-ct-hide.eae-fbox-heading{border:0 solid #000}.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper{position:absolute;top:0;width:100px;overflow:hidden;height:100px;z-index:998;padding:8px 12px}.eae-ct-ribbons-h-top.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper{position:absolute;top:0;width:100%;overflow:hidden;height:50px;z-index:999;padding:8px 12px}.eae-ct-ribbons-h-top.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper-top{background-color:rgba(63,195,135,.8);color:#fff;transform:translateY(-100%);position:absolute;width:100%;top:0;left:0}.eae-ct-ribbons-h-left.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);left:0;right:auto}.eae-ct-ribbons-h-right.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(90deg);left:auto;right:0}.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper span.eae-ct-ribbons-inner{position:absolute;text-align:center;left:0;top:0;width:200%;-webkit-transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);-ms-transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);margin-top:35px;font-size:13px;line-height:2;font-weight:800;text-transform:uppercase;background:rgba(63,195,135,.8);padding:8px 12px;color:#fff}.eae-ct-wrapper .tooltip{position:relative;display:inline-block}.eae-ct-wrapper .tooltip .tooltiptext{visibility:hidden;min-width:120px;background-color:#000;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1;bottom:120%;left:50%;margin-left:-60px}.eae-ct-wrapper .tooltip:hover .tooltiptext{visibility:visible}.eae-ct-heading-tooltip{text-decoration-line:underline;text-decoration-style:dotted}.eae-ct-btn{padding:10px 15px 10px 15px;color:#fff;display:inline-block;line-height:1em}.eae-ct-btn:hover{color:#fff}.eae-ct-wrapper i.fa.fa-check,.eae-ct-wrapper i.fas.fa-check{color:#38f146}.eae-ct-wrapper i.fa.fa-close,.eae-ct-wrapper i.fas.fa-times{color:red}.button-heading-blank.eae-ct-wrapper tr:last-child td:first-child{background:0 0!important;border:none!important}.eae-ct-wrapper tr:last-child{background:0 0!important}tbody tr:nth-child(2){background:0 0!important}@media (min-width:767px){.eae-ct-wrapper .eae-ct-header,.eae-ct-wrapper td{width:330px}.eae-ct-wrapper td+td,.eae-ct-wrapper th+th{width:auto}}.eae-tab-format-all .eae-ct-wrapper ul{display:flex}.hide.eae-ct-hide{display:table-cell}@media (min-width:1023px){.eae-tab-format-all tbody tr.eae-ct-header{display:none}.eae-tab-format-mobile .eae-ct-wrapper td,.eae-tab-format-mobile .eae-ct-wrapper th,.eae-tab-format-tab-mob .eae-ct-wrapper td,.eae-tab-format-tab-mob .eae-ct-wrapper th{display:table-cell!important}.eae-tab-format-all .hide.eae-ct-hide{display:table-cell}.eae-tab-format-mobile .hide.eae-ct-hide,.eae-tab-format-tab-mob .hide.eae-ct-hide{display:none!important}}@media (max-width:1023px){.eae-tab-format-tab-mob .eae-ct-wrapper ul{display:flex}.eae-tab-format-all tbody tr.eae-ct-header,.eae-tab-format-tab-mob tbody tr.eae-ct-header{display:none}.eae-tab-format-all .hide.eae-ct-hide{display:table-cell}.eae-tab-format-tab-mob .hide.eae-ct-hide{display:table-cell}}@media (max-width:1023px) and (min-width:768px){.eae-tab-format-mobile .eae-ct-wrapper td,.eae-tab-format-mobile .eae-ct-wrapper th{display:table-cell!important}.eae-tab-format-all tbody tr.eae-ct-header,.eae-tab-format-tab-mob tbody tr.eae-ct-header{display:none}.eae-tab-format-tab-mob .hide.eae-ct-hide{display:table-cell}}@media (max-width:767px){.eae-tab-format-mobile .eae-ct-wrapper ul{display:flex}.eae-tab-format-mobile tbody tr.eae-ct-header{display:none}.eae-tab-format-all tbody tr.eae-ct-header,.eae-tab-format-mobile tbody tr.eae-ct-header{display:none}.eae-tab-format-mobile .hide.eae-ct-hide{display:table-cell}}.eae-progress-bar-wrapper{display:flex;flex-direction:column;align-items:flex-start;margin:15px 0}.eae-progress-bar-wrapper.eae-progress-bar{width:100%;position:relative;box-sizing:border-box}.eae-pb-bar,.eae-pb-bar-inner,.eae-pb-bar-skill,.eae-pb-bar-value{box-sizing:border-box}.eae-pb-bar{position:relative;height:100%;width:100%;overflow:hidden}.eae-pb-bar--no-overflow{overflow:visible}.eae-pb-bar-inner{position:absolute;top:0;left:0;height:100%;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:left center;transform-origin:left center}body.rtl .eae-pb-bar .eae-pb-bar-inner{position:absolute;top:0;right:0!important;height:100%;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:right center;transform-origin:right center}.eae-pb-bar-inner.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:cubic-bezier(.1,1.14,.31,1.06);transition-delay:1.5s;-webkit-transform:scaleX(1);transform:scaleX(1)}body.rtl .eae-pb-bar .eae-pb-bar-inner.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:cubic-bezier(.1,1.14,.31,1.06);transition-delay:1.5s;-webkit-transform:scaleX(1);transform:scaleX(1)}.eae-pb-bar-skill,.eae-pb-bar-value{font-size:14px;letter-spacing:1px}body:not(.rtl) .eae-pb-bar-value--aligned-value{-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.rtl .eae-pb-bar-value--aligned-value{-webkit-transform:translateX(50%);transform:translateX(50%)}.eae-progress-bar-skin1{height:20px;padding:4px;border:1px solid #ddd;border-radius:20px}.eae-pb-bar-skin1{border-radius:20px}.eae-pb-bar-inner-skin1{background-color:#00bfb3;background-size:200%;background-position:0 0;border-radius:20px}.eae-pb-bar-skill-skin1{position:absolute;bottom:20px;left:0;opacity:0}body.rtl .eae-pb-bar-skill-skin1{right:0}.eae-pb-bar-skill-skin1.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;left:0;opacity:1}body.rtl .eae-pb-bar-skill-skin1.js-animated{right:0!important}.eae-pb-bar-value-skin1{position:absolute;bottom:20px;opacity:1}body:not(.rtl) .eae-pb-bar-value-skin1{right:0}body.rtl .eae-pb-bar-value-skin1{left:0!important}.eae-pb-bar-value-skin1.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;opacity:1}body:not(.rtl) .eae-pb-bar-value-skin1.js-animated{right:0}.eae-progress-bar-skin2{height:15px;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);border-radius:3px}@-webkit-keyframes progress-2-bg-animation-rtl{100%{background-position:0 0,0 0}0%{background-position:0 0,42px 0}}@keyframes progress-2-bg-animation-rtl{100%{background-position:0 0,0 0}0%{background-position:0 0,42px 0}}@-webkit-keyframes progress-2-bg-animation{0%{background-position:0 0,0 0}1000%{background-position:0 0,42px 0}}@keyframes progress-2-bg-animation{0%{background-position:0 0,0 0}100%{background-position:0 0,42px 0}}.eae-pb-bar-inner-skin2{background-image:linear-gradient(to top,rgba(255,255,255,.15),rgba(0,0,0,.2)),linear-gradient(135deg,#5eeb5b,#5eeb5b 33%,#358600 33%,#358600 66%,#5eeb5b 66%);background-size:100% 100%,42px 100%;background-position:0 0,0 0;border-radius:3px}body:not(.rtl) .eae-pb-bar-inner-skin2.js-animated{-webkit-animation:progress-2-bg-animation 1.5s linear 0s infinite;animation:progress-2-bg-animation 1.5s linear 0s infinite}body.rtl .eae-pb-bar-inner-skin2.js-animated{-webkit-animation:progress-2-bg-animation-rtl 1.5s linear 0s infinite;animation:progress-2-bg-animation-rtl 1.5s linear 0s infinite}.eae-pb-bar-skill-skin2{position:absolute;opacity:0}body:not(.rtl) .eae-pb-bar-skill-skin2{left:0}body.rtl .eae-pb-bar-skill-skin2{right:0}.eae-pb-bar-skill-skin2.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;bottom:20px;opacity:1}.eae-pb-bar-value-skin2{position:absolute;opacity:0}body:not(.rtl) .eae-pb-bar-value-skin2{right:0}body.rtl .eae-pb-bar-value-skin2{left:0}.eae-pb-bar-value-skin2.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;bottom:20px;opacity:1}.eae-progress-bar-skin3{height:5px;background-color:#efefef}.eae-pb-bar-inner-skin3,.eae-pb-bar-value-skin3{background-color:#f40076}.eae-pb-bar-inner:after,.eae-pb-bar-value-skin3:after{border-top-color:#f40076}.eae-pb-bar-skill-skin3{position:absolute;bottom:10px;left:-10px;opacity:0}.eae-pb-bar-skill-skin3.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;opacity:1}body:not(.rtl) .eae-pb-bar-skill-skin3.js-animated{left:0}body.rtl .eae-pb-bar-skill-skin3.js-animated{right:0}.eae-pb-bar-value-skin3{position:absolute;display:inline-block;padding:0 8px;font-size:14px;color:#fff;opacity:0}.eae-pb-bar-value-skin3:after{position:absolute;left:50%;bottom:-10px;display:block;width:0;height:0;content:"";-webkit-transform:translateX(-50%);transform:translateX(-50%);border-width:5px;border-style:solid;border-color:#f40076 transparent transparent transparent}.eae-pb-bar-inner-skin3.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:cubic-bezier(.1,1.14,.31,1.06);transition-delay:1.5s;-webkit-transform:scaleX(1);transform:scaleX(1)}.eae-pb-bar-value-skin3.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:cubic-bezier(.1,1.14,.31,1.06);transition-delay:2s;bottom:14px;opacity:1}.eae-progress-bar-skin4{height:3px;background-color:#efefef}.eae-pb-bar-inner-skin4{background-color:#000}.eae-pb-bar-inner-skin4:after{position:absolute;top:50%;display:block;width:8px;height:8px;content:"";-webkit-transform:translateY(-50%);transform:translateY(-50%);background-color:#000;border-radius:50%}body:not(.rtl) .eae-pb-bar-inner-skin4:after{right:0}body.rtl .eae-pb-bar-inner-skin4:after{left:0}.eae-pb-bar-value-skin4{position:absolute;bottom:2px;font-size:14px;opacity:0}.eae-pb-bar-value-skin4.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:linear;transition-delay:1.5s;opacity:1}.eae-pb-bar-skill-skin4{position:absolute;bottom:2px;left:-20px;opacity:0}.eae-pb-bar-skill-skin4.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;opacity:1}body:not(.rtl) .eae-pb-bar-skill-skin4.js-animated{left:0}body.rtl .eae-pb-bar-skill-skin4.js-animated{right:0}.eae-progress-bar-skin5{height:30px;background-color:#f7f7f7}.eae-pb-bar-inner-skin5{background-color:#57b8ff}.eae-pb-bar-skill-skin5{position:absolute;top:50%;color:#fff;-webkit-transform:translateY(-50%);transform:translateY(-50%);opacity:0}body:not(.rtl) .eae-pb-bar-skill-skin5{left:10px}body:not(.rtl) .eae-pb-bar-skill-skin5{right:10px}.eae-pb-bar-skill-skin5.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;opacity:1}.eae-pb-bar-value-skin5{position:absolute;top:50%;color:#fff;opacity:0;z-index:10}body:not(.rtl) .eae-pb-bar-value-skin5{-webkit-transform:translateX(-100%) translateX(-10px) translateY(-50%);transform:translateX(-100%) translateX(-10px) translateY(-50%)}body.rtl .eae-pb-bar-value-skin5{-webkit-transform:translateX(100%) translateX(10px) translateY(-50%);transform:translateX(100%) translateX(10px) translateY(-50%)}.eae-pb-bar-value-skin5.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:linear;transition-delay:1.5s;opacity:1}.eae-dual-button-wrapper .eae-button-1-wrapper,.eae-dual-button-wrapper .eae-button-2-wrapper{overflow:hidden}.eae-dual-button-wrapper.button-style-horizontal{display:flex;flex-direction:row;position:relative}.eae-dual-button-main-wrapper{display:flex;flex-direction:row;justify-content:center}.eae-dual-button-wrapper a{min-width:0}.eae-dual-button-wrapper.button-style-vertical{display:inline-flex;flex-direction:column;position:relative}.eae-button-1.icon-before,.eae-button-2.icon-before{display:flex;flex-direction:row}body.rtl .eae-button-1.icon-before,body.rtl .eae-button-2.icon-before{display:flex;flex-direction:row-reverse}.eae-button-1.icon-after,.eae-button-2.icon-after{display:flex;flex-direction:row-reverse}body.rtl .eae-button-1.icon-after,body.rtl .eae-button-2.icon-after{display:flex;flex-direction:row}.eae-button-1-wrapper .eae-button-1,.eae-button-2-wrapper .eae-button-2{color:#000;align-items:center}.eae-button-1-wrapper:hover .eae-button-1,.eae-button-2-wrapper:hover .eae-button-2{color:#000}.eae-dual-button-wrapper.button-style-vertical .eae-button-1.icon-after,.eae-dual-button-wrapper.button-style-vertical .eae-button-1.icon-before,.eae-dual-button-wrapper.button-style-vertical .eae-button-2.icon-after,.eae-dual-button-wrapper.button-style-vertical .eae-button-2.icon-before{justify-content:center}.eae-button-1.icon-up,.eae-button-2.icon-up{display:flex;flex-direction:column;text-align:center}.eae-button-1.icon-down,.eae-button-2.icon-down{display:flex;flex-direction:column-reverse;text-align:center}.eae-button-1-wrapper{background:#ffb6c1;display:flex;justify-content:center;width:100%;line-height:1}.eae-button-2-wrapper{background:orange;display:flex;justify-content:center;width:100%;line-height:1}.eae-button-1.icon-up .icon-wrapper,.eae-button-2.icon-down .icon-wrapper,.eae-button-2.icon-up .icon-wrapper{text-align:center}.eae-button-1.icon-up .eae-button-text,.eae-button-2.icon-down .eae-button-text,.eae-button-2.icon-up .eae-button-text{text-align:center}.eae-button-1.icon-before i,.eae-button-2.icon-after i,.eae-button-2.icon-before i{align-self:center;margin:0 10px 0 0}.eae-button-1.icon-after i,.eae-button-2.icon-after i{align-self:center;margin:0 0 0 10px}.eae-button-1.icon-down i,.eae-button-1.icon-up i,.eae-button-2.icon-down i,.eae-button-2.icon-up i{align-self:center;margin:5px 0}.eae-dual-button-wrapper.button-style-horizontal .eae-button-1-wrapper,.eae-dual-button-wrapper.button-style-horizontal .eae-button-2-wrapper{padding:12px 30px}.eae-dual-button-wrapper.button-style-vertical .eae-button-1-wrapper,.eae-dual-button-wrapper.button-style-vertical .eae-button-2-wrapper{padding:20px 30px}.eae-button1,.eae-button2{position:relative;display:flex}.eae-dual-button-wrapper.button-style-horizontal .eae-button1,.eae-dual-button-wrapper.button-style-horizontal .eae-button2{min-width:150px}.eae-dual-button-wrapper.button-style-vertical .eae-button1{display:flex;flex-direction:column}.eae-button-separator-wrapper .eae-button-separator{width:40px;height:40px;line-height:40px;border-radius:50%;z-index:1;box-shadow:0 0 0 6px rgba(255,255,255,.2);background:#fafaf8;color:#444;text-transform:uppercase;text-align:center;vertical-align:middle;font-weight:400;font-size:14px;position:absolute;transform:translateY(-50%)}.eae-button-separator span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}body.rtl.elementor-editor-active .eae-dual-button-main-wrapper .button-style-horizontal .eae-button1 .eae-button-separator-wrapper.not-rtl .eae-button-separator{display:none!important}body:not(.rtl).elementor-editor-active .eae-dual-button-main-wrapper .button-style-horizontal .eae-button2 .eae-button-separator-wrapper.rtl .eae-button-separator,body:not(.rtl).elementor-editor-preview .eae-dual-button-main-wrapper .button-style-horizontal .eae-button2 .eae-button-separator-wrapper.rtl .eae-button-separator{display:none!important}.eae-sweep-right{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.3s;transition-duration:.3s}.eae-sweep-right:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-sweep-right:active,.eae-sweep-right:focus,.eae-sweep-right:hover{color:#fff}.eae-sweep-right:active:before,.eae-sweep-right:focus:before,.eae-sweep-right:hover:before{-webkit-transform:scaleX(1);transform:scaleX(1)}.eae-sweep-left{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.3s;transition-duration:.3s}.eae-sweep-left:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-sweep-left:active,.eae-sweep-left:focus,.eae-sweep-left:hover{color:#fff}.eae-sweep-left:active:before,.eae-sweep-left:focus:before,.eae-sweep-left:hover:before{-webkit-transform:scaleX(1);transform:scaleX(1)}.eae-sweep-bottom{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.3s;transition-duration:.3s}.eae-sweep-bottom:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-sweep-bottom:active,.eae-sweep-bottom:focus,.eae-sweep-bottom:hover{color:#fff}.eae-sweep-bottom:active:before,.eae-sweep-bottom:focus:before,.eae-sweep-bottom:hover:before{-webkit-transform:scaleY(1);transform:scaleY(1)}.eae-sweep-top{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.3s;transition-duration:.3s}.eae-sweep-top:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-sweep-top:active,.eae-sweep-top:focus,.eae-sweep-top:hover{color:#fff}.eae-sweep-top:active:before,.eae-sweep-top:focus:before,.eae-sweep-top:hover:before{-webkit-transform:scaleY(1);transform:scaleY(1)}.eae-bounce-right{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.5s;transition-duration:.5s}.eae-bounce-right:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-bounce-right:active,.eae-bounce-right:focus,.eae-bounce-right:hover{color:#fff}.eae-bounce-right:active:before,.eae-bounce-right:focus:before,.eae-bounce-right:hover:before{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition-timing-function:cubic-bezier(.52,1.64,.37,.66);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.eae-bounce-left{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.5s;transition-duration:.5s}.eae-bounce-left:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-bounce-left:active,.eae-bounce-left:focus,.eae-bounce-left:hover{color:#fff}.eae-bounce-left:active:before,.eae-bounce-left:focus:before,.eae-bounce-left:hover:before{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition-timing-function:cubic-bezier(.52,1.64,.37,.66);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.eae-bounce-bottom{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.5s;transition-duration:.5s}.eae-bounce-bottom:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-bounce-bottom:active,.eae-bounce-bottom:focus,.eae-bounce-bottom:hover{color:#fff}.eae-bounce-bottom:active:before,.eae-bounce-bottom:focus:before,.eae-bounce-bottom:hover:before{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition-timing-function:cubic-bezier(.52,1.64,.37,.66);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.eae-bounce-top{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.5s;transition-duration:.5s}.eae-bounce-top:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-bounce-top:active,.eae-bounce-top:focus,.eae-bounce-top:hover{color:#fff}.eae-bounce-top:active:before,.eae-bounce-top:focus:before,.eae-bounce-top:hover:before{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition-timing-function:cubic-bezier(.52,1.64,.37,.66);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.eae-markers .marker{display:none}.eae-markers p{margin-bottom:0}.eae-fg-wrapper{display:flex;flex-direction:column;overflow:hidden}.eae-gallery-filter{display:flex;flex-direction:row;justify-content:center;flex-wrap:wrap}.eae-filter-label{padding:5px 10px;background-color:#a0ce4e;color:#fff;margin:0 3px 0 3px}.eae-filter-label.current{background-color:#73b9dc}.eae-fg-image{display:flex;flex-wrap:wrap;flex-direction:row}.eae-fg-wrapper .eae-gallery-item-inner img{width:100%;height:auto;display:block!important;transition:all .5s ease;-webkit-transition:all .5s ease}.eae-gallery-item{height:auto}.eae-gallery-filter a{color:#fff;text-decoration:none}.eae-gallery-filter a.current{font-weight:700}.eae-gallery-item-inner{position:relative;overflow:hidden}.eae-overlay-always .eae-gallery-item .eae-grid-overlay{display:block}.eae-overlay-hover .eae-gallery-item-inner:hover .eae-grid-overlay{display:block}.eae-overlay-hide-on-hover .eae-gallery-item-inner:hover .eae-grid-overlay{display:none}.eae-overlay-hide-on-hover .eae-grid-overlay{display:block}.eae-grid-overlay{position:absolute;top:0;left:0;display:none;z-index:99;background:rgba(0,0,0,.5);height:100%;width:100%}.eae-grid-overlay-inner{display:block;position:relative;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center}.eae-fg-wrapper .eae-icon-wrapper{display:flex;justify-content:center}.eae-overlay-caption{display:block;line-height:1em;margin-top:15px;color:#73b9dc;font-size:20px}.eae-overlay-icon{line-height:1em;padding:.5em;display:inline-block}.eae-overlay-icon svg{height:auto}.eae-icon-view-framed .eae-overlay-icon{padding:.5em;color:#73b9dc;border:3px solid #73b9dc;background-color:transparent}.eae-icon-view-stacked .eae-overlay-icon{padding:.5em;color:#fff;background-color:#818a91}.eae-hover-direction-effect .eae-grid-overlay{position:absolute;z-index:99;background:rgba(0,0,0,.5);height:100%;width:100%}.eae-fg-wrapper.eae-image-ratio-yes .eae-gallery-item-inner .eae-fg-img-wrapper{position:relative;top:0;overflow:hidden;left:0;right:0;border:0}.eae-fg-wrapper.eae-image-ratio-yes .eae-gallery-item-inner .eae-fg-img-wrapper img{height:100%;width:100%;display:block;position:absolute;top:0;left:0;object-fit:cover}.wts-eae-ribbons-badges-wrapper{display:none}.wts-eae-enable-ribbons-badges-yes .elementor-column-wrap>.wts-eae-ribbons-badges-wrapper{display:block}.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-ribbon>.wts-eae-ribbons-badges-wrapper{position:absolute;top:0;left:auto;right:0;-ms-transform:rotate(90deg);width:150px;overflow:hidden;height:150px;z-index:999;padding:8px 12px}.wts-eae-badge-h-left.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-ribbon>.wts-eae-ribbons-badges-wrapper{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);left:0;right:auto}.wts-eae-badge-h-right.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-ribbon>.wts-eae-ribbons-badges-wrapper{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(90deg);left:auto;right:0}.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-ribbon>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{position:absolute;text-align:center;left:0;top:0;width:200%;-webkit-transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);-ms-transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);margin-top:35px;font-size:13px;line-height:2;font-weight:800;text-transform:uppercase;background:rgba(63,195,135,.8);padding:8px 12px}.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-badge>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{min-height:3.236em;min-width:3.236em;padding:0;font-size:1em;font-weight:700;position:absolute;text-align:center;line-height:3.236;top:-.5em;left:-.5em;margin:0;border-radius:100%;background-color:#77a464;color:#fff;font-size:.857em;z-index:9}.wts-eae-badge-h-left.wts-eae-badge-v-bottom.wts-eae-enable-ribbons-badges-yes>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{left:20px;right:auto;top:auto;bottom:20px}.wts-eae-badge-h-left.wts-eae-badge-v-top.wts-eae-enable-ribbons-badges-yes>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{left:20px;right:auto;top:20px;bottom:auto}.wts-eae-badge-h-right.wts-eae-badge-v-bottom.wts-eae-enable-ribbons-badges-yes>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{left:auto;right:20px;top:auto;bottom:20px}.wts-eae-badge-h-right.wts-eae-badge-v-top.wts-eae-enable-ribbons-badges-yes>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{left:auto;right:20px;top:20px;bottom:auto}.eae-flip-box-back svg,.eae-flip-box-front svg{width:25px;height:auto}.wts-eae-textseparator svg{width:25px;height:auto}.eae-img-comp-slider svg{width:22px;height:auto}.eae-popup-link svg{display:inline-block;width:1em}.eae-popup svg:focus,.eae-popup svg:hover{opacity:1;cursor:pointer}.eae-popup svg:active{top:1px}.eae-popup svg.eae-close{width:28px;height:28px;line-height:1em;text-decoration:none;text-align:center;opacity:1;background-color:#fff}.eae-dual-button-wrapper svg{width:1em;height:auto;display:block}eae-button-separator i{position:relative;display:block}.eae-button-1.icon-before svg,.eae-button-2.icon-after svg,.eae-button-2.icon-before svg{align-self:center;margin:0 10px 0 0}.eae-button-1.icon-after svg,.eae-button-2.icon-after svg{align-self:center;margin:0 0 0 10px}.eae-button-1.icon-down svg,.eae-button-1.icon-up svg,.eae-button-2.icon-down svg,.eae-button-2.icon-up svg{align-self:center;margin:5px 0}.eae-pt-button-wrapper a svg{width:1em}.eae-pt-action-button .eae-pt-align-icon-left{float:left}.eae-pt-action-button .eae-pt-align-icon-right{float:right}.eae-icon-wrap svg{width:20px;height:auto;font-size:20px;display:block}.eae-info-circle .eae-icon-wrap svg{width:20px;height:auto;font-size:20px}.eae-icon-view-stacked svg{fill:#fff}.ae-link-yes{cursor:pointer}.eae-element-unfold-content{padding:10px 0;background-color:#d3d3d3c4;width:100%;position:absolute;left:0;bottom:0;z-index:999}a.eae-unfold-link{background-color:#61ce70;color:#fff;display:inline-block;overflow:hidden}a.eae-unfold-link svg{background-color:#fff}.eae-unfold-button-icon{vertical-align:middle}.eae-fold-yes .elementor-column-wrap,.eae-fold-yes.elementor-section .elementor-container,.eae-fold-yes.elementor-widget{overflow:hidden}body.elementor-editor-active .elementor.elementor-edit-mode .elementor-element.elementor-section.eae-widget-unfold-yes .elementor-container,body.elementor-editor-preview .elementor.elementor-edit-mode .elementor-element.elementor-section.eae-widget-unfold-yes .elementor-container{overflow:hidden}body.elementor-editor-active .elementor.elementor-edit-mode .elementor-element.elementor-column.eae-widget-unfold-yes .elementor-column-wrap,body.elementor-editor-preview .elementor.elementor-edit-mode .elementor-element.elementor-column.eae-widget-unfold-yes .elementor-column-wrap{overflow:hidden}body.elementor-editor-active .elementor.elementor-edit-mode .elementor-element.elementor-widget.eae-widget-unfold-yes,body.elementor-editor-preview .elementor.elementor-edit-mode .elementor-element.elementor-widget.eae-widget-unfold-yes{overflow:hidden}.eae-widget-unfold-yes .elementor-widget-container .eae-fold-yes.eae-rc{display:none!important}.eae-unfold-button-icon svg{line-height:1em;text-decoration:none;-webkit-mask-repeat:no-repeat!important;text-align:center;opacity:1}.eae-fold-icon-type-svg .eae-unfold-button-icon,.eae-unfold-icon-type-svg .eae-unfold-button-icon{-webkit-mask-size:cover!important;background-image:none;transform:translateY(-50%)}.elementor-section.elementor-section-items-bottom.eae-widget-unfold-yes>.elementor-container,.elementor-section.elementor-section-items-middle.eae-widget-unfold-yes>.elementor-container{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:start}.elementor-section.elementor-section-content-bottom.eae-widget-unfold-yes>.elementor-container,.elementor-section.elementor-section-content-middle.eae-widget-unfold-yes>.elementor-container{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:start}.elementor-widget-wts-modal-popup.eae-pop-btn-type-image .eae-popup-link{padding:0;background-color:transparent;overflow:hidden}[data-elementor-device-mode=tablet] .eae-tab-format-mobile .eae-ct-hide.eae-fbox-heading{display:none!important}.eae-timeline-item .eae-icon-view-stacked{border-width:0!important}.eae-content-switcher-wrapper{display:block;text-align:center}.eae-cs-layout-skin1 .eae-cs-switch-wrapper{display:inline-flex;flex-wrap:wrap;padding:8px 12px;background:#54595f;border-radius:50px}.eae-cs-switch-container{display:block;text-align:center}.eae-cs-layout-skin1 .eae-cs-label-wrapper{display:inline-block;overflow:hidden}.eae-cs-layout-skin1 .eae-content-switch-button{border-radius:50px;padding:8px 12px;background-color:#7a7a7a;color:#fff;overflow:hidden;display:block;min-width:150px;position:relative;text-align:center;margin:3px}.eae-cs-layout-skin1 .eae-content-switch-button:before{height:100%;top:0;left:0;z-index:0;content:'';width:0;position:absolute;right:0;transition:all .3s ease-out}.eae-cs-layout-skin1 .eae-content-switch-button.active:before{width:100%;left:0;right:auto;background-color:#61ce70}.eae-cs-layout-skin1 .eae-content-switch-label{position:relative}.eae-cs-content-section{display:none}.eae-cs-content-section.active{display:block}@media only screen and (max-width:768px){.eae-cs-switch-wrapper{display:inline-block!important}}.eae-cs-layout-skin2 .eae-cs-switch-wrapper{display:inline-flex;flex-wrap:wrap;padding:0;background:0 0}.eae-cs-layout-skin2 .eae-cs-label-wrapper{display:inline-block}.eae-cs-layout-skin2 .eae-content-switch-button{width:auto;margin:3px 8px;padding:10px 12px;background-color:#e2e2e2;overflow:hidden;display:block;position:relative;text-align:center;border-radius:5px;border:1px solid rgba(130,130,130,.26);color:rgba(71,71,71,.44)}.eae-cs-layout-skin2 .eae-content-switch-button.active{box-shadow:0 10px 34px -9px rgba(0,0,0,.38);background-color:#fff;color:#575757;border-color:#fff}h5.eae-cs-label{margin:0}.eae-cs-layout-skin3 .eae-cs-switch-wrapper{display:block;justify-content:center;align-items:center}.eae-content-switch-label.primary-label{margin-right:30px}.eae-content-switch-label.secondary-label{margin-left:30px}.eae-cs-layout-skin3 .eae-cs-switch-label{position:relative;display:inline-block;width:4.5em;height:2.3em;vertical-align:middle}.eae-cs-layout-skin3 .eae-content-switch-label{margin:0;display:inline-block}.eae-cs-layout-skin3 .eae-cs-switch-button{display:inline-block}.eae-cs-layout-skin3 .eae-cs-label{display:inline-block}.eae-cs-layout-skin3 .eae-cs-switch-label input.eae-content-toggle-switch{display:none}.eae-cs-layout-skin3 .eae-cs-switch-label input.eae-content-toggle-switch+span{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;-webkit-transition:.4s;transition:.4s;-webkit-border-radius:1.5em;border-radius:1.5em;background:#2e394d;border:2px solid #2e394d}.eae-cs-layout-skin3 .eae-cs-switch-label input.eae-content-toggle-switch+span:before{position:absolute;content:"";height:28px;width:28px;left:4px;transform:translateY(-52%);top:50%;transition:.4s;transition:.4s;-webkit-border-radius:50%;border-radius:50%;background:#88cf8f;border:2px solid #88cf8f}body.rtl .eae-cs-layout-skin3 .eae-cs-switch-label input.eae-content-toggle-switch+span:before{left:unset;right:4px}.eae-cs-layout-skin3 .eae-cs-switch-label input:checked.eae-content-toggle-switch+span:before{transform:translate(36px,-52%)}body.rtl .eae-cs-layout-skin3 .eae-cs-switch-label input:checked.eae-content-toggle-switch+span:before{transform:translate(-36px,-52%)}.eae-content-switch-label.active{color:#61ce70}.eae-cs-layout-skin4 .eae-cs-switch-wrapper{display:block}.eae-cs-layout-skin4 .eae-content-switch-label.primary-label{margin-right:30px}.eae-cs-layout-skin4 .eae-content-switch-label.secondary-label{margin-left:30px}.eae-cs-layout-skin4 .eae-content-switch-label{display:inline-block}.eae-cs-layout-skin4 .eae-cs-switch-label{position:relative;display:inline-block;width:70px;height:20px;vertical-align:middle}.eae-cs-layout-skin4 .eae-cs-label{display:inline-block}.eae-cs-layout-skin4 .eae-content-toggle-switch{display:none}.eae-cs-layout-skin4 .eae-content-toggle-switcher{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;-webkit-transition:.4s;transition:.4s;-webkit-border-radius:1.5em;border-radius:1.5em;background:#2e394d;border:2px solid #2e394d}.eae-cs-layout-skin4 .eae-cs-switch-button{display:inline-block}.eae-cs-layout-skin4 .eae-content-toggle-switcher:before{position:absolute;content:"";height:34px;width:34px;left:-12px;top:50%;transform:translateY(-50%);border-radius:50%;border:2px solid #88cf8f;background:#88cf8f;-webkit-transition:.4s;transition:.4s;-webkit-box-shadow:3px 3px 6px 1px rgba(0,0,0,.2);box-shadow:3px 3px 6px 1px rgba(0,0,0,.2)}.eae-cs-layout-skin4 .eae-cs-switch-container{padding:15px 0}body.rtl .eae-cs-layout-skin4 .eae-content-toggle-switcher:before{right:-12px!important}.eae-cs-layout-skin4 input:checked+.eae-content-toggle-switcher:before{transform:translate(55px,-50%)}body.rtl .eae-cs-layout-skin4 input:checked+.eae-content-toggle-switcher:before{transform:translate(-55px,-50%)}.eae-swiper-outer-wrapper{position:relative}.eae-swiper-container{position:relative}.eae-thumb-container{position:absolute}.eae-swiper-outer-wrapper .eae-swiper-slide{height:400px;background-size:cover;background-repeat:no-repeat;background-position:right}.eae-swiper-outer-wrapper .eae-swiper-slide .eae-slide-inner{color:#7a7a7a;display:flex;position:absolute;top:0;left:0;bottom:0;right:0;padding:20px}.eae-slide-inner .eae-slide-content{padding:20px 30px}.eae-slide-inner .eae-slide-heading{font-size:35px;font-weight:700;line-height:1}.eae-slide-inner .eae-slide-text{font-size:17px;line-height:1.4}.eae-slide-inner .eae-slide-button{display:inline-block}.eae-slide-inner .eae-slide-btn{display:inline-block;font-size:15px;padding:12px 24px;border-radius:3px;cursor:pointer;transition:all .3s}.eae-slide-inner .eae-slide-heading:not(:last-child),.eae-slide-inner .eae-slide-text:not(:last-child){margin-bottom:30px}.eae--hr-position-left .eae-slide-inner{-webkit-box-pack:start;justify-content:flex-start}.eae--hr-position-right .eae-slide-inner{-webkit-box-pack:end;justify-content:flex-end}.eae--hr-position-center .eae-slide-inner{-webkit-box-pack:center;justify-content:center}.eae--vr-position-top .eae-slide-inner{-webkit-box-pack:start;align-items:flex-start}.eae--vr-position-middle .eae-slide-inner{-webkit-box-align:center;align-items:center}.eae--vr-position-bottom .eae-slide-inner{-webkit-box-pack:end;align-items:flex-end}.eae-swiper-button-prev{left:10px}.eae-swiper-button-next{right:10px}.eae-swiper-button{position:absolute;display:inline-flex;z-index:1;cursor:pointer;color:#7a7a7a;top:50%;transform:translateY(-50%)}.swiper-pagination-bullet{margin-bottom:5px!important}.eae-swiper-outer-wrapper .eae-swiper-slide .eae-background-overlay{width:100%;height:100%;position:absolute}.eae-swiper-outer-wrapper .eae-gallery-thumbs{box-sizing:border-box;text-align:center}.eae-swiper-outer-wrapper .eae-gallery-thumbs .eae-thumb-slide{background-size:cover;background-position:center;height:100%;opacity:.7}.eae-swiper-outer-wrapper .eae-gallery-thumbs .swiper-slide-thumb-active{opacity:1}.eae-chart-outer-container{position:relative}.eae-chart-overlay{width:100%;height:100%;position:absolute}
|
1 |
+
.elementor-widget-wts-textseparator .elementor-widget-container{overflow:hidden}.wts-eae-textseparator{align-items:center;display:flex;flex-flow:row nowrap;margin:auto}body.rtl .wts-eae-textseparator{flex-direction:row-reverse}.eae-separator-icon-inner i{height:1em;width:1em;text-align:center;position:relative;display:block}.eae-separator-icon-inner i:before{position:absolute;left:50%;-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-o-transform:translateX(-50%);transform:translateX(-50%)}.wts-eae-textseparator .eae-sep-holder{flex:1 1 auto;height:1px;min-width:10%;position:relative}.wts-eae-textseparator .eae-sep-holder .eae-sep-lines{border-top-width:1px;display:block;height:1px;position:relative;top:1px;width:100%}.eae-separator-title{margin:0;-moz-box-flex:0;flex:0 1 auto;line-height:1em;margin:0;overflow-wrap:break-word}.sep-align-right .sep-right{display:none}.sep-align-left .sep-left{display:none}.eae-icon-view-stacked i{color:#fff}.eae-icon-view-framed .eae-separator-icon-inner{border:1px solid}.eae-icon-shape-circle .eae-separator-icon-inner{border-radius:50%}.eae-separator-icon-wrapper,.eae-separator-title{margin:0 5px!important}.eae-separator-icon-inner{line-height:1}.wts-price-box-wrapper .eae-pt-heading,.wts-price-box-wrapper .eae-pt-sub-heading{margin:5px 0;text-align:center}.plan-price-shape{display:table;height:6em;margin:auto;width:6em}.eae-pt-price-box-shape-circle .plan-price-shape,.eae-pt-price-box-shape-square .plan-price-shape{border:1px solid}.eae-pt-price-box-shape-circle .plan-price-shape{border-radius:50%}.plan-price-block{padding:10px 0}.plan-price-shape-inner{display:table-cell;vertical-align:middle;padding:10px}.plan-price-shape-inner>span{display:block;font-size:1em;text-align:center}.eae-pt-feature-list{list-style:outside none none;text-align:center;margin:10px 0}.eae-pt-button-wrapper>a{text-align:center;display:inline-block;line-height:1}.eae-pt-button-wrapper{text-align:center}.wts-price-box-wrapper .heading-wrapper,.wts-price-box-wrapper .plan-features-wrapper{padding:10px 5px}.eae-pt-button-wrapper{padding:15px 0}.eae-pt-button-wrapper a{padding:5px 15px;border-radius:3px}.eae-pt-align-icon-right{float:right}.strike-feature{text-decoration:line-through}.eae-flip-box{width:100%;text-align:center}.eae-flip-box-wrapper{display:inline-block;width:100%}.eae-flip-box-inner{width:100%;height:200px;position:relative;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;-ms-transform-style:preserve-3d;transform-style:preserve-3d}.eae-flip-box-inner .eae-flip-box-back,.eae-flip-box-inner .eae-flip-box-front{width:100%;height:100%;position:absolute;top:0;left:0;text-align:center;padding:10px;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:all .6s ease 0s;-moz-transition:all .6s ease 0s;-ms-transition:all .6s ease 0s;-o-transition:all .6s ease 0s;transition:all .6s ease 0s}.eae-flip-box-front{z-index:2}.eae-flip-box-back{z-index:1}.eae-fb-animate-vertical .eae-flip-box-inner .eae-flip-box-front{-webkit-transform:perspective(1000px) rotateX(0);-ms-transform:perspective(1000px) rotateX(0);transform:perspective(1000px) rotateX(0)}.eae-fb-animate-vertical .eae-flip-box-inner .eae-flip-box-back{-webkit-transform:perspective(1000px) rotateX(180deg);transform:perspective(1000px) rotateX(180deg);-ms-transform:perspective(1000px) rotateX(180deg)}.eae-fb-animate-vertical .eae-flip-box-inner:hover .eae-flip-box-front{-webkit-transform:perspective(1000px) rotateX(180deg);transform:perspective(1000px) rotateX(180deg);-ms-transform:perspective(1000px) rotateX(180deg)}.eae-fb-animate-vertical .eae-flip-box-inner:hover .eae-flip-box-back{-webkit-transform:perspective(1000px) rotateX(0);transform:perspective(1000px) rotateX(0);-ms-transform:perspective(1000px) rotateX(0)}.eae-fb-animate-horizontal .eae-flip-box-inner .eae-flip-box-front{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0);-ms-transform:perspective(1000px) rotateY(0)}.eae-fb-animate-horizontal .eae-flip-box-inner .eae-flip-box-back{-webkit-transform:perspective(1000px) rotateY(180deg);transform:perspective(1000px) rotateY(180deg);-ms-transform:perspective(1000px) rotateY(180deg)}.eae-fb-animate-horizontal .eae-flip-box-inner:hover .eae-flip-box-front{-webkit-transform:perspective(1000px) rotateY(180deg);transform:perspective(1000px) rotateY(180deg);-ms-transform:perspective(1000px) rotateY(180deg)}.eae-fb-animate-horizontal .eae-flip-box-inner:hover .eae-flip-box-back{-webkit-transform:perspective(1000px) rotateY(0);transform:perspective(1000px) rotateY(0);-ms-transform:perspective(1000px) rotateY(0)}.eae-fb-animate-fade .eae-flip-box-inner .eae-flip-box-front{opacity:1}.eae-fb-animate-fade .eae-flip-box-inner .eae-flip-box-back{opacity:0}.eae-fb-animate-fade .eae-flip-box-inner:hover .eae-flip-box-front{opacity:0}.eae-fb-animate-fade .eae-flip-box-inner:hover .eae-flip-box-back{opacity:1}.eae-flip-box-wrapper:focus .eae-flip-box-back,.eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:2}.eae-flip-box-wrapper:focus .eae-flip-box-front,.eae-flip-box-wrapper:hover .eae-flip-box-front{z-index:1}.fade .eae-flip-box-wrapper .eae-flip-box-front{opacity:1;transition:1s}.fade .eae-flip-box-wrapper .eae-flip-box-back{opacity:0;transition:1s}.fade .eae-flip-box-wrapper:focus .eae-flip-box-front,.fade .eae-flip-box-wrapper:hover .eae-flip-box-front{opacity:0}.fade .eae-flip-box-wrapper:focus .eae-flip-box-back,.fade .eae-flip-box-wrapper:hover .eae-flip-box-back{opacity:1}.eae-fb-animate-flip .eae-flip-box-wrapper{perspective:800px}.eae-fb-animate-flip .eae-flip-box-inner{transform-style:preserve-3d;transform:rotateX(0) rotateY(0) rotateZ(0);transition:1s}.eae-fb-animate-flip .eae-flip-box-front{transform:translate3d(0,0,1px)}.eae-fb-animate-flip .eae-flip-box-back{transform:rotateY(180deg) translate3d(0,0,0)}.eae-fb-animate-flip .eae-flip-box-wrapper:focus .eae-flip-box-inner,.eae-fb-animate-flip .eae-flip-box-wrapper:hover .eae-flip-box-inner{transform:rotateY(180deg)}.up .eae-flip-box-front{transform:translate3d(0,0,1px)}.up .eae-flip-box-back{transform:rotateX(180deg) translate3d(0,0,0)}.up .eae-flip-box-wrapper:focus .eae-flip-box-inner,.up .eae-flip-box-wrapper:hover .eae-flip-box-inner{transform:rotateX(180deg)}.box .eae-flip-box-front{transform:translate3d(0,0,100px) scale(.85,.85)}.box .eae-flip-box-back{transform:rotateY(180deg) translate3d(0,0,100px) scale(.85,.85)}.box.up .eae-flip-box-back{transform:rotateX(180deg) translate3d(0,0,100px) scale(.85,.85)}.hideback .eae-flip-box-back,.hideback .eae-flip-box-front{backface-visibility:hidden}.eae-fb-animate-nananana .eae-flip-box-wrapper:focus .eae-flip-box-front,.eae-fb-animate-nananana .eae-flip-box-wrapper:hover .eae-flip-box-front{z-index:10;animation:batman 1s 2 alternate linear}.eae-fb-animate-flipcard .eae-flip-box-back,.eae-fb-animate-flipcard .eae-flip-box-front{transition:transform .4s ease;transform-origin:center center -150px;-webkit-transform-origin:center center -150px}.flipcard-rotate-top-down .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-top-down .eae-flip-box-back{transform:perspective(0) rotateX(90deg) rotateY(0) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-top-down .eae-flip-box-wrapper:hover .eae-flip-box-front{transform:perspective(0) rotateX(-90deg) rotateY(0) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-top-down .eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:99999;transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-down-top .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-down-top .eae-flip-box-back{transform:perspective(0) rotateX(-90deg) rotateY(0) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-down-top .eae-flip-box-wrapper:hover .eae-flip-box-front{transform:perspective(0) rotateX(90deg) rotateY(0) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-down-top .eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:99999;transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-left-right .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-left-right .eae-flip-box-back{transform:perspective(0) rotateX(0) rotateY(-90deg) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-left-right .eae-flip-box-wrapper:hover .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(90deg) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-left-right .eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:99999;transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-right-left .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}.flipcard-rotate-right-left .eae-flip-box-back{transform:perspective(0) rotateX(0) rotateY(90deg) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-right-left .eae-flip-box-wrapper:hover .eae-flip-box-front{transform:perspective(0) rotateX(0) rotateY(-90deg) rotateZ(0)}.eae-fb-animate-flipcard.flipcard-rotate-right-left .eae-flip-box-wrapper:hover .eae-flip-box-back{z-index:99999;transform:perspective(0) rotateX(0) rotateY(0) rotateZ(0)}@keyframes batman{0%{transform:scale(1,1) rotateZ(0)}100%{transform:scale(0,0) rotateZ(720deg);opacity:0}}.eae-flip-box-back i,.eae-flip-box-front i{font-size:32px;height:1em;width:1em;position:relative;display:block}.eae-flip-box-back i:before,.eae-flip-box-front i:before{position:absolute;left:50%;-webkit-transform:translate(-50%);-moz-transform:translate(-50%);-ms-transform:translate(-50%);-o-transform:translate(-50%);transform:translate(-50%)}.eae-fb-icon-view-framed{border:1px solid #92be43}.eae-fb-icon-shape-circle{border-radius:50%}.eae-flip-box-wrapper .icon-wrapper{display:inline-block;padding:10px;line-height:1}.eae-flip-box-wrapper .back-icon-title,.eae-flip-box-wrapper .front-icon-title{margin:10px auto;color:#fff}.eae-flip-box-wrapper .flipbox-content{display:block;position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%)}.flipbox-content p{margin-bottom:10px}.eae-fb-button{display:inline-block;padding:5px 10px}.eae-flip-box-front{background:#a0ce4e}.eae-flip-box-back{background:#73b9dc}@media only screen and (max-width:768px){.eae-flip-box-back,.eae-flip-box-front,.flipbox-content{cursor:pointer;overflow:visible!important;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}}.elementor-widget-wts-shape-separator svg{display:block}.wts-eae-pl-wrapper ul{margin:0}.wts-eae-pl-wrapper ul li{list-style:none;overflow:hidden;margin-bottom:10px}.eae-pl-img-align-none .eae-pl-image-wrapper a{text-align:center}.eae-pl-title{margin:0}.eae-pl-title a{display:block}.eae-pl-readmore a{display:inline-block;border-radius:2px;color:#fff;padding:4px 8px}.eae-at-animation-text-wrapper{display:inline-block;position:relative;text-align:left}.eae-at-animation-text-wrapper .eae-at-animation-text{display:inline-block;position:absolute;white-space:nowrap;left:0;top:0}[data-elementor-device-mode=mobile] .eae-at-animation-text{white-space:normal}.eae-at-animation-text-wrapper .eae-at-animation-text.is-visible{position:relative}.no-js .eae-at-animation-text-wrapper .eae-at-animation-text{opacity:0}.no-js .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible{opacity:1}.eae-animtext-wrapper{font-size:40px}.eae-st-rest-text{display:inline-block}.eae-st-split-text{display:inline-block}body.rtl .eae-st-transform-text-title{display:flex;flex-direction:row-reverse}body.rtl .eae-text-align-left .eae-st-transform-text-title{justify-content:flex-start}body.rtl .eae-text-align-right .eae-st-transform-text-title{justify-content:flex-end}body.rtl .eae-text-align-center .eae-st-transform-text-title{justify-content:center}.eae-at-animation.type .eae-at-animation-text-wrapper{vertical-align:bottom;overflow:hidden}.eae-at-animation.type .eae-at-animation-text-wrapper::after{content:"";position:absolute;right:0;top:50%;bottom:auto;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);height:90%;width:1px}.eae-at-animation.type .eae-at-animation-text-wrapper.waiting::after{-webkit-animation:cd-pulse 1s infinite;-moz-animation:cd-pulse 1s infinite;animation:cd-pulse 1s infinite}.eae-at-animation.type .eae-at-animation-text-wrapper.selected::after{visibility:hidden}.eae-at-animation.type .eae-at-animation-text{visibility:hidden}.eae-at-animation.type .eae-at-animation-text.is-visible{visibility:visible}.eae-at-animation.type i{position:absolute;visibility:hidden}.eae-at-animation.type i.in{position:relative;visibility:visible}@-webkit-keyframes cd-pulse{0%{-webkit-transform:translateY(-50%) scale(1);opacity:1}40%{-webkit-transform:translateY(-50%) scale(.9);opacity:0}100%{-webkit-transform:translateY(-50%) scale(0);opacity:0}}@-moz-keyframes cd-pulse{0%{-moz-transform:translateY(-50%) scale(1);opacity:1}40%{-moz-transform:translateY(-50%) scale(.9);opacity:0}100%{-moz-transform:translateY(-50%) scale(0);opacity:0}}@keyframes cd-pulse{0%{-webkit-transform:translateY(-50%) scale(1);-moz-transform:translateY(-50%) scale(1);-ms-transform:translateY(-50%) scale(1);-o-transform:translateY(-50%) scale(1);transform:translateY(-50%) scale(1);opacity:1}40%{-webkit-transform:translateY(-50%) scale(.9);-moz-transform:translateY(-50%) scale(.9);-ms-transform:translateY(-50%) scale(.9);-o-transform:translateY(-50%) scale(.9);transform:translateY(-50%) scale(.9);opacity:0}100%{-webkit-transform:translateY(-50%) scale(0);-moz-transform:translateY(-50%) scale(0);-ms-transform:translateY(-50%) scale(0);-o-transform:translateY(-50%) scale(0);transform:translateY(-50%) scale(0);opacity:0}}.eae-img-comp-container{width:100%;position:relative;text-align:center}.eae-img-comp-container img{vertical-align:middle}.eae-img-comp-img{position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;transform:translateZ(0);backface-visibility:hidden}.eae-img-comp-img img{display:block;max-width:100%;width:100%}.eae-img-comp-slider{position:absolute;z-index:9;width:40px;height:40px;background-color:#2196f3;opacity:1;border-radius:50%}.icon-horizontal{cursor:ew-resize}.icon-vertical{cursor:n-resize}.mode-horizontal .eae-img-comp-overlay img{position:absolute;left:0;top:0;display:block;width:auto;height:100%!important;max-width:none!important}.mode-vertical .eae-img-comp-overlay img{position:absolute;left:0;top:0;display:block;width:100%;height:auto!important;max-width:none!important}.eae-img-comp-slider svg,.eae-slider-icon{top:50%;transform:translateY(-50%) translateX(-50%);position:absolute;left:50%;color:#fff}.elementor-widget-wts-ab-image{text-align:center}.elementor-widget-wts-ab-image .elementor-widget-container{display:inline-block;margin:0 auto!important;overflow:hidden}.eae-text-before{position:absolute!important;padding:10px;transition:transform .3s .7s,opacity .3s .7s;color:#d36118;z-index:0;background:rgba(255,255,255,.5);margin:20px}.eae-text-after{position:absolute!important;padding:10px;transition:transform .3s .7s,opacity .3s .7s;color:#d36118;z-index:0;background:rgba(255,255,255,.5);margin:20px}.divTest{display:inline-block;background-color:#00a0d2;padding:20px}.eae-particle-wrapper{position:absolute;left:0;top:0}.eae-particle-wrapper.eae-particle-area{width:100%;height:100%}body:not(.elementor-editor-active) .eae-particle-wrapper{width:100%;height:100%}body:not(.elementor-editor-active) .eae-particle-wrapper .particles-js-canvas-el{height:100%;position:absolute;z-index:0}.eae-section-bs{position:absolute;width:100%;height:100%;top:0}.eae-section-bs-inner{width:100%;height:100%!important}.eae-popup.mfp-bg{top:0;left:0;width:100%;height:100%;z-index:1042;overflow:hidden;position:fixed;background:#0b0b0b;opacity:.8}.eae-popup-link{padding:12px 24px;color:#fff;display:inline-flex;line-height:1}.eae-popup-link svg{fill:#fff}.eae-popup-link:hover{color:#fff}.eae-popup.mfp-wrap{top:0;left:0;width:100%;height:100%;z-index:1043;position:fixed;outline:0!important;-webkit-backface-visibility:hidden}.eae-popup .mfp-container{text-align:center;position:absolute;width:100%;height:100%;left:0;top:0;padding:0 8px;box-sizing:border-box}.eae-popup .mfp-container:before{content:"";display:inline-block;height:100%;vertical-align:middle}.eae-popup .mfp-align-top .mfp-container:before{display:none}.eae-popup .mfp-content{position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:1045}.eae-modal-content{padding:20px}.eae-pop-btn-align-left .eae-popup-wrapper{text-align:left}.eae-pop-btn-align-right .eae-popup-wrapper{text-align:right}.eae-pop-btn-align-center .eae-popup-wrapper{text-align:center}.eae-pop-btn-align-justify .eae-popup-wrapper{text-align:center}.eae-pop-btn-align-justify .eae-popup-wrapper a{display:block}.eae-popup .mfp-ajax-holder .mfp-content,.eae-popup .mfp-inline-holder .mfp-content{width:50%;background-color:#fff;cursor:auto;overflow:hidden}.eae-popup .mfp-ajax-cur{cursor:progress}.eae-popup .mfp-zoom-out-cur,.eae-popup .mfp-zoom-out-cur .mfp-image-holder .eae-close{cursor:-moz-zoom-out;cursor:-webkit-zoom-out;cursor:zoom-out}.eae-popup .mfp-zoom{cursor:pointer;cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.eae-popup.mfp-auto-cursor .mfp-content{cursor:auto}.eae-popup .eae-close,.eae-popup .mfp-arrow,.eae-popup .mfp-counter,.eae-popup .mfp-preloader{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none!important}.eae-popup .mfp-preloader{color:#ccc;position:absolute;top:50%;width:auto;text-align:center;margin-top:-.8em;left:8px;right:8px;z-index:1044}.eae-popup .mfp-preloader a{color:#ccc}.eae-popup .mfp-preloader a:hover{color:#fff}.mfp-s-ready .mfp-preloader{display:none}.mfp-s-error .mfp-content{display:none}button.eae-close,button.mfp-arrow{overflow:visible;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;display:block;outline:0;padding:0;z-index:1046;box-shadow:none;touch-action:manipulation}button::-moz-focus-inner{padding:0;border:0}.eae-popup .eae-close{width:28px;height:28px;line-height:1em;position:absolute;right:10px;top:10px;text-decoration:none;text-align:center;opacity:1;color:#fff;font-size:28px;z-index:1500}.eae-close:focus,.eae-close:hover{opacity:1;cursor:pointer}.eae-close:active{top:1px}.eae-close:before{top:50%;left:50%;position:absolute;transform:translate(-50%,-50%)}.eae-popup.eae-close-btn-in .eae-close{color:#fff}.mfp-iframe-holder .eae-close,.mfp-image-holder .eae-close{color:#fff;right:-6px;text-align:right;padding-right:6px;width:100%}.mfp-counter{position:absolute;top:0;right:0;color:#ccc;font-size:12px;line-height:18px;white-space:nowrap}.mfp-arrow{position:absolute;opacity:.65;margin:0;top:50%;margin-top:-55px;padding:0;width:90px;height:110px;-webkit-tap-highlight-color:transparent}.mfp-arrow:active{margin-top:-54px}.mfp-arrow:focus,.mfp-arrow:hover{opacity:1}.mfp-arrow:after,.mfp-arrow:before{content:"";display:block;width:0;height:0;position:absolute;left:0;top:0;margin-top:35px;margin-left:35px;border:medium inset transparent}.mfp-arrow:after{border-top-width:13px;border-bottom-width:13px;top:8px}.mfp-arrow:before{border-top-width:21px;border-bottom-width:21px;opacity:.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after{border-right:17px solid #fff;margin-left:31px}.mfp-arrow-left:before{margin-left:25px;border-right:27px solid #3f3f3f}.mfp-arrow-right{right:0}.mfp-arrow-right:after{border-left:17px solid #fff;margin-left:39px}.mfp-arrow-right:before{border-left:27px solid #3f3f3f}.mfp-iframe-holder{padding-top:40px;padding-bottom:40px}.mfp-iframe-holder .mfp-content{line-height:0;width:100%;max-width:900px}.mfp-iframe-holder .eae-close{top:-40px}.mfp-iframe-scaler{width:100%;height:0;overflow:hidden;padding-top:56.25%}.mfp-iframe-scaler iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;box-shadow:0 0 8px rgba(0,0,0,.6);background:#000}img.mfp-img{width:auto;max-width:100%;height:auto;display:block;line-height:0;box-sizing:border-box;padding:40px 0 40px;margin:0 auto}.eae-popup .mfp-figure{line-height:0}.eae-popup .mfp-figure:after{content:"";position:absolute;left:0;top:40px;bottom:40px;display:block;right:0;width:auto;height:auto;z-index:-1;box-shadow:0 0 8px rgba(0,0,0,.6);background:#444}.eae-popup .mfp-figure small{color:#bdbdbd;display:block;font-size:12px;line-height:14px}.eae-popup .mfp-figure figure{margin:0}.eae-popup .mfp-bottom-bar{margin-top:-36px;position:absolute;top:100%;left:0;width:100%;cursor:auto}.eae-popup .mfp-title{text-align:left;line-height:1;word-wrap:break-word;color:#fff;background-color:#4054b2;padding:20px 20px 20px 20px}.eae-popup .mfp-image-holder .mfp-content{max-width:100%}.eae-popup .mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-width:800px) and (orientation:landscape),screen and (max-height:300px){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{top:0;bottom:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:rgba(0,0,0,.6);bottom:0;margin:0;top:auto;padding:3px 5px;position:fixed;box-sizing:border-box}.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .eae-close{top:0;right:0;width:35px;height:35px;line-height:35px;background:rgba(0,0,0,.6);position:fixed;text-align:center;padding:0}}.elementor-element.eae-animated-gradient-yes,.elementor-element.eae-animated-gradient-yes .animated-gradient{background-size:400% 400%!important;-webkit-animation:AnimateGradient 15s ease-in-out infinite;-moz-animation:AnimateGradient 15s ease-in-out infinite;animation:AnimateGradient 15s ease-in-out infinite}.animated-gradient{position:absolute;top:0;left:0;height:100%;width:100%}@-webkit-keyframes AnimateGradient{0%{background-position:0 50%}50%{background-position:100% 50%}100%{background-position:0 50%}}@-moz-keyframes AnimateGradient{0%{background-position:0 50%}50%{background-position:100% 50%}100%{background-position:0 50%}}@keyframes AnimateGradient{0%{background-position:0 50%}50%{background-position:100% 50%}100%{background-position:0 50%}}.eae-swiper-outer-wrapper .swiper-slide{height:auto;overflow:inherit}.eae-swiper-outer-wrapper .swiper-slide-wrapper,.eae-swiper-outer-wrapper .testimonial-wrapper{height:100%}.eae-grid{display:flex;flex-wrap:wrap;flex-direction:row}.eae-masonry- .eae-grid-item{position:relative;height:100%}.eae-masonry- .eae-grid-item .testimonial-wrapper{height:100%}.eae-grid-container{transition:.1s all ease}.eae-grid-container{display:inline-block}.wrapper .content{margin:10px 0}.skin-2.testimonial-wrapper{display:flex;flex-direction:column;background-color:#9c989821;min-height:300px;padding:10px 20px;box-shadow:0 0 5px rgba(0,0,0,.15);color:#696969}.skin-2 .content-wrapper{padding:10px;position:relative;background-color:#fff;border-radius:10px;color:#77778e}.skin-2 i.after-content,.skin-2 i.before-content{position:absolute}.skin-2 i.before-content{top:10px;left:20px}.skin-2 i.after-content{bottom:10px;right:20px}.skin-2 blockquote{position:relative;font-size:14px;padding:10px;font-weight:500;text-align:left;margin:0;line-height:1.6em;font-style:italic}.skin-2 blockquote::after,.skin-2 blockquote::before{font-family:FontAwesome;content:"\201C";position:absolute;font-size:50px;opacity:.3;font-style:normal}.skin-2 blockquote::before{top:10px;left:20px}.skin-2 blockquote::after{content:"\201D";right:20px}.skin-2 .image-wrapper{position:relative;max-width:100%;text-align:center}.skin-2 img{width:100px;border-radius:25%}.skin-2 .detail-wrapper{text-align:center}.skin-2 .company,.skin-2 .designation,.skin-2 .rating-wrapper,.skin-2 .title{padding:5px 0}.skin-2 .rating-wrapper{color:navy}.skin-2 .title{font-weight:800;color:#000}.skin-2 blockquote p{margin:10px 0!important}.skin-1.testimonial-wrapper{display:flex;flex-direction:column;background-color:#fff;box-shadow:0 0 5px rgba(0,0,0,.15);color:#000}.skin-1 .content-wrapper{order:0}.skin-1 .image-wrapper{order:1;text-align:center;margin:15px 0}.skin-1 .detail-wrapper{order:2}.skin-1 .content-wrapper{padding:10px;position:relative}.skin-1 i.after-content,.skin-1 i.before-content{position:absolute}.skin-1 i.before-content{top:10px;left:20px}.skin-1 i.after-content{bottom:10px;right:20px}.skin-1 blockquote{position:relative;background-color:#fff;font-size:14px;padding:10px;font-weight:500;text-align:left;margin:0;line-height:1.6em;font-style:italic}.skin-1 blockquote::after,.skin-1 blockquote::before{font-family:FontAwesome;content:"\201C";position:absolute;font-size:50px;opacity:.3;font-style:normal}.skin-1 blockquote::before{top:10px;left:20px}.skin-1 blockquote::after{content:"\201D";right:20px}.skin-1 .image-wrapper{position:relative;max-width:100%}.skin-1 img{width:100px;height:auto;border-radius:50%}.skin-1 .detail-wrapper{display:flex;flex-direction:row-reverse;justify-content:space-between;padding:10px;background-color:rgba(157,163,156,.18)}.skin-1 .designation,.skin-1 .rating-wrapper,.skin-1 .title{margin:0 5px}.skin-1 .title-wrapper{display:flex;flex-direction:row}.skin-1 .rating-wrapper{color:#fecc1f}.skin-4.testimonial-wrapper{flex-direction:column;display:flex;background-color:#bfbfb6bd;min-height:300px;padding:10px 0;box-shadow:0 0 5px rgba(0,0,0,.15);color:#77778e}.skin-4 .content-wrapper{padding:10px;position:relative}.skin-4 .content-wrapper{order:2;color:#3c3c3c}.skin-4 i.after-content,.skin-4 i.before-content{position:absolute}.skin-4 i.before-content{top:10px;left:20px}.skin-4 i.after-content{bottom:10px;right:20px}.skin-4 blockquote{position:relative;font-size:14px;padding:10px;font-weight:500;text-align:left;margin:0;line-height:1.6em;font-style:italic}.skin-4 blockquote::after,.skin-4 blockquote::before{font-family:FontAwesome;content:"\201C";position:absolute;font-size:50px;opacity:.3;font-style:normal}.skin-4 blockquote::before{top:10px;left:20px}.skin-4 blockquote::after{content:"\201D";right:20px}.skin-4 .image-wrapper{position:relative;max-width:100%;text-align:center}.skin-4 img{width:100px;border-radius:50%}.skin-4 .detail-wrapper{text-align:center}.skin-2 .designation,.skin-2 .title,.skin-4 .rating-wrapper{padding:5px 0}.skin-4 .rating-wrapper{color:#690a69}.skin-4 .title{font-weight:800;color:#000}.skin-3.testimonial-wrapper{display:flex;flex-direction:row;background-color:#9c989821;box-shadow:0 0 5px rgba(0,0,0,.15);color:#000;overflow:hidden}.skin-3 .content-section{display:flex;flex-direction:column;align-self:center}.skin-3 .content-wrapper{padding:10px;position:relative}.skin-2 i.after-content,.skin-3 i.before-content{position:absolute}.skin-3 i.before-content{top:10px;left:20px}.skin-3 i.after-content{bottom:10px;right:20px}.skin-3 blockquote{position:relative;font-size:18px;padding:10px;font-weight:500;text-align:left;margin:0;line-height:1.6em;font-style:italic}.skin-3 blockquote::after,.skin-3 blockquote::before{font-family:FontAwesome;content:"\201C";position:absolute;font-size:50px;opacity:.3;font-style:normal}.skin-3 blockquote::before{top:10px;left:20px}.skin-3 blockquote::after{content:"\201D";right:20px}.skin-3 .image-wrapper{position:relative;max-width:30%;max-height:250px;text-align:center;align-self:center}.skin-3 img{width:100%}.testimonial-wrapper .skin-3 .eae-person-avatar{border-radius:50%}.skin-3 .detail-wrapper{text-align:left;padding-left:20px}.skin-3 .designation,.skin-3 .rating-wrapper,.skin-3 .title{padding:3px 0}.skin-3 .rating-wrapper{color:#800040}.skin-3 .title{font-weight:800}.eae-swiper-outer-wrapper .swiper-button-prev{-webkit-mask:url(arrow-left.svg) no-repeat 100% 100%;mask:url(arrow-left.svg) no-repeat 100% 100%;-webkit-mask-size:cover;mask-size:cover;background-image:none;background-color:#007aff;transform:translateY(-50%);margin-top:0}.eae-swiper-outer-wrapper .swiper-container-rtl .swiper-button-prev{-webkit-mask:url(arrow-right.svg) no-repeat 100% 100%;mask:url(arrow-right.svg) no-repeat 100% 100%}.eae-swiper-outer-wrapper .swiper-button-next{-webkit-mask:url(arrow-right.svg) no-repeat 100% 100%;mask:url(arrow-right.svg) no-repeat 100% 100%;-webkit-mask-size:cover;mask-size:cover;background-image:none;background-color:#007aff;transform:translateY(-50%);margin-top:0}.eae-swiper-outer-wrapper .swiper-container-rtl .swiper-button-next{-webkit-mask:url(arrow-left.svg) no-repeat 100% 100%;mask:url(arrow-left.svg) no-repeat 100% 100%}.elementor-widget-wts-testimonial-slider .eae-swiper-outer-wrapper .swiper-button-next,.elementor-widget-wts-testimonial-slider .eae-swiper-outer-wrapper .swiper-button-prev{-webkit-mask:none;mask:none;-webkit-mask-size:unset;mask-size:unset;background-image:none;background-color:unset;width:auto;height:auto;transform:translateY(-50%);margin-top:0}.swiper-container .swiper-button-next i,.swiper-container .swiper-button-prev i{width:1em;height:1em;text-align:center;position:relative}.elementor-widget-wts-testimonial-slider .eae-swiper-outer-wrapper .eae-swiper-button-wrapper{position:absolute;height:auto;line-height:0}.eae-hpos-right.eae-vpos-top .eae-swiper-button-wrapper{bottom:auto;top:0;width:auto;right:0}.eae-vpos-top.eae-hpos-left .eae-swiper-button-wrapper{bottom:auto;top:0;width:auto;left:0}.eeae-hpos-right.eae-vpos-bottom .eae-swiper-button-wrapper{bottom:0;top:auto;width:auto;right:0}.eae-vpos-bottom.eae-hpos-left .eae-swiper-button-wrapper{bottom:0;top:auto;width:auto;left:0}.eae-hpos-right.eae-vpos-middle .eae-swiper-button-wrapper{bottom:auto;top:50%;width:auto;right:0}.eae-hpos-left.eae-vpos-middle .eae-swiper-button-wrapper{bottom:auto;top:50%;width:auto;left:0}.eae-hpos-left .swiper-button-next,.eae-hpos-left .swiper-button-prev,.eae-hpos-right .swiper-button-next,.eae-hpos-right .swiper-button-prev{position:relative;display:inline-block;right:auto;left:auto}.eae-hpos-right.eae-vpos-bottom .swiper-button-next,.eae-hpos-right.eae-vpos-bottom .swiper-button-prev{top:auto;bottom:0;transform:unset}.eae-hpos-right.eae-vpos-top .swiper-button-next,.eae-hpos-right.eae-vpos-top .swiper-button-prev{top:0;bottom:auto;transform:unset}.eae-hpos-left.eae-vpos-top .swiper-button-next,.eae-hpos-left.eae-vpos-top .swiper-button-prev{top:0;bottom:auto;transform:unset}.eae-hpos-left.eae-vpos-bottom .swiper-button-next,.eae-hpos-left.eae-vpos-bottom .swiper-button-prev{top:auto;bottom:0;transform:unset}.eae-hpos-center.eae-vpos-bottom .swiper-button-next,.eae-hpos-center.eae-vpos-bottom .swiper-button-prev{top:auto;bottom:0;transform:unset}.eae-hpos-center.eae-vpos-top .swiper-button-next,.eae-hpos-center.eae-vpos-top .swiper-button-prev{top:0;bottom:auto;transform:unset}@media all and (max-width:900px){.mfp-arrow{-webkit-transform:scale(.75);transform:scale(.75)}.mfp-arrow-left{-webkit-transform-origin:0;transform-origin:0}.mfp-arrow-right{-webkit-transform-origin:100%;transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}.eae-info-circle{position:relative;width:90%;margin:0 auto;border-radius:50%;display:block}.eae-info-circle:before{content:"";display:block;position:absolute;top:4%;left:4%;width:92%;height:92%;border-radius:50%;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;pointer-events:none}.eae-info-circle:after{content:"";display:block;padding-top:100%}.eae-info-circle .eae-ic-icon-wrap{position:absolute;display:inline-block;top:50%;left:50%;z-index:2;line-height:1em;vertical-align:middle;overflow:hidden;max-width:100%}.eae-info-circle .eae-info-circle-item{top:0;left:0;width:100%;height:100%;display:block}.eae-info-circle .eae-info-circle-item.eae-active .eae-info-circle-item__content-wrap{visibility:visible;opacity:1;display:flex}.eae-info-circle .eae-info-circle-item__content-wrap{visibility:visible;display:none;height:91%;width:91%;opacity:0;top:50%;transform:translateY(-50%) translateX(-50%);position:absolute;left:50%;border-radius:50%;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.eae-info-circle .eae-info-circle-item__content-wrap:before{content:"";display:inline-block;height:100%;vertical-align:middle}.eae-info-circle .eae-info-circle-item__content{display:inline-block;top:50%;transform:translateY(-50%) translateX(-50%);position:absolute;left:50%;vertical-align:middle;z-index:1;max-height:100%;overflow:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;text-align:center;width:75%}@media screen and (max-width:767px){.eae-info-circle.eae-info-circle .eae-info-circle-item__content-wrap:before{display:none}.eae-info-circle:after,.eae-info-circle:before{display:none}.eae-info-circle{width:100%!important}.eae-info-circle-wrapper:after,.eae-info-circle-wrapper:before{display:none}.eae-info-circle .eae-ic-icon-wrap{display:block;text-align:center;position:relative!important;left:unset!important;margin-left:0!important;margin-top:0!important;margin-bottom:10px}.eae-info-circle-item{position:relative!important;border-radius:0!important;padding:0;margin:10px 0}.eae-info-circle .eae-info-circle-item__content-wrap{visibility:visible;opacity:1!important;display:flex!important;border-radius:0!important;border:none!important;margin:0!important;padding-right:0!important;padding-left:0!important;padding-bottom:0!important;width:100%;height:auto;line-height:1.5em;position:relative;top:unset;left:unset;transform:unset}.eae-info-circle .eae-info-circle-item__content{position:relative;top:unset;left:unset;transform:unset;width:100%;padding:10px}}.eae-icon-wrap i{height:1.25em;width:1.25em;line-height:1.25em;display:block}.eae-icon-wrap i img{top:50%;left:50%;transform:translateX(-50%) translateY(-50%);position:absolute}.eae-icon{display:inline-block;text-align:center;vertical-align:middle;max-width:100%;overflow:hidden;padding:10px}.eae-icon-shape-circle:not(.elementor-element){border-radius:50%}.eae-icon-view-framed:not(.elementor-element){border-width:1px;border-style:solid}.eae-icon-wrapper{display:flex}.eae-icon-wrapper .eae-icon{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);line-height:1}.eae-timeline{position:relative;display:inline-block;width:100%}.eae-timline-progress-bar{width:4px;background-color:#f45b69;top:0;bottom:50px;position:absolute;transform:translateX(-50%)}.eae-timeline-item{position:relative;display:flex;flex-direction:row;padding-bottom:50px}.eae-timeline-item:last-child{padding-bottom:0!important}.eae-tl-top .eae-timeline-item{align-items:flex-start}.eae-tl-top .eae-tl-item-content::before{top:10px}.eae-timeline-item.image-position-row .eae-tl-item-image,.eae-timeline-item.image-position-row-reverse .eae-tl-item-image{margin-top:0;margin-bottom:0}.eae-tl-item-meta-wrapper-inner{display:none}.eae-tl-bottom .eae-timeline-item{align-items:flex-end}.eae-tl-bottom .eae-tl-item-content::before{bottom:10px}.eae-tl-center .eae-timeline-item{align-items:center}.eae-tl-center .eae-tl-item-content::before{bottom:calc(50% - 5px)}.eae-layout-center .eae-timline-progress-bar{left:50%}.eae-layout-center .eae-timeline-item:nth-child(odd){flex-direction:row-reverse}.eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-item-meta-wrapper{margin-right:0;margin-left:0;justify-content:flex-start}body.rtl[data-elementor-device-mode=tablet] .eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-content-wrapper,body:not(.rtl)[data-elementor-device-mode=tablet] .eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-content-wrapper{padding-right:20px;padding-left:0}body.rtl[data-elementor-device-mode=tablet] .eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-content-wrapper,body:not(.rtl)[data-elementor-device-mode=tablet] .eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-content-wrapper{padding-right:0;padding-left:20px}body:not(.rtl) .eae-layout-left .eae-tl-content-wrapper{padding-right:10px;padding-left:20px}body.rtl .eae-layout-left .eae-tl-content-wrapper{padding-right:20px;padding-left:10px}.eae-layout-left .eae-timline-progress-bar{display:none}.eae-layout-left .eae-tl-item-meta-wrapper{display:none}.eae-layout-left .eae-tl-item-meta-wrapper-inner{display:block}.eae-layout-right .eae-timline-progress-bar{display:none}body:not(.rtl) .eae-layout-right .eae-tl-content-wrapper{padding-right:20px;padding-left:10px}body.rtl .eae-layout-right .eae-tl-content-wrapper{padding-right:10px;padding-left:20px}.eae-layout-right .eae-tl-icon-wrapper{order:3}.eae-layout-right .eae-tl-item-meta-wrapper{display:none}.eae-layout-right .eae-tl-item-meta-wrapper-inner{display:block}.eae-tl-item-meta-wrapper{flex-grow:1;order:0;flex-basis:50%;flex-direction:initial;justify-content:flex-end;display:flex;align-items:center;margin-right:0}.eae-tl-item-meta{padding:0 20px}.eae-tl-icon-wrapper{height:auto;width:auto;flex-grow:0;flex-shrink:0;order:1;margin-left:0;margin-right:0;min-width:10px;min-height:10px;border-radius:999px;position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.eae-tl-content-wrapper{flex-grow:1;order:2;flex-basis:50%;position:relative;padding-right:0;padding-left:20px}.eae-tl-item-content{background:#f4f4f4;padding:25px;overflow:hidden;text-align:center;display:flex;flex-direction:row}.eae-tl-content{display:inline-block;position:relative;padding:10px;width:100%;color:#000}.eae-timeline-item.custom-image-style-yes.image-position-row .eae-content-inner,.eae-timeline-item.custom-image-style-yes.image-position-row-reverse .eae-content-inner,.image-position-row .eae-timeline .eae-timeline-item:not(.custom-image-style-yes) .eae-content-inner,.image-position-row-reverse .eae-timeline .eae-timeline-item:not(.custom-image-style-yes) .eae-content-inner{position:relative;left:50%;top:50%;transform:translate(-50%,-50%);line-height:1;width:100%}.custom-image-style-.image-position-row .eae-content-inner,.custom-image-style-.image-position-row-reverse .eae-content-inner,.custom-image-style-no.image-position-row .eae-content-inner,.custom-image-style-no.image-position-row-reverse .eae-content-inner{left:unset;top:unset;transform:unset}.eae-tl-item-image{display:inline-block}.image-position-row .eae-tl-item-image img,.image-position-row-reverse .eae-tl-item-image img{object-fit:cover;height:100%!important}.image-position-row .eae-tl-item-image,.image-position-row-reverse .eae-tl-item-image{margin:0}.image-position-column .eae-tl-item-image{margin:auto}.custom-image-style-.image-position-column .eae-tl-item-image,.custom-image-style-no.image-position-column .eae-tl-item-image{margin:0 auto}.eae-pb-inner-line{width:100%;background-color:#3d5ac3}.eae-tl-item-content::before{content:"";position:absolute;width:0;height:0;border-style:solid;border-width:8px 16px 8px 0;border-color:transparent #f4f4f4 transparent transparent}.eae-icon-wrapper{display:flex}.elementor-widget-bpel-timeline .eae-icon-wrapper{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);line-height:1}.eae-tl-read-more{display:inline-block;padding:5px;border:2px solid #000}.image-position-row .eae-timeline.eae-timeline-alternate-yes .eae-timeline-item:nth-child(odd):not(.custom-image-style-yes) .eae-tl-item-content{flex-direction:row-reverse!important}.image-position-row-reverse .eae-timeline.eae-timeline-alternate-yes .eae-timeline-item:nth-child(odd):not(.custom-image-style-yes) .eae-tl-item-content{flex-direction:row!important}@media screen and (min-width:1024px){.eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-content-wrapper,body.rtl .eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-content-wrapper{padding-right:20px;padding-left:0}.eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-content-wrapper,body.rtl .eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-content-wrapper{padding-right:0;padding-left:20px}.eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,.eae-layout-right .eae-tl-item-content::before,body.rtl .eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-item-content::before,body.rtl .eae-layout-left .eae-tl-item-content::before{right:4px;left:unset;border-width:8px 0 8px 16px;border-color:transparent transparent transparent #f4f4f4}.eae-layout-center .eae-timeline-item:nth-child(even) .eae-tl-item-content::before,.eae-layout-left .eae-tl-item-content::before,body.rtl .eae-layout-center .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,body.rtl .eae-layout-right .eae-tl-item-content::before{left:4px;right:unset;border-width:8px 16px 8px 0;border-color:transparent #f4f4f4 transparent transparent}}@media screen and (max-width:1023px) and (min-width:768px){.image-position-row .eae-timeline.eae-timeline-alternate-yes .eae-timeline-item:nth-child(odd):not(.custom-image-style-yes) .eae-tl-item-content{flex-direction:row-reverse!important}.image-position-row-reverse .eae-timeline.eae-timeline-alternate-yes .eae-timeline-item:nth-child(odd):not(.custom-image-style-yes) .eae-tl-item-content{flex-direction:row!important}.eae-tl-res-style-mobile-tablet .eae-tl-item-meta-wrapper{display:none}.eae-tl-res-style-mobile-tablet .eae-tl-item-meta-wrapper-inner{display:block}.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item{flex-direction:row!important}.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item{flex-direction:row-reverse!important}.eae-layout-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before,.eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(even) .eae-tl-item-content::before,body.rtl .eae-layout-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-layout-right .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-layout-right .eae-tl-item-content::before,body.rtl .eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,body:not(.rtl) .eae-layout-left .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-left .eae-tl-item-content::before{left:4px!important;border-width:8px 16px 8px 0!important;border-color:transparent #f4f4f4 transparent transparent!important}body.rtl .eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before{left:4px!important;right:unset!important;border-width:8px 16px 8px 0!important;border-color:transparent #f4f4f4 transparent transparent!important}.eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,body.rtl .eae-layout-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-layout-left .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-layout-left .eae-tl-item-content::before,body.rtl .eae-timeline.eae-layout-center.eae-tl-res-style-mobile .eae-timeline-item:nth-child(even) .eae-tl-item-content::before,body:not(.rtl) .eae-layout-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-right .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before{right:4px!important;border-width:8px 0 8px 16px!important;border-color:transparent transparent transparent #f4f4f4!important}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper,body.rtl .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper{padding-right:0!important;padding-left:20px!important}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper,body.rtl .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper{padding-right:20px!important;padding-left:0!important}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timline-progress-bar{left:13px}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timline-progress-bar{left:calc(100% - 13px)}}@media screen and (max-width:767px){.eae-tl-item-meta-wrapper{display:none}.eae-tl-item-meta-wrapper-inner{display:block}.elementor-widget-bpel-timeline:not(.image-position-column) .eae-timeline .eae-tl-item-content{flex-direction:column-reverse!important}.eae-tl-item-image,.elementor-widget-bpel-timeline:not(.image-position-column) .eae-tl-content{width:100%!important}.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item,.eae-tl-res-style-mobile.eae-tl-res-layout-left .eae-timeline-item{flex-direction:row!important}.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item,.eae-tl-res-style-mobile.eae-tl-res-layout-right .eae-timeline-item{flex-direction:row-reverse!important}.eae-timeline.eae-layout-center.eae-tl-center.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,.eae-timeline.eae-layout-center.eae-tl-center.eae-tl-res-style-mobile.eae-tl-res-layout-left .eae-timeline-item:nth-child(odd) .eae-tl-item-content::before,body.rtl .eae-timeline.eae-layout-right .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-timeline.eae-tl-res-style-mobile.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-left .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before{left:4px!important;border-width:8px 16px 8px 0!important;border-color:transparent #f4f4f4 transparent transparent!important}body.rtl .eae-layout-left .eae-timeline-item .eae-tl-item-content::before,body.rtl .eae-tl-res-style-mobile.eae-tl-res-layout-left .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before,body:not(.rtl) .eae-tl-res-style-mobile.eae-tl-res-layout-right .eae-timeline-item .eae-tl-item-content::before{right:4px!important;border-width:8px 0 8px 16px!important;border-color:transparent transparent transparent #f4f4f4!important}.eae-timeline.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper body.rtl .eae-timeline.eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper,body:not(.rtl) .eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper{padding-right:0!important;padding-left:20px!important}body.rtl .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper,body.rtl .eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper,body:not(.rtl) .eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper,body:not(.rtl) .eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper{padding-right:20px!important;padding-left:0!important}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-left .eae-timline-progress-bar,.eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-left .eae-timline-progress-bar{left:13px}.eae-tl-res-style-mobile-tablet.eae-layout-center.eae-tl-res-layout-right .eae-timline-progress-bar,.eae-tl-res-style-mobile.eae-layout-center.eae-tl-res-layout-right .eae-timline-progress-bar{left:calc(100% - 13px)}body.rtl .eae-layout-center.eae-timeline.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-right .eae-timeline-item .eae-tl-content-wrapper .eae-tl-item-content::before{left:4px;right:unset}body.rtl .eae-layout-center.eae-timeline.eae-tl-res-style-mobile-tablet.eae-tl-res-layout-left .eae-timeline-item .eae-tl-content-wrapper .eae-tl-item-content::before{left:unset;right:4px;border-width:8px 0 8px 16px!important;border-color:transparent transparent transparent #f4f4f4!important}}[data-element_type="eae-evergreen-timer.skin1"] .eae-evergreen-wrapper{display:block;text-align:center}[data-element_type="eae-evergreen-timer.skin1"] #eaeclockdiv{font-family:sans-serif;color:#fff;display:inline-block;font-weight:100;text-align:center;font-size:30px}[data-element_type="eae-evergreen-timer.skin1"] .eae-time-wrapper{padding:10px;border-radius:3px;background:#00bf96;display:inline-block;overflow:hidden}[data-element_type="eae-evergreen-timer.skin1"] #eaeclockdiv div>span{padding:15px;width:100%;background:#00816a;display:inline-block}[data-element_type="eae-evergreen-timer.skin1"] .smalltext{padding:7px;font-size:16px}[data-element_type="eae-evergreen-timer.skin1"] .eae-egt-hide{display:none}.eae-egt-message{display:none}@media screen and (max-width:767px){[data-element_type="eae-evergreen-timer.skin1"] #eaeclockdiv div>span{padding:5px}[data-element_type="eae-evergreen-timer.skin1"] .eae-time-wrapper{padding:5px}}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden;backface-visibility:hidden}[data-element_type="eae-evergreen-timer.skin2"] .eae-evergreen-wrapper{display:inline-block;width:100%;text-align:center;margin:auto}[data-element_type="eae-evergreen-timer.skin2"] .timer-container{display:inline-block}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper a{cursor:pointer;text-decoration:none;color:#ccc}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper a:hover{color:#fff}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul{list-style:none}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper.clearfix:after,[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper.clearfix:before{content:" ";display:table}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper.clearfix:after{clear:both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper{font:normal 11px "Helvetica Neue",Helvetica,sans-serif;-webkit-user-select:none}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-meridium{background:0 0!important;box-shadow:0 0 0!important;font-size:36px!important}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-meridium a{color:#313333}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper{text-align:center;position:relative;width:100%;margin:1em}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper:after,[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper:before{content:" ";display:table}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper:after{clear:both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul{position:relative;float:left;margin:5px;width:60px;height:90px;font-size:80px;font-weight:700;line-height:87px;border-radius:6px;background:#000}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:87px;text-decoration:none!important}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li:first-child{z-index:2}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;-moz-perspective:200px;perspective:200px;margin:0!important;overflow:visible!important;cursor:default!important}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;-moz-transform-origin:50% 100%;-ms-transform-origin:50% 100%;-o-transform-origin:50% 100%;transform-origin:50% 100%;top:0}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.up:after{content:"";position:absolute;top:44px;left:0;z-index:5;width:100%;height:3px;background-color:#000;background-color:rgba(0,0,0,.4)}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-ms-transform-origin:50% 0;-o-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div div.inn{position:absolute;left:0;z-index:1;width:100%;height:200%;color:#ccc;text-shadow:0 1px 2px #000;text-align:center;background-color:#333;border-radius:6px;font-size:70px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.up div.inn{top:0}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div.down div.inn{bottom:0}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-before{z-index:3}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,.7)}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-active{-webkit-animation:asd 10ms .49s linear both;-moz-animation:asd 10ms .49s linear both;animation:asd 10ms .49s linear both;z-index:5}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider{float:left;display:inline-block;position:relative;width:20px;height:100px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider:first-child{width:0}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-dot{display:block;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,.5);left:5px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider .flip-clock-label{position:absolute;top:-1.5em;right:-86px;color:#000;text-shadow:none}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider.minutes .flip-clock-label{right:-88px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider.seconds .flip-clock-label{right:-91px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-dot.top{top:30%}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-dot.bottom{bottom:30%}@-webkit-keyframes asd{0%{z-index:2}100%{z-index:4}}@-moz-keyframes asd{0%{z-index:2}100%{z-index:4}}@-o-keyframes asd{0%{z-index:2}100%{z-index:4}}@keyframes asd{0%{z-index:2}100%{z-index:4}}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-active .down{z-index:2;-webkit-animation:turn .5s .5s linear both;-moz-animation:turn .5s .5s linear both;animation:turn .5s .5s linear both}@-webkit-keyframes turn{0%{-webkit-transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0)}}@-moz-keyframes turn{0%{-moz-transform:rotateX(90deg)}100%{-moz-transform:rotateX(0)}}@-o-keyframes turn{0%{-o-transform:rotateX(90deg)}100%{-o-transform:rotateX(0)}}@keyframes turn{0%{transform:rotateX(90deg)}100%{transform:rotateX(0)}}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-before .up{z-index:2;-webkit-animation:turn2 .5s linear both;-moz-animation:turn2 .5s linear both;animation:turn2 .5s linear both}@-webkit-keyframes turn2{0%{-webkit-transform:rotateX(0)}100%{-webkit-transform:rotateX(-90deg)}}@-moz-keyframes turn2{0%{-moz-transform:rotateX(0)}100%{-moz-transform:rotateX(-90deg)}}@-o-keyframes turn2{0%{-o-transform:rotateX(0)}100%{-o-transform:rotateX(-90deg)}}@keyframes turn2{0%{transform:rotateX(0)}100%{transform:rotateX(-90deg)}}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li.flip-clock-active{z-index:3}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-before .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,#000));background:linear,top,rgba(0,0,0,.1) 0,#000 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:linear,to bottom,rgba(0,0,0,.1) 0,#000 100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-active .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,#000));background:linear,top,rgba(0,0,0,.1) 0,#000 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1) 0,#000 100%);background:linear,to bottom,rgba(0,0,0,.1) 0,#000 100%;-webkit-animation:hide .5s .3s linear both;-moz-animation:hide .5s .3s linear both;animation:hide .5s .3s linear both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-before .down .shadow{background:-moz-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#000),color-stop(100%,rgba(0,0,0,.1)));background:linear,top,#000 0,rgba(0,0,0,.1) 100%;background:-o-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:-ms-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:linear,to bottom,#000 0,rgba(0,0,0,.1) 100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul.play li.flip-clock-active .down .shadow{background:-moz-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#000),color-stop(100%,rgba(0,0,0,.1)));background:linear,top,#000 0,rgba(0,0,0,.1) 100%;background:-o-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:-ms-linear-gradient(top,#000 0,rgba(0,0,0,.1) 100%);background:linear,to bottom,#000 0,rgba(0,0,0,.1) 100%;-webkit-animation:hide .5s .3s linear both;-moz-animation:hide .5s .3s linear both;animation:hide .5s .2s linear both}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@-moz-keyframes show{0%{opacity:0}100%{opacity:1}}@-o-keyframes show{0%{opacity:0}100%{opacity:1}}@keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@-moz-keyframes hide{0%{opacity:1}100%{opacity:0}}@-o-keyframes hide{0%{opacity:1}100%{opacity:0}}@keyframes hide{0%{opacity:1}100%{opacity:0}}@media screen and (max-width:767px){[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider{width:15px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-dot{height:5px;width:5px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul{height:40px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider{height:50px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li{line-height:37px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul li a div div.inn{font-size:24px}[data-element_type="eae-evergreen-timer.skin2"] .eae-flip-clock-wrapper ul{margin:2px}}[data-element_type="eae-evergreen-timer.skin3"] #timer{font-family:sans-serif;color:#fff;display:inline-block;font-weight:100;text-align:center;font-size:30px}[data-element_type="eae-evergreen-timer.skin3"] .desc{display:flex;justify-content:center}[data-element_type="eae-evergreen-timer.skin3"].eae-egt-content-align-right .desc{justify-content:flex-end}[data-element_type="eae-evergreen-timer.skin3"].eae-egt-content-align-left .desc{justify-content:flex-start}[data-element_type="eae-evergreen-timer.skin3"] .desc .egt-time-text{display:inline-block;padding:0 50px 0 50px}[data-element_type="eae-evergreen-timer.skin3"] .eae-time-wrapper{padding:50px;border-radius:3px;background:#00bf96;display:inline-block;overflow:hidden;margin:5px;line-height:1em}[data-element_type="eae-evergreen-timer.skin3"] #timer span:nth-child(1){background:khaki}[data-element_type="eae-evergreen-timer.skin3"] #timer span:nth-child(2){background:#cd5c5c}[data-element_type="eae-evergreen-timer.skin3"] #timer span:nth-child(3){background:#5f9ea0}[data-element_type="eae-evergreen-timer.skin3"] #timer span:nth-child(4){background:#6495ed}[data-element_type="eae-evergreen-timer.skin3"] .fade{animation:flip .7s ease forwards}@keyframes flip{0%{transform:rotateY(0) scaleY(1.1);opacity:.5}50%{transform:rotateY(180deg) scaleY(1.3);opacity:0}100%{transform:rotateY(0);opacity:1}}@media screen and (max-width:767px){[data-element_type="eae-evergreen-timer.skin3"] #timer span{font-size:22px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider .flip-clock-label{top:-1.5em;right:-42px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider.minutes .flip-clock-label{right:-48px}[data-element_type="eae-evergreen-timer.skin2"] .flip-clock-divider.seconds .flip-clock-label{right:-51px}}[data-element_type="eae-evergreen-timer.skin4"] .eae-evergreen-wrapper{width:100%}[data-element_type="eae-evergreen-timer.skin4"] .container{margin:0 auto}[data-element_type="eae-evergreen-timer.skin4"] .special{position:relative;width:840px;height:47px}[data-element_type="eae-evergreen-timer.skin4"] #counter{position:absolute;z-index:4000}[data-element_type="eae-evergreen-timer.skin4"] .digit-separator{position:relative;float:left;width:17px;height:44px;overflow:hidden;background-image:url(../digit-sep-svg.svg);background-repeat:no-repeat;background-position:0 0;background-color:#4054b2}[data-element_type="eae-evergreen-timer.skin4"] .digit{background-image:url(../digits-svg-alpha.svg);background-color:#4054b2}.eae-ct-wrapper *{box-sizing:border-box;margin:0;outline:0}article.eae-ct-wrapper{width:100%;max-width:1000px;margin:0 auto;position:relative}.eae-ct-wrapper tbody tr.eae-ct-header td,.eae-ct-wrapper th{position:relative}.eae-ct-wrapper ul{display:none;top:0;z-index:10;padding-bottom:14px}.eae-ct-wrapper li{list-style:none;flex:1;position:relative}.eae-ct-wrapper li:hover{cursor:pointer}.eae-ct-wrapper .eae-ct-heading{width:100%;padding:10px;background:#fff;font-size:20px;font-weight:700;height:60px;color:#999;text-align:center}.eae-ct-wrapper li.eae-ct-heading .eae-ct-heading-inner{position:absolute;align-self:center;top:50%;left:50%;transform:translate(-50%,-50%);width:100%}.eae-ct-wrapper li.eae-ct-heading.active{background:#f5f5f5}.eae-ct-wrapper table{border-collapse:collapse;table-layout:fixed;width:100%}.eae-ct-wrapper th{background:#f5f5f5;display:none}.eae-ct-wrapper td,.eae-ct-wrapper th{height:53px;vertical-align:middle}.eae-ct-wrapper table{border:none}.eae-ct-wrapper table td,.eae-ct-wrapper table th{border:none}.eae-ct-wrapper table tr td:first-child,.eae-ct-wrapper table tr td:last-child,.eae-ct-wrapper td,.eae-ct-wrapper th{padding:10px;empty-cells:show}.eae-ct-wrapper td,.eae-ct-wrapper th{text-align:center}.eae-ct-wrapper td+td,.eae-ct-wrapper th+th{text-align:center}.eae-ct-wrapper tr:first-child{background:0 0!important}.eae-ct-wrapper ul li:nth-child(1){display:table-cell}.eae-ct-wrapper tr td:nth-child(2){display:table-cell}.eae-ct-wrapper td:nth-child(1){display:table-cell}.eae-ct-wrapper td{display:none}.eae-ct-wrapper .sep{background:#f5f5f5;font-weight:700}.eae-ct-price-wrapper{display:flex;justify-content:center}.eae-ct-tt-type-icon .eae-ct-feature .tooltip{float:right}.eae-ct-wrapper .tooltiptext::before{content:"";border-width:5px 5px 0 5px;border-color:#fff;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;bottom:-10px;width:0;height:0;border-style:solid;position:absolute;margin:5px;left:42%}.eae-ct-wrapper .eae-ct-price{font-size:28px;font-weight:700;line-height:1em}.eae-ct-wrapper .eae-ct-currency{align-self:flex-start;margin-right:3px}.eae-ct-wrapper .eae-ct-fractional-price{align-self:flex-start;margin-left:3px}.eae-ct-wrapper .eae-ct-duration{align-self:flex-start}.eae-ct-wrapper .eae-ct-original-price{margin-right:5px;text-decoration:line-through;align-self:flex-end}.eae-ct-wrapper .tick{font-size:18px;color:#2ca01c}.feature-heading-blank.eae-ct-wrapper .hide{border:unset!important;background:unset!important}.eae-ct-wrapper .hide.eae-ct-hide.eae-fbox-heading{border:0 solid #000}.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper{position:absolute;top:0;width:100px;overflow:hidden;height:100px;z-index:998;padding:8px 12px}.eae-ct-ribbons-h-top.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper{position:absolute;top:0;width:100%;overflow:hidden;height:50px;z-index:999;padding:8px 12px}.eae-ct-ribbons-h-top.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper-top{background-color:rgba(63,195,135,.8);color:#fff;transform:translateY(-100%);position:absolute;width:100%;top:0;left:0}.eae-ct-ribbons-h-left.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);left:0;right:auto}.eae-ct-ribbons-h-right.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(90deg);left:auto;right:0}.eae-ct-ribbons-yes .eae-ct-ribbons-wrapper span.eae-ct-ribbons-inner{position:absolute;text-align:center;left:0;top:0;width:200%;-webkit-transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);-ms-transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);margin-top:35px;font-size:13px;line-height:2;font-weight:800;text-transform:uppercase;background:rgba(63,195,135,.8);padding:8px 12px;color:#fff}.eae-ct-wrapper .tooltip{position:relative;display:inline-block}.eae-ct-wrapper .tooltip .tooltiptext{visibility:hidden;min-width:120px;background-color:#000;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1;bottom:120%;left:50%;margin-left:-60px}.eae-ct-wrapper .tooltip:hover .tooltiptext{visibility:visible}.eae-ct-heading-tooltip{text-decoration-line:underline;text-decoration-style:dotted}.eae-ct-btn{padding:10px 15px 10px 15px;color:#fff;display:inline-block;line-height:1em}.eae-ct-btn:hover{color:#fff}.eae-ct-wrapper i.fa.fa-check,.eae-ct-wrapper i.fas.fa-check{color:#38f146}.eae-ct-wrapper i.fa.fa-close,.eae-ct-wrapper i.fas.fa-times{color:red}.button-heading-blank.eae-ct-wrapper tr:last-child td:first-child{background:0 0!important;border:none!important}.eae-ct-wrapper tr:last-child{background:0 0!important}.eae-ct-wrapper tbody tr:nth-child(2){background:0 0!important}@media (min-width:767px){.eae-ct-wrapper .eae-ct-header,.eae-ct-wrapper td{width:330px}.eae-ct-wrapper td+td,.eae-ct-wrapper th+th{width:auto}}.eae-tab-format-all .eae-ct-wrapper ul{display:flex}.hide.eae-ct-hide{display:table-cell}@media (min-width:1023px){.eae-tab-format-all tbody tr.eae-ct-header{display:none}.eae-tab-format-mobile .eae-ct-wrapper td,.eae-tab-format-mobile .eae-ct-wrapper th,.eae-tab-format-tab-mob .eae-ct-wrapper td,.eae-tab-format-tab-mob .eae-ct-wrapper th{display:table-cell!important}.eae-tab-format-all .hide.eae-ct-hide{display:table-cell}.eae-tab-format-mobile .hide.eae-ct-hide,.eae-tab-format-tab-mob .hide.eae-ct-hide{display:none!important}}@media (max-width:1023px){.eae-tab-format-tab-mob .eae-ct-wrapper ul{display:flex}.eae-tab-format-all tbody tr.eae-ct-header,.eae-tab-format-tab-mob tbody tr.eae-ct-header{display:none}.eae-tab-format-all .hide.eae-ct-hide{display:table-cell}.eae-tab-format-tab-mob .hide.eae-ct-hide{display:table-cell}}@media (max-width:1023px) and (min-width:768px){.eae-tab-format-mobile .eae-ct-wrapper td,.eae-tab-format-mobile .eae-ct-wrapper th{display:table-cell!important}.eae-tab-format-all tbody tr.eae-ct-header,.eae-tab-format-tab-mob tbody tr.eae-ct-header{display:none}.eae-tab-format-tab-mob .hide.eae-ct-hide{display:table-cell}}@media (max-width:767px){.eae-tab-format-mobile .eae-ct-wrapper ul{display:flex}.eae-tab-format-mobile tbody tr.eae-ct-header{display:none}.eae-tab-format-all tbody tr.eae-ct-header,.eae-tab-format-mobile tbody tr.eae-ct-header{display:none}.eae-tab-format-mobile .hide.eae-ct-hide{display:table-cell}}.eae-progress-bar-wrapper{display:flex;flex-direction:column;align-items:flex-start;margin:15px 0}.eae-progress-bar-wrapper.eae-progress-bar{width:100%;position:relative;box-sizing:border-box}.eae-pb-bar,.eae-pb-bar-inner,.eae-pb-bar-skill,.eae-pb-bar-value{box-sizing:border-box}.eae-pb-bar{position:relative;height:100%;width:100%;overflow:hidden}.eae-pb-bar--no-overflow{overflow:visible}.eae-pb-bar-inner{position:absolute;top:0;left:0;height:100%;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:left center;transform-origin:left center}body.rtl .eae-pb-bar .eae-pb-bar-inner{position:absolute;top:0;right:0!important;height:100%;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:right center;transform-origin:right center}.eae-pb-bar-inner.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:cubic-bezier(.1,1.14,.31,1.06);transition-delay:1.5s;-webkit-transform:scaleX(1);transform:scaleX(1)}body.rtl .eae-pb-bar .eae-pb-bar-inner.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:cubic-bezier(.1,1.14,.31,1.06);transition-delay:1.5s;-webkit-transform:scaleX(1);transform:scaleX(1)}.eae-pb-bar-skill,.eae-pb-bar-value{font-size:14px;letter-spacing:1px}body:not(.rtl) .eae-pb-bar-value--aligned-value{-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.rtl .eae-pb-bar-value--aligned-value{-webkit-transform:translateX(50%);transform:translateX(50%)}.eae-progress-bar-skin1{height:20px;padding:4px;border:1px solid #ddd;border-radius:20px}.eae-pb-bar-skin1{border-radius:20px}.eae-pb-bar-inner-skin1{background-color:#00bfb3;background-size:200%;background-position:0 0;border-radius:20px}.eae-pb-bar-skill-skin1{position:absolute;bottom:20px;left:0;opacity:0}body.rtl .eae-pb-bar-skill-skin1{right:0}.eae-pb-bar-skill-skin1.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;left:0;opacity:1}body.rtl .eae-pb-bar-skill-skin1.js-animated{right:0!important}.eae-pb-bar-value-skin1{position:absolute;bottom:20px;opacity:1}body:not(.rtl) .eae-pb-bar-value-skin1{right:0}body.rtl .eae-pb-bar-value-skin1{left:0!important}.eae-pb-bar-value-skin1.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;opacity:1}body:not(.rtl) .eae-pb-bar-value-skin1.js-animated{right:0}.eae-progress-bar-skin2{height:15px;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);border-radius:3px}@-webkit-keyframes progress-2-bg-animation-rtl{100%{background-position:0 0,0 0}0%{background-position:0 0,42px 0}}@keyframes progress-2-bg-animation-rtl{100%{background-position:0 0,0 0}0%{background-position:0 0,42px 0}}@-webkit-keyframes progress-2-bg-animation{0%{background-position:0 0,0 0}1000%{background-position:0 0,42px 0}}@keyframes progress-2-bg-animation{0%{background-position:0 0,0 0}100%{background-position:0 0,42px 0}}.eae-pb-bar-inner-skin2{background-image:linear-gradient(to top,rgba(255,255,255,.15),rgba(0,0,0,.2)),linear-gradient(135deg,#5eeb5b,#5eeb5b 33%,#358600 33%,#358600 66%,#5eeb5b 66%);background-size:100% 100%,42px 100%;background-position:0 0,0 0;border-radius:3px}body:not(.rtl) .eae-pb-bar-inner-skin2.js-animated{-webkit-animation:progress-2-bg-animation 1.5s linear 0s infinite;animation:progress-2-bg-animation 1.5s linear 0s infinite}body.rtl .eae-pb-bar-inner-skin2.js-animated{-webkit-animation:progress-2-bg-animation-rtl 1.5s linear 0s infinite;animation:progress-2-bg-animation-rtl 1.5s linear 0s infinite}.eae-pb-bar-skill-skin2{position:absolute;opacity:0}body:not(.rtl) .eae-pb-bar-skill-skin2{left:0}body.rtl .eae-pb-bar-skill-skin2{right:0}.eae-pb-bar-skill-skin2.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;bottom:20px;opacity:1}.eae-pb-bar-value-skin2{position:absolute;opacity:0}body:not(.rtl) .eae-pb-bar-value-skin2{right:0}body.rtl .eae-pb-bar-value-skin2{left:0}.eae-pb-bar-value-skin2.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;bottom:20px;opacity:1}.eae-progress-bar-skin3{height:5px;background-color:#efefef}.eae-pb-bar-inner-skin3,.eae-pb-bar-value-skin3{background-color:#f40076}.eae-pb-bar-inner:after,.eae-pb-bar-value-skin3:after{border-top-color:#f40076}.eae-pb-bar-skill-skin3{position:absolute;bottom:10px;left:-10px;opacity:0}.eae-pb-bar-skill-skin3.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;opacity:1}body:not(.rtl) .eae-pb-bar-skill-skin3.js-animated{left:0}body.rtl .eae-pb-bar-skill-skin3.js-animated{right:0}.eae-pb-bar-value-skin3{position:absolute;display:inline-block;padding:0 8px;font-size:14px;color:#fff;opacity:0}.eae-pb-bar-value-skin3:after{position:absolute;left:50%;bottom:-10px;display:block;width:0;height:0;content:"";-webkit-transform:translateX(-50%);transform:translateX(-50%);border-width:5px;border-style:solid;border-color:#f40076 transparent transparent transparent}.eae-pb-bar-inner-skin3.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:cubic-bezier(.1,1.14,.31,1.06);transition-delay:1.5s;-webkit-transform:scaleX(1);transform:scaleX(1)}.eae-pb-bar-value-skin3.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:cubic-bezier(.1,1.14,.31,1.06);transition-delay:2s;bottom:14px;opacity:1}.eae-progress-bar-skin4{height:3px;background-color:#efefef}.eae-pb-bar-inner-skin4{background-color:#000}.eae-pb-bar-inner-skin4:after{position:absolute;top:50%;display:block;width:8px;height:8px;content:"";-webkit-transform:translateY(-50%);transform:translateY(-50%);background-color:#000;border-radius:50%}body:not(.rtl) .eae-pb-bar-inner-skin4:after{right:0}body.rtl .eae-pb-bar-inner-skin4:after{left:0}.eae-pb-bar-value-skin4{position:absolute;bottom:2px;font-size:14px;opacity:0}.eae-pb-bar-value-skin4.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:linear;transition-delay:1.5s;opacity:1}.eae-pb-bar-skill-skin4{position:absolute;bottom:2px;left:-20px;opacity:0}.eae-pb-bar-skill-skin4.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;opacity:1}body:not(.rtl) .eae-pb-bar-skill-skin4.js-animated{left:0}body.rtl .eae-pb-bar-skill-skin4.js-animated{right:0}.eae-progress-bar-skin5{height:30px;background-color:#f7f7f7}.eae-pb-bar-inner-skin5{background-color:#57b8ff}.eae-pb-bar-skill-skin5{position:absolute;top:50%;color:#fff;-webkit-transform:translateY(-50%);transform:translateY(-50%);opacity:0}body:not(.rtl) .eae-pb-bar-skill-skin5{left:10px}body:not(.rtl) .eae-pb-bar-skill-skin5{right:10px}.eae-pb-bar-skill-skin5.js-animated{transition-property:all;transition-duration:.5s;transition-timing-function:linear;transition-delay:.5s;opacity:1}.eae-pb-bar-value-skin5{position:absolute;top:50%;color:#fff;opacity:0;z-index:10}body:not(.rtl) .eae-pb-bar-value-skin5{-webkit-transform:translateX(-100%) translateX(-10px) translateY(-50%);transform:translateX(-100%) translateX(-10px) translateY(-50%)}body.rtl .eae-pb-bar-value-skin5{-webkit-transform:translateX(100%) translateX(10px) translateY(-50%);transform:translateX(100%) translateX(10px) translateY(-50%)}.eae-pb-bar-value-skin5.js-animated{transition-property:all;transition-duration:1.5s;transition-timing-function:linear;transition-delay:1.5s;opacity:1}.eae-dual-button-wrapper .eae-button-1-wrapper,.eae-dual-button-wrapper .eae-button-2-wrapper{overflow:hidden}.eae-dual-button-wrapper.button-style-horizontal{display:flex;flex-direction:row;position:relative}.eae-dual-button-main-wrapper{display:flex;flex-direction:row;justify-content:center}.eae-dual-button-wrapper a{min-width:0}.eae-dual-button-wrapper.button-style-vertical{display:inline-flex;flex-direction:column;position:relative}.eae-button-1.icon-before,.eae-button-2.icon-before{display:flex;flex-direction:row}body.rtl .eae-button-1.icon-before,body.rtl .eae-button-2.icon-before{display:flex;flex-direction:row-reverse}.eae-button-1.icon-after,.eae-button-2.icon-after{display:flex;flex-direction:row-reverse}body.rtl .eae-button-1.icon-after,body.rtl .eae-button-2.icon-after{display:flex;flex-direction:row}.eae-button-1-wrapper .eae-button-1,.eae-button-2-wrapper .eae-button-2{color:#000;align-items:center}.eae-button-1-wrapper:hover .eae-button-1,.eae-button-2-wrapper:hover .eae-button-2{color:#000}.eae-dual-button-wrapper.button-style-vertical .eae-button-1.icon-after,.eae-dual-button-wrapper.button-style-vertical .eae-button-1.icon-before,.eae-dual-button-wrapper.button-style-vertical .eae-button-2.icon-after,.eae-dual-button-wrapper.button-style-vertical .eae-button-2.icon-before{justify-content:center}.eae-button-1.icon-up,.eae-button-2.icon-up{display:flex;flex-direction:column;text-align:center}.eae-button-1.icon-down,.eae-button-2.icon-down{display:flex;flex-direction:column-reverse;text-align:center}.eae-button-1-wrapper{background:#ffb6c1;display:flex;justify-content:center;width:100%;line-height:1}.eae-button-2-wrapper{background:orange;display:flex;justify-content:center;width:100%;line-height:1}.eae-button-1.icon-up .icon-wrapper,.eae-button-2.icon-down .icon-wrapper,.eae-button-2.icon-up .icon-wrapper{text-align:center}.eae-button-1.icon-up .eae-button-text,.eae-button-2.icon-down .eae-button-text,.eae-button-2.icon-up .eae-button-text{text-align:center}.eae-button-1.icon-before i,.eae-button-2.icon-after i,.eae-button-2.icon-before i{align-self:center;margin:0 10px 0 0}.eae-button-1.icon-after i,.eae-button-2.icon-after i{align-self:center;margin:0 0 0 10px}.eae-button-1.icon-down i,.eae-button-1.icon-up i,.eae-button-2.icon-down i,.eae-button-2.icon-up i{align-self:center;margin:5px 0}.eae-dual-button-wrapper.button-style-horizontal .eae-button-1-wrapper,.eae-dual-button-wrapper.button-style-horizontal .eae-button-2-wrapper{padding:12px 30px}.eae-dual-button-wrapper.button-style-vertical .eae-button-1-wrapper,.eae-dual-button-wrapper.button-style-vertical .eae-button-2-wrapper{padding:20px 30px}.eae-button1,.eae-button2{position:relative;display:flex}.eae-dual-button-wrapper.button-style-horizontal .eae-button1,.eae-dual-button-wrapper.button-style-horizontal .eae-button2{min-width:150px}.eae-dual-button-wrapper.button-style-vertical .eae-button1{display:flex;flex-direction:column}.eae-button-separator-wrapper .eae-button-separator{width:40px;height:40px;line-height:40px;border-radius:50%;z-index:1;box-shadow:0 0 0 6px rgba(255,255,255,.2);background:#fafaf8;color:#444;text-transform:uppercase;text-align:center;vertical-align:middle;font-weight:400;font-size:14px;position:absolute;transform:translateY(-50%)}.eae-button-separator span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}body.rtl.elementor-editor-active .eae-dual-button-main-wrapper .button-style-horizontal .eae-button1 .eae-button-separator-wrapper.not-rtl .eae-button-separator{display:none!important}body:not(.rtl).elementor-editor-active .eae-dual-button-main-wrapper .button-style-horizontal .eae-button2 .eae-button-separator-wrapper.rtl .eae-button-separator,body:not(.rtl).elementor-editor-preview .eae-dual-button-main-wrapper .button-style-horizontal .eae-button2 .eae-button-separator-wrapper.rtl .eae-button-separator{display:none!important}.eae-sweep-right{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.3s;transition-duration:.3s}.eae-sweep-right:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-sweep-right:active,.eae-sweep-right:focus,.eae-sweep-right:hover{color:#fff}.eae-sweep-right:active:before,.eae-sweep-right:focus:before,.eae-sweep-right:hover:before{-webkit-transform:scaleX(1);transform:scaleX(1)}.eae-sweep-left{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.3s;transition-duration:.3s}.eae-sweep-left:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-sweep-left:active,.eae-sweep-left:focus,.eae-sweep-left:hover{color:#fff}.eae-sweep-left:active:before,.eae-sweep-left:focus:before,.eae-sweep-left:hover:before{-webkit-transform:scaleX(1);transform:scaleX(1)}.eae-sweep-bottom{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.3s;transition-duration:.3s}.eae-sweep-bottom:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-sweep-bottom:active,.eae-sweep-bottom:focus,.eae-sweep-bottom:hover{color:#fff}.eae-sweep-bottom:active:before,.eae-sweep-bottom:focus:before,.eae-sweep-bottom:hover:before{-webkit-transform:scaleY(1);transform:scaleY(1)}.eae-sweep-top{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.3s;transition-duration:.3s}.eae-sweep-top:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-sweep-top:active,.eae-sweep-top:focus,.eae-sweep-top:hover{color:#fff}.eae-sweep-top:active:before,.eae-sweep-top:focus:before,.eae-sweep-top:hover:before{-webkit-transform:scaleY(1);transform:scaleY(1)}.eae-bounce-right{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.5s;transition-duration:.5s}.eae-bounce-right:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-bounce-right:active,.eae-bounce-right:focus,.eae-bounce-right:hover{color:#fff}.eae-bounce-right:active:before,.eae-bounce-right:focus:before,.eae-bounce-right:hover:before{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition-timing-function:cubic-bezier(.52,1.64,.37,.66);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.eae-bounce-left{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.5s;transition-duration:.5s}.eae-bounce-left:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-bounce-left:active,.eae-bounce-left:focus,.eae-bounce-left:hover{color:#fff}.eae-bounce-left:active:before,.eae-bounce-left:focus:before,.eae-bounce-left:hover:before{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition-timing-function:cubic-bezier(.52,1.64,.37,.66);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.eae-bounce-bottom{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.5s;transition-duration:.5s}.eae-bounce-bottom:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-bounce-bottom:active,.eae-bounce-bottom:focus,.eae-bounce-bottom:hover{color:#fff}.eae-bounce-bottom:active:before,.eae-bounce-bottom:focus:before,.eae-bounce-bottom:hover:before{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition-timing-function:cubic-bezier(.52,1.64,.37,.66);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.eae-bounce-top{vertical-align:middle;-webkit-transform:perspective(1px) translateZ(0);transform:perspective(1px) translateZ(0);box-shadow:0 0 1px transparent;position:relative;-webkit-transition-property:color;transition-property:color;-webkit-transition-duration:.5s;transition-duration:.5s}.eae-bounce-top:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098d1;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transition-property:transform;transition-property:transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.eae-bounce-top:active,.eae-bounce-top:focus,.eae-bounce-top:hover{color:#fff}.eae-bounce-top:active:before,.eae-bounce-top:focus:before,.eae-bounce-top:hover:before{-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition-timing-function:cubic-bezier(.52,1.64,.37,.66);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.eae-markers .marker{display:none}.eae-markers p{margin-bottom:0}.eae-fg-wrapper{display:flex;flex-direction:column;overflow:hidden}.eae-gallery-filter{display:flex;flex-direction:row;justify-content:center;flex-wrap:wrap}.eae-filter-label{padding:5px 10px;background-color:#a0ce4e;color:#fff;margin:0 3px 0 3px}.eae-filter-label.current{background-color:#73b9dc}.eae-fg-image{display:flex;flex-wrap:wrap;flex-direction:row}.eae-fg-wrapper .eae-gallery-item-inner img{width:100%;height:auto;display:block!important;transition:all .5s ease;-webkit-transition:all .5s ease}.eae-gallery-item{height:auto}.eae-gallery-filter a{color:#fff;text-decoration:none}.eae-gallery-filter a.current{font-weight:700}.eae-gallery-item-inner{position:relative;overflow:hidden}.eae-overlay-always .eae-gallery-item .eae-grid-overlay{display:block}.eae-overlay-hover .eae-gallery-item-inner:hover .eae-grid-overlay{display:block}.eae-overlay-hide-on-hover .eae-gallery-item-inner:hover .eae-grid-overlay{display:none}.eae-overlay-hide-on-hover .eae-grid-overlay{display:block}.eae-grid-overlay{position:absolute;top:0;left:0;display:none;z-index:99;background:rgba(0,0,0,.5);height:100%;width:100%}.eae-grid-overlay-inner{display:block;position:relative;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center}.eae-fg-wrapper .eae-icon-wrapper{display:flex;justify-content:center}.eae-overlay-caption{display:block;line-height:1em;margin-top:15px;color:#73b9dc;font-size:20px}.eae-overlay-icon{line-height:1em;padding:.5em;display:inline-block}.eae-overlay-icon svg{height:auto}.eae-icon-view-framed .eae-overlay-icon{padding:.5em;color:#73b9dc;border:3px solid #73b9dc;background-color:transparent}.eae-icon-view-stacked .eae-overlay-icon{padding:.5em;color:#fff;background-color:#818a91}.eae-hover-direction-effect .eae-grid-overlay{position:absolute;z-index:99;background:rgba(0,0,0,.5);height:100%;width:100%}.eae-fg-wrapper.eae-image-ratio-yes .eae-gallery-item-inner .eae-fg-img-wrapper{position:relative;top:0;overflow:hidden;left:0;right:0;border:0}.eae-fg-wrapper.eae-image-ratio-yes .eae-gallery-item-inner .eae-fg-img-wrapper img{height:100%;width:100%;display:block;position:absolute;top:0;left:0;object-fit:cover}.wts-eae-ribbons-badges-wrapper{display:none}.wts-eae-enable-ribbons-badges-yes .elementor-column-wrap>.wts-eae-ribbons-badges-wrapper{display:block}.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-ribbon>.wts-eae-ribbons-badges-wrapper{position:absolute;top:0;left:auto;right:0;-ms-transform:rotate(90deg);width:150px;overflow:hidden;height:150px;z-index:999;padding:8px 12px}.wts-eae-badge-h-left.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-ribbon>.wts-eae-ribbons-badges-wrapper{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);left:0;right:auto}.wts-eae-badge-h-right.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-ribbon>.wts-eae-ribbons-badges-wrapper{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(90deg);left:auto;right:0}.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-ribbon>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{position:absolute;text-align:center;left:0;top:0;width:200%;-webkit-transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);-ms-transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);transform:translateY(-50%) translateX(-50%) translateX(35px) rotate(-45deg);margin-top:35px;font-size:13px;line-height:2;font-weight:800;text-transform:uppercase;background:rgba(63,195,135,.8);padding:8px 12px}.wts-eae-enable-ribbons-badges-yes.wts-eae-badge-type-badge>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{min-height:3.236em;min-width:3.236em;padding:0;font-size:1em;font-weight:700;position:absolute;text-align:center;line-height:3.236;top:-.5em;left:-.5em;margin:0;border-radius:100%;background-color:#77a464;color:#fff;font-size:.857em;z-index:9}.wts-eae-badge-h-left.wts-eae-badge-v-bottom.wts-eae-enable-ribbons-badges-yes>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{left:20px;right:auto;top:auto;bottom:20px}.wts-eae-badge-h-left.wts-eae-badge-v-top.wts-eae-enable-ribbons-badges-yes>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{left:20px;right:auto;top:20px;bottom:auto}.wts-eae-badge-h-right.wts-eae-badge-v-bottom.wts-eae-enable-ribbons-badges-yes>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{left:auto;right:20px;top:auto;bottom:20px}.wts-eae-badge-h-right.wts-eae-badge-v-top.wts-eae-enable-ribbons-badges-yes>.wts-eae-ribbons-badges-wrapper span.wts-eae-ribbons-badges-inner{left:auto;right:20px;top:20px;bottom:auto}.eae-flip-box-back svg,.eae-flip-box-front svg{width:25px;height:auto}.wts-eae-textseparator svg{width:25px;height:auto}.eae-img-comp-slider svg{width:22px;height:auto}.eae-popup-link svg{display:inline-block;width:1em}.eae-popup svg:focus,.eae-popup svg:hover{opacity:1;cursor:pointer}.eae-popup svg:active{top:1px}.eae-popup svg.eae-close{width:28px;height:28px;line-height:1em;text-decoration:none;text-align:center;opacity:1;background-color:#fff}.eae-dual-button-wrapper svg{width:1em;height:auto;display:block}eae-button-separator i{position:relative;display:block}.eae-button-1.icon-before svg,.eae-button-2.icon-after svg,.eae-button-2.icon-before svg{align-self:center;margin:0 10px 0 0}.eae-button-1.icon-after svg,.eae-button-2.icon-after svg{align-self:center;margin:0 0 0 10px}.eae-button-1.icon-down svg,.eae-button-1.icon-up svg,.eae-button-2.icon-down svg,.eae-button-2.icon-up svg{align-self:center;margin:5px 0}.eae-pt-button-wrapper a svg{width:1em}.eae-pt-action-button .eae-pt-align-icon-left{float:left}.eae-pt-action-button .eae-pt-align-icon-right{float:right}.eae-icon-wrap svg{width:20px;height:auto;font-size:20px;display:block}.eae-info-circle .eae-icon-wrap svg{width:20px;height:auto;font-size:20px}.eae-icon-view-stacked svg{fill:#fff}.ae-link-yes{cursor:pointer}.eae-element-unfold-content{padding:10px 0;background-color:#d3d3d3c4;width:100%;position:absolute;left:0;bottom:0;z-index:999}a.eae-unfold-link{background-color:#61ce70;color:#fff;display:inline-block;overflow:hidden}a.eae-unfold-link svg{background-color:#fff}.eae-unfold-button-icon{vertical-align:middle}.eae-fold-yes .elementor-column-wrap,.eae-fold-yes.elementor-section .elementor-container,.eae-fold-yes.elementor-widget{overflow:hidden}body.elementor-editor-active .elementor.elementor-edit-mode .elementor-element.elementor-section.eae-widget-unfold-yes .elementor-container,body.elementor-editor-preview .elementor.elementor-edit-mode .elementor-element.elementor-section.eae-widget-unfold-yes .elementor-container{overflow:hidden}body.elementor-editor-active .elementor.elementor-edit-mode .elementor-element.elementor-column.eae-widget-unfold-yes .elementor-column-wrap,body.elementor-editor-preview .elementor.elementor-edit-mode .elementor-element.elementor-column.eae-widget-unfold-yes .elementor-column-wrap{overflow:hidden}body.elementor-editor-active .elementor.elementor-edit-mode .elementor-element.elementor-widget.eae-widget-unfold-yes,body.elementor-editor-preview .elementor.elementor-edit-mode .elementor-element.elementor-widget.eae-widget-unfold-yes{overflow:hidden}.eae-widget-unfold-yes .elementor-widget-container .eae-fold-yes.eae-rc{display:none!important}.eae-unfold-button-icon svg{line-height:1em;text-decoration:none;-webkit-mask-repeat:no-repeat!important;text-align:center;opacity:1}.eae-fold-icon-type-svg .eae-unfold-button-icon,.eae-unfold-icon-type-svg .eae-unfold-button-icon{-webkit-mask-size:cover!important;background-image:none;transform:translateY(-50%)}.elementor-section.elementor-section-items-bottom.eae-widget-unfold-yes>.elementor-container,.elementor-section.elementor-section-items-middle.eae-widget-unfold-yes>.elementor-container{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:start}.elementor-section.elementor-section-content-bottom.eae-widget-unfold-yes>.elementor-container,.elementor-section.elementor-section-content-middle.eae-widget-unfold-yes>.elementor-container{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:start}.elementor-widget-wts-modal-popup.eae-pop-btn-type-image .eae-popup-link{padding:0;background-color:transparent;overflow:hidden}[data-elementor-device-mode=tablet] .eae-tab-format-mobile .eae-ct-hide.eae-fbox-heading{display:none!important}.eae-timeline-item .eae-icon-view-stacked{border-width:0!important}.eae-content-switcher-wrapper{display:block;text-align:center}.eae-cs-layout-skin1 .eae-cs-switch-wrapper{display:inline-flex;flex-wrap:wrap;padding:8px 12px;background:#54595f;border-radius:50px}.eae-cs-switch-container{display:block;text-align:center}.eae-cs-layout-skin1 .eae-cs-label-wrapper{display:inline-block;overflow:hidden}.eae-cs-layout-skin1 .eae-content-switch-button{border-radius:50px;padding:8px 12px;background-color:#7a7a7a;color:#fff;overflow:hidden;display:block;min-width:150px;position:relative;text-align:center;margin:3px}.eae-cs-layout-skin1 .eae-content-switch-button:before{height:100%;top:0;left:0;z-index:0;content:'';width:0;position:absolute;right:0;transition:all .3s ease-out}.eae-cs-layout-skin1 .eae-content-switch-button.active:before{width:100%;left:0;right:auto;background-color:#61ce70}.eae-cs-layout-skin1 .eae-content-switch-label{position:relative}.eae-cs-content-section{display:none}.eae-cs-content-section.active{display:block}@media only screen and (max-width:768px){.eae-cs-switch-wrapper{display:inline-block!important}}.eae-cs-layout-skin2 .eae-cs-switch-wrapper{display:inline-flex;flex-wrap:wrap;padding:0;background:0 0}.eae-cs-layout-skin2 .eae-cs-label-wrapper{display:inline-block}.eae-cs-layout-skin2 .eae-content-switch-button{width:auto;margin:3px 8px;padding:10px 12px;background-color:#e2e2e2;overflow:hidden;display:block;position:relative;text-align:center;border-radius:5px;border:1px solid rgba(130,130,130,.26);color:rgba(71,71,71,.44)}.eae-cs-layout-skin2 .eae-content-switch-button.active{box-shadow:0 10px 34px -9px rgba(0,0,0,.38);background-color:#fff;color:#575757;border-color:#fff}h5.eae-cs-label{margin:0}.eae-cs-layout-skin3 .eae-cs-switch-wrapper{display:block;justify-content:center;align-items:center}.eae-content-switch-label.primary-label{margin-right:30px}.eae-content-switch-label.secondary-label{margin-left:30px}.eae-cs-layout-skin3 .eae-cs-switch-label{position:relative;display:inline-block;width:4.5em;height:2.3em;vertical-align:middle}.eae-cs-layout-skin3 .eae-content-switch-label{margin:0;display:inline-block}.eae-cs-layout-skin3 .eae-cs-switch-button{display:inline-block}.eae-cs-layout-skin3 .eae-cs-label{display:inline-block}.eae-cs-layout-skin3 .eae-cs-switch-label input.eae-content-toggle-switch{display:none}.eae-cs-layout-skin3 .eae-cs-switch-label input.eae-content-toggle-switch+span{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;-webkit-transition:.4s;transition:.4s;-webkit-border-radius:1.5em;border-radius:1.5em;background:#2e394d;border:2px solid #2e394d}.eae-cs-layout-skin3 .eae-cs-switch-label input.eae-content-toggle-switch+span:before{position:absolute;content:"";height:28px;width:28px;left:4px;transform:translateY(-52%);top:50%;transition:.4s;transition:.4s;-webkit-border-radius:50%;border-radius:50%;background:#88cf8f;border:2px solid #88cf8f}body.rtl .eae-cs-layout-skin3 .eae-cs-switch-label input.eae-content-toggle-switch+span:before{left:unset;right:4px}.eae-cs-layout-skin3 .eae-cs-switch-label input:checked.eae-content-toggle-switch+span:before{transform:translate(36px,-52%)}body.rtl .eae-cs-layout-skin3 .eae-cs-switch-label input:checked.eae-content-toggle-switch+span:before{transform:translate(-36px,-52%)}.eae-content-switch-label.active{color:#61ce70}.eae-cs-layout-skin4 .eae-cs-switch-wrapper{display:block}.eae-cs-layout-skin4 .eae-content-switch-label.primary-label{margin-right:30px}.eae-cs-layout-skin4 .eae-content-switch-label.secondary-label{margin-left:30px}.eae-cs-layout-skin4 .eae-content-switch-label{display:inline-block}.eae-cs-layout-skin4 .eae-cs-switch-label{position:relative;display:inline-block;width:70px;height:20px;vertical-align:middle}.eae-cs-layout-skin4 .eae-cs-label{display:inline-block}.eae-cs-layout-skin4 .eae-content-toggle-switch{display:none}.eae-cs-layout-skin4 .eae-content-toggle-switcher{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;-webkit-transition:.4s;transition:.4s;-webkit-border-radius:1.5em;border-radius:1.5em;background:#2e394d;border:2px solid #2e394d}.eae-cs-layout-skin4 .eae-cs-switch-button{display:inline-block}.eae-cs-layout-skin4 .eae-content-toggle-switcher:before{position:absolute;content:"";height:34px;width:34px;left:-12px;top:50%;transform:translateY(-50%);border-radius:50%;border:2px solid #88cf8f;background:#88cf8f;-webkit-transition:.4s;transition:.4s;-webkit-box-shadow:3px 3px 6px 1px rgba(0,0,0,.2);box-shadow:3px 3px 6px 1px rgba(0,0,0,.2)}.eae-cs-layout-skin4 .eae-cs-switch-container{padding:15px 0}body.rtl .eae-cs-layout-skin4 .eae-content-toggle-switcher:before{right:-12px!important}.eae-cs-layout-skin4 input:checked+.eae-content-toggle-switcher:before{transform:translate(55px,-50%)}body.rtl .eae-cs-layout-skin4 input:checked+.eae-content-toggle-switcher:before{transform:translate(-55px,-50%)}.eae-swiper-outer-wrapper{position:relative}.eae-swiper-container{position:relative}.eae-thumb-container{position:absolute}.eae-swiper-outer-wrapper .eae-swiper-slide{height:400px;background-size:cover;background-repeat:no-repeat;background-position:right}.eae-swiper-outer-wrapper .eae-swiper-slide .eae-slide-inner{color:#7a7a7a;display:flex;position:absolute;top:0;left:0;bottom:0;right:0;padding:20px}.eae-slide-inner .eae-slide-content{padding:20px 30px}.eae-slide-inner .eae-slide-heading{font-size:35px;font-weight:700;line-height:1}.eae-slide-inner .eae-slide-text{font-size:17px;line-height:1.4}.eae-slide-inner .eae-slide-button{display:inline-block}.eae-slide-inner .eae-slide-btn{display:inline-block;font-size:15px;padding:12px 24px;border-radius:3px;cursor:pointer;transition:all .3s}.eae-slide-inner .eae-slide-heading:not(:last-child),.eae-slide-inner .eae-slide-text:not(:last-child){margin-bottom:30px}.eae--hr-position-left .eae-slide-inner{-webkit-box-pack:start;justify-content:flex-start}.eae--hr-position-right .eae-slide-inner{-webkit-box-pack:end;justify-content:flex-end}.eae--hr-position-center .eae-slide-inner{-webkit-box-pack:center;justify-content:center}.eae--vr-position-top .eae-slide-inner{-webkit-box-pack:start;align-items:flex-start}.eae--vr-position-middle .eae-slide-inner{-webkit-box-align:center;align-items:center}.eae--vr-position-bottom .eae-slide-inner{-webkit-box-pack:end;align-items:flex-end}.eae-swiper-button-prev{left:10px}.eae-swiper-button-next{right:10px}.eae-swiper-button{position:absolute;display:inline-flex;z-index:1;cursor:pointer;color:#7a7a7a;top:50%;transform:translateY(-50%)}.swiper-pagination-bullet{margin-bottom:5px!important}.eae-swiper-outer-wrapper .eae-swiper-slide .eae-background-overlay{width:100%;height:100%;position:absolute}.eae-swiper-outer-wrapper .eae-gallery-thumbs{box-sizing:border-box;text-align:center}.eae-swiper-outer-wrapper .eae-gallery-thumbs .eae-thumb-slide{background-size:cover;background-position:center;height:100%;opacity:.7}.eae-swiper-outer-wrapper .eae-gallery-thumbs .swiper-slide-thumb-active{opacity:1}.eae-chart-outer-container{position:relative}.eae-chart-overlay{width:100%;height:100%;position:absolute}.eae-table{width:100%;height:auto;margin:0;padding:0;border:none;border-collapse:collapse}.eae-table tr{border-style:none}.eae-table__body_row_column{border:none;overflow:hidden}.eae-table__head_column{transition:all .3s ease-in-out}.eae-table__body_row_column{transition:all .3s ease-in-out}.eae-head-icon{vertical-align:middle}.eae-table__head-column-wrapper .eae-head-img{width:50px;display:inline-block}.eae-table__head-column-wrapper .eae-lottie-animation svg{width:70px!important;line-height:0}.eae-head-icon-before{margin-right:5px}.eae-head-icon-after{margin-left:5px}.eae-table__col-inner{display:block}.eae-body-icon{vertical-align:middle}.eae-table__body-column-wrapper .eae-body-image{width:70px;display:inline-block}.eae-table__body-column-wrapper .eae-table-lottie-animation svg{width:70px!important;line-height:0}.eae-body-icon-before{margin-right:5px}.eae-body-icon-after{margin-left:5px}.eae-table-body__text{vertical-align:middle}.eae-table .eae-table-search-hide{display:none}.eae-table-search-wrap{padding:0;margin:0;margin-bottom:10px}.eae-search-wrap{padding:0;margin:0;width:50%;display:inline-flex;align-items:center;box-sizing:border-box;overflow:hidden;align-items:center}.eae-table-search-wrap .eae-table-search-field{margin:0;padding:0;border:0;outline:0;background-color:#eceeef;width:100%;font-size:15px;color:#7a7a7a;padding:10px;line-height:0;display:inline-block;box-sizing:border-box}.eae-table-search-wrap .eae-table-search-field:focus{background-color:#eceeef}::placeholder{opacity:.5}.search-icon{background-color:#eceeef;padding:0;margin:0;padding:10px}.search-icon i{color:#7a7A7A73;display:flex;align-items:center;left:0;font-size:20px}.eae-table__sortable .eae-table__sortable-head{cursor:pointer}.eae-table__head__wrapper{display:flex;justify-content:center;align-items:center}.eae-sort-icon{padding:0;margin:0;align-self:center}.eae-table__head-column-wrapper{flex-grow:3;display:inline-block;width:100%}.eae-icon-sort-icon{vertical-align:middle;display:inline-block}.eae-icon{padding:0;margin:0}.eae-table__head__wrapper .eae-sort-icon .eae-icon{font-size:25px}.eae-table__sortable .eae-table__head__wrapper .eae-sort-icon-down,.eae-table__sortable .eae-table__head__wrapper .eae-sort-icon-up{display:none}.eae-table__sortable .eae-table__sort-Asc .eae-table__head__wrapper .eae-icon-sort-icon,.eae-table__sortable .eae-table__sort-Desc .eae-table__head__wrapper .eae-icon-sort-icon{display:none}.eae-table__sortable .eae-table__sort-Asc .eae-table__head__wrapper .eae-sort-icon-up,.eae-table__sortable .eae-table__sort-Desc .eae-table__head__wrapper .eae-sort-icon-down{display:block}
|
assets/js/eae.js
CHANGED
@@ -2386,7 +2386,7 @@ var breakpoints = eae.breakpoints;
|
|
2386 |
var $grid = $container.isotope(adata);
|
2387 |
$grid.imagesLoaded().progress(function() {
|
2388 |
$grid.isotope('layout');
|
2389 |
-
|
2390 |
});
|
2391 |
|
2392 |
|
@@ -2729,6 +2729,59 @@ var breakpoints = eae.breakpoints;
|
|
2729 |
};
|
2730 |
|
2731 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2732 |
elementorFrontend.hooks.addAction('frontend/element_ready/wts-ab-image.default', ab_image);
|
2733 |
elementorFrontend.hooks.addAction('frontend/element_ready/global', ParticlesBG);
|
2734 |
elementorFrontend.hooks.addAction('frontend/element_ready/global', AnimatedGradient);
|
@@ -2769,6 +2822,7 @@ var breakpoints = eae.breakpoints;
|
|
2769 |
elementorFrontend.hooks.addAction('frontend/element_ready/eae-chart.bar', EAEChart);
|
2770 |
elementorFrontend.hooks.addAction('frontend/element_ready/eae-chart.horizontalBar', EAEChart);
|
2771 |
elementorFrontend.hooks.addAction('frontend/element_ready/eae-chart.line', EAEChart);
|
|
|
2772 |
|
2773 |
});
|
2774 |
|
2386 |
var $grid = $container.isotope(adata);
|
2387 |
$grid.imagesLoaded().progress(function() {
|
2388 |
$grid.isotope('layout');
|
2389 |
+
//$scope.find('.eae-fg-image').css({"min-height":"300px" ,"height" : container_outerheight});
|
2390 |
});
|
2391 |
|
2392 |
|
2729 |
};
|
2730 |
|
2731 |
|
2732 |
+
let EAETable = function ($scope, $){
|
2733 |
+
const table = $scope.find('.eae-table');
|
2734 |
+
const wrapper = $scope.find('.eae-table-container');
|
2735 |
+
lottie_class = $scope.find('.eae-lottie');
|
2736 |
+
settings = table.data('settings');
|
2737 |
+
|
2738 |
+
// lottie animation
|
2739 |
+
lottie_class.each(function(){
|
2740 |
+
let lottie_data = $(this).data('lottie-settings');
|
2741 |
+
|
2742 |
+
let eae_animation = lottie.loadAnimation({
|
2743 |
+
container: document.getElementById(lottie_data.id),
|
2744 |
+
path: lottie_data.url,
|
2745 |
+
renderer: 'svg',
|
2746 |
+
loop: lottie_data.loop,
|
2747 |
+
});
|
2748 |
+
|
2749 |
+
if(lottie_data.reverse == true){
|
2750 |
+
eae_animation.setDirection(-1);
|
2751 |
+
}
|
2752 |
+
|
2753 |
+
});
|
2754 |
+
|
2755 |
+
// Table Sort
|
2756 |
+
if(settings.sort === true){
|
2757 |
+
head_class = $('.eae-table thead tr:not(:last-child)').addClass('eae-sort__ignoreRow');
|
2758 |
+
|
2759 |
+
table.tablesorter({
|
2760 |
+
sortReset: false,
|
2761 |
+
sortRestart: true,
|
2762 |
+
});
|
2763 |
+
}else{
|
2764 |
+
head_class = $('.eae-table thead tr:not(:last-child)').removeClass('eae-sort__ignoreRow');
|
2765 |
+
}
|
2766 |
+
|
2767 |
+
// Table Search
|
2768 |
+
if(settings.search){
|
2769 |
+
wrapper.find('#eae-searchable').keyup(function(){
|
2770 |
+
_this = this;
|
2771 |
+
|
2772 |
+
table
|
2773 |
+
.find(".eae-table__body tr")
|
2774 |
+
.each(function(){
|
2775 |
+
if ($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1)
|
2776 |
+
$(this).addClass("eae-table-search-hide");
|
2777 |
+
else $(this).removeClass("eae-table-search-hide");
|
2778 |
+
});
|
2779 |
+
});
|
2780 |
+
}
|
2781 |
+
};
|
2782 |
+
|
2783 |
+
|
2784 |
+
|
2785 |
elementorFrontend.hooks.addAction('frontend/element_ready/wts-ab-image.default', ab_image);
|
2786 |
elementorFrontend.hooks.addAction('frontend/element_ready/global', ParticlesBG);
|
2787 |
elementorFrontend.hooks.addAction('frontend/element_ready/global', AnimatedGradient);
|
2822 |
elementorFrontend.hooks.addAction('frontend/element_ready/eae-chart.bar', EAEChart);
|
2823 |
elementorFrontend.hooks.addAction('frontend/element_ready/eae-chart.horizontalBar', EAEChart);
|
2824 |
elementorFrontend.hooks.addAction('frontend/element_ready/eae-chart.line', EAEChart);
|
2825 |
+
elementorFrontend.hooks.addAction('frontend/element_ready/eae-data-table.default', EAETable);
|
2826 |
|
2827 |
});
|
2828 |
|
assets/js/eae.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(window).on("elementor/frontend/init",(function(){elementorFrontend.hooks.addAction("frontend/element_ready/wts-gmap.default",(function(e){map=function(a){$wrapper=e.find(".eae-markers");var t=$wrapper.data("zoom"),i=a.find(".marker"),n=$wrapper.data("style"),r=($wrapper.data("scroll"),{zoom:t,center:new google.maps.LatLng(0,0),mapTypeId:google.maps.MapTypeId.ROADMAP,styles:n}),d=new google.maps.Map(a[0],r);return d.markers=[],i.each((function(){!function(a,t){var i=$wrapper.data("animate");$wrapper.data("show-info-window-onload");$wrapper=e.find(".eae-markers");var n=new google.maps.LatLng(a.attr("data-lat"),a.attr("data-lng"));if(icon_img=a.attr("data-icon"),""!=icon_img)var r={url:a.attr("data-icon"),scaledSize:new google.maps.Size(a.attr("data-icon-size"),a.attr("data-icon-size"))};var d=new google.maps.Marker({position:n,map:t,icon:r,animation:google.maps.Animation.DROP});"animate-yes"==i&&"yes"!=a.data("info-window")&&d.setAnimation(google.maps.Animation.BOUNCE);"animate-yes"==i&&google.maps.event.addListener(d,"click",(function(){d.setAnimation(null)}));if(t.markers.push(d),a.html()){var s=new google.maps.InfoWindow({content:a.html()});"yes"==a.data("info-window")&&s.open(t,d),google.maps.event.addListener(d,"click",(function(){s.open(t,d)}))}"animate-yes"==i&&google.maps.event.addListener(s,"closeclick",(function(){d.setAnimation(google.maps.Animation.BOUNCE)}))}(jQuery(this),d)})),function(e,a){var t=new google.maps.LatLngBounds;jQuery.each(e.markers,(function(e,a){var i=new google.maps.LatLng(a.position.lat(),a.position.lng());t.extend(i)})),1==e.markers.length?(e.setCenter(t.getCenter()),e.setZoom(a)):e.fitBounds(t)}(d,t),d}(e.find(".eae-markers"))})),elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(e){var a,t,i,n,r,d,s,l=[],o=[],c=e.children(".eae-section-bs").children(".eae-section-bs-inner");c&&c.data("eae-bg-slider")&&(slider_images=c.data("eae-bg-slider"),a=c.data("eae-bg-slider-transition"),t=c.data("eae-bg-slider-animation"),n=("yes"==(i=c.data("eae-bg-custom-overlay"))||c.data("eae-bg-slider-overlay"),eae_editor.plugin_url+"assets/lib/vegas/overlays/"+c.data("eae-bg-slider-overlay")),r=c.data("eae-bg-slider-cover"),d=c.data("eae-bs-slider-delay"),s=c.data("eae-bs-slider-timer"),"undefined"!=typeof slider_images&&(l=slider_images.split(","),jQuery.each(l,(function(e,a){var t=[];t.src=a,o.push(t)})),c.vegas({slides:o,transition:a,animation:t,overlay:n,cover:r,delay:d,timer:s,init:function(){"yes"==i&&c.children(".vegas-overlay").css("background-image","")}})))}))}));var isEditMode=!1,breakpoints=eae.breakpoints;!function(e){e(window).on("elementor/frontend/init",(function(){var a=function(e,a){function t(e){$icons=a(document).find(e).find(".eae-ic-icon-wrap"),window.innerWidth<767?$icons.each((function(e,t){a(t).css("top",a(t).height()/2+8+"px"),a(t).next(".eae-info-circle-item__content-wrap").css("padding-top",a(t).height()/2+8+"px")})):$icons.each((function(e,t){a(t).css("margin-left",-.5*a(t).outerWidth()),a(t).css("margin-top",-.5*a(t).outerHeight()),$a=function(e){return e=(e-90)*Math.PI/180,{x:50+45*Math.cos(e),y:50+45*Math.sin(e)}}($angle),$b=360/$icons.length,a(t).css("left",$a.x+"%"),a(t).css("top",$a.y+"%"),$angle+=$b}))}$wrap_class=".elementor-element-"+e.data("id"),$angle=0,t(e);var i=null;function n(){"yes"==e.find(".eae-info-circle").data("autoplay")&&(i=setInterval(r,$autoplayDuration))}function r(){e.find(".eae-active").next().length>0?e.find(".eae-active").next().addClass("eae-active").siblings().removeClass("eae-active"):e.find(".eae-info-circle-item").eq(0).addClass("eae-active").siblings().removeClass("eae-active")}$autoplayDuration=e.find(".eae-info-circle").data("delay"),n(),e.find(".eae-ic-icon-wrap").hover((function(){clearInterval(i)}),(function(){n()})),e.find(".eae-info-circle-item").length>0&&a(e.find(".eae-info-circle-item")[0]).addClass("eae-active"),e.find(".eae-ic-icon-wrap").on("click",(function(){e.find(".eae-info-circle-item").removeClass("eae-active"),a(this).parent().addClass("eae-active")})),e.hasClass("eae-mouseenter-yes")&&e.find(".eae-ic-icon-wrap").on("mouseenter",(function(){e.find(".eae-info-circle-item").removeClass("eae-active"),a(this).parent().addClass("eae-active")})),window.addEventListener("resize",t.bind(this,$wrap_class))},t=function(e,a){function t(){var t=e.find(".eae-timline-progress-bar"),i=e.find(".eae-timeline-item"),n=e.find(".eae-timeline");const r=n.data("top-offset");var d=a(n).height(),s=a(i).last().find(".eae-tl-icon-wrapper").offset().top-a(i[0]).parent().offset().top,l=e.find(".eae-tl-icon-wrapper");a(t).css("top",a(i[0]).find(".eae-tl-icon-wrapper").offset().top-a(i[0]).parent().offset().top),a(t).css("bottom",d-s),a(t).css("left",l.eq(0)[0].offsetLeft+l.eq(0).width()/2),a(t).css("display","block"),i.each((function(e,t){new Waypoint({element:a(t),handler:function(e){"down"==e?a(t).addClass("eae-tl-item-focused"):a(t).removeClass("eae-tl-item-focused")},offset:r})}))}t(),window.addEventListener("resize",t),window.addEventListener("scroll",(function(){e.find(".eae-timline-progress-bar");const t=e.find(".eae-timeline").data("top-offset");e.find(".eae-pb-inner-line").css("height",a(window).scrollTop()-e.find(".eae-timeline").offset().top+t),e.find(".eae-pb-inner-line").css("max-height",e.find(".eae-pb-inner-line").parent().height())}))};function i(e,a,t){var i=new Date;i.setTime(i.getTime()+60*t*60*1e3);var n="expires="+i.toUTCString();document.cookie=e+"="+a+";"+n+";path=/"}function n(e){for(var a=e+"=",t=decodeURIComponent(document.cookie).split(";"),i=0;i<t.length;i++){for(var n=t[i];" "==n.charAt(0);)n=n.substring(1);if(0==n.indexOf(a))return n.substring(a.length,n.length)}return""}var r=function(e,a){$is_rtl=jQuery("body").hasClass("rtl"),$wrapper=e.find(".eae-progress-bar");$wrapper.attr("data-skill");var t=$wrapper.attr("data-value"),i=$wrapper.attr("data-skin"),n=$wrapper.find(".eae-pb-bar-skill"),r=$wrapper.find(".eae-pb-bar-value"),d=$wrapper.find(".eae-pb-bar"),s=$wrapper.find(".eae-pb-bar-inner");"skin1"===i&&a(s).attr("style","width : "+t+"%"),"skin2"===i&&a(s).attr("style","width : "+t+"%"),"skin3"===i&&(a(r).addClass("eae-pb-bar-value--aligned-value"),$is_rtl?a(r).attr("style","right :"+t+"%"):a(r).attr("style","left :"+t+"%"),a(s).attr("style","width :"+t+"%")),"skin4"===i&&(a(r).addClass("eae-pb-bar-value--aligned-value"),$is_rtl?a(r).attr("style","right :"+t+"%"):a(r).attr("style","left :"+t+"%"),a(s).attr("style","width :"+t+"%"),a(d).addClass("eae-pb-bar--no-overflow")),"skin5"===i&&(a(r).addClass("eae-pb-bar-value--aligned-value"),$is_rtl?a(r).attr("style","right :"+t+"%"):a(r).attr("style","left :"+t+"%"),a(s).attr("style","width :"+t+"%")),$wrapper.each((function(e,t){new Waypoint({element:t,skill_value:a(t).find(".eae-pb-bar-skill"),valueElem:a(t).find(".eae-pb-bar-value"),prgBar:a(t).find(".eae-pb-bar-bar"),prgInner:a(t).find(".eae-pb-bar-inner"),handler:function(e){"down"==e&&(a(r).hasClass("js-animated")||a(r).addClass("js-animated"),a(s).hasClass("js-animated")||a(s).addClass("js-animated"),a(n).hasClass("js-animated")||a(n).addClass("js-animated"))},offset:"bottom-in-view"})}))},d=function(e,a){var t=e.find(".eae-content-switcher-wrapper"),i=(e.data("id"),t.find(".eae-content-switch-button"));i.each((function(e,n){a(this).on("click",(function(e){e.preventDefault();let n=a(this).find(".eae-content-switch-label");if(!a(this).hasClass("active")){a(i).removeClass("active");let e=a(n).attr("id");a(this).addClass("active");var r=a(t).find(".eae-cs-content-section");a(r).removeClass("active");let d=a(t).find(".eae-content-section-"+e);a(d).addClass("active")}}))}))},s=function(e,a){let t=e.find(".eae-content-switcher-wrapper"),i=(e.data("id"),t.find(".eae-cs-switch-label")),n=t.find(".eae-content-switch-label.primary-label");const r=a(n).attr("item_id");let d=t.find(".eae-content-switch-label.secondary-label");const s=a(d).attr("item_id");let l=t.find(".eae-cs-content-section.eae-content-section-"+r),o=t.find(".eae-cs-content-section.eae-content-section-"+s);a(i).on("click",(function(e){a(this).find("input.eae-content-toggle-switch").is(":checked")?(d.addClass("active"),o.addClass("active"),n.removeClass("active"),l.removeClass("active")):(n.addClass("active"),l.addClass("active"),d.removeClass("active"),o.removeClass("active"))}))};e.fn.EAEHoverDirection=function(a){var t=e.extend({inaccuracy:30,speed:200},a);this.find(".overlay").css({top:-9999999}),this.mouseenter((function(a){container=e(this),overlay=container.find(".overlay"),parentOffset=container.offset(),relX=a.pageX-parentOffset.left,relY=a.pageY-parentOffset.top,overlay.css({top:0,left:0,width:container.width(),height:container.height()}),relX>container.width()-t.inaccuracy?overlay.css({top:0,left:container.width()}):relX<t.inaccuracy?overlay.css({top:0,left:-container.width()}):relY>container.height()-t.inaccuracy?overlay.css({top:container.width(),left:0}):relY<t.inaccuracy&&overlay.css({top:-container.width(),left:0}),overlay.animate({top:0,left:0},t.speed)})),this.mouseleave((function(a){container=e(this),overlay=container.find(".overlay"),parentOffset=container.offset(),relX=a.pageX-parentOffset.left,relY=a.pageY-parentOffset.top,relX<=0&&overlay.animate({top:0,left:-container.width()},t.speed),relX>=container.width()&&overlay.animate({top:0,left:container.width()},t.speed),relY<=0&&overlay.animate({left:0,top:-container.height()},t.speed),relY>=container.height()&&overlay.animate({left:0,top:container.height()},t.speed)}))};let l=function(e,a){const t=e.find(".eae-chart-outer-container"),i=(e.data("id"),e.find("#eae-chart-canvas"));let n=t.data("settings");new Chart(i,n)};elementorFrontend.hooks.addAction("frontend/element_ready/wts-ab-image.default",(function(e,a){e.find(".eae-img-comp-container").imagesLoaded().done((function(){ab_style=e.find(".eae-img-comp-container").data("ab-style"),slider_pos=e.find(".eae-img-comp-container").data("slider-pos"),"horizontal"===ab_style?(separator_width=parseInt(e.find(".eae-img-comp-overlay").css("border-right-width")),function(e){var a,t;a=e.find(".eae-img-comp-overlay"),t=(t=a.width())*slider_pos/100,function(a){var i,n,r,d=0;function s(e){e.preventDefault(),d=1,window.addEventListener("mousemove",o),i.addEventListener("touchmove",c)}function l(){d=0}function o(e){var t;if(0==d)return!1;(t=function(e){var t;return e=e||window.event,t=a.getBoundingClientRect(),e.pageX-t.left}(e))<0&&(t=0),t>n&&(t=n),p(t)}function c(e){var t;if(0==d)return!1;(t=function(e){var t;return t=a.getBoundingClientRect(),e.changedTouches[0].clientX-t.left}(e))<0&&(t=0),t>n&&(t=n),p(t)}function p(e){a.style.width=e+"px",i.style.left=a.offsetWidth-i.offsetWidth/2-separator_width/2+"px"}n=a.offsetWidth,r=a.offsetHeight,a.style.width=t+"px",(i=(i=e.find(".eae-img-comp-slider"))[0]).style.top=r/2-i.offsetHeight/2+"px",i.style.left=t-i.offsetWidth/2-separator_width/2+"px",e.hasClass("elementor-element-edit-mode")||(i.addEventListener("mousedown",s),window.addEventListener("mouseup",l),i.addEventListener("touchstart",s),window.addEventListener("touchstop",l))}(a[0])}(e)):(separator_width=parseInt(e.find(".eae-img-comp-overlay").css("border-bottom-width")),function(e){var a;a=e.find(".eae-img-comp-overlay"),start_pos=a.height(),start_pos=start_pos*slider_pos/100,function(a){var t,i,n,r=0;function d(e){e.preventDefault(),r=1,window.addEventListener("mousemove",l),t.addEventListener("touchmove",o)}function s(){r=0}function l(e){var t;if(0==r)return!1;(t=function(e){var t,i=0;return e=e||window.event,t=a.getBoundingClientRect(),i=e.pageY-t.top,i-=window.pageYOffset}(e))<0&&(t=0),t>n&&(t=n),c(t)}function o(e){var t;if(0==r)return!1;(t=function(e){var t;return t=a.getBoundingClientRect(),e.changedTouches[0].clientY-t.top}(e))<0&&(t=0),t>n&&(t=n),c(t)}function c(e){a.style.height=e+"px",t.style.top=a.offsetHeight-t.offsetHeight/2-separator_width/2+"px"}i=a.offsetWidth,n=a.offsetHeight,a.style.height=start_pos+"px",(t=(t=e.find(".eae-img-comp-slider"))[0]).style.top=start_pos-t.offsetHeight/2-separator_width/2+"px",t.style.left=i/2-t.offsetWidth/2+"px",e.hasClass("elementor-element-edit-mode")||(t.addEventListener("mousedown",d),window.addEventListener("mouseup",s),t.addEventListener("touchstart",d),window.addEventListener("touchstop",s))}(a[0])}(e))}))})),elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(e,a){e.hasClass("eae-particle-yes")&&(id=e.data("id"),element_type=e.data("element_type"),pdata=e.data("eae-particle"),pdata_wrapper=e.find(".eae-particle-wrapper").data("eae-pdata"),"undefined"!=typeof pdata&&""!=pdata?e.find(".eae-section-bs").length>0?(e.find(".eae-section-bs").after('<div class="eae-particle-wrapper" id="eae-particle-'+id+'"></div>'),particlesJS("eae-particle-"+id,pdata)):("column"==element_type?e.prepend('<div class="eae-particle-wrapper" id="eae-particle-'+id+'"></div>'):e.prepend('<div class="eae-particle-wrapper " id="eae-particle-'+id+'"></div>'),particlesJS("eae-particle-"+id,pdata)):"undefined"!=typeof pdata_wrapper&&""!=pdata_wrapper&&(element_type,e.prepend('<div class="eae-particle-wrapper eae-particle-area" id="eae-particle-'+id+'"></div>'),particlesJS("eae-particle-"+id,JSON.parse(pdata_wrapper))))})),elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(e,a){if(e.hasClass("eae-animated-gradient-yes")){id=e.data("id"),color=e.data("color"),angle=e.data("angle");var t="linear-gradient("+angle+","+color+")";heading=e.find(".elementor-heading-title"),e.css("background-image",t),e.hasClass("elementor-element-edit-mode")&&(color=e.find(".animated-gradient").data("color"),angle=e.find(".animated-gradient").data("angle"),gradient_color_editor="linear-gradient("+angle+","+color+")",e.prepend('<div class="animated-gradient" style="background-image : '+gradient_color_editor+' "></div>'))}})),elementorFrontend.hooks.addAction("frontend/element_ready/wts-modal-popup.default",(function(e,a){$preview_modal=e.find(".eae-popup-wrapper").data("preview-modal"),$close_btn_type=e.find(".eae-popup-wrapper").data("close-button-type"),$close_btn=e.find(".eae-popup-wrapper").data("close-btn"),"icon"==$close_btn_type?$close_btn_html='<i class="eae-close '+$close_btn+'"> </i>':$close_btn_html='<svg class="eae-close" style="-webkit-mask: url('+$close_btn+"); mask: url("+$close_btn+'); "></svg>',$magnific=e.find(".eae-popup-link").eaePopup({type:"inline",disableOn:0,key:null,midClick:!1,mainClass:"eae-popup eae-popup-"+e.find(".eae-popup-link").data("id")+" eae-wrap-"+e.find(".eae-popup-link").data("ctrl-id"),preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:e.find(".eae-popup-wrapper").data("close-in-out"),showCloseBtn:!0,enableEscapeKey:!1,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:$close_btn_html,tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}),"yes"==$preview_modal&&e.hasClass("elementor-element-edit-mode")&&e.find(".eae-popup-link").click()})),elementorFrontend.hooks.addAction("frontend/element_ready/wts-testimonial-slider.default",(function(e,a){if(e.find(".eae-grid-wrapper").hasClass("eae-masonry-yes")){var t=e.find(".eae-grid").masonry({});t.imagesLoaded().progress((function(){t.masonry("layout")}))}if(e.find(".eae-layout-carousel").length){outer_wrapper=e.find(".eae-swiper-outer-wrapper"),wid=e.data("id"),wclass=".elementor-element-"+wid;var i=outer_wrapper.data("direction"),n=outer_wrapper.data("speed"),r=outer_wrapper.data("autoplay"),d=outer_wrapper.data("duration"),s=outer_wrapper.data("effect"),l=outer_wrapper.data("space"),o=outer_wrapper.data("loop");o="yes"==o;var c=outer_wrapper.data("slides-per-view"),p=outer_wrapper.data("slides-per-group"),f=outer_wrapper.data("ptype"),m=outer_wrapper.data("navigation"),u=outer_wrapper.data("clickable"),g=outer_wrapper.data("keyboard"),v=outer_wrapper.data("scrollbar");adata={direction:i,effect:s,spaceBetween:l.desktop,loop:o,speed:n,slidesPerView:c.desktop,slidesPerGroup:p.desktop,observer:!0,mousewheel:{invert:!0},breakpoints:{1024:{spaceBetween:l.tablet,slidesPerView:c.tablet,slidesPerGroup:p.tablet},767:{spaceBetween:l.mobile,slidesPerView:c.mobile,slidesPerGroup:p.mobile}}},"fade"==s&&(adata.fadeEffect={crossFade:!1}),adata.autoplay="yes"==r&&{delay:d,disableOnInteraction:!1},"yes"==m&&(adata.navigation={nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}),""!=f&&(adata.pagination={el:".swiper-pagination",type:f}),"bullets"==f&&"yes"==u&&(adata.pagination={el:".swiper-pagination",clickable:!0,type:f}),"yes"==v&&(adata.scrollbar={el:".swiper-scrollbar",draggable:!0}),"yes"==g&&(adata.keyboard={enabled:!0,onlyInViewport:!0}),0==o&&(adata.autoplay={delay:d,stopOnLastSlide:!0,disableOnInteraction:!1}),window.mswiper=new Swiper(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .swiper-container",adata),a(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .swiper-container").css("visibility","visible")}})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-info-circle.skin1",a),elementorFrontend.hooks.addAction("frontend/element_ready/eae-info-circle.skin2",a),elementorFrontend.hooks.addAction("frontend/element_ready/eae-info-circle.skin3",a),elementorFrontend.hooks.addAction("frontend/element_ready/eae-info-circle.skin4",a),elementorFrontend.hooks.addAction("frontend/element_ready/eae-timeline.skin1",t),elementorFrontend.hooks.addAction("frontend/element_ready/eae-timeline.skin2",t),elementorFrontend.hooks.addAction("frontend/element_ready/eae-timeline.skin3",t),elementorFrontend.hooks.addAction("frontend/element_ready/eae-timeline.skin4",t),elementorFrontend.hooks.addAction("frontend/element_ready/eae-evergreen-timer.skin1",(function(e,a){var t=e.find(".eae-evergreen-wrapper").data("egtime"),r=e.find(".eae-evergreen-wrapper").data("egt-expire"),d=e.find(".eae-evergreen-wrapper").data("element-type"),s="eae-"+e.find(".eae-evergreen-wrapper").data("id"),l="eae-temp-"+e.find(".eae-evergreen-wrapper").data("id"),o=e.find(".eae-evergreen-wrapper").data("actions"),c=e.find(".eae-evergreen-wrapper").data("unqid"),p=(new Date).getTime();if(!e.hasClass("elementor-element-edit-mode"))if("countdown"===d){u=new Date(t),t=u.getTime();var f="expires="+u.toUTCString();document.cookie=l+"="+u.getTime()+";"+f+";path=/"}else{var m=n(s),u="";if(""!==m){(u=new Date(parseInt(m))).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime();var g=new Date(parseInt(m));g.setTime(g.getTime()+60*r*60*1e3);var v="expires="+g.toUTCString();document.cookie=s+"="+m+";"+v+";path=/";var h=new Date(parseInt(m));h.setTime(h.getTime()+1e3*e.find(".eae-evergreen-wrapper").data("egtime"));f="expires="+h.toUTCString();t-p>0&&(document.cookie=l+"="+m+";"+f+";path=/")}else{temp_date=t,(u=new Date).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime(),i(s,(new Date).getTime(),r);var w=new Date;w.setTime(w.getTime()+1e3*temp_date);var y="expires="+w.toUTCString();document.cookie=l+"="+(new Date).getTime()+";"+y+";path=/"}}if(!e.hasClass("elementor-element-edit-mode")&&t-p<0)return o.length>0&&o.forEach((function(t){"redirect"===t&&($url=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==a.trim($url)&&(window.location.href=$url1)),"hide"===t&&(e.hasClass("elementor-element-edit-mode")||(e.find("#eaeclockdiv").css("display","none"),e.find(".egt-title").css("display","none"))),"message"===t&&e.find(".eae-egt-message").css("display","block"),"hide_parent"===t&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none")))})),days="00",hours="00",minutes="00",seconds="00",e.find("."+c).find("#eaedivDays").html(days),e.find("."+c).find("#eaedivHours").html(hours.slice(-2)),e.find("."+c).find("#eaedivMinutes").html(minutes.slice(-2)),void e.find("."+c).find("#eaedivSeconds").html(seconds.slice(-2));e.hasClass("elementor-element-edit-mode")&&("countdown"===d?(u=new Date(t),t=u.getTime()):((u=new Date).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime()));var k=setInterval((function(){var i=(new Date).getTime(),n=t-i,r=0,d=0,s=0,l=0;n>0?(r=Math.floor(n/864e5),d="0"+Math.floor(n%864e5/36e5),s="0"+Math.floor(n%36e5/6e4),l="0"+Math.floor(n%6e4/1e3)):(o.length>0&&(e.hasClass("elementor-element-edit-mode")||o.forEach((function(t){"redirect"===t&&($url1=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==a.trim($url1)&&(window.location.href=$url1)),"hide"===t&&(e.find("#eaeclockdiv").css("display","none"),e.find(".egt-title").css("display","none")),"message"===t&&e.find(".eae-egt-message").css("display","block"),"hide_parent"===t&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none")))}))),clearInterval(k),r="0",d="00",s="00",l="00"),r<10&&(r="0"+r),e.find("."+c).find("#eaedivDays").html(r),e.find("."+c).find("#eaedivHours").html(d.slice(-2)),e.find("."+c).find("#eaedivMinutes").html(s.slice(-2)),e.find("."+c).find("#eaedivSeconds").html(l.slice(-2))}),1e3)})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-evergreen-timer.skin2",(function(e,a){var t=e.find(".eae-evergreen-wrapper").data("egtime"),r=e.find(".eae-evergreen-wrapper").data("egt-expire"),d=e.find(".eae-evergreen-wrapper").data("element-type"),s="eae-"+e.find(".eae-evergreen-wrapper").data("id"),l="eae-temp-"+e.find(".eae-evergreen-wrapper").data("id"),o=e.find(".eae-evergreen-wrapper").data("actions"),c=e.find(".eae-evergreen-wrapper").data("unqid"),p=(new Date).getTime();if(!e.hasClass("elementor-element-edit-mode"))if("countdown"===d){u=new Date(t),t=u.getTime();var f="expires="+u.toUTCString();document.cookie=l+"="+u.getTime()+";"+f+";path=/"}else{var m=n(s),u="";if(""!==m){(u=new Date(parseInt(m))).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime();var g=new Date(parseInt(m));g.setTime(g.getTime()+60*r*60*1e3);var v="expires="+g.toUTCString();document.cookie=s+"="+m+";"+v+";path=/";var h=new Date(parseInt(m));h.setTime(h.getTime()+1e3*e.find(".eae-evergreen-wrapper").data("egtime"));f="expires="+h.toUTCString();t-p>0&&(document.cookie=l+"="+m+";"+f+";path=/")}else{temp_date=t,(u=new Date).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime(),i(s,(new Date).getTime(),r);var w=new Date;w.setTime(w.getTime()+1e3*temp_date);var y="expires="+w.toUTCString();document.cookie=l+"="+(new Date).getTime()+";"+y+";path=/"}}if(!e.hasClass("elementor-element-edit-mode")&&t-p<0)return void(o.length>0&&o.forEach((function(t){"redirect"===t&&($url=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==a.trim($url)&&(window.location.href=$url)),"hide"===t&&(e.find("."+c).find(".timer-container").css("display","none"),e.find("."+c).find(".egt-title").css("display","none")),"message"===t&&e.find("."+c).find(".eae-egt-message").css("display","block"),"hide_parent"===t&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none")))})));e.hasClass("elementor-element-edit-mode")&&("countdown"===d?(u=new Date(t),t=u.getTime()):((u=new Date).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime()));var k=setInterval((function(){var i=(new Date).getTime(),n=t-i,r=Math.floor(n/864e5),d=Math.floor(n%864e5/36e5),s=Math.floor(n%36e5/6e4),l=Math.floor(n%6e4/1e3);if(e.find("."+c).find("#eaeulSec1").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulSec1").find(".flip-clock-before").removeClass("flip-clock-before"),e.find("."+c).find("#eaeulSec").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulSec").find(".flip-clock-before").removeClass("flip-clock-before"),n<0)return clearInterval(k),void(o.length>0&&o.forEach((function(t){"redirect"===t&&(e.hasClass("elementor-element-edit-mode")||($url1=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==a.trim($url1)&&(window.location.href=$url1))),"hide"===t&&(e.hasClass("elementor-element-edit-mode")||(e.find("."+c).find(".timer-container").css("display","none"),e.find("."+c).find(".egt-title").css("display","none"))),"message"===t&&(e.hasClass("elementor-element-edit-mode")||e.find("."+c).find(".eae-egt-message").css("display","block")),"hide_parent"===t&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none")))})));if(2===a.trim(l).length){var p="#eaeulSec1 li:eq( "+a.trim(l).charAt(1)+" )",f="#eaeulSec li:eq( "+a.trim(l).charAt(0)+" )";e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulSec1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulSec1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulSec li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulSec li:first-child").addClass("flip-clock-before"))}else{p="#eaeulSec1 li:eq( "+a.trim(l).charAt(0)+" )",f="#eaeulSec li:eq( 0 )";e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulSec1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulSec1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulSec li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulSec li:first-child").addClass("flip-clock-before"))}if(e.find("."+c).find("#eaeulMin1").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulMin1").find(".flip-clock-before").removeClass("flip-clock-before"),e.find("."+c).find("#eaeulMin").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulMin").find(".flip-clock-before").removeClass("flip-clock-before"),2==a.trim(s).length){p="#eaeulMin1 li:eq( "+a.trim(s).charAt(1)+" )",f="#eaeulMin li:eq( "+a.trim(s).charAt(0)+" )";e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulMin1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulMin1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulMin li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulMin li:first-child").addClass("flip-clock-before"))}else{p="#eaeulMin1 li:eq( "+a.trim(s).charAt(0)+" )",f="#eaeulMin li:eq( 0 )";e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulMin1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulMin1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulMin li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulMin li:first-child").addClass("flip-clock-before"))}if(e.find("."+c).find("#eaeulHour1").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulHour1").find(".flip-clock-before").removeClass("flip-clock-before"),e.find("."+c).find("#eaeulHour").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulHour").find(".flip-clock-before").removeClass("flip-clock-before"),2==a.trim(d).length){p="#eaeulHour1 li:eq( "+a.trim(d).charAt(1)+" )",f="#eaeulHour li:eq( "+a.trim(d).charAt(0)+" )";e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulHour1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulHour1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulHour li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulHour li:first-child").addClass("flip-clock-before"))}else{p="#eaeulHour1 li:eq( "+a.trim(d).charAt(0)+" )",f="#eaeulHour li:eq( 0 )";e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulHour1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulHour li:first-child").addClass("flip-clock-before")),e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulHour li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulHour li:first-child").addClass("flip-clock-before"))}if(e.find("."+c).find("#eaeulDay1").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulDay1").find(".flip-clock-before").removeClass("flip-clock-before"),e.find("."+c).find("#eaeulDay").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulDay").find(".flip-clock-before").removeClass("flip-clock-before"),2==a.trim(r).length){p="#eaeulDay1 li:eq( "+a.trim(r).charAt(1)+" )",f="#eaeulDay li:eq( "+a.trim(r).charAt(0)+" )";e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulDay1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulDay1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulDay li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulDay li:first-child").addClass("flip-clock-before"))}else{p="#eaeulDay1 li:eq( "+a.trim(r).charAt(0)+" )",f="#eaeulDay li:eq( 0 )";e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulDay1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulDay li:first-child").addClass("flip-clock-before")),e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulDay li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulDay li:first-child").addClass("flip-clock-before"))}}),1e3)})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-evergreen-timer.skin3",(function(e,a){var t,r=e.find(".eae-evergreen-wrapper").data("egtime"),d=e.find(".eae-evergreen-wrapper").data("egt-expire"),s=e.find(".eae-evergreen-wrapper").data("element-type"),l="eae-"+e.find(".eae-evergreen-wrapper").data("id"),o="eae-temp-"+e.find(".eae-evergreen-wrapper").data("id"),c=e.find(".eae-evergreen-wrapper").data("actions"),p=e.find(".eae-evergreen-wrapper").data("days"),f=e.find(".eae-evergreen-wrapper").data("hours"),m=e.find(".eae-evergreen-wrapper").data("mins"),u=e.find(".eae-evergreen-wrapper").data("seconds"),g=e.find(".eae-evergreen-wrapper").data("unqid"),v=(new Date).getTime();if(!e.hasClass("elementor-element-edit-mode"))if("countdown"===s){y=new Date(r),r=y.getTime();var h="expires="+y.toUTCString();document.cookie=o+"="+y.getTime()+";"+h+";path=/"}else{var w=n(l),y="";if(""!==w){(y=new Date(parseInt(w))).setSeconds(y.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),r=y.getTime();var k=new Date(parseInt(w));k.setTime(k.getTime()+60*d*60*1e3);var b="expires="+k.toUTCString();document.cookie=l+"="+w+";"+b+";path=/";var C=new Date(parseInt(w));C.setTime(C.getTime()+1e3*e.find(".eae-evergreen-wrapper").data("egtime"));h="expires="+C.toUTCString();r-v>0&&(document.cookie=o+"="+w+";"+h+";path=/")}else{temp_date=r,(y=new Date).setSeconds(y.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),r=y.getTime(),i(l,(new Date).getTime(),d);var _=new Date;_.setTime(_.getTime()+1e3*temp_date);var x="expires="+_.toUTCString();document.cookie=o+"="+(new Date).getTime()+";"+x+";path=/"}}if(!e.hasClass("elementor-element-edit-mode")){var T=D(r);if(parseInt(T.all)<1){if(c.length>0&&(c.forEach((function(a){"redirect"===a&&(e.hasClass("elementor-element-edit-mode")||($url=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==$url&&(window.location.href=$url))),"hide_parent"===a&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none"))),"hide"===a&&(e.find("#timer").css("display","none"),e.find(".egt-title").css("display","none"),e.find(".desc").css("display","none")),"message"===a&&e.find(".eae-egt-message").css("display","block")})),1===c.length&&(""===c[0]||"message"===c[0]))){var $=e.find("."+g).find("#timer")[0];"yes"===p&&($.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===f&&("yes"===p?a($).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):$.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===m&&("yes"===p||"yes"===f?a($).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):$.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===u&&("yes"===p||"yes"===f||"yes"===m?a($).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):$.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>")}return}}function D(e){var a=r-new Date;return{days:Math.floor(a/864e5),hours:"0"+Math.floor(a/36e5%24),minutes:"0"+Math.floor(a/6e4%60),seconds:"0"+Math.floor(a/1e3%60),all:a}}function S(e){e.classList.add("fade"),setTimeout((function(){e.classList.remove("fade")}),700)}e.hasClass("elementor-element-edit-mode")&&("countdown"===s?(y=new Date(r),r=y.getTime()):((y=new Date).setSeconds(y.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),r=y.getTime())),D(r).all>1&&(t=setInterval((function(){var i=e.find("."+g).find("#timer")[0],n=D(r);"yes"===p&&(n.days<10&&(n.days="0"+n.days),i.innerHTML="<span class='egt-time eae-time-wrapper'><div>"+n.days+"</div></span>"),"yes"===f&&("yes"===p?a(i).append("<span class='egt-time eae-time-wrapper'><div>"+n.hours.slice(-2)+"</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>"+n.hours.slice(-2)+"</div></span>"),"yes"===m&&("yes"===p||"yes"===f?a(i).append("<span class='egt-time eae-time-wrapper'><div>"+n.minutes.slice(-2)+"</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>"+n.minutes.slice(-2)+"</div></span>"),"yes"===u&&("yes"===p||"yes"===f||"yes"===m?a(i).append("<span class='egt-time eae-time-wrapper'><div>"+n.seconds.slice(-2)+"</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>"+n.seconds.slice(-2)+"</div></span>");var d=i.getElementsByTagName("span");"yes"===p&&59==n.hours&&59==n.minutes&&59==n.seconds&&S(d[0]),"yes"===f&&("yes"===p?59==n.minutes&&59==n.seconds&&S(d[1]):59==n.minutes&&59==n.seconds&&S(d[0])),"yes"===m&&("yes"===p?"yes"===f?59==n.seconds&&S(d[2]):59==n.seconds&&S(d[1]):"yes"===f?59==n.seconds&&S(d[1]):59==n.seconds&&S(d[0])),"yes"===u&&("yes"===p?"yes"===f?"yes"===m&&S(d[3]):S("yes"===m?d[2]:d[1]):"yes"===f?"yes"===m&&S(d[2]):S("yes"===m?d[1]:d[0])),n.all<=1&&(clearInterval(t),"yes"===p&&(i.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===f&&("yes"===p?a(i).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===m&&("yes"===p||"yes"===f?a(i).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===u&&("yes"===p||"yes"===f||"yes"===m?a(i).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),e.hasClass("elementor-element-edit-mode")||c.length>0&&c.forEach((function(a){"redirect"===a&&($url1=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==$url1&&(window.location.href=$url1)),"hide"===a&&(e.find("#timer").css("display","none"),e.find(".egt-title").css("display","none"),e.find(".desc").css("display","none")),"message"===a&&e.find(".eae-egt-message").css("display","block"),"hide_parent"===a&&($p_secs=e.closest("section"),$p_secs.css("display","none"))})))}),1e3))})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-comparisontable.default",(function(e,a){a(e.find(".eae-ct-heading")[0]).addClass("active"),e.find("ul").on("click","li",(function(){var t=a(this).index()+2;e.find("tr").find("td:not(:eq(0))").hide(),e.find("td:nth-child("+t+")").css("display","table-cell"),e.find("tr").find("th:not(:eq(0))").hide(),e.find("li").removeClass("active"),a(this).addClass("active")}));var t=window.matchMedia("(min-width: 767px)");function i(a){a.matches?e.find(".sep").attr("colspan",5):e.find(".sep").attr("colspan",2)}t.addListener(i),i(t)})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin1",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin2",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin3",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin4",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin5",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-filterableGallery.default",(function(e,a){var t=e.find(".eae-fg-wrapper"),i=e.data("id"),n=t.attr("data-maxtilt"),r=t.attr("data-perspective"),d=t.attr("data-speed"),s=t.attr("data-tilt-axis"),l=t.attr("data-glare"),o=parseInt(t.attr("data-overlay-speed"));if(s="x"===s?"y":"y"===s?"x":"both","yes"===l)var c=t.attr("data-max-glare");l="yes"===l;var p=a(".elementor-element-"+i+" .eae-fg-image"),f=t.hasClass("masonry-yes")?"masonry":"fitRows";let m=p.outerHeight();adata={percentPosition:!0,animationOptions:{duration:750,easing:"linear",queue:!1}},"fitRows"===f&&(adata.layoutMode="fitRows"),"masonry"===f&&(adata.masonry={columnWidth:".eae-gallery-item",horizontalOrder:!0}),e.hasClass("eae-show-all-yes")||(e.find(".eae-gallery-filter a").first().addClass("current"),adata.filter=e.find(".eae-gallery-filter a").first().attr("data-filter"));var u=p.isotope(adata);u.imagesLoaded().progress((function(){u.isotope("layout"),e.find(".eae-fg-image").css({"min-height":"300px",height:m})})),e.find(".eae-tilt-yes")&&(atilt={maxTilt:n,perspective:r,easing:"linear",scale:1,speed:d,disableAxis:s,transition:!0,reset:!0,glare:l,maxGlare:c},e.find(".el-tilt").tilt(atilt)),a(".elementor-element-"+i+" .eae-gallery-filter a").on("click",(function(){e.find(".eae-gallery-filter .current").removeClass("current"),a(this).addClass("current");var t=a(this).attr("data-filter");adata.filter=t;var i=p.isotope(adata);return i.imagesLoaded().progress((function(){if(i.isotope("layout"),isEditMode)return!1;e.find(".eae-tilt-yes")&&(e.find(".el-tilt").tilt(atilt),e.find(".el-tilt").tilt.reset.call(e.find(".el-tilt")))})),!1})),t.hasClass("eae-hover-direction-effect")||e.find(".eae-gallery-item-inner").hover((function(){a(this).find(".eae-grid-overlay").addClass("animated")})),t.hasClass("eae-hover-direction-effect")&&(e.find(".eae-gallery-item-inner").hover((function(){a(this).find(".eae-grid-overlay").addClass("overlay")})),t.find(".eae-gallery-item-inner").EAEHoverDirection({speed:o}))})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-content-switcher.skin1",d),elementorFrontend.hooks.addAction("frontend/element_ready/eae-content-switcher.skin2",d),elementorFrontend.hooks.addAction("frontend/element_ready/eae-content-switcher.skin3",s),elementorFrontend.hooks.addAction("frontend/element_ready/eae-content-switcher.skin4",s),elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(e,a){isEditMode||e.data("wts-url")&&"yes"==e.data("wts-link")&&e.on("click",(function(a){e.data("wts-url")&&"yes"==e.data("wts-new-window")?window.open(e.data("wts-url")):location.href=e.data("wts-url")}))})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-thumbgallery.default",(function(e,a){swiper_outer_wrapper=e.find(".eae-swiper-outer-wrapper"),wid=e.data("id"),wClass=".elementor-element-"+wid,thumb_outer_wrapper=e.find(".eae-gallery-thumbs");let t=swiper_outer_wrapper.data("swiper-settings"),i=swiper_outer_wrapper.data("slides-per-view"),n=swiper_outer_wrapper.data("space");const r=eae.breakpoints;let d={};d[r.lg-1]={slidesPerView:i.desktop,spaceBetween:n.desktop},d[r.md-1]={slidesPerView:i.tablet,spaceBetween:n.tablet};const s=eae.breakpoints;let l={};if(l[s.lg-1]={spaceBetween:t.spaceBetween.desktop},l[s.md-1]={spaceBetween:t.spaceBetween.tablet},sliderData={direction:"horizontal",effect:t.effect,keyboard:{enabled:t.keyboard},spaceBetween:t.spaceBetween.mobile,breakpoints:l,speed:t.speed,loop:"yes"===t.loop,thumbs:{swiper:{el:thumb_outer_wrapper,direction:"horizontal",spaceBetween:n.mobile,slidesPerView:i.mobile,navigation:{nextEl:wClass+" .eae-swiper-button-next",prevEl:wClass+" .eae-swiper-button-prev"},speed:t.speed,loop:"yes"===t.loop,freeMode:!0,watchSlidesVisibility:!0,watchSlidesProgress:!0,breakpoints:d,slideToClickedSlide:!0}}},void 0!==t.autoplay&&(sliderData.thumbs.swiper.autoplay={delay:t.autoplay.duration,disableOnInteraction:t.autoplay.disableOnInteraction,reverseDirection:t.autoplay.reverseDirection}),"yes"==t.navigation&&(sliderData.navigation={nextEl:wClass+" .eae-swiper-button-next",prevEl:wClass+" .eae-swiper-button-prev"}),""!==t.pagination&&(sliderData.pagination={type:t.pagination,el:wClass+" .swiper-pagination",clickable:t.clickable}),void 0!==t.autoplay&&(sliderData.autoplay={delay:t.autoplay.duration,disableOnInteraction:t.autoplay.disableOnInteraction,reverseDirection:t.autoplay.reverseDirection}),"undefined"==typeof Swiper){new(0,elementorFrontend.utils.swiper)(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .eae-swiper-container",sliderData).then(e=>{sswiper=e})}else window.sswiper=new Swiper(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .eae-swiper-container",sliderData),a(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .eae-swiper-container").css("visibility","visible");if(void 0!==t.autoplay){"yes"==t.autoplay.pauseOnHover&&jQuery(wClass+" .eae-swiper-container").hover((function(){sswiper.autoplay.stop(),sswiper.thumbs.swiper.autoplay.stop()}),(function(){sswiper.autoplay.start(),sswiper.thumbs.swiper.autoplay.start()}))}})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-chart.bar",l),elementorFrontend.hooks.addAction("frontend/element_ready/eae-chart.horizontalBar",l),elementorFrontend.hooks.addAction("frontend/element_ready/eae-chart.line",l)}))}(jQuery);
|
1 |
+
jQuery(window).on("elementor/frontend/init",(function(){elementorFrontend.hooks.addAction("frontend/element_ready/wts-gmap.default",(function(e){map=function(a){$wrapper=e.find(".eae-markers");var t=$wrapper.data("zoom"),i=a.find(".marker"),n=$wrapper.data("style"),r=($wrapper.data("scroll"),{zoom:t,center:new google.maps.LatLng(0,0),mapTypeId:google.maps.MapTypeId.ROADMAP,styles:n}),d=new google.maps.Map(a[0],r);return d.markers=[],i.each((function(){!function(a,t){var i=$wrapper.data("animate");$wrapper.data("show-info-window-onload");$wrapper=e.find(".eae-markers");var n=new google.maps.LatLng(a.attr("data-lat"),a.attr("data-lng"));if(icon_img=a.attr("data-icon"),""!=icon_img)var r={url:a.attr("data-icon"),scaledSize:new google.maps.Size(a.attr("data-icon-size"),a.attr("data-icon-size"))};var d=new google.maps.Marker({position:n,map:t,icon:r,animation:google.maps.Animation.DROP});"animate-yes"==i&&"yes"!=a.data("info-window")&&d.setAnimation(google.maps.Animation.BOUNCE);"animate-yes"==i&&google.maps.event.addListener(d,"click",(function(){d.setAnimation(null)}));if(t.markers.push(d),a.html()){var s=new google.maps.InfoWindow({content:a.html()});"yes"==a.data("info-window")&&s.open(t,d),google.maps.event.addListener(d,"click",(function(){s.open(t,d)}))}"animate-yes"==i&&google.maps.event.addListener(s,"closeclick",(function(){d.setAnimation(google.maps.Animation.BOUNCE)}))}(jQuery(this),d)})),function(e,a){var t=new google.maps.LatLngBounds;jQuery.each(e.markers,(function(e,a){var i=new google.maps.LatLng(a.position.lat(),a.position.lng());t.extend(i)})),1==e.markers.length?(e.setCenter(t.getCenter()),e.setZoom(a)):e.fitBounds(t)}(d,t),d}(e.find(".eae-markers"))})),elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(e){var a,t,i,n,r,d,s,o=[],l=[],c=e.children(".eae-section-bs").children(".eae-section-bs-inner");c&&c.data("eae-bg-slider")&&(slider_images=c.data("eae-bg-slider"),a=c.data("eae-bg-slider-transition"),t=c.data("eae-bg-slider-animation"),n=("yes"==(i=c.data("eae-bg-custom-overlay"))||c.data("eae-bg-slider-overlay"),eae_editor.plugin_url+"assets/lib/vegas/overlays/"+c.data("eae-bg-slider-overlay")),r=c.data("eae-bg-slider-cover"),d=c.data("eae-bs-slider-delay"),s=c.data("eae-bs-slider-timer"),"undefined"!=typeof slider_images&&(o=slider_images.split(","),jQuery.each(o,(function(e,a){var t=[];t.src=a,l.push(t)})),c.vegas({slides:l,transition:a,animation:t,overlay:n,cover:r,delay:d,timer:s,init:function(){"yes"==i&&c.children(".vegas-overlay").css("background-image","")}})))}))}));var isEditMode=!1,breakpoints=eae.breakpoints;!function(e){e(window).on("elementor/frontend/init",(function(){var a=function(e,a){function t(e){$icons=a(document).find(e).find(".eae-ic-icon-wrap"),window.innerWidth<767?$icons.each((function(e,t){a(t).css("top",a(t).height()/2+8+"px"),a(t).next(".eae-info-circle-item__content-wrap").css("padding-top",a(t).height()/2+8+"px")})):$icons.each((function(e,t){a(t).css("margin-left",-.5*a(t).outerWidth()),a(t).css("margin-top",-.5*a(t).outerHeight()),$a=function(e){return e=(e-90)*Math.PI/180,{x:50+45*Math.cos(e),y:50+45*Math.sin(e)}}($angle),$b=360/$icons.length,a(t).css("left",$a.x+"%"),a(t).css("top",$a.y+"%"),$angle+=$b}))}$wrap_class=".elementor-element-"+e.data("id"),$angle=0,t(e);var i=null;function n(){"yes"==e.find(".eae-info-circle").data("autoplay")&&(i=setInterval(r,$autoplayDuration))}function r(){e.find(".eae-active").next().length>0?e.find(".eae-active").next().addClass("eae-active").siblings().removeClass("eae-active"):e.find(".eae-info-circle-item").eq(0).addClass("eae-active").siblings().removeClass("eae-active")}$autoplayDuration=e.find(".eae-info-circle").data("delay"),n(),e.find(".eae-ic-icon-wrap").hover((function(){clearInterval(i)}),(function(){n()})),e.find(".eae-info-circle-item").length>0&&a(e.find(".eae-info-circle-item")[0]).addClass("eae-active"),e.find(".eae-ic-icon-wrap").on("click",(function(){e.find(".eae-info-circle-item").removeClass("eae-active"),a(this).parent().addClass("eae-active")})),e.hasClass("eae-mouseenter-yes")&&e.find(".eae-ic-icon-wrap").on("mouseenter",(function(){e.find(".eae-info-circle-item").removeClass("eae-active"),a(this).parent().addClass("eae-active")})),window.addEventListener("resize",t.bind(this,$wrap_class))},t=function(e,a){function t(){var t=e.find(".eae-timline-progress-bar"),i=e.find(".eae-timeline-item"),n=e.find(".eae-timeline");const r=n.data("top-offset");var d=a(n).height(),s=a(i).last().find(".eae-tl-icon-wrapper").offset().top-a(i[0]).parent().offset().top,o=e.find(".eae-tl-icon-wrapper");a(t).css("top",a(i[0]).find(".eae-tl-icon-wrapper").offset().top-a(i[0]).parent().offset().top),a(t).css("bottom",d-s),a(t).css("left",o.eq(0)[0].offsetLeft+o.eq(0).width()/2),a(t).css("display","block"),i.each((function(e,t){new Waypoint({element:a(t),handler:function(e){"down"==e?a(t).addClass("eae-tl-item-focused"):a(t).removeClass("eae-tl-item-focused")},offset:r})}))}t(),window.addEventListener("resize",t),window.addEventListener("scroll",(function(){e.find(".eae-timline-progress-bar");const t=e.find(".eae-timeline").data("top-offset");e.find(".eae-pb-inner-line").css("height",a(window).scrollTop()-e.find(".eae-timeline").offset().top+t),e.find(".eae-pb-inner-line").css("max-height",e.find(".eae-pb-inner-line").parent().height())}))};function i(e,a,t){var i=new Date;i.setTime(i.getTime()+60*t*60*1e3);var n="expires="+i.toUTCString();document.cookie=e+"="+a+";"+n+";path=/"}function n(e){for(var a=e+"=",t=decodeURIComponent(document.cookie).split(";"),i=0;i<t.length;i++){for(var n=t[i];" "==n.charAt(0);)n=n.substring(1);if(0==n.indexOf(a))return n.substring(a.length,n.length)}return""}var r=function(e,a){$is_rtl=jQuery("body").hasClass("rtl"),$wrapper=e.find(".eae-progress-bar");$wrapper.attr("data-skill");var t=$wrapper.attr("data-value"),i=$wrapper.attr("data-skin"),n=$wrapper.find(".eae-pb-bar-skill"),r=$wrapper.find(".eae-pb-bar-value"),d=$wrapper.find(".eae-pb-bar"),s=$wrapper.find(".eae-pb-bar-inner");"skin1"===i&&a(s).attr("style","width : "+t+"%"),"skin2"===i&&a(s).attr("style","width : "+t+"%"),"skin3"===i&&(a(r).addClass("eae-pb-bar-value--aligned-value"),$is_rtl?a(r).attr("style","right :"+t+"%"):a(r).attr("style","left :"+t+"%"),a(s).attr("style","width :"+t+"%")),"skin4"===i&&(a(r).addClass("eae-pb-bar-value--aligned-value"),$is_rtl?a(r).attr("style","right :"+t+"%"):a(r).attr("style","left :"+t+"%"),a(s).attr("style","width :"+t+"%"),a(d).addClass("eae-pb-bar--no-overflow")),"skin5"===i&&(a(r).addClass("eae-pb-bar-value--aligned-value"),$is_rtl?a(r).attr("style","right :"+t+"%"):a(r).attr("style","left :"+t+"%"),a(s).attr("style","width :"+t+"%")),$wrapper.each((function(e,t){new Waypoint({element:t,skill_value:a(t).find(".eae-pb-bar-skill"),valueElem:a(t).find(".eae-pb-bar-value"),prgBar:a(t).find(".eae-pb-bar-bar"),prgInner:a(t).find(".eae-pb-bar-inner"),handler:function(e){"down"==e&&(a(r).hasClass("js-animated")||a(r).addClass("js-animated"),a(s).hasClass("js-animated")||a(s).addClass("js-animated"),a(n).hasClass("js-animated")||a(n).addClass("js-animated"))},offset:"bottom-in-view"})}))},d=function(e,a){var t=e.find(".eae-content-switcher-wrapper"),i=(e.data("id"),t.find(".eae-content-switch-button"));i.each((function(e,n){a(this).on("click",(function(e){e.preventDefault();let n=a(this).find(".eae-content-switch-label");if(!a(this).hasClass("active")){a(i).removeClass("active");let e=a(n).attr("id");a(this).addClass("active");var r=a(t).find(".eae-cs-content-section");a(r).removeClass("active");let d=a(t).find(".eae-content-section-"+e);a(d).addClass("active")}}))}))},s=function(e,a){let t=e.find(".eae-content-switcher-wrapper"),i=(e.data("id"),t.find(".eae-cs-switch-label")),n=t.find(".eae-content-switch-label.primary-label");const r=a(n).attr("item_id");let d=t.find(".eae-content-switch-label.secondary-label");const s=a(d).attr("item_id");let o=t.find(".eae-cs-content-section.eae-content-section-"+r),l=t.find(".eae-cs-content-section.eae-content-section-"+s);a(i).on("click",(function(e){a(this).find("input.eae-content-toggle-switch").is(":checked")?(d.addClass("active"),l.addClass("active"),n.removeClass("active"),o.removeClass("active")):(n.addClass("active"),o.addClass("active"),d.removeClass("active"),l.removeClass("active"))}))};e.fn.EAEHoverDirection=function(a){var t=e.extend({inaccuracy:30,speed:200},a);this.find(".overlay").css({top:-9999999}),this.mouseenter((function(a){container=e(this),overlay=container.find(".overlay"),parentOffset=container.offset(),relX=a.pageX-parentOffset.left,relY=a.pageY-parentOffset.top,overlay.css({top:0,left:0,width:container.width(),height:container.height()}),relX>container.width()-t.inaccuracy?overlay.css({top:0,left:container.width()}):relX<t.inaccuracy?overlay.css({top:0,left:-container.width()}):relY>container.height()-t.inaccuracy?overlay.css({top:container.width(),left:0}):relY<t.inaccuracy&&overlay.css({top:-container.width(),left:0}),overlay.animate({top:0,left:0},t.speed)})),this.mouseleave((function(a){container=e(this),overlay=container.find(".overlay"),parentOffset=container.offset(),relX=a.pageX-parentOffset.left,relY=a.pageY-parentOffset.top,relX<=0&&overlay.animate({top:0,left:-container.width()},t.speed),relX>=container.width()&&overlay.animate({top:0,left:container.width()},t.speed),relY<=0&&overlay.animate({left:0,top:-container.height()},t.speed),relY>=container.height()&&overlay.animate({left:0,top:container.height()},t.speed)}))};let o=function(e,a){const t=e.find(".eae-chart-outer-container"),i=(e.data("id"),e.find("#eae-chart-canvas"));let n=t.data("settings");new Chart(i,n)};elementorFrontend.hooks.addAction("frontend/element_ready/wts-ab-image.default",(function(e,a){e.find(".eae-img-comp-container").imagesLoaded().done((function(){ab_style=e.find(".eae-img-comp-container").data("ab-style"),slider_pos=e.find(".eae-img-comp-container").data("slider-pos"),"horizontal"===ab_style?(separator_width=parseInt(e.find(".eae-img-comp-overlay").css("border-right-width")),function(e){var a,t;a=e.find(".eae-img-comp-overlay"),t=(t=a.width())*slider_pos/100,function(a){var i,n,r,d=0;function s(e){e.preventDefault(),d=1,window.addEventListener("mousemove",l),i.addEventListener("touchmove",c)}function o(){d=0}function l(e){var t;if(0==d)return!1;(t=function(e){var t;return e=e||window.event,t=a.getBoundingClientRect(),e.pageX-t.left}(e))<0&&(t=0),t>n&&(t=n),f(t)}function c(e){var t;if(0==d)return!1;(t=function(e){var t;return t=a.getBoundingClientRect(),e.changedTouches[0].clientX-t.left}(e))<0&&(t=0),t>n&&(t=n),f(t)}function f(e){a.style.width=e+"px",i.style.left=a.offsetWidth-i.offsetWidth/2-separator_width/2+"px"}n=a.offsetWidth,r=a.offsetHeight,a.style.width=t+"px",(i=(i=e.find(".eae-img-comp-slider"))[0]).style.top=r/2-i.offsetHeight/2+"px",i.style.left=t-i.offsetWidth/2-separator_width/2+"px",e.hasClass("elementor-element-edit-mode")||(i.addEventListener("mousedown",s),window.addEventListener("mouseup",o),i.addEventListener("touchstart",s),window.addEventListener("touchstop",o))}(a[0])}(e)):(separator_width=parseInt(e.find(".eae-img-comp-overlay").css("border-bottom-width")),function(e){var a;a=e.find(".eae-img-comp-overlay"),start_pos=a.height(),start_pos=start_pos*slider_pos/100,function(a){var t,i,n,r=0;function d(e){e.preventDefault(),r=1,window.addEventListener("mousemove",o),t.addEventListener("touchmove",l)}function s(){r=0}function o(e){var t;if(0==r)return!1;(t=function(e){var t,i=0;return e=e||window.event,t=a.getBoundingClientRect(),i=e.pageY-t.top,i-=window.pageYOffset}(e))<0&&(t=0),t>n&&(t=n),c(t)}function l(e){var t;if(0==r)return!1;(t=function(e){var t;return t=a.getBoundingClientRect(),e.changedTouches[0].clientY-t.top}(e))<0&&(t=0),t>n&&(t=n),c(t)}function c(e){a.style.height=e+"px",t.style.top=a.offsetHeight-t.offsetHeight/2-separator_width/2+"px"}i=a.offsetWidth,n=a.offsetHeight,a.style.height=start_pos+"px",(t=(t=e.find(".eae-img-comp-slider"))[0]).style.top=start_pos-t.offsetHeight/2-separator_width/2+"px",t.style.left=i/2-t.offsetWidth/2+"px",e.hasClass("elementor-element-edit-mode")||(t.addEventListener("mousedown",d),window.addEventListener("mouseup",s),t.addEventListener("touchstart",d),window.addEventListener("touchstop",s))}(a[0])}(e))}))})),elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(e,a){e.hasClass("eae-particle-yes")&&(id=e.data("id"),element_type=e.data("element_type"),pdata=e.data("eae-particle"),pdata_wrapper=e.find(".eae-particle-wrapper").data("eae-pdata"),"undefined"!=typeof pdata&&""!=pdata?e.find(".eae-section-bs").length>0?(e.find(".eae-section-bs").after('<div class="eae-particle-wrapper" id="eae-particle-'+id+'"></div>'),particlesJS("eae-particle-"+id,pdata)):("column"==element_type?e.prepend('<div class="eae-particle-wrapper" id="eae-particle-'+id+'"></div>'):e.prepend('<div class="eae-particle-wrapper " id="eae-particle-'+id+'"></div>'),particlesJS("eae-particle-"+id,pdata)):"undefined"!=typeof pdata_wrapper&&""!=pdata_wrapper&&(element_type,e.prepend('<div class="eae-particle-wrapper eae-particle-area" id="eae-particle-'+id+'"></div>'),particlesJS("eae-particle-"+id,JSON.parse(pdata_wrapper))))})),elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(e,a){if(e.hasClass("eae-animated-gradient-yes")){id=e.data("id"),color=e.data("color"),angle=e.data("angle");var t="linear-gradient("+angle+","+color+")";heading=e.find(".elementor-heading-title"),e.css("background-image",t),e.hasClass("elementor-element-edit-mode")&&(color=e.find(".animated-gradient").data("color"),angle=e.find(".animated-gradient").data("angle"),gradient_color_editor="linear-gradient("+angle+","+color+")",e.prepend('<div class="animated-gradient" style="background-image : '+gradient_color_editor+' "></div>'))}})),elementorFrontend.hooks.addAction("frontend/element_ready/wts-modal-popup.default",(function(e,a){$preview_modal=e.find(".eae-popup-wrapper").data("preview-modal"),$close_btn_type=e.find(".eae-popup-wrapper").data("close-button-type"),$close_btn=e.find(".eae-popup-wrapper").data("close-btn"),"icon"==$close_btn_type?$close_btn_html='<i class="eae-close '+$close_btn+'"> </i>':$close_btn_html='<svg class="eae-close" style="-webkit-mask: url('+$close_btn+"); mask: url("+$close_btn+'); "></svg>',$magnific=e.find(".eae-popup-link").eaePopup({type:"inline",disableOn:0,key:null,midClick:!1,mainClass:"eae-popup eae-popup-"+e.find(".eae-popup-link").data("id")+" eae-wrap-"+e.find(".eae-popup-link").data("ctrl-id"),preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:e.find(".eae-popup-wrapper").data("close-in-out"),showCloseBtn:!0,enableEscapeKey:!1,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:$close_btn_html,tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}),"yes"==$preview_modal&&e.hasClass("elementor-element-edit-mode")&&e.find(".eae-popup-link").click()})),elementorFrontend.hooks.addAction("frontend/element_ready/wts-testimonial-slider.default",(function(e,a){if(e.find(".eae-grid-wrapper").hasClass("eae-masonry-yes")){var t=e.find(".eae-grid").masonry({});t.imagesLoaded().progress((function(){t.masonry("layout")}))}if(e.find(".eae-layout-carousel").length){outer_wrapper=e.find(".eae-swiper-outer-wrapper"),wid=e.data("id"),wclass=".elementor-element-"+wid;var i=outer_wrapper.data("direction"),n=outer_wrapper.data("speed"),r=outer_wrapper.data("autoplay"),d=outer_wrapper.data("duration"),s=outer_wrapper.data("effect"),o=outer_wrapper.data("space"),l=outer_wrapper.data("loop");l="yes"==l;var c=outer_wrapper.data("slides-per-view"),f=outer_wrapper.data("slides-per-group"),p=outer_wrapper.data("ptype"),m=outer_wrapper.data("navigation"),u=outer_wrapper.data("clickable"),g=outer_wrapper.data("keyboard"),v=outer_wrapper.data("scrollbar");adata={direction:i,effect:s,spaceBetween:o.desktop,loop:l,speed:n,slidesPerView:c.desktop,slidesPerGroup:f.desktop,observer:!0,mousewheel:{invert:!0},breakpoints:{1024:{spaceBetween:o.tablet,slidesPerView:c.tablet,slidesPerGroup:f.tablet},767:{spaceBetween:o.mobile,slidesPerView:c.mobile,slidesPerGroup:f.mobile}}},"fade"==s&&(adata.fadeEffect={crossFade:!1}),adata.autoplay="yes"==r&&{delay:d,disableOnInteraction:!1},"yes"==m&&(adata.navigation={nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}),""!=p&&(adata.pagination={el:".swiper-pagination",type:p}),"bullets"==p&&"yes"==u&&(adata.pagination={el:".swiper-pagination",clickable:!0,type:p}),"yes"==v&&(adata.scrollbar={el:".swiper-scrollbar",draggable:!0}),"yes"==g&&(adata.keyboard={enabled:!0,onlyInViewport:!0}),0==l&&(adata.autoplay={delay:d,stopOnLastSlide:!0,disableOnInteraction:!1}),window.mswiper=new Swiper(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .swiper-container",adata),a(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .swiper-container").css("visibility","visible")}})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-info-circle.skin1",a),elementorFrontend.hooks.addAction("frontend/element_ready/eae-info-circle.skin2",a),elementorFrontend.hooks.addAction("frontend/element_ready/eae-info-circle.skin3",a),elementorFrontend.hooks.addAction("frontend/element_ready/eae-info-circle.skin4",a),elementorFrontend.hooks.addAction("frontend/element_ready/eae-timeline.skin1",t),elementorFrontend.hooks.addAction("frontend/element_ready/eae-timeline.skin2",t),elementorFrontend.hooks.addAction("frontend/element_ready/eae-timeline.skin3",t),elementorFrontend.hooks.addAction("frontend/element_ready/eae-timeline.skin4",t),elementorFrontend.hooks.addAction("frontend/element_ready/eae-evergreen-timer.skin1",(function(e,a){var t=e.find(".eae-evergreen-wrapper").data("egtime"),r=e.find(".eae-evergreen-wrapper").data("egt-expire"),d=e.find(".eae-evergreen-wrapper").data("element-type"),s="eae-"+e.find(".eae-evergreen-wrapper").data("id"),o="eae-temp-"+e.find(".eae-evergreen-wrapper").data("id"),l=e.find(".eae-evergreen-wrapper").data("actions"),c=e.find(".eae-evergreen-wrapper").data("unqid"),f=(new Date).getTime();if(!e.hasClass("elementor-element-edit-mode"))if("countdown"===d){u=new Date(t),t=u.getTime();var p="expires="+u.toUTCString();document.cookie=o+"="+u.getTime()+";"+p+";path=/"}else{var m=n(s),u="";if(""!==m){(u=new Date(parseInt(m))).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime();var g=new Date(parseInt(m));g.setTime(g.getTime()+60*r*60*1e3);var v="expires="+g.toUTCString();document.cookie=s+"="+m+";"+v+";path=/";var h=new Date(parseInt(m));h.setTime(h.getTime()+1e3*e.find(".eae-evergreen-wrapper").data("egtime"));p="expires="+h.toUTCString();t-f>0&&(document.cookie=o+"="+m+";"+p+";path=/")}else{temp_date=t,(u=new Date).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime(),i(s,(new Date).getTime(),r);var w=new Date;w.setTime(w.getTime()+1e3*temp_date);var y="expires="+w.toUTCString();document.cookie=o+"="+(new Date).getTime()+";"+y+";path=/"}}if(!e.hasClass("elementor-element-edit-mode")&&t-f<0)return l.length>0&&l.forEach((function(t){"redirect"===t&&($url=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==a.trim($url)&&(window.location.href=$url1)),"hide"===t&&(e.hasClass("elementor-element-edit-mode")||(e.find("#eaeclockdiv").css("display","none"),e.find(".egt-title").css("display","none"))),"message"===t&&e.find(".eae-egt-message").css("display","block"),"hide_parent"===t&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none")))})),days="00",hours="00",minutes="00",seconds="00",e.find("."+c).find("#eaedivDays").html(days),e.find("."+c).find("#eaedivHours").html(hours.slice(-2)),e.find("."+c).find("#eaedivMinutes").html(minutes.slice(-2)),void e.find("."+c).find("#eaedivSeconds").html(seconds.slice(-2));e.hasClass("elementor-element-edit-mode")&&("countdown"===d?(u=new Date(t),t=u.getTime()):((u=new Date).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime()));var k=setInterval((function(){var i=(new Date).getTime(),n=t-i,r=0,d=0,s=0,o=0;n>0?(r=Math.floor(n/864e5),d="0"+Math.floor(n%864e5/36e5),s="0"+Math.floor(n%36e5/6e4),o="0"+Math.floor(n%6e4/1e3)):(l.length>0&&(e.hasClass("elementor-element-edit-mode")||l.forEach((function(t){"redirect"===t&&($url1=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==a.trim($url1)&&(window.location.href=$url1)),"hide"===t&&(e.find("#eaeclockdiv").css("display","none"),e.find(".egt-title").css("display","none")),"message"===t&&e.find(".eae-egt-message").css("display","block"),"hide_parent"===t&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none")))}))),clearInterval(k),r="0",d="00",s="00",o="00"),r<10&&(r="0"+r),e.find("."+c).find("#eaedivDays").html(r),e.find("."+c).find("#eaedivHours").html(d.slice(-2)),e.find("."+c).find("#eaedivMinutes").html(s.slice(-2)),e.find("."+c).find("#eaedivSeconds").html(o.slice(-2))}),1e3)})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-evergreen-timer.skin2",(function(e,a){var t=e.find(".eae-evergreen-wrapper").data("egtime"),r=e.find(".eae-evergreen-wrapper").data("egt-expire"),d=e.find(".eae-evergreen-wrapper").data("element-type"),s="eae-"+e.find(".eae-evergreen-wrapper").data("id"),o="eae-temp-"+e.find(".eae-evergreen-wrapper").data("id"),l=e.find(".eae-evergreen-wrapper").data("actions"),c=e.find(".eae-evergreen-wrapper").data("unqid"),f=(new Date).getTime();if(!e.hasClass("elementor-element-edit-mode"))if("countdown"===d){u=new Date(t),t=u.getTime();var p="expires="+u.toUTCString();document.cookie=o+"="+u.getTime()+";"+p+";path=/"}else{var m=n(s),u="";if(""!==m){(u=new Date(parseInt(m))).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime();var g=new Date(parseInt(m));g.setTime(g.getTime()+60*r*60*1e3);var v="expires="+g.toUTCString();document.cookie=s+"="+m+";"+v+";path=/";var h=new Date(parseInt(m));h.setTime(h.getTime()+1e3*e.find(".eae-evergreen-wrapper").data("egtime"));p="expires="+h.toUTCString();t-f>0&&(document.cookie=o+"="+m+";"+p+";path=/")}else{temp_date=t,(u=new Date).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime(),i(s,(new Date).getTime(),r);var w=new Date;w.setTime(w.getTime()+1e3*temp_date);var y="expires="+w.toUTCString();document.cookie=o+"="+(new Date).getTime()+";"+y+";path=/"}}if(!e.hasClass("elementor-element-edit-mode")&&t-f<0)return void(l.length>0&&l.forEach((function(t){"redirect"===t&&($url=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==a.trim($url)&&(window.location.href=$url)),"hide"===t&&(e.find("."+c).find(".timer-container").css("display","none"),e.find("."+c).find(".egt-title").css("display","none")),"message"===t&&e.find("."+c).find(".eae-egt-message").css("display","block"),"hide_parent"===t&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none")))})));e.hasClass("elementor-element-edit-mode")&&("countdown"===d?(u=new Date(t),t=u.getTime()):((u=new Date).setSeconds(u.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),t=u.getTime()));var k=setInterval((function(){var i=(new Date).getTime(),n=t-i,r=Math.floor(n/864e5),d=Math.floor(n%864e5/36e5),s=Math.floor(n%36e5/6e4),o=Math.floor(n%6e4/1e3);if(e.find("."+c).find("#eaeulSec1").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulSec1").find(".flip-clock-before").removeClass("flip-clock-before"),e.find("."+c).find("#eaeulSec").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulSec").find(".flip-clock-before").removeClass("flip-clock-before"),n<0)return clearInterval(k),void(l.length>0&&l.forEach((function(t){"redirect"===t&&(e.hasClass("elementor-element-edit-mode")||($url1=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==a.trim($url1)&&(window.location.href=$url1))),"hide"===t&&(e.hasClass("elementor-element-edit-mode")||(e.find("."+c).find(".timer-container").css("display","none"),e.find("."+c).find(".egt-title").css("display","none"))),"message"===t&&(e.hasClass("elementor-element-edit-mode")||e.find("."+c).find(".eae-egt-message").css("display","block")),"hide_parent"===t&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none")))})));if(2===a.trim(o).length){var f="#eaeulSec1 li:eq( "+a.trim(o).charAt(1)+" )",p="#eaeulSec li:eq( "+a.trim(o).charAt(0)+" )";e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulSec1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulSec1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulSec li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulSec li:first-child").addClass("flip-clock-before"))}else{f="#eaeulSec1 li:eq( "+a.trim(o).charAt(0)+" )",p="#eaeulSec li:eq( 0 )";e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulSec1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulSec1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulSec li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulSec li:first-child").addClass("flip-clock-before"))}if(e.find("."+c).find("#eaeulMin1").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulMin1").find(".flip-clock-before").removeClass("flip-clock-before"),e.find("."+c).find("#eaeulMin").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulMin").find(".flip-clock-before").removeClass("flip-clock-before"),2==a.trim(s).length){f="#eaeulMin1 li:eq( "+a.trim(s).charAt(1)+" )",p="#eaeulMin li:eq( "+a.trim(s).charAt(0)+" )";e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulMin1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulMin1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulMin li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulMin li:first-child").addClass("flip-clock-before"))}else{f="#eaeulMin1 li:eq( "+a.trim(s).charAt(0)+" )",p="#eaeulMin li:eq( 0 )";e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulMin1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulMin1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulMin li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulMin li:first-child").addClass("flip-clock-before"))}if(e.find("."+c).find("#eaeulHour1").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulHour1").find(".flip-clock-before").removeClass("flip-clock-before"),e.find("."+c).find("#eaeulHour").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulHour").find(".flip-clock-before").removeClass("flip-clock-before"),2==a.trim(d).length){f="#eaeulHour1 li:eq( "+a.trim(d).charAt(1)+" )",p="#eaeulHour li:eq( "+a.trim(d).charAt(0)+" )";e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulHour1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulHour1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulHour li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulHour li:first-child").addClass("flip-clock-before"))}else{f="#eaeulHour1 li:eq( "+a.trim(d).charAt(0)+" )",p="#eaeulHour li:eq( 0 )";e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulHour1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulHour li:first-child").addClass("flip-clock-before")),e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulHour li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulHour li:first-child").addClass("flip-clock-before"))}if(e.find("."+c).find("#eaeulDay1").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulDay1").find(".flip-clock-before").removeClass("flip-clock-before"),e.find("."+c).find("#eaeulDay").find(".flip-clock-active").removeClass("flip-clock-active"),e.find("."+c).find("#eaeulDay").find(".flip-clock-before").removeClass("flip-clock-before"),2==a.trim(r).length){f="#eaeulDay1 li:eq( "+a.trim(r).charAt(1)+" )",p="#eaeulDay li:eq( "+a.trim(r).charAt(0)+" )";e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulDay1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulDay1 li:first-child").addClass("flip-clock-before")),e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulDay li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulDay li:first-child").addClass("flip-clock-before"))}else{f="#eaeulDay1 li:eq( "+a.trim(r).charAt(0)+" )",p="#eaeulDay li:eq( 0 )";e.find("."+c).find(f).next().length>0?(e.find("."+c).find(f).addClass("flip-clock-active"),e.find("."+c).find(f).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulDay1 li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulDay li:first-child").addClass("flip-clock-before")),e.find("."+c).find(p).next().length>0?(e.find("."+c).find(p).addClass("flip-clock-active"),e.find("."+c).find(p).next().addClass("flip-clock-before")):(e.find("."+c).find("#eaeulDay li:last-child").addClass("flip-clock-active"),e.find("."+c).find("#eaeulDay li:first-child").addClass("flip-clock-before"))}}),1e3)})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-evergreen-timer.skin3",(function(e,a){var t,r=e.find(".eae-evergreen-wrapper").data("egtime"),d=e.find(".eae-evergreen-wrapper").data("egt-expire"),s=e.find(".eae-evergreen-wrapper").data("element-type"),o="eae-"+e.find(".eae-evergreen-wrapper").data("id"),l="eae-temp-"+e.find(".eae-evergreen-wrapper").data("id"),c=e.find(".eae-evergreen-wrapper").data("actions"),f=e.find(".eae-evergreen-wrapper").data("days"),p=e.find(".eae-evergreen-wrapper").data("hours"),m=e.find(".eae-evergreen-wrapper").data("mins"),u=e.find(".eae-evergreen-wrapper").data("seconds"),g=e.find(".eae-evergreen-wrapper").data("unqid"),v=(new Date).getTime();if(!e.hasClass("elementor-element-edit-mode"))if("countdown"===s){y=new Date(r),r=y.getTime();var h="expires="+y.toUTCString();document.cookie=l+"="+y.getTime()+";"+h+";path=/"}else{var w=n(o),y="";if(""!==w){(y=new Date(parseInt(w))).setSeconds(y.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),r=y.getTime();var k=new Date(parseInt(w));k.setTime(k.getTime()+60*d*60*1e3);var b="expires="+k.toUTCString();document.cookie=o+"="+w+";"+b+";path=/";var C=new Date(parseInt(w));C.setTime(C.getTime()+1e3*e.find(".eae-evergreen-wrapper").data("egtime"));h="expires="+C.toUTCString();r-v>0&&(document.cookie=l+"="+w+";"+h+";path=/")}else{temp_date=r,(y=new Date).setSeconds(y.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),r=y.getTime(),i(o,(new Date).getTime(),d);var _=new Date;_.setTime(_.getTime()+1e3*temp_date);var x="expires="+_.toUTCString();document.cookie=l+"="+(new Date).getTime()+";"+x+";path=/"}}if(!e.hasClass("elementor-element-edit-mode")){var T=D(r);if(parseInt(T.all)<1){if(c.length>0&&(c.forEach((function(a){"redirect"===a&&(e.hasClass("elementor-element-edit-mode")||($url=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==$url&&(window.location.href=$url))),"hide_parent"===a&&(e.hasClass("elementor-element-edit-mode")||($p_secs=e.closest("section"),$p_secs.css("display","none"))),"hide"===a&&(e.find("#timer").css("display","none"),e.find(".egt-title").css("display","none"),e.find(".desc").css("display","none")),"message"===a&&e.find(".eae-egt-message").css("display","block")})),1===c.length&&(""===c[0]||"message"===c[0]))){var $=e.find("."+g).find("#timer")[0];"yes"===f&&($.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===p&&("yes"===f?a($).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):$.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===m&&("yes"===f||"yes"===p?a($).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):$.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===u&&("yes"===f||"yes"===p||"yes"===m?a($).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):$.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>")}return}}function D(e){var a=r-new Date;return{days:Math.floor(a/864e5),hours:"0"+Math.floor(a/36e5%24),minutes:"0"+Math.floor(a/6e4%60),seconds:"0"+Math.floor(a/1e3%60),all:a}}function S(e){e.classList.add("fade"),setTimeout((function(){e.classList.remove("fade")}),700)}e.hasClass("elementor-element-edit-mode")&&("countdown"===s?(y=new Date(r),r=y.getTime()):((y=new Date).setSeconds(y.getSeconds()+e.find(".eae-evergreen-wrapper").data("egtime")),r=y.getTime())),D(r).all>1&&(t=setInterval((function(){var i=e.find("."+g).find("#timer")[0],n=D(r);"yes"===f&&(n.days<10&&(n.days="0"+n.days),i.innerHTML="<span class='egt-time eae-time-wrapper'><div>"+n.days+"</div></span>"),"yes"===p&&("yes"===f?a(i).append("<span class='egt-time eae-time-wrapper'><div>"+n.hours.slice(-2)+"</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>"+n.hours.slice(-2)+"</div></span>"),"yes"===m&&("yes"===f||"yes"===p?a(i).append("<span class='egt-time eae-time-wrapper'><div>"+n.minutes.slice(-2)+"</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>"+n.minutes.slice(-2)+"</div></span>"),"yes"===u&&("yes"===f||"yes"===p||"yes"===m?a(i).append("<span class='egt-time eae-time-wrapper'><div>"+n.seconds.slice(-2)+"</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>"+n.seconds.slice(-2)+"</div></span>");var d=i.getElementsByTagName("span");"yes"===f&&59==n.hours&&59==n.minutes&&59==n.seconds&&S(d[0]),"yes"===p&&("yes"===f?59==n.minutes&&59==n.seconds&&S(d[1]):59==n.minutes&&59==n.seconds&&S(d[0])),"yes"===m&&("yes"===f?"yes"===p?59==n.seconds&&S(d[2]):59==n.seconds&&S(d[1]):"yes"===p?59==n.seconds&&S(d[1]):59==n.seconds&&S(d[0])),"yes"===u&&("yes"===f?"yes"===p?"yes"===m&&S(d[3]):S("yes"===m?d[2]:d[1]):"yes"===p?"yes"===m&&S(d[2]):S("yes"===m?d[1]:d[0])),n.all<=1&&(clearInterval(t),"yes"===f&&(i.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===p&&("yes"===f?a(i).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===m&&("yes"===f||"yes"===p?a(i).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),"yes"===u&&("yes"===f||"yes"===p||"yes"===m?a(i).append("<span class='egt-time eae-time-wrapper'><div>00</div></span>"):i.innerHTML="<span class='egt-time eae-time-wrapper'><div>00</div></span>"),e.hasClass("elementor-element-edit-mode")||c.length>0&&c.forEach((function(a){"redirect"===a&&($url1=e.find(".eae-evergreen-wrapper").data("redirected-url"),""!==$url1&&(window.location.href=$url1)),"hide"===a&&(e.find("#timer").css("display","none"),e.find(".egt-title").css("display","none"),e.find(".desc").css("display","none")),"message"===a&&e.find(".eae-egt-message").css("display","block"),"hide_parent"===a&&($p_secs=e.closest("section"),$p_secs.css("display","none"))})))}),1e3))})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-comparisontable.default",(function(e,a){a(e.find(".eae-ct-heading")[0]).addClass("active"),e.find("ul").on("click","li",(function(){var t=a(this).index()+2;e.find("tr").find("td:not(:eq(0))").hide(),e.find("td:nth-child("+t+")").css("display","table-cell"),e.find("tr").find("th:not(:eq(0))").hide(),e.find("li").removeClass("active"),a(this).addClass("active")}));var t=window.matchMedia("(min-width: 767px)");function i(a){a.matches?e.find(".sep").attr("colspan",5):e.find(".sep").attr("colspan",2)}t.addListener(i),i(t)})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin1",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin2",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin3",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin4",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-progress-bar.skin5",r),elementorFrontend.hooks.addAction("frontend/element_ready/eae-filterableGallery.default",(function(e,a){var t=e.find(".eae-fg-wrapper"),i=e.data("id"),n=t.attr("data-maxtilt"),r=t.attr("data-perspective"),d=t.attr("data-speed"),s=t.attr("data-tilt-axis"),o=t.attr("data-glare"),l=parseInt(t.attr("data-overlay-speed"));if(s="x"===s?"y":"y"===s?"x":"both","yes"===o)var c=t.attr("data-max-glare");o="yes"===o;var f=a(".elementor-element-"+i+" .eae-fg-image"),p=t.hasClass("masonry-yes")?"masonry":"fitRows";f.outerHeight();adata={percentPosition:!0,animationOptions:{duration:750,easing:"linear",queue:!1}},"fitRows"===p&&(adata.layoutMode="fitRows"),"masonry"===p&&(adata.masonry={columnWidth:".eae-gallery-item",horizontalOrder:!0}),e.hasClass("eae-show-all-yes")||(e.find(".eae-gallery-filter a").first().addClass("current"),adata.filter=e.find(".eae-gallery-filter a").first().attr("data-filter"));var m=f.isotope(adata);m.imagesLoaded().progress((function(){m.isotope("layout")})),e.find(".eae-tilt-yes")&&(atilt={maxTilt:n,perspective:r,easing:"linear",scale:1,speed:d,disableAxis:s,transition:!0,reset:!0,glare:o,maxGlare:c},e.find(".el-tilt").tilt(atilt)),a(".elementor-element-"+i+" .eae-gallery-filter a").on("click",(function(){e.find(".eae-gallery-filter .current").removeClass("current"),a(this).addClass("current");var t=a(this).attr("data-filter");adata.filter=t;var i=f.isotope(adata);return i.imagesLoaded().progress((function(){if(i.isotope("layout"),isEditMode)return!1;e.find(".eae-tilt-yes")&&(e.find(".el-tilt").tilt(atilt),e.find(".el-tilt").tilt.reset.call(e.find(".el-tilt")))})),!1})),t.hasClass("eae-hover-direction-effect")||e.find(".eae-gallery-item-inner").hover((function(){a(this).find(".eae-grid-overlay").addClass("animated")})),t.hasClass("eae-hover-direction-effect")&&(e.find(".eae-gallery-item-inner").hover((function(){a(this).find(".eae-grid-overlay").addClass("overlay")})),t.find(".eae-gallery-item-inner").EAEHoverDirection({speed:l}))})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-content-switcher.skin1",d),elementorFrontend.hooks.addAction("frontend/element_ready/eae-content-switcher.skin2",d),elementorFrontend.hooks.addAction("frontend/element_ready/eae-content-switcher.skin3",s),elementorFrontend.hooks.addAction("frontend/element_ready/eae-content-switcher.skin4",s),elementorFrontend.hooks.addAction("frontend/element_ready/global",(function(e,a){isEditMode||e.data("wts-url")&&"yes"==e.data("wts-link")&&e.on("click",(function(a){e.data("wts-url")&&"yes"==e.data("wts-new-window")?window.open(e.data("wts-url")):location.href=e.data("wts-url")}))})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-thumbgallery.default",(function(e,a){swiper_outer_wrapper=e.find(".eae-swiper-outer-wrapper"),wid=e.data("id"),wClass=".elementor-element-"+wid,thumb_outer_wrapper=e.find(".eae-gallery-thumbs");let t=swiper_outer_wrapper.data("swiper-settings"),i=swiper_outer_wrapper.data("slides-per-view"),n=swiper_outer_wrapper.data("space");const r=eae.breakpoints;let d={};d[r.lg-1]={slidesPerView:i.desktop,spaceBetween:n.desktop},d[r.md-1]={slidesPerView:i.tablet,spaceBetween:n.tablet};const s=eae.breakpoints;let o={};if(o[s.lg-1]={spaceBetween:t.spaceBetween.desktop},o[s.md-1]={spaceBetween:t.spaceBetween.tablet},sliderData={direction:"horizontal",effect:t.effect,keyboard:{enabled:t.keyboard},spaceBetween:t.spaceBetween.mobile,breakpoints:o,speed:t.speed,loop:"yes"===t.loop,thumbs:{swiper:{el:thumb_outer_wrapper,direction:"horizontal",spaceBetween:n.mobile,slidesPerView:i.mobile,navigation:{nextEl:wClass+" .eae-swiper-button-next",prevEl:wClass+" .eae-swiper-button-prev"},speed:t.speed,loop:"yes"===t.loop,freeMode:!0,watchSlidesVisibility:!0,watchSlidesProgress:!0,breakpoints:d,slideToClickedSlide:!0}}},void 0!==t.autoplay&&(sliderData.thumbs.swiper.autoplay={delay:t.autoplay.duration,disableOnInteraction:t.autoplay.disableOnInteraction,reverseDirection:t.autoplay.reverseDirection}),"yes"==t.navigation&&(sliderData.navigation={nextEl:wClass+" .eae-swiper-button-next",prevEl:wClass+" .eae-swiper-button-prev"}),""!==t.pagination&&(sliderData.pagination={type:t.pagination,el:wClass+" .swiper-pagination",clickable:t.clickable}),void 0!==t.autoplay&&(sliderData.autoplay={delay:t.autoplay.duration,disableOnInteraction:t.autoplay.disableOnInteraction,reverseDirection:t.autoplay.reverseDirection}),"undefined"==typeof Swiper){new(0,elementorFrontend.utils.swiper)(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .eae-swiper-container",sliderData).then(e=>{sswiper=e})}else window.sswiper=new Swiper(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .eae-swiper-container",sliderData),a(".elementor-element-"+wid+" .eae-swiper-outer-wrapper .eae-swiper-container").css("visibility","visible");if(void 0!==t.autoplay){"yes"==t.autoplay.pauseOnHover&&jQuery(wClass+" .eae-swiper-container").hover((function(){sswiper.autoplay.stop(),sswiper.thumbs.swiper.autoplay.stop()}),(function(){sswiper.autoplay.start(),sswiper.thumbs.swiper.autoplay.start()}))}})),elementorFrontend.hooks.addAction("frontend/element_ready/eae-chart.bar",o),elementorFrontend.hooks.addAction("frontend/element_ready/eae-chart.horizontalBar",o),elementorFrontend.hooks.addAction("frontend/element_ready/eae-chart.line",o),elementorFrontend.hooks.addAction("frontend/element_ready/eae-data-table.default",(function(e,a){const t=e.find(".eae-table"),i=e.find(".eae-table-container");lottie_class=e.find(".eae-lottie"),settings=t.data("settings"),lottie_class.each((function(){let e=a(this).data("lottie-settings"),t=lottie.loadAnimation({container:document.getElementById(e.id),path:e.url,renderer:"svg",loop:e.loop});1==e.reverse&&t.setDirection(-1)})),!0===settings.sort?(head_class=a(".eae-table thead tr:not(:last-child)").addClass("eae-sort__ignoreRow"),t.tablesorter({sortReset:!1,sortRestart:!0})):head_class=a(".eae-table thead tr:not(:last-child)").removeClass("eae-sort__ignoreRow"),settings.search&&i.find("#eae-searchable").keyup((function(){_this=this,t.find(".eae-table__body tr").each((function(){-1===a(this).text().toLowerCase().indexOf(a(_this).val().toLowerCase())?a(this).addClass("eae-table-search-hide"):a(this).removeClass("eae-table-search-hide")}))}))}))}))}(jQuery);
|
assets/lib/lottie/lottie.js
ADDED
@@ -0,0 +1,14561 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Version: 5.6.8
|
3 |
+
License: MIT
|
4 |
+
*/
|
5 |
+
(typeof navigator !== "undefined") && (function(root, factory) {
|
6 |
+
if (typeof define === "function" && define.amd) {
|
7 |
+
define(function() {
|
8 |
+
return factory(root);
|
9 |
+
});
|
10 |
+
} else if (typeof module === "object" && module.exports) {
|
11 |
+
module.exports = factory(root);
|
12 |
+
} else {
|
13 |
+
root.lottie = factory(root);
|
14 |
+
root.bodymovin = root.lottie;
|
15 |
+
}
|
16 |
+
}((window || {}), function(window) {
|
17 |
+
"use strict";
|
18 |
+
var svgNS = "http://www.w3.org/2000/svg";
|
19 |
+
|
20 |
+
var locationHref = '';
|
21 |
+
|
22 |
+
var initialDefaultFrame = -999999;
|
23 |
+
|
24 |
+
var subframeEnabled = true;
|
25 |
+
var expressionsPlugin;
|
26 |
+
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
27 |
+
var cachedColors = {};
|
28 |
+
var bm_rounder = Math.round;
|
29 |
+
var bm_rnd;
|
30 |
+
var bm_pow = Math.pow;
|
31 |
+
var bm_sqrt = Math.sqrt;
|
32 |
+
var bm_abs = Math.abs;
|
33 |
+
var bm_floor = Math.floor;
|
34 |
+
var bm_max = Math.max;
|
35 |
+
var bm_min = Math.min;
|
36 |
+
var blitter = 10;
|
37 |
+
|
38 |
+
var BMMath = {};
|
39 |
+
(function(){
|
40 |
+
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"];
|
41 |
+
var i, len = propertyNames.length;
|
42 |
+
for(i=0;i<len;i+=1){
|
43 |
+
BMMath[propertyNames[i]] = Math[propertyNames[i]];
|
44 |
+
}
|
45 |
+
}());
|
46 |
+
|
47 |
+
function ProjectInterface(){return {};}
|
48 |
+
|
49 |
+
BMMath.random = Math.random;
|
50 |
+
BMMath.abs = function(val){
|
51 |
+
var tOfVal = typeof val;
|
52 |
+
if(tOfVal === 'object' && val.length){
|
53 |
+
var absArr = createSizedArray(val.length);
|
54 |
+
var i, len = val.length;
|
55 |
+
for(i=0;i<len;i+=1){
|
56 |
+
absArr[i] = Math.abs(val[i]);
|
57 |
+
}
|
58 |
+
return absArr;
|
59 |
+
}
|
60 |
+
return Math.abs(val);
|
61 |
+
|
62 |
+
};
|
63 |
+
var defaultCurveSegments = 150;
|
64 |
+
var degToRads = Math.PI/180;
|
65 |
+
var roundCorner = 0.5519;
|
66 |
+
|
67 |
+
function roundValues(flag){
|
68 |
+
if(flag){
|
69 |
+
bm_rnd = Math.round;
|
70 |
+
}else{
|
71 |
+
bm_rnd = function(val){
|
72 |
+
return val;
|
73 |
+
};
|
74 |
+
}
|
75 |
+
}
|
76 |
+
roundValues(false);
|
77 |
+
|
78 |
+
function styleDiv(element){
|
79 |
+
element.style.position = 'absolute';
|
80 |
+
element.style.top = 0;
|
81 |
+
element.style.left = 0;
|
82 |
+
element.style.display = 'block';
|
83 |
+
element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
|
84 |
+
element.style.backfaceVisibility = element.style.webkitBackfaceVisibility = 'visible';
|
85 |
+
element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
|
86 |
+
}
|
87 |
+
|
88 |
+
function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
|
89 |
+
this.type = type;
|
90 |
+
this.currentTime = currentTime;
|
91 |
+
this.totalTime = totalTime;
|
92 |
+
this.direction = frameMultiplier < 0 ? -1 : 1;
|
93 |
+
}
|
94 |
+
|
95 |
+
function BMCompleteEvent(type, frameMultiplier){
|
96 |
+
this.type = type;
|
97 |
+
this.direction = frameMultiplier < 0 ? -1 : 1;
|
98 |
+
}
|
99 |
+
|
100 |
+
function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
|
101 |
+
this.type = type;
|
102 |
+
this.currentLoop = currentLoop;
|
103 |
+
this.totalLoops = totalLoops;
|
104 |
+
this.direction = frameMultiplier < 0 ? -1 : 1;
|
105 |
+
}
|
106 |
+
|
107 |
+
function BMSegmentStartEvent(type, firstFrame, totalFrames){
|
108 |
+
this.type = type;
|
109 |
+
this.firstFrame = firstFrame;
|
110 |
+
this.totalFrames = totalFrames;
|
111 |
+
}
|
112 |
+
|
113 |
+
function BMDestroyEvent(type, target){
|
114 |
+
this.type = type;
|
115 |
+
this.target = target;
|
116 |
+
}
|
117 |
+
|
118 |
+
function BMRenderFrameErrorEvent(nativeError, currentTime) {
|
119 |
+
this.type = 'renderFrameError';
|
120 |
+
this.nativeError = nativeError;
|
121 |
+
this.currentTime = currentTime;
|
122 |
+
}
|
123 |
+
|
124 |
+
function BMConfigErrorEvent(nativeError) {
|
125 |
+
this.type = 'configError';
|
126 |
+
this.nativeError = nativeError;
|
127 |
+
}
|
128 |
+
|
129 |
+
function BMAnimationConfigErrorEvent(type, nativeError) {
|
130 |
+
this.type = type;
|
131 |
+
this.nativeError = nativeError;
|
132 |
+
this.currentTime = currentTime;
|
133 |
+
}
|
134 |
+
|
135 |
+
var createElementID = (function(){
|
136 |
+
var _count = 0;
|
137 |
+
return function createID() {
|
138 |
+
return '__lottie_element_' + ++_count
|
139 |
+
}
|
140 |
+
}())
|
141 |
+
|
142 |
+
function HSVtoRGB(h, s, v) {
|
143 |
+
var r, g, b, i, f, p, q, t;
|
144 |
+
i = Math.floor(h * 6);
|
145 |
+
f = h * 6 - i;
|
146 |
+
p = v * (1 - s);
|
147 |
+
q = v * (1 - f * s);
|
148 |
+
t = v * (1 - (1 - f) * s);
|
149 |
+
switch (i % 6) {
|
150 |
+
case 0: r = v; g = t; b = p; break;
|
151 |
+
case 1: r = q; g = v; b = p; break;
|
152 |
+
case 2: r = p; g = v; b = t; break;
|
153 |
+
case 3: r = p; g = q; b = v; break;
|
154 |
+
case 4: r = t; g = p; b = v; break;
|
155 |
+
case 5: r = v; g = p; b = q; break;
|
156 |
+
}
|
157 |
+
return [ r,
|
158 |
+
g,
|
159 |
+
b ];
|
160 |
+
}
|
161 |
+
|
162 |
+
function RGBtoHSV(r, g, b) {
|
163 |
+
var max = Math.max(r, g, b), min = Math.min(r, g, b),
|
164 |
+
d = max - min,
|
165 |
+
h,
|
166 |
+
s = (max === 0 ? 0 : d / max),
|
167 |
+
v = max / 255;
|
168 |
+
|
169 |
+
switch (max) {
|
170 |
+
case min: h = 0; break;
|
171 |
+
case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
|
172 |
+
case g: h = (b - r) + d * 2; h /= 6 * d; break;
|
173 |
+
case b: h = (r - g) + d * 4; h /= 6 * d; break;
|
174 |
+
}
|
175 |
+
|
176 |
+
return [
|
177 |
+
h,
|
178 |
+
s,
|
179 |
+
v
|
180 |
+
];
|
181 |
+
}
|
182 |
+
|
183 |
+
function addSaturationToRGB(color,offset){
|
184 |
+
var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
|
185 |
+
hsv[1] += offset;
|
186 |
+
if (hsv[1] > 1) {
|
187 |
+
hsv[1] = 1;
|
188 |
+
}
|
189 |
+
else if (hsv[1] <= 0) {
|
190 |
+
hsv[1] = 0;
|
191 |
+
}
|
192 |
+
return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
|
193 |
+
}
|
194 |
+
|
195 |
+
function addBrightnessToRGB(color,offset){
|
196 |
+
var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
|
197 |
+
hsv[2] += offset;
|
198 |
+
if (hsv[2] > 1) {
|
199 |
+
hsv[2] = 1;
|
200 |
+
}
|
201 |
+
else if (hsv[2] < 0) {
|
202 |
+
hsv[2] = 0;
|
203 |
+
}
|
204 |
+
return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
|
205 |
+
}
|
206 |
+
|
207 |
+
function addHueToRGB(color,offset) {
|
208 |
+
var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
|
209 |
+
hsv[0] += offset/360;
|
210 |
+
if (hsv[0] > 1) {
|
211 |
+
hsv[0] -= 1;
|
212 |
+
}
|
213 |
+
else if (hsv[0] < 0) {
|
214 |
+
hsv[0] += 1;
|
215 |
+
}
|
216 |
+
return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
|
217 |
+
}
|
218 |
+
|
219 |
+
var rgbToHex = (function(){
|
220 |
+
var colorMap = [];
|
221 |
+
var i;
|
222 |
+
var hex;
|
223 |
+
for(i=0;i<256;i+=1){
|
224 |
+
hex = i.toString(16);
|
225 |
+
colorMap[i] = hex.length == 1 ? '0' + hex : hex;
|
226 |
+
}
|
227 |
+
|
228 |
+
return function(r, g, b) {
|
229 |
+
if(r<0){
|
230 |
+
r = 0;
|
231 |
+
}
|
232 |
+
if(g<0){
|
233 |
+
g = 0;
|
234 |
+
}
|
235 |
+
if(b<0){
|
236 |
+
b = 0;
|
237 |
+
}
|
238 |
+
return '#' + colorMap[r] + colorMap[g] + colorMap[b];
|
239 |
+
};
|
240 |
+
}());
|
241 |
+
function BaseEvent(){}
|
242 |
+
BaseEvent.prototype = {
|
243 |
+
triggerEvent: function (eventName, args) {
|
244 |
+
if (this._cbs[eventName]) {
|
245 |
+
var len = this._cbs[eventName].length;
|
246 |
+
for (var i = 0; i < len; i++){
|
247 |
+
this._cbs[eventName][i](args);
|
248 |
+
}
|
249 |
+
}
|
250 |
+
},
|
251 |
+
addEventListener: function (eventName, callback) {
|
252 |
+
if (!this._cbs[eventName]){
|
253 |
+
this._cbs[eventName] = [];
|
254 |
+
}
|
255 |
+
this._cbs[eventName].push(callback);
|
256 |
+
|
257 |
+
return function() {
|
258 |
+
this.removeEventListener(eventName, callback);
|
259 |
+
}.bind(this);
|
260 |
+
},
|
261 |
+
removeEventListener: function (eventName,callback){
|
262 |
+
if (!callback){
|
263 |
+
this._cbs[eventName] = null;
|
264 |
+
}else if(this._cbs[eventName]){
|
265 |
+
var i = 0, len = this._cbs[eventName].length;
|
266 |
+
while(i<len){
|
267 |
+
if(this._cbs[eventName][i] === callback){
|
268 |
+
this._cbs[eventName].splice(i,1);
|
269 |
+
i -=1;
|
270 |
+
len -= 1;
|
271 |
+
}
|
272 |
+
i += 1;
|
273 |
+
}
|
274 |
+
if(!this._cbs[eventName].length){
|
275 |
+
this._cbs[eventName] = null;
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
};
|
280 |
+
var createTypedArray = (function(){
|
281 |
+
function createRegularArray(type, len){
|
282 |
+
var i = 0, arr = [], value;
|
283 |
+
switch(type) {
|
284 |
+
case 'int16':
|
285 |
+
case 'uint8c':
|
286 |
+
value = 1;
|
287 |
+
break;
|
288 |
+
default:
|
289 |
+
value = 1.1;
|
290 |
+
break;
|
291 |
+
}
|
292 |
+
for(i = 0; i < len; i += 1) {
|
293 |
+
arr.push(value);
|
294 |
+
}
|
295 |
+
return arr;
|
296 |
+
}
|
297 |
+
function createTypedArray(type, len){
|
298 |
+
if(type === 'float32') {
|
299 |
+
return new Float32Array(len);
|
300 |
+
} else if(type === 'int16') {
|
301 |
+
return new Int16Array(len);
|
302 |
+
} else if(type === 'uint8c') {
|
303 |
+
return new Uint8ClampedArray(len);
|
304 |
+
}
|
305 |
+
}
|
306 |
+
if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
|
307 |
+
return createTypedArray;
|
308 |
+
} else {
|
309 |
+
return createRegularArray;
|
310 |
+
}
|
311 |
+
}());
|
312 |
+
|
313 |
+
function createSizedArray(len) {
|
314 |
+
return Array.apply(null,{length:len});
|
315 |
+
}
|
316 |
+
function createNS(type) {
|
317 |
+
//return {appendChild:function(){},setAttribute:function(){},style:{}}
|
318 |
+
return document.createElementNS(svgNS, type);
|
319 |
+
}
|
320 |
+
function createTag(type) {
|
321 |
+
//return {appendChild:function(){},setAttribute:function(){},style:{}}
|
322 |
+
return document.createElement(type);
|
323 |
+
}
|
324 |
+
function DynamicPropertyContainer(){};
|
325 |
+
DynamicPropertyContainer.prototype = {
|
326 |
+
addDynamicProperty: function(prop) {
|
327 |
+
if(this.dynamicProperties.indexOf(prop) === -1) {
|
328 |
+
this.dynamicProperties.push(prop);
|
329 |
+
this.container.addDynamicProperty(this);
|
330 |
+
this._isAnimated = true;
|
331 |
+
}
|
332 |
+
},
|
333 |
+
iterateDynamicProperties: function(){
|
334 |
+
this._mdf = false;
|
335 |
+
var i, len = this.dynamicProperties.length;
|
336 |
+
for(i=0;i<len;i+=1){
|
337 |
+
this.dynamicProperties[i].getValue();
|
338 |
+
if(this.dynamicProperties[i]._mdf) {
|
339 |
+
this._mdf = true;
|
340 |
+
}
|
341 |
+
}
|
342 |
+
},
|
343 |
+
initDynamicPropertyContainer: function(container){
|
344 |
+
this.container = container;
|
345 |
+
this.dynamicProperties = [];
|
346 |
+
this._mdf = false;
|
347 |
+
this._isAnimated = false;
|
348 |
+
}
|
349 |
+
}
|
350 |
+
var getBlendMode = (function() {
|
351 |
+
|
352 |
+
var blendModeEnums = {
|
353 |
+
0:'source-over',
|
354 |
+
1:'multiply',
|
355 |
+
2:'screen',
|
356 |
+
3:'overlay',
|
357 |
+
4:'darken',
|
358 |
+
5:'lighten',
|
359 |
+
6:'color-dodge',
|
360 |
+
7:'color-burn',
|
361 |
+
8:'hard-light',
|
362 |
+
9:'soft-light',
|
363 |
+
10:'difference',
|
364 |
+
11:'exclusion',
|
365 |
+
12:'hue',
|
366 |
+
13:'saturation',
|
367 |
+
14:'color',
|
368 |
+
15:'luminosity'
|
369 |
+
}
|
370 |
+
|
371 |
+
return function(mode) {
|
372 |
+
return blendModeEnums[mode] || '';
|
373 |
+
}
|
374 |
+
}())
|
375 |
+
/*!
|
376 |
+
Transformation Matrix v2.0
|
377 |
+
(c) Epistemex 2014-2015
|
378 |
+
www.epistemex.com
|
379 |
+
By Ken Fyrstenberg
|
380 |
+
Contributions by leeoniya.
|
381 |
+
License: MIT, header required.
|
382 |
+
*/
|
383 |
+
|
384 |
+
/**
|
385 |
+
* 2D transformation matrix object initialized with identity matrix.
|
386 |
+
*
|
387 |
+
* The matrix can synchronize a canvas context by supplying the context
|
388 |
+
* as an argument, or later apply current absolute transform to an
|
389 |
+
* existing context.
|
390 |
+
*
|
391 |
+
* All values are handled as floating point values.
|
392 |
+
*
|
393 |
+
* @param {CanvasRenderingContext2D} [context] - Optional context to sync with Matrix
|
394 |
+
* @prop {number} a - scale x
|
395 |
+
* @prop {number} b - shear y
|
396 |
+
* @prop {number} c - shear x
|
397 |
+
* @prop {number} d - scale y
|
398 |
+
* @prop {number} e - translate x
|
399 |
+
* @prop {number} f - translate y
|
400 |
+
* @prop {CanvasRenderingContext2D|null} [context=null] - set or get current canvas context
|
401 |
+
* @constructor
|
402 |
+
*/
|
403 |
+
|
404 |
+
var Matrix = (function(){
|
405 |
+
|
406 |
+
var _cos = Math.cos;
|
407 |
+
var _sin = Math.sin;
|
408 |
+
var _tan = Math.tan;
|
409 |
+
var _rnd = Math.round;
|
410 |
+
|
411 |
+
function reset(){
|
412 |
+
this.props[0] = 1;
|
413 |
+
this.props[1] = 0;
|
414 |
+
this.props[2] = 0;
|
415 |
+
this.props[3] = 0;
|
416 |
+
this.props[4] = 0;
|
417 |
+
this.props[5] = 1;
|
418 |
+
this.props[6] = 0;
|
419 |
+
this.props[7] = 0;
|
420 |
+
this.props[8] = 0;
|
421 |
+
this.props[9] = 0;
|
422 |
+
this.props[10] = 1;
|
423 |
+
this.props[11] = 0;
|
424 |
+
this.props[12] = 0;
|
425 |
+
this.props[13] = 0;
|
426 |
+
this.props[14] = 0;
|
427 |
+
this.props[15] = 1;
|
428 |
+
return this;
|
429 |
+
}
|
430 |
+
|
431 |
+
function rotate(angle) {
|
432 |
+
if(angle === 0){
|
433 |
+
return this;
|
434 |
+
}
|
435 |
+
var mCos = _cos(angle);
|
436 |
+
var mSin = _sin(angle);
|
437 |
+
return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
438 |
+
}
|
439 |
+
|
440 |
+
function rotateX(angle){
|
441 |
+
if(angle === 0){
|
442 |
+
return this;
|
443 |
+
}
|
444 |
+
var mCos = _cos(angle);
|
445 |
+
var mSin = _sin(angle);
|
446 |
+
return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
|
447 |
+
}
|
448 |
+
|
449 |
+
function rotateY(angle){
|
450 |
+
if(angle === 0){
|
451 |
+
return this;
|
452 |
+
}
|
453 |
+
var mCos = _cos(angle);
|
454 |
+
var mSin = _sin(angle);
|
455 |
+
return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
|
456 |
+
}
|
457 |
+
|
458 |
+
function rotateZ(angle){
|
459 |
+
if(angle === 0){
|
460 |
+
return this;
|
461 |
+
}
|
462 |
+
var mCos = _cos(angle);
|
463 |
+
var mSin = _sin(angle);
|
464 |
+
return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
465 |
+
}
|
466 |
+
|
467 |
+
function shear(sx,sy){
|
468 |
+
return this._t(1, sy, sx, 1, 0, 0);
|
469 |
+
}
|
470 |
+
|
471 |
+
function skew(ax, ay){
|
472 |
+
return this.shear(_tan(ax), _tan(ay));
|
473 |
+
}
|
474 |
+
|
475 |
+
function skewFromAxis(ax, angle){
|
476 |
+
var mCos = _cos(angle);
|
477 |
+
var mSin = _sin(angle);
|
478 |
+
return this._t(mCos, mSin, 0, 0, -mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
479 |
+
._t(1, 0, 0, 0, _tan(ax), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
480 |
+
._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
481 |
+
//return this._t(mCos, mSin, -mSin, mCos, 0, 0)._t(1, 0, _tan(ax), 1, 0, 0)._t(mCos, -mSin, mSin, mCos, 0, 0);
|
482 |
+
}
|
483 |
+
|
484 |
+
function scale(sx, sy, sz) {
|
485 |
+
if(!sz && sz !== 0) {
|
486 |
+
sz = 1;
|
487 |
+
}
|
488 |
+
if(sx === 1 && sy === 1 && sz === 1){
|
489 |
+
return this;
|
490 |
+
}
|
491 |
+
return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
|
492 |
+
}
|
493 |
+
|
494 |
+
function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
|
495 |
+
this.props[0] = a;
|
496 |
+
this.props[1] = b;
|
497 |
+
this.props[2] = c;
|
498 |
+
this.props[3] = d;
|
499 |
+
this.props[4] = e;
|
500 |
+
this.props[5] = f;
|
501 |
+
this.props[6] = g;
|
502 |
+
this.props[7] = h;
|
503 |
+
this.props[8] = i;
|
504 |
+
this.props[9] = j;
|
505 |
+
this.props[10] = k;
|
506 |
+
this.props[11] = l;
|
507 |
+
this.props[12] = m;
|
508 |
+
this.props[13] = n;
|
509 |
+
this.props[14] = o;
|
510 |
+
this.props[15] = p;
|
511 |
+
return this;
|
512 |
+
}
|
513 |
+
|
514 |
+
function translate(tx, ty, tz) {
|
515 |
+
tz = tz || 0;
|
516 |
+
if(tx !== 0 || ty !== 0 || tz !== 0){
|
517 |
+
return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
|
518 |
+
}
|
519 |
+
return this;
|
520 |
+
}
|
521 |
+
|
522 |
+
function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
|
523 |
+
|
524 |
+
var _p = this.props;
|
525 |
+
|
526 |
+
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){
|
527 |
+
//NOTE: commenting this condition because TurboFan deoptimizes code when present
|
528 |
+
//if(m2 !== 0 || n2 !== 0 || o2 !== 0){
|
529 |
+
_p[12] = _p[12] * a2 + _p[15] * m2;
|
530 |
+
_p[13] = _p[13] * f2 + _p[15] * n2;
|
531 |
+
_p[14] = _p[14] * k2 + _p[15] * o2;
|
532 |
+
_p[15] = _p[15] * p2;
|
533 |
+
//}
|
534 |
+
this._identityCalculated = false;
|
535 |
+
return this;
|
536 |
+
}
|
537 |
+
|
538 |
+
var a1 = _p[0];
|
539 |
+
var b1 = _p[1];
|
540 |
+
var c1 = _p[2];
|
541 |
+
var d1 = _p[3];
|
542 |
+
var e1 = _p[4];
|
543 |
+
var f1 = _p[5];
|
544 |
+
var g1 = _p[6];
|
545 |
+
var h1 = _p[7];
|
546 |
+
var i1 = _p[8];
|
547 |
+
var j1 = _p[9];
|
548 |
+
var k1 = _p[10];
|
549 |
+
var l1 = _p[11];
|
550 |
+
var m1 = _p[12];
|
551 |
+
var n1 = _p[13];
|
552 |
+
var o1 = _p[14];
|
553 |
+
var p1 = _p[15];
|
554 |
+
|
555 |
+
/* matrix order (canvas compatible):
|
556 |
+
* ace
|
557 |
+
* bdf
|
558 |
+
* 001
|
559 |
+
*/
|
560 |
+
_p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
|
561 |
+
_p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
|
562 |
+
_p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
|
563 |
+
_p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
|
564 |
+
|
565 |
+
_p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
|
566 |
+
_p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
|
567 |
+
_p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
|
568 |
+
_p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
|
569 |
+
|
570 |
+
_p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
|
571 |
+
_p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
|
572 |
+
_p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
|
573 |
+
_p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
|
574 |
+
|
575 |
+
_p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
|
576 |
+
_p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
|
577 |
+
_p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
|
578 |
+
_p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
|
579 |
+
|
580 |
+
this._identityCalculated = false;
|
581 |
+
return this;
|
582 |
+
}
|
583 |
+
|
584 |
+
function isIdentity() {
|
585 |
+
if(!this._identityCalculated){
|
586 |
+
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);
|
587 |
+
this._identityCalculated = true;
|
588 |
+
}
|
589 |
+
return this._identity;
|
590 |
+
}
|
591 |
+
|
592 |
+
function equals(matr){
|
593 |
+
var i = 0;
|
594 |
+
while (i < 16) {
|
595 |
+
if(matr.props[i] !== this.props[i]) {
|
596 |
+
return false;
|
597 |
+
}
|
598 |
+
i+=1;
|
599 |
+
}
|
600 |
+
return true;
|
601 |
+
}
|
602 |
+
|
603 |
+
function clone(matr){
|
604 |
+
var i;
|
605 |
+
for(i=0;i<16;i+=1){
|
606 |
+
matr.props[i] = this.props[i];
|
607 |
+
}
|
608 |
+
}
|
609 |
+
|
610 |
+
function cloneFromProps(props){
|
611 |
+
var i;
|
612 |
+
for(i=0;i<16;i+=1){
|
613 |
+
this.props[i] = props[i];
|
614 |
+
}
|
615 |
+
}
|
616 |
+
|
617 |
+
function applyToPoint(x, y, z) {
|
618 |
+
|
619 |
+
return {
|
620 |
+
x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
|
621 |
+
y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
|
622 |
+
z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
|
623 |
+
};
|
624 |
+
/*return {
|
625 |
+
x: x * me.a + y * me.c + me.e,
|
626 |
+
y: x * me.b + y * me.d + me.f
|
627 |
+
};*/
|
628 |
+
}
|
629 |
+
function applyToX(x, y, z) {
|
630 |
+
return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
|
631 |
+
}
|
632 |
+
function applyToY(x, y, z) {
|
633 |
+
return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
|
634 |
+
}
|
635 |
+
function applyToZ(x, y, z) {
|
636 |
+
return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
|
637 |
+
}
|
638 |
+
|
639 |
+
function getInverseMatrix() {
|
640 |
+
var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
|
641 |
+
var a = this.props[5]/determinant;
|
642 |
+
var b = - this.props[1]/determinant;
|
643 |
+
var c = - this.props[4]/determinant;
|
644 |
+
var d = this.props[0]/determinant;
|
645 |
+
var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
|
646 |
+
var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
|
647 |
+
var inverseMatrix = new Matrix();
|
648 |
+
inverseMatrix.props[0] = a;
|
649 |
+
inverseMatrix.props[1] = b;
|
650 |
+
inverseMatrix.props[4] = c;
|
651 |
+
inverseMatrix.props[5] = d;
|
652 |
+
inverseMatrix.props[12] = e;
|
653 |
+
inverseMatrix.props[13] = f;
|
654 |
+
return inverseMatrix;
|
655 |
+
}
|
656 |
+
|
657 |
+
function inversePoint(pt) {
|
658 |
+
var inverseMatrix = this.getInverseMatrix();
|
659 |
+
return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
|
660 |
+
}
|
661 |
+
|
662 |
+
function inversePoints(pts){
|
663 |
+
var i, len = pts.length, retPts = [];
|
664 |
+
for(i=0;i<len;i+=1){
|
665 |
+
retPts[i] = inversePoint(pts[i]);
|
666 |
+
}
|
667 |
+
return retPts;
|
668 |
+
}
|
669 |
+
|
670 |
+
function applyToTriplePoints(pt1, pt2, pt3) {
|
671 |
+
var arr = createTypedArray('float32', 6);
|
672 |
+
if(this.isIdentity()) {
|
673 |
+
arr[0] = pt1[0];
|
674 |
+
arr[1] = pt1[1];
|
675 |
+
arr[2] = pt2[0];
|
676 |
+
arr[3] = pt2[1];
|
677 |
+
arr[4] = pt3[0];
|
678 |
+
arr[5] = pt3[1];
|
679 |
+
} else {
|
680 |
+
var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
|
681 |
+
arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
|
682 |
+
arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
|
683 |
+
arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
|
684 |
+
arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
|
685 |
+
arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
|
686 |
+
arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
|
687 |
+
}
|
688 |
+
return arr;
|
689 |
+
}
|
690 |
+
|
691 |
+
function applyToPointArray(x,y,z){
|
692 |
+
var arr;
|
693 |
+
if(this.isIdentity()) {
|
694 |
+
arr = [x,y,z];
|
695 |
+
} else {
|
696 |
+
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]];
|
697 |
+
}
|
698 |
+
return arr;
|
699 |
+
}
|
700 |
+
|
701 |
+
function applyToPointStringified(x, y) {
|
702 |
+
if(this.isIdentity()) {
|
703 |
+
return x + ',' + y;
|
704 |
+
}
|
705 |
+
var _p = this.props;
|
706 |
+
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;
|
707 |
+
}
|
708 |
+
|
709 |
+
function toCSS() {
|
710 |
+
//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.
|
711 |
+
/*if(this.isIdentity()) {
|
712 |
+
return '';
|
713 |
+
}*/
|
714 |
+
var i = 0;
|
715 |
+
var props = this.props;
|
716 |
+
var cssValue = 'matrix3d(';
|
717 |
+
var v = 10000;
|
718 |
+
while(i<16){
|
719 |
+
cssValue += _rnd(props[i]*v)/v;
|
720 |
+
cssValue += i === 15 ? ')':',';
|
721 |
+
i += 1;
|
722 |
+
}
|
723 |
+
return cssValue;
|
724 |
+
}
|
725 |
+
|
726 |
+
function roundMatrixProperty(val) {
|
727 |
+
var v = 10000;
|
728 |
+
if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
|
729 |
+
return _rnd(val * v) / v;
|
730 |
+
}
|
731 |
+
return val;
|
732 |
+
}
|
733 |
+
|
734 |
+
function to2dCSS() {
|
735 |
+
//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.
|
736 |
+
/*if(this.isIdentity()) {
|
737 |
+
return '';
|
738 |
+
}*/
|
739 |
+
var props = this.props;
|
740 |
+
var _a = roundMatrixProperty(props[0]);
|
741 |
+
var _b = roundMatrixProperty(props[1]);
|
742 |
+
var _c = roundMatrixProperty(props[4]);
|
743 |
+
var _d = roundMatrixProperty(props[5]);
|
744 |
+
var _e = roundMatrixProperty(props[12]);
|
745 |
+
var _f = roundMatrixProperty(props[13]);
|
746 |
+
return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
|
747 |
+
}
|
748 |
+
|
749 |
+
return function(){
|
750 |
+
this.reset = reset;
|
751 |
+
this.rotate = rotate;
|
752 |
+
this.rotateX = rotateX;
|
753 |
+
this.rotateY = rotateY;
|
754 |
+
this.rotateZ = rotateZ;
|
755 |
+
this.skew = skew;
|
756 |
+
this.skewFromAxis = skewFromAxis;
|
757 |
+
this.shear = shear;
|
758 |
+
this.scale = scale;
|
759 |
+
this.setTransform = setTransform;
|
760 |
+
this.translate = translate;
|
761 |
+
this.transform = transform;
|
762 |
+
this.applyToPoint = applyToPoint;
|
763 |
+
this.applyToX = applyToX;
|
764 |
+
this.applyToY = applyToY;
|
765 |
+
this.applyToZ = applyToZ;
|
766 |
+
this.applyToPointArray = applyToPointArray;
|
767 |
+
this.applyToTriplePoints = applyToTriplePoints;
|
768 |
+
this.applyToPointStringified = applyToPointStringified;
|
769 |
+
this.toCSS = toCSS;
|
770 |
+
this.to2dCSS = to2dCSS;
|
771 |
+
this.clone = clone;
|
772 |
+
this.cloneFromProps = cloneFromProps;
|
773 |
+
this.equals = equals;
|
774 |
+
this.inversePoints = inversePoints;
|
775 |
+
this.inversePoint = inversePoint;
|
776 |
+
this.getInverseMatrix = getInverseMatrix;
|
777 |
+
this._t = this.transform;
|
778 |
+
this.isIdentity = isIdentity;
|
779 |
+
this._identity = true;
|
780 |
+
this._identityCalculated = false;
|
781 |
+
|
782 |
+
this.props = createTypedArray('float32', 16);
|
783 |
+
this.reset();
|
784 |
+
};
|
785 |
+
}());
|
786 |
+
|
787 |
+
/*
|
788 |
+
Copyright 2014 David Bau.
|
789 |
+
|
790 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
791 |
+
a copy of this software and associated documentation files (the
|
792 |
+
"Software"), to deal in the Software without restriction, including
|
793 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
794 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
795 |
+
permit persons to whom the Software is furnished to do so, subject to
|
796 |
+
the following conditions:
|
797 |
+
|
798 |
+
The above copyright notice and this permission notice shall be
|
799 |
+
included in all copies or substantial portions of the Software.
|
800 |
+
|
801 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
802 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
803 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
804 |
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
805 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
806 |
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
807 |
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
808 |
+
|
809 |
+
*/
|
810 |
+
|
811 |
+
(function (pool, math) {
|
812 |
+
//
|
813 |
+
// The following constants are related to IEEE 754 limits.
|
814 |
+
//
|
815 |
+
var global = this,
|
816 |
+
width = 256, // each RC4 output is 0 <= x < 256
|
817 |
+
chunks = 6, // at least six RC4 outputs for each double
|
818 |
+
digits = 52, // there are 52 significant digits in a double
|
819 |
+
rngname = 'random', // rngname: name for Math.random and Math.seedrandom
|
820 |
+
startdenom = math.pow(width, chunks),
|
821 |
+
significance = math.pow(2, digits),
|
822 |
+
overflow = significance * 2,
|
823 |
+
mask = width - 1,
|
824 |
+
nodecrypto; // node.js crypto module, initialized at the bottom.
|
825 |
+
|
826 |
+
//
|
827 |
+
// seedrandom()
|
828 |
+
// This is the seedrandom function described above.
|
829 |
+
//
|
830 |
+
function seedrandom(seed, options, callback) {
|
831 |
+
var key = [];
|
832 |
+
options = (options === true) ? { entropy: true } : (options || {});
|
833 |
+
|
834 |
+
// Flatten the seed string or build one from local entropy if needed.
|
835 |
+
var shortseed = mixkey(flatten(
|
836 |
+
options.entropy ? [seed, tostring(pool)] :
|
837 |
+
(seed === null) ? autoseed() : seed, 3), key);
|
838 |
+
|
839 |
+
// Use the seed to initialize an ARC4 generator.
|
840 |
+
var arc4 = new ARC4(key);
|
841 |
+
|
842 |
+
// This function returns a random double in [0, 1) that contains
|
843 |
+
// randomness in every bit of the mantissa of the IEEE 754 value.
|
844 |
+
var prng = function() {
|
845 |
+
var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48
|
846 |
+
d = startdenom, // and denominator d = 2 ^ 48.
|
847 |
+
x = 0; // and no 'extra last byte'.
|
848 |
+
while (n < significance) { // Fill up all significant digits by
|
849 |
+
n = (n + x) * width; // shifting numerator and
|
850 |
+
d *= width; // denominator and generating a
|
851 |
+
x = arc4.g(1); // new least-significant-byte.
|
852 |
+
}
|
853 |
+
while (n >= overflow) { // To avoid rounding up, before adding
|
854 |
+
n /= 2; // last byte, shift everything
|
855 |
+
d /= 2; // right using integer math until
|
856 |
+
x >>>= 1; // we have exactly the desired bits.
|
857 |
+
}
|
858 |
+
return (n + x) / d; // Form the number within [0, 1).
|
859 |
+
};
|
860 |
+
|
861 |
+
prng.int32 = function() { return arc4.g(4) | 0; };
|
862 |
+
prng.quick = function() { return arc4.g(4) / 0x100000000; };
|
863 |
+
prng.double = prng;
|
864 |
+
|
865 |
+
// Mix the randomness into accumulated entropy.
|
866 |
+
mixkey(tostring(arc4.S), pool);
|
867 |
+
|
868 |
+
// Calling convention: what to return as a function of prng, seed, is_math.
|
869 |
+
return (options.pass || callback ||
|
870 |
+
function(prng, seed, is_math_call, state) {
|
871 |
+
if (state) {
|
872 |
+
// Load the arc4 state from the given state if it has an S array.
|
873 |
+
if (state.S) { copy(state, arc4); }
|
874 |
+
// Only provide the .state method if requested via options.state.
|
875 |
+
prng.state = function() { return copy(arc4, {}); };
|
876 |
+
}
|
877 |
+
|
878 |
+
// If called as a method of Math (Math.seedrandom()), mutate
|
879 |
+
// Math.random because that is how seedrandom.js has worked since v1.0.
|
880 |
+
if (is_math_call) { math[rngname] = prng; return seed; }
|
881 |
+
|
882 |
+
// Otherwise, it is a newer calling convention, so return the
|
883 |
+
// prng directly.
|
884 |
+
else return prng;
|
885 |
+
})(
|
886 |
+
prng,
|
887 |
+
shortseed,
|
888 |
+
'global' in options ? options.global : (this == math),
|
889 |
+
options.state);
|
890 |
+
}
|
891 |
+
math['seed' + rngname] = seedrandom;
|
892 |
+
|
893 |
+
//
|
894 |
+
// ARC4
|
895 |
+
//
|
896 |
+
// An ARC4 implementation. The constructor takes a key in the form of
|
897 |
+
// an array of at most (width) integers that should be 0 <= x < (width).
|
898 |
+
//
|
899 |
+
// The g(count) method returns a pseudorandom integer that concatenates
|
900 |
+
// the next (count) outputs from ARC4. Its return value is a number x
|
901 |
+
// that is in the range 0 <= x < (width ^ count).
|
902 |
+
//
|
903 |
+
function ARC4(key) {
|
904 |
+
var t, keylen = key.length,
|
905 |
+
me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];
|
906 |
+
|
907 |
+
// The empty key [] is treated as [0].
|
908 |
+
if (!keylen) { key = [keylen++]; }
|
909 |
+
|
910 |
+
// Set up S using the standard key scheduling algorithm.
|
911 |
+
while (i < width) {
|
912 |
+
s[i] = i++;
|
913 |
+
}
|
914 |
+
for (i = 0; i < width; i++) {
|
915 |
+
s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];
|
916 |
+
s[j] = t;
|
917 |
+
}
|
918 |
+
|
919 |
+
// The "g" method returns the next (count) outputs as one number.
|
920 |
+
me.g = function(count) {
|
921 |
+
// Using instance members instead of closure state nearly doubles speed.
|
922 |
+
var t, r = 0,
|
923 |
+
i = me.i, j = me.j, s = me.S;
|
924 |
+
while (count--) {
|
925 |
+
t = s[i = mask & (i + 1)];
|
926 |
+
r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];
|
927 |
+
}
|
928 |
+
me.i = i; me.j = j;
|
929 |
+
return r;
|
930 |
+
// For robust unpredictability, the function call below automatically
|
931 |
+
// discards an initial batch of values. This is called RC4-drop[256].
|
932 |
+
// See http://google.com/search?q=rsa+fluhrer+response&btnI
|
933 |
+
};
|
934 |
+
}
|
935 |
+
|
936 |
+
//
|
937 |
+
// copy()
|
938 |
+
// Copies internal state of ARC4 to or from a plain object.
|
939 |
+
//
|
940 |
+
function copy(f, t) {
|
941 |
+
t.i = f.i;
|
942 |
+
t.j = f.j;
|
943 |
+
t.S = f.S.slice();
|
944 |
+
return t;
|
945 |
+
}
|
946 |
+
|
947 |
+
//
|
948 |
+
// flatten()
|
949 |
+
// Converts an object tree to nested arrays of strings.
|
950 |
+
//
|
951 |
+
function flatten(obj, depth) {
|
952 |
+
var result = [], typ = (typeof obj), prop;
|
953 |
+
if (depth && typ == 'object') {
|
954 |
+
for (prop in obj) {
|
955 |
+
try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}
|
956 |
+
}
|
957 |
+
}
|
958 |
+
return (result.length ? result : typ == 'string' ? obj : obj + '\0');
|
959 |
+
}
|
960 |
+
|
961 |
+
//
|
962 |
+
// mixkey()
|
963 |
+
// Mixes a string seed into a key that is an array of integers, and
|
964 |
+
// returns a shortened string seed that is equivalent to the result key.
|
965 |
+
//
|
966 |
+
function mixkey(seed, key) {
|
967 |
+
var stringseed = seed + '', smear, j = 0;
|
968 |
+
while (j < stringseed.length) {
|
969 |
+
key[mask & j] =
|
970 |
+
mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));
|
971 |
+
}
|
972 |
+
return tostring(key);
|
973 |
+
}
|
974 |
+
|
975 |
+
//
|
976 |
+
// autoseed()
|
977 |
+
// Returns an object for autoseeding, using window.crypto and Node crypto
|
978 |
+
// module if available.
|
979 |
+
//
|
980 |
+
function autoseed() {
|
981 |
+
try {
|
982 |
+
if (nodecrypto) { return tostring(nodecrypto.randomBytes(width)); }
|
983 |
+
var out = new Uint8Array(width);
|
984 |
+
(global.crypto || global.msCrypto).getRandomValues(out);
|
985 |
+
return tostring(out);
|
986 |
+
} catch (e) {
|
987 |
+
var browser = global.navigator,
|
988 |
+
plugins = browser && browser.plugins;
|
989 |
+
return [+new Date(), global, plugins, global.screen, tostring(pool)];
|
990 |
+
}
|
991 |
+
}
|
992 |
+
|
993 |
+
//
|
994 |
+
// tostring()
|
995 |
+
// Converts an array of charcodes to a string
|
996 |
+
//
|
997 |
+
function tostring(a) {
|
998 |
+
return String.fromCharCode.apply(0, a);
|
999 |
+
}
|
1000 |
+
|
1001 |
+
//
|
1002 |
+
// When seedrandom.js is loaded, we immediately mix a few bits
|
1003 |
+
// from the built-in RNG into the entropy pool. Because we do
|
1004 |
+
// not want to interfere with deterministic PRNG state later,
|
1005 |
+
// seedrandom will not call math.random on its own again after
|
1006 |
+
// initialization.
|
1007 |
+
//
|
1008 |
+
mixkey(math.random(), pool);
|
1009 |
+
|
1010 |
+
//
|
1011 |
+
// Nodejs and AMD support: export the implementation as a module using
|
1012 |
+
// either convention.
|
1013 |
+
//
|
1014 |
+
|
1015 |
+
// End anonymous scope, and pass initial values.
|
1016 |
+
})(
|
1017 |
+
[], // pool: entropy pool starts empty
|
1018 |
+
BMMath // math: package containing random, pow, and seedrandom
|
1019 |
+
);
|
1020 |
+
var BezierFactory = (function(){
|
1021 |
+
/**
|
1022 |
+
* BezierEasing - use bezier curve for transition easing function
|
1023 |
+
* by Gaëtan Renaudeau 2014 - 2015 – MIT License
|
1024 |
+
*
|
1025 |
+
* Credits: is based on Firefox's nsSMILKeySpline.cpp
|
1026 |
+
* Usage:
|
1027 |
+
* var spline = BezierEasing([ 0.25, 0.1, 0.25, 1.0 ])
|
1028 |
+
* spline.get(x) => returns the easing value | x must be in [0, 1] range
|
1029 |
+
*
|
1030 |
+
*/
|
1031 |
+
|
1032 |
+
var ob = {};
|
1033 |
+
ob.getBezierEasing = getBezierEasing;
|
1034 |
+
var beziers = {};
|
1035 |
+
|
1036 |
+
function getBezierEasing(a,b,c,d,nm){
|
1037 |
+
var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
|
1038 |
+
if(beziers[str]){
|
1039 |
+
return beziers[str];
|
1040 |
+
}
|
1041 |
+
var bezEasing = new BezierEasing([a,b,c,d]);
|
1042 |
+
beziers[str] = bezEasing;
|
1043 |
+
return bezEasing;
|
1044 |
+
}
|
1045 |
+
|
1046 |
+
// These values are established by empiricism with tests (tradeoff: performance VS precision)
|
1047 |
+
var NEWTON_ITERATIONS = 4;
|
1048 |
+
var NEWTON_MIN_SLOPE = 0.001;
|
1049 |
+
var SUBDIVISION_PRECISION = 0.0000001;
|
1050 |
+
var SUBDIVISION_MAX_ITERATIONS = 10;
|
1051 |
+
|
1052 |
+
var kSplineTableSize = 11;
|
1053 |
+
var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
1054 |
+
|
1055 |
+
var float32ArraySupported = typeof Float32Array === "function";
|
1056 |
+
|
1057 |
+
function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
|
1058 |
+
function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
|
1059 |
+
function C (aA1) { return 3.0 * aA1; }
|
1060 |
+
|
1061 |
+
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
1062 |
+
function calcBezier (aT, aA1, aA2) {
|
1063 |
+
return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
|
1067 |
+
function getSlope (aT, aA1, aA2) {
|
1068 |
+
return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
|
1069 |
+
}
|
1070 |
+
|
1071 |
+
function binarySubdivide (aX, aA, aB, mX1, mX2) {
|
1072 |
+
var currentX, currentT, i = 0;
|
1073 |
+
do {
|
1074 |
+
currentT = aA + (aB - aA) / 2.0;
|
1075 |
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
1076 |
+
if (currentX > 0.0) {
|
1077 |
+
aB = currentT;
|
1078 |
+
} else {
|
1079 |
+
aA = currentT;
|
1080 |
+
}
|
1081 |
+
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
1082 |
+
return currentT;
|
1083 |
+
}
|
1084 |
+
|
1085 |
+
function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
|
1086 |
+
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
|
1087 |
+
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
1088 |
+
if (currentSlope === 0.0) return aGuessT;
|
1089 |
+
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
1090 |
+
aGuessT -= currentX / currentSlope;
|
1091 |
+
}
|
1092 |
+
return aGuessT;
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
/**
|
1096 |
+
* points is an array of [ mX1, mY1, mX2, mY2 ]
|
1097 |
+
*/
|
1098 |
+
function BezierEasing (points) {
|
1099 |
+
this._p = points;
|
1100 |
+
this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
1101 |
+
this._precomputed = false;
|
1102 |
+
|
1103 |
+
this.get = this.get.bind(this);
|
1104 |
+
}
|
1105 |
+
|
1106 |
+
BezierEasing.prototype = {
|
1107 |
+
|
1108 |
+
get: function (x) {
|
1109 |
+
var mX1 = this._p[0],
|
1110 |
+
mY1 = this._p[1],
|
1111 |
+
mX2 = this._p[2],
|
1112 |
+
mY2 = this._p[3];
|
1113 |
+
if (!this._precomputed) this._precompute();
|
1114 |
+
if (mX1 === mY1 && mX2 === mY2) return x; // linear
|
1115 |
+
// Because JavaScript number are imprecise, we should guarantee the extremes are right.
|
1116 |
+
if (x === 0) return 0;
|
1117 |
+
if (x === 1) return 1;
|
1118 |
+
return calcBezier(this._getTForX(x), mY1, mY2);
|
1119 |
+
},
|
1120 |
+
|
1121 |
+
// Private part
|
1122 |
+
|
1123 |
+
_precompute: function () {
|
1124 |
+
var mX1 = this._p[0],
|
1125 |
+
mY1 = this._p[1],
|
1126 |
+
mX2 = this._p[2],
|
1127 |
+
mY2 = this._p[3];
|
1128 |
+
this._precomputed = true;
|
1129 |
+
if (mX1 !== mY1 || mX2 !== mY2)
|
1130 |
+
this._calcSampleValues();
|
1131 |
+
},
|
1132 |
+
|
1133 |
+
_calcSampleValues: function () {
|
1134 |
+
var mX1 = this._p[0],
|
1135 |
+
mX2 = this._p[2];
|
1136 |
+
for (var i = 0; i < kSplineTableSize; ++i) {
|
1137 |
+
this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
1138 |
+
}
|
1139 |
+
},
|
1140 |
+
|
1141 |
+
/**
|
1142 |
+
* getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
|
1143 |
+
*/
|
1144 |
+
_getTForX: function (aX) {
|
1145 |
+
var mX1 = this._p[0],
|
1146 |
+
mX2 = this._p[2],
|
1147 |
+
mSampleValues = this._mSampleValues;
|
1148 |
+
|
1149 |
+
var intervalStart = 0.0;
|
1150 |
+
var currentSample = 1;
|
1151 |
+
var lastSample = kSplineTableSize - 1;
|
1152 |
+
|
1153 |
+
for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
|
1154 |
+
intervalStart += kSampleStepSize;
|
1155 |
+
}
|
1156 |
+
--currentSample;
|
1157 |
+
|
1158 |
+
// Interpolate to provide an initial guess for t
|
1159 |
+
var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
|
1160 |
+
var guessForT = intervalStart + dist * kSampleStepSize;
|
1161 |
+
|
1162 |
+
var initialSlope = getSlope(guessForT, mX1, mX2);
|
1163 |
+
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
1164 |
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
1165 |
+
} else if (initialSlope === 0.0) {
|
1166 |
+
return guessForT;
|
1167 |
+
} else {
|
1168 |
+
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
1169 |
+
}
|
1170 |
+
}
|
1171 |
+
};
|
1172 |
+
|
1173 |
+
return ob;
|
1174 |
+
|
1175 |
+
}());
|
1176 |
+
(function () {
|
1177 |
+
var lastTime = 0;
|
1178 |
+
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
1179 |
+
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
1180 |
+
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
|
1181 |
+
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
|
1182 |
+
}
|
1183 |
+
if(!window.requestAnimationFrame)
|
1184 |
+
window.requestAnimationFrame = function (callback, element) {
|
1185 |
+
var currTime = new Date().getTime();
|
1186 |
+
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
1187 |
+
var id = setTimeout(function () {
|
1188 |
+
callback(currTime + timeToCall);
|
1189 |
+
},
|
1190 |
+
timeToCall);
|
1191 |
+
lastTime = currTime + timeToCall;
|
1192 |
+
return id;
|
1193 |
+
};
|
1194 |
+
if(!window.cancelAnimationFrame)
|
1195 |
+
window.cancelAnimationFrame = function (id) {
|
1196 |
+
clearTimeout(id);
|
1197 |
+
};
|
1198 |
+
}());
|
1199 |
+
|
1200 |
+
function extendPrototype(sources,destination){
|
1201 |
+
var i, len = sources.length, sourcePrototype;
|
1202 |
+
for (i = 0;i < len;i += 1) {
|
1203 |
+
sourcePrototype = sources[i].prototype;
|
1204 |
+
for (var attr in sourcePrototype) {
|
1205 |
+
if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
|
1206 |
+
}
|
1207 |
+
}
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
function getDescriptor(object, prop) {
|
1211 |
+
return Object.getOwnPropertyDescriptor(object, prop);
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
function createProxyFunction(prototype) {
|
1215 |
+
function ProxyFunction(){}
|
1216 |
+
ProxyFunction.prototype = prototype;
|
1217 |
+
return ProxyFunction;
|
1218 |
+
}
|
1219 |
+
function bezFunction(){
|
1220 |
+
|
1221 |
+
var easingFunctions = [];
|
1222 |
+
var math = Math;
|
1223 |
+
|
1224 |
+
function pointOnLine2D(x1,y1, x2,y2, x3,y3){
|
1225 |
+
var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
|
1226 |
+
return det1 > -0.001 && det1 < 0.001;
|
1227 |
+
}
|
1228 |
+
|
1229 |
+
function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
|
1230 |
+
if(z1 === 0 && z2 === 0 && z3 === 0) {
|
1231 |
+
return pointOnLine2D(x1,y1, x2,y2, x3,y3);
|
1232 |
+
}
|
1233 |
+
var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
|
1234 |
+
var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
|
1235 |
+
var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
|
1236 |
+
var diffDist;
|
1237 |
+
if(dist1 > dist2){
|
1238 |
+
if(dist1 > dist3){
|
1239 |
+
diffDist = dist1 - dist2 - dist3;
|
1240 |
+
} else {
|
1241 |
+
diffDist = dist3 - dist2 - dist1;
|
1242 |
+
}
|
1243 |
+
} else if(dist3 > dist2){
|
1244 |
+
diffDist = dist3 - dist2 - dist1;
|
1245 |
+
} else {
|
1246 |
+
diffDist = dist2 - dist1 - dist3;
|
1247 |
+
}
|
1248 |
+
return diffDist > -0.0001 && diffDist < 0.0001;
|
1249 |
+
}
|
1250 |
+
|
1251 |
+
var getBezierLength = (function(){
|
1252 |
+
|
1253 |
+
return function(pt1,pt2,pt3,pt4){
|
1254 |
+
var curveSegments = defaultCurveSegments;
|
1255 |
+
var k;
|
1256 |
+
var i, len;
|
1257 |
+
var ptCoord,perc,addedLength = 0;
|
1258 |
+
var ptDistance;
|
1259 |
+
var point = [],lastPoint = [];
|
1260 |
+
var lengthData = bezier_length_pool.newElement();
|
1261 |
+
len = pt3.length;
|
1262 |
+
for(k=0;k<curveSegments;k+=1){
|
1263 |
+
perc = k/(curveSegments-1);
|
1264 |
+
ptDistance = 0;
|
1265 |
+
for(i=0;i<len;i+=1){
|
1266 |
+
ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
|
1267 |
+
point[i] = ptCoord;
|
1268 |
+
if(lastPoint[i] !== null){
|
1269 |
+
ptDistance += bm_pow(point[i] - lastPoint[i],2);
|
1270 |
+
}
|
1271 |
+
lastPoint[i] = point[i];
|
1272 |
+
}
|
1273 |
+
if(ptDistance){
|
1274 |
+
ptDistance = bm_sqrt(ptDistance);
|
1275 |
+
addedLength += ptDistance;
|
1276 |
+
}
|
1277 |
+
lengthData.percents[k] = perc;
|
1278 |
+
lengthData.lengths[k] = addedLength;
|
1279 |
+
}
|
1280 |
+
lengthData.addedLength = addedLength;
|
1281 |
+
return lengthData;
|
1282 |
+
};
|
1283 |
+
}());
|
1284 |
+
|
1285 |
+
function getSegmentsLength(shapeData) {
|
1286 |
+
var segmentsLength = segments_length_pool.newElement();
|
1287 |
+
var closed = shapeData.c;
|
1288 |
+
var pathV = shapeData.v;
|
1289 |
+
var pathO = shapeData.o;
|
1290 |
+
var pathI = shapeData.i;
|
1291 |
+
var i, len = shapeData._length;
|
1292 |
+
var lengths = segmentsLength.lengths;
|
1293 |
+
var totalLength = 0;
|
1294 |
+
for(i=0;i<len-1;i+=1){
|
1295 |
+
lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
|
1296 |
+
totalLength += lengths[i].addedLength;
|
1297 |
+
}
|
1298 |
+
if(closed && len){
|
1299 |
+
lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
|
1300 |
+
totalLength += lengths[i].addedLength;
|
1301 |
+
}
|
1302 |
+
segmentsLength.totalLength = totalLength;
|
1303 |
+
return segmentsLength;
|
1304 |
+
}
|
1305 |
+
|
1306 |
+
function BezierData(length){
|
1307 |
+
this.segmentLength = 0;
|
1308 |
+
this.points = new Array(length);
|
1309 |
+
}
|
1310 |
+
|
1311 |
+
function PointData(partial,point){
|
1312 |
+
this.partialLength = partial;
|
1313 |
+
this.point = point;
|
1314 |
+
}
|
1315 |
+
|
1316 |
+
var buildBezierData = (function(){
|
1317 |
+
|
1318 |
+
var storedData = {};
|
1319 |
+
|
1320 |
+
return function (pt1, pt2, pt3, pt4){
|
1321 |
+
var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
|
1322 |
+
if(!storedData[bezierName]){
|
1323 |
+
var curveSegments = defaultCurveSegments;
|
1324 |
+
var k, i, len;
|
1325 |
+
var ptCoord,perc,addedLength = 0;
|
1326 |
+
var ptDistance;
|
1327 |
+
var point,lastPoint = null;
|
1328 |
+
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])){
|
1329 |
+
curveSegments = 2;
|
1330 |
+
}
|
1331 |
+
var bezierData = new BezierData(curveSegments);
|
1332 |
+
len = pt3.length;
|
1333 |
+
for (k = 0; k < curveSegments; k += 1) {
|
1334 |
+
point = createSizedArray(len);
|
1335 |
+
perc = k / (curveSegments - 1);
|
1336 |
+
ptDistance = 0;
|
1337 |
+
for (i = 0; i < len; i += 1){
|
1338 |
+
ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
|
1339 |
+
point[i] = ptCoord;
|
1340 |
+
if(lastPoint !== null){
|
1341 |
+
ptDistance += bm_pow(point[i] - lastPoint[i],2);
|
1342 |
+
}
|
1343 |
+
}
|
1344 |
+
ptDistance = bm_sqrt(ptDistance);
|
1345 |
+
addedLength += ptDistance;
|
1346 |
+
bezierData.points[k] = new PointData(ptDistance, point);
|
1347 |
+
lastPoint = point;
|
1348 |
+
}
|
1349 |
+
bezierData.segmentLength = addedLength;
|
1350 |
+
storedData[bezierName] = bezierData;
|
1351 |
+
}
|
1352 |
+
return storedData[bezierName];
|
1353 |
+
};
|
1354 |
+
}());
|
1355 |
+
|
1356 |
+
function getDistancePerc(perc,bezierData){
|
1357 |
+
var percents = bezierData.percents;
|
1358 |
+
var lengths = bezierData.lengths;
|
1359 |
+
var len = percents.length;
|
1360 |
+
var initPos = bm_floor((len-1)*perc);
|
1361 |
+
var lengthPos = perc*bezierData.addedLength;
|
1362 |
+
var lPerc = 0;
|
1363 |
+
if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
|
1364 |
+
return percents[initPos];
|
1365 |
+
}else{
|
1366 |
+
var dir = lengths[initPos] > lengthPos ? -1 : 1;
|
1367 |
+
var flag = true;
|
1368 |
+
while(flag){
|
1369 |
+
if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
|
1370 |
+
lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
|
1371 |
+
flag = false;
|
1372 |
+
}else{
|
1373 |
+
initPos += dir;
|
1374 |
+
}
|
1375 |
+
if(initPos < 0 || initPos >= len - 1){
|
1376 |
+
//FIX for TypedArrays that don't store floating point values with enough accuracy
|
1377 |
+
if(initPos === len - 1) {
|
1378 |
+
return percents[initPos];
|
1379 |
+
}
|
1380 |
+
flag = false;
|
1381 |
+
}
|
1382 |
+
}
|
1383 |
+
return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
|
1384 |
+
}
|
1385 |
+
}
|
1386 |
+
|
1387 |
+
function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
|
1388 |
+
var t1 = getDistancePerc(percent,bezierData);
|
1389 |
+
var u0 = 1;
|
1390 |
+
var u1 = 1 - t1;
|
1391 |
+
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;
|
1392 |
+
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;
|
1393 |
+
return [ptX, ptY];
|
1394 |
+
}
|
1395 |
+
|
1396 |
+
function getSegmentArray() {
|
1397 |
+
|
1398 |
+
}
|
1399 |
+
|
1400 |
+
var bezier_segment_points = createTypedArray('float32', 8);
|
1401 |
+
|
1402 |
+
function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
|
1403 |
+
|
1404 |
+
startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
|
1405 |
+
var t0 = getDistancePerc(startPerc,bezierData);
|
1406 |
+
endPerc = endPerc > 1 ? 1 : endPerc;
|
1407 |
+
var t1 = getDistancePerc(endPerc,bezierData);
|
1408 |
+
var i, len = pt1.length;
|
1409 |
+
var u0 = 1 - t0;
|
1410 |
+
var u1 = 1 - t1;
|
1411 |
+
var u0u0u0 = u0*u0*u0;
|
1412 |
+
var t0u0u0_3 = t0*u0*u0*3;
|
1413 |
+
var t0t0u0_3 = t0*t0*u0*3;
|
1414 |
+
var t0t0t0 = t0*t0*t0;
|
1415 |
+
//
|
1416 |
+
var u0u0u1 = u0*u0*u1;
|
1417 |
+
var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
|
1418 |
+
var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
|
1419 |
+
var t0t0t1 = t0*t0*t1;
|
1420 |
+
//
|
1421 |
+
var u0u1u1 = u0*u1*u1;
|
1422 |
+
var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
|
1423 |
+
var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
|
1424 |
+
var t0t1t1 = t0*t1*t1;
|
1425 |
+
//
|
1426 |
+
var u1u1u1 = u1*u1*u1;
|
1427 |
+
var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
|
1428 |
+
var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
|
1429 |
+
var t1t1t1 = t1*t1*t1;
|
1430 |
+
for(i=0;i<len;i+=1){
|
1431 |
+
bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
|
1432 |
+
bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
|
1433 |
+
bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
|
1434 |
+
bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
|
1435 |
+
}
|
1436 |
+
|
1437 |
+
return bezier_segment_points;
|
1438 |
+
}
|
1439 |
+
|
1440 |
+
return {
|
1441 |
+
getSegmentsLength : getSegmentsLength,
|
1442 |
+
getNewSegment : getNewSegment,
|
1443 |
+
getPointInSegment : getPointInSegment,
|
1444 |
+
buildBezierData : buildBezierData,
|
1445 |
+
pointOnLine2D : pointOnLine2D,
|
1446 |
+
pointOnLine3D : pointOnLine3D
|
1447 |
+
};
|
1448 |
+
}
|
1449 |
+
|
1450 |
+
var bez = bezFunction();
|
1451 |
+
function dataFunctionManager(){
|
1452 |
+
|
1453 |
+
//var tCanvasHelper = createTag('canvas').getContext('2d');
|
1454 |
+
|
1455 |
+
function completeLayers(layers, comps, fontManager){
|
1456 |
+
var layerData;
|
1457 |
+
var animArray, lastFrame;
|
1458 |
+
var i, len = layers.length;
|
1459 |
+
var j, jLen, k, kLen;
|
1460 |
+
for(i=0;i<len;i+=1){
|
1461 |
+
layerData = layers[i];
|
1462 |
+
if(!('ks' in layerData) || layerData.completed){
|
1463 |
+
continue;
|
1464 |
+
}
|
1465 |
+
layerData.completed = true;
|
1466 |
+
if(layerData.tt){
|
1467 |
+
layers[i-1].td = layerData.tt;
|
1468 |
+
}
|
1469 |
+
animArray = [];
|
1470 |
+
lastFrame = -1;
|
1471 |
+
if(layerData.hasMask){
|
1472 |
+
var maskProps = layerData.masksProperties;
|
1473 |
+
jLen = maskProps.length;
|
1474 |
+
for(j=0;j<jLen;j+=1){
|
1475 |
+
if(maskProps[j].pt.k.i){
|
1476 |
+
convertPathsToAbsoluteValues(maskProps[j].pt.k);
|
1477 |
+
}else{
|
1478 |
+
kLen = maskProps[j].pt.k.length;
|
1479 |
+
for(k=0;k<kLen;k+=1){
|
1480 |
+
if(maskProps[j].pt.k[k].s){
|
1481 |
+
convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
|
1482 |
+
}
|
1483 |
+
if(maskProps[j].pt.k[k].e){
|
1484 |
+
convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
|
1485 |
+
}
|
1486 |
+
}
|
1487 |
+
}
|
1488 |
+
}
|
1489 |
+
}
|
1490 |
+
if(layerData.ty===0){
|
1491 |
+
layerData.layers = findCompLayers(layerData.refId, comps);
|
1492 |
+
completeLayers(layerData.layers,comps, fontManager);
|
1493 |
+
}else if(layerData.ty === 4){
|
1494 |
+
completeShapes(layerData.shapes);
|
1495 |
+
}else if(layerData.ty == 5){
|
1496 |
+
completeText(layerData, fontManager);
|
1497 |
+
}
|
1498 |
+
}
|
1499 |
+
}
|
1500 |
+
|
1501 |
+
function findCompLayers(id,comps){
|
1502 |
+
var i = 0, len = comps.length;
|
1503 |
+
while(i<len){
|
1504 |
+
if(comps[i].id === id){
|
1505 |
+
if(!comps[i].layers.__used) {
|
1506 |
+
comps[i].layers.__used = true;
|
1507 |
+
return comps[i].layers;
|
1508 |
+
}
|
1509 |
+
return JSON.parse(JSON.stringify(comps[i].layers));
|
1510 |
+
}
|
1511 |
+
i += 1;
|
1512 |
+
}
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
function completeShapes(arr){
|
1516 |
+
var i, len = arr.length;
|
1517 |
+
var j, jLen;
|
1518 |
+
var hasPaths = false;
|
1519 |
+
for(i=len-1;i>=0;i-=1){
|
1520 |
+
if(arr[i].ty == 'sh'){
|
1521 |
+
if(arr[i].ks.k.i){
|
1522 |
+
convertPathsToAbsoluteValues(arr[i].ks.k);
|
1523 |
+
}else{
|
1524 |
+
jLen = arr[i].ks.k.length;
|
1525 |
+
for(j=0;j<jLen;j+=1){
|
1526 |
+
if(arr[i].ks.k[j].s){
|
1527 |
+
convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
|
1528 |
+
}
|
1529 |
+
if(arr[i].ks.k[j].e){
|
1530 |
+
convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
|
1531 |
+
}
|
1532 |
+
}
|
1533 |
+
}
|
1534 |
+
hasPaths = true;
|
1535 |
+
}else if(arr[i].ty == 'gr'){
|
1536 |
+
completeShapes(arr[i].it);
|
1537 |
+
}
|
1538 |
+
}
|
1539 |
+
/*if(hasPaths){
|
1540 |
+
//mx: distance
|
1541 |
+
//ss: sensitivity
|
1542 |
+
//dc: decay
|
1543 |
+
arr.splice(arr.length-1,0,{
|
1544 |
+
"ty": "ms",
|
1545 |
+
"mx":20,
|
1546 |
+
"ss":10,
|
1547 |
+
"dc":0.001,
|
1548 |
+
"maxDist":200
|
1549 |
+
});
|
1550 |
+
}*/
|
1551 |
+
}
|
1552 |
+
|
1553 |
+
function convertPathsToAbsoluteValues(path){
|
1554 |
+
var i, len = path.i.length;
|
1555 |
+
for(i=0;i<len;i+=1){
|
1556 |
+
path.i[i][0] += path.v[i][0];
|
1557 |
+
path.i[i][1] += path.v[i][1];
|
1558 |
+
path.o[i][0] += path.v[i][0];
|
1559 |
+
path.o[i][1] += path.v[i][1];
|
1560 |
+
}
|
1561 |
+
}
|
1562 |
+
|
1563 |
+
function checkVersion(minimum,animVersionString){
|
1564 |
+
var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
|
1565 |
+
if(minimum[0]>animVersion[0]){
|
1566 |
+
return true;
|
1567 |
+
} else if(animVersion[0] > minimum[0]){
|
1568 |
+
return false;
|
1569 |
+
}
|
1570 |
+
if(minimum[1]>animVersion[1]){
|
1571 |
+
return true;
|
1572 |
+
} else if(animVersion[1] > minimum[1]){
|
1573 |
+
return false;
|
1574 |
+
}
|
1575 |
+
if(minimum[2]>animVersion[2]){
|
1576 |
+
return true;
|
1577 |
+
} else if(animVersion[2] > minimum[2]){
|
1578 |
+
return false;
|
1579 |
+
}
|
1580 |
+
}
|
1581 |
+
|
1582 |
+
var checkText = (function(){
|
1583 |
+
var minimumVersion = [4,4,14];
|
1584 |
+
|
1585 |
+
function updateTextLayer(textLayer){
|
1586 |
+
var documentData = textLayer.t.d;
|
1587 |
+
textLayer.t.d = {
|
1588 |
+
k: [
|
1589 |
+
{
|
1590 |
+
s:documentData,
|
1591 |
+
t:0
|
1592 |
+
}
|
1593 |
+
]
|
1594 |
+
};
|
1595 |
+
}
|
1596 |
+
|
1597 |
+
function iterateLayers(layers){
|
1598 |
+
var i, len = layers.length;
|
1599 |
+
for(i=0;i<len;i+=1){
|
1600 |
+
if(layers[i].ty === 5){
|
1601 |
+
updateTextLayer(layers[i]);
|
1602 |
+
}
|
1603 |
+
}
|
1604 |
+
}
|
1605 |
+
|
1606 |
+
return function (animationData){
|
1607 |
+
if(checkVersion(minimumVersion,animationData.v)){
|
1608 |
+
iterateLayers(animationData.layers);
|
1609 |
+
if(animationData.assets){
|
1610 |
+
var i, len = animationData.assets.length;
|
1611 |
+
for(i=0;i<len;i+=1){
|
1612 |
+
if(animationData.assets[i].layers){
|
1613 |
+
iterateLayers(animationData.assets[i].layers);
|
1614 |
+
|
1615 |
+
}
|
1616 |
+
}
|
1617 |
+
}
|
1618 |
+
}
|
1619 |
+
};
|
1620 |
+
}());
|
1621 |
+
|
1622 |
+
var checkChars = (function() {
|
1623 |
+
var minimumVersion = [4,7,99];
|
1624 |
+
return function (animationData){
|
1625 |
+
if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
|
1626 |
+
var i, len = animationData.chars.length, j, jLen, k, kLen;
|
1627 |
+
var pathData, paths;
|
1628 |
+
for(i = 0; i < len; i += 1) {
|
1629 |
+
if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
|
1630 |
+
paths = animationData.chars[i].data.shapes[0].it;
|
1631 |
+
jLen = paths.length;
|
1632 |
+
|
1633 |
+
for(j = 0; j < jLen; j += 1) {
|
1634 |
+
pathData = paths[j].ks.k;
|
1635 |
+
if(!pathData.__converted) {
|
1636 |
+
convertPathsToAbsoluteValues(paths[j].ks.k);
|
1637 |
+
pathData.__converted = true;
|
1638 |
+
}
|
1639 |
+
}
|
1640 |
+
}
|
1641 |
+
}
|
1642 |
+
}
|
1643 |
+
};
|
1644 |
+
}());
|
1645 |
+
|
1646 |
+
var checkColors = (function(){
|
1647 |
+
var minimumVersion = [4,1,9];
|
1648 |
+
|
1649 |
+
function iterateShapes(shapes){
|
1650 |
+
var i, len = shapes.length;
|
1651 |
+
var j, jLen;
|
1652 |
+
for(i=0;i<len;i+=1){
|
1653 |
+
if(shapes[i].ty === 'gr'){
|
1654 |
+
iterateShapes(shapes[i].it);
|
1655 |
+
}else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
|
1656 |
+
if(shapes[i].c.k && shapes[i].c.k[0].i){
|
1657 |
+
jLen = shapes[i].c.k.length;
|
1658 |
+
for(j=0;j<jLen;j+=1){
|
1659 |
+
if(shapes[i].c.k[j].s){
|
1660 |
+
shapes[i].c.k[j].s[0] /= 255;
|
1661 |
+
shapes[i].c.k[j].s[1] /= 255;
|
1662 |
+
shapes[i].c.k[j].s[2] /= 255;
|
1663 |
+
shapes[i].c.k[j].s[3] /= 255;
|
1664 |
+
}
|
1665 |
+
if(shapes[i].c.k[j].e){
|
1666 |
+
shapes[i].c.k[j].e[0] /= 255;
|
1667 |
+
shapes[i].c.k[j].e[1] /= 255;
|
1668 |
+
shapes[i].c.k[j].e[2] /= 255;
|
1669 |
+
shapes[i].c.k[j].e[3] /= 255;
|
1670 |
+
}
|
1671 |
+
}
|
1672 |
+
} else {
|
1673 |
+
shapes[i].c.k[0] /= 255;
|
1674 |
+
shapes[i].c.k[1] /= 255;
|
1675 |
+
shapes[i].c.k[2] /= 255;
|
1676 |
+
shapes[i].c.k[3] /= 255;
|
1677 |
+
}
|
1678 |
+
}
|
1679 |
+
}
|
1680 |
+
}
|
1681 |
+
|
1682 |
+
function iterateLayers(layers){
|
1683 |
+
var i, len = layers.length;
|
1684 |
+
for(i=0;i<len;i+=1){
|
1685 |
+
if(layers[i].ty === 4){
|
1686 |
+
iterateShapes(layers[i].shapes);
|
1687 |
+
}
|
1688 |
+
}
|
1689 |
+
}
|
1690 |
+
|
1691 |
+
return function (animationData){
|
1692 |
+
if(checkVersion(minimumVersion,animationData.v)){
|
1693 |
+
iterateLayers(animationData.layers);
|
1694 |
+
if(animationData.assets){
|
1695 |
+
var i, len = animationData.assets.length;
|
1696 |
+
for(i=0;i<len;i+=1){
|
1697 |
+
if(animationData.assets[i].layers){
|
1698 |
+
iterateLayers(animationData.assets[i].layers);
|
1699 |
+
|
1700 |
+
}
|
1701 |
+
}
|
1702 |
+
}
|
1703 |
+
}
|
1704 |
+
};
|
1705 |
+
}());
|
1706 |
+
|
1707 |
+
var checkShapes = (function(){
|
1708 |
+
var minimumVersion = [4,4,18];
|
1709 |
+
|
1710 |
+
|
1711 |
+
|
1712 |
+
function completeShapes(arr){
|
1713 |
+
var i, len = arr.length;
|
1714 |
+
var j, jLen;
|
1715 |
+
var hasPaths = false;
|
1716 |
+
for(i=len-1;i>=0;i-=1){
|
1717 |
+
if(arr[i].ty == 'sh'){
|
1718 |
+
if(arr[i].ks.k.i){
|
1719 |
+
arr[i].ks.k.c = arr[i].closed;
|
1720 |
+
}else{
|
1721 |
+
jLen = arr[i].ks.k.length;
|
1722 |
+
for(j=0;j<jLen;j+=1){
|
1723 |
+
if(arr[i].ks.k[j].s){
|
1724 |
+
arr[i].ks.k[j].s[0].c = arr[i].closed;
|
1725 |
+
}
|
1726 |
+
if(arr[i].ks.k[j].e){
|
1727 |
+
arr[i].ks.k[j].e[0].c = arr[i].closed;
|
1728 |
+
}
|
1729 |
+
}
|
1730 |
+
}
|
1731 |
+
hasPaths = true;
|
1732 |
+
}else if(arr[i].ty == 'gr'){
|
1733 |
+
completeShapes(arr[i].it);
|
1734 |
+
}
|
1735 |
+
}
|
1736 |
+
}
|
1737 |
+
|
1738 |
+
function iterateLayers(layers){
|
1739 |
+
var layerData;
|
1740 |
+
var i, len = layers.length;
|
1741 |
+
var j, jLen, k, kLen;
|
1742 |
+
for(i=0;i<len;i+=1){
|
1743 |
+
layerData = layers[i];
|
1744 |
+
if(layerData.hasMask){
|
1745 |
+
var maskProps = layerData.masksProperties;
|
1746 |
+
jLen = maskProps.length;
|
1747 |
+
for(j=0;j<jLen;j+=1){
|
1748 |
+
if(maskProps[j].pt.k.i){
|
1749 |
+
maskProps[j].pt.k.c = maskProps[j].cl;
|
1750 |
+
}else{
|
1751 |
+
kLen = maskProps[j].pt.k.length;
|
1752 |
+
for(k=0;k<kLen;k+=1){
|
1753 |
+
if(maskProps[j].pt.k[k].s){
|
1754 |
+
maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
|
1755 |
+
}
|
1756 |
+
if(maskProps[j].pt.k[k].e){
|
1757 |
+
maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
|
1758 |
+
}
|
1759 |
+
}
|
1760 |
+
}
|
1761 |
+
}
|
1762 |
+
}
|
1763 |
+
if(layerData.ty === 4){
|
1764 |
+
completeShapes(layerData.shapes);
|
1765 |
+
}
|
1766 |
+
}
|
1767 |
+
}
|
1768 |
+
|
1769 |
+
return function (animationData){
|
1770 |
+
if(checkVersion(minimumVersion,animationData.v)){
|
1771 |
+
iterateLayers(animationData.layers);
|
1772 |
+
if(animationData.assets){
|
1773 |
+
var i, len = animationData.assets.length;
|
1774 |
+
for(i=0;i<len;i+=1){
|
1775 |
+
if(animationData.assets[i].layers){
|
1776 |
+
iterateLayers(animationData.assets[i].layers);
|
1777 |
+
|
1778 |
+
}
|
1779 |
+
}
|
1780 |
+
}
|
1781 |
+
}
|
1782 |
+
};
|
1783 |
+
}());
|
1784 |
+
|
1785 |
+
function completeData(animationData, fontManager){
|
1786 |
+
if(animationData.__complete){
|
1787 |
+
return;
|
1788 |
+
}
|
1789 |
+
checkColors(animationData);
|
1790 |
+
checkText(animationData);
|
1791 |
+
checkChars(animationData);
|
1792 |
+
checkShapes(animationData);
|
1793 |
+
completeLayers(animationData.layers, animationData.assets, fontManager);
|
1794 |
+
animationData.__complete = true;
|
1795 |
+
//blitAnimation(animationData, animationData.assets, fontManager);
|
1796 |
+
}
|
1797 |
+
|
1798 |
+
function completeText(data, fontManager){
|
1799 |
+
if(data.t.a.length === 0 && !('m' in data.t.p)){
|
1800 |
+
data.singleShape = true;
|
1801 |
+
}
|
1802 |
+
}
|
1803 |
+
|
1804 |
+
var moduleOb = {};
|
1805 |
+
moduleOb.completeData = completeData;
|
1806 |
+
moduleOb.checkColors = checkColors;
|
1807 |
+
moduleOb.checkChars = checkChars;
|
1808 |
+
moduleOb.checkShapes = checkShapes;
|
1809 |
+
moduleOb.completeLayers = completeLayers;
|
1810 |
+
|
1811 |
+
return moduleOb;
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
var dataManager = dataFunctionManager();
|
1815 |
+
|
1816 |
+
var FontManager = (function(){
|
1817 |
+
|
1818 |
+
var maxWaitingTime = 5000;
|
1819 |
+
var emptyChar = {
|
1820 |
+
w: 0,
|
1821 |
+
size:0,
|
1822 |
+
shapes:[]
|
1823 |
+
};
|
1824 |
+
var combinedCharacters = [];
|
1825 |
+
//Hindi characters
|
1826 |
+
combinedCharacters = combinedCharacters.concat([2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364, 2366
|
1827 |
+
, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379
|
1828 |
+
, 2380, 2381, 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403]);
|
1829 |
+
|
1830 |
+
function setUpNode(font, family){
|
1831 |
+
var parentNode = createTag('span');
|
1832 |
+
parentNode.style.fontFamily = family;
|
1833 |
+
var node = createTag('span');
|
1834 |
+
// Characters that vary significantly among different fonts
|
1835 |
+
node.innerHTML = 'giItT1WQy@!-/#';
|
1836 |
+
// Visible - so we can measure it - but not on the screen
|
1837 |
+
parentNode.style.position = 'absolute';
|
1838 |
+
parentNode.style.left = '-10000px';
|
1839 |
+
parentNode.style.top = '-10000px';
|
1840 |
+
// Large font size makes even subtle changes obvious
|
1841 |
+
parentNode.style.fontSize = '300px';
|
1842 |
+
// Reset any font properties
|
1843 |
+
parentNode.style.fontVariant = 'normal';
|
1844 |
+
parentNode.style.fontStyle = 'normal';
|
1845 |
+
parentNode.style.fontWeight = 'normal';
|
1846 |
+
parentNode.style.letterSpacing = '0';
|
1847 |
+
parentNode.appendChild(node);
|
1848 |
+
document.body.appendChild(parentNode);
|
1849 |
+
|
1850 |
+
// Remember width with no applied web font
|
1851 |
+
var width = node.offsetWidth;
|
1852 |
+
node.style.fontFamily = font + ', '+family;
|
1853 |
+
return {node:node, w:width, parent:parentNode};
|
1854 |
+
}
|
1855 |
+
|
1856 |
+
function checkLoadedFonts() {
|
1857 |
+
var i, len = this.fonts.length;
|
1858 |
+
var node, w;
|
1859 |
+
var loadedCount = len;
|
1860 |
+
for(i=0;i<len; i+= 1){
|
1861 |
+
if(this.fonts[i].loaded){
|
1862 |
+
loadedCount -= 1;
|
1863 |
+
continue;
|
1864 |
+
}
|
1865 |
+
if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
|
1866 |
+
this.fonts[i].loaded = true;
|
1867 |
+
} else{
|
1868 |
+
node = this.fonts[i].monoCase.node;
|
1869 |
+
w = this.fonts[i].monoCase.w;
|
1870 |
+
if(node.offsetWidth !== w){
|
1871 |
+
loadedCount -= 1;
|
1872 |
+
this.fonts[i].loaded = true;
|
1873 |
+
}else{
|
1874 |
+
node = this.fonts[i].sansCase.node;
|
1875 |
+
w = this.fonts[i].sansCase.w;
|
1876 |
+
if(node.offsetWidth !== w){
|
1877 |
+
loadedCount -= 1;
|
1878 |
+
this.fonts[i].loaded = true;
|
1879 |
+
}
|
1880 |
+
}
|
1881 |
+
if(this.fonts[i].loaded){
|
1882 |
+
this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
|
1883 |
+
this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
|
1884 |
+
}
|
1885 |
+
}
|
1886 |
+
}
|
1887 |
+
|
1888 |
+
if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
|
1889 |
+
setTimeout(this.checkLoadedFonts.bind(this),20);
|
1890 |
+
}else{
|
1891 |
+
setTimeout(function(){this.isLoaded = true;}.bind(this),0);
|
1892 |
+
|
1893 |
+
}
|
1894 |
+
}
|
1895 |
+
|
1896 |
+
function createHelper(def, fontData){
|
1897 |
+
var tHelper = createNS('text');
|
1898 |
+
tHelper.style.fontSize = '100px';
|
1899 |
+
//tHelper.style.fontFamily = fontData.fFamily;
|
1900 |
+
tHelper.setAttribute('font-family', fontData.fFamily);
|
1901 |
+
tHelper.setAttribute('font-style', fontData.fStyle);
|
1902 |
+
tHelper.setAttribute('font-weight', fontData.fWeight);
|
1903 |
+
tHelper.textContent = '1';
|
1904 |
+
if(fontData.fClass){
|
1905 |
+
tHelper.style.fontFamily = 'inherit';
|
1906 |
+
tHelper.setAttribute('class', fontData.fClass);
|
1907 |
+
} else {
|
1908 |
+
tHelper.style.fontFamily = fontData.fFamily;
|
1909 |
+
}
|
1910 |
+
def.appendChild(tHelper);
|
1911 |
+
var tCanvasHelper = createTag('canvas').getContext('2d');
|
1912 |
+
tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
|
1913 |
+
//tCanvasHelper.font = ' 100px '+ fontData.fFamily;
|
1914 |
+
return tHelper;
|
1915 |
+
}
|
1916 |
+
|
1917 |
+
function addFonts(fontData, defs){
|
1918 |
+
if(!fontData){
|
1919 |
+
this.isLoaded = true;
|
1920 |
+
return;
|
1921 |
+
}
|
1922 |
+
if(this.chars){
|
1923 |
+
this.isLoaded = true;
|
1924 |
+
this.fonts = fontData.list;
|
1925 |
+
return;
|
1926 |
+
}
|
1927 |
+
|
1928 |
+
|
1929 |
+
var fontArr = fontData.list;
|
1930 |
+
var i, len = fontArr.length;
|
1931 |
+
var _pendingFonts = len;
|
1932 |
+
for(i=0; i<len; i+= 1){
|
1933 |
+
var shouldLoadFont = true;
|
1934 |
+
var loadedSelector;
|
1935 |
+
var j;
|
1936 |
+
fontArr[i].loaded = false;
|
1937 |
+
fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
|
1938 |
+
fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
|
1939 |
+
if(!fontArr[i].fPath) {
|
1940 |
+
fontArr[i].loaded = true;
|
1941 |
+
_pendingFonts -= 1;
|
1942 |
+
}else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
|
1943 |
+
loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
|
1944 |
+
|
1945 |
+
if (loadedSelector.length > 0) {
|
1946 |
+
shouldLoadFont = false;
|
1947 |
+
}
|
1948 |
+
|
1949 |
+
if (shouldLoadFont) {
|
1950 |
+
var s = createTag('style');
|
1951 |
+
s.setAttribute('f-forigin', fontArr[i].fOrigin);
|
1952 |
+
s.setAttribute('f-origin', fontArr[i].origin);
|
1953 |
+
s.setAttribute('f-family', fontArr[i].fFamily);
|
1954 |
+
s.type = "text/css";
|
1955 |
+
s.innerHTML = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
|
1956 |
+
defs.appendChild(s);
|
1957 |
+
}
|
1958 |
+
} else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
|
1959 |
+
loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
|
1960 |
+
|
1961 |
+
for (j = 0; j < loadedSelector.length; j++) {
|
1962 |
+
if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
|
1963 |
+
// Font is already loaded
|
1964 |
+
shouldLoadFont = false;
|
1965 |
+
}
|
1966 |
+
}
|
1967 |
+
|
1968 |
+
if (shouldLoadFont) {
|
1969 |
+
var l = createTag('link');
|
1970 |
+
l.setAttribute('f-forigin', fontArr[i].fOrigin);
|
1971 |
+
l.setAttribute('f-origin', fontArr[i].origin);
|
1972 |
+
l.type = "text/css";
|
1973 |
+
l.rel = "stylesheet";
|
1974 |
+
l.href = fontArr[i].fPath;
|
1975 |
+
document.body.appendChild(l);
|
1976 |
+
}
|
1977 |
+
} else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
|
1978 |
+
loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
|
1979 |
+
|
1980 |
+
for (j = 0; j < loadedSelector.length; j++) {
|
1981 |
+
if (fontArr[i].fPath === loadedSelector[j].src) {
|
1982 |
+
// Font is already loaded
|
1983 |
+
shouldLoadFont = false;
|
1984 |
+
}
|
1985 |
+
}
|
1986 |
+
|
1987 |
+
if (shouldLoadFont) {
|
1988 |
+
var sc = createTag('link');
|
1989 |
+
sc.setAttribute('f-forigin', fontArr[i].fOrigin);
|
1990 |
+
sc.setAttribute('f-origin', fontArr[i].origin);
|
1991 |
+
sc.setAttribute('rel','stylesheet');
|
1992 |
+
sc.setAttribute('href',fontArr[i].fPath);
|
1993 |
+
defs.appendChild(sc);
|
1994 |
+
}
|
1995 |
+
}
|
1996 |
+
fontArr[i].helper = createHelper(defs,fontArr[i]);
|
1997 |
+
fontArr[i].cache = {};
|
1998 |
+
this.fonts.push(fontArr[i]);
|
1999 |
+
}
|
2000 |
+
if (_pendingFonts === 0) {
|
2001 |
+
this.isLoaded = true;
|
2002 |
+
} else {
|
2003 |
+
//On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
|
2004 |
+
//Adding this timeout seems to fix it
|
2005 |
+
setTimeout(this.checkLoadedFonts.bind(this), 100);
|
2006 |
+
}
|
2007 |
+
}
|
2008 |
+
|
2009 |
+
function addChars(chars){
|
2010 |
+
if(!chars){
|
2011 |
+
return;
|
2012 |
+
}
|
2013 |
+
if(!this.chars){
|
2014 |
+
this.chars = [];
|
2015 |
+
}
|
2016 |
+
var i, len = chars.length;
|
2017 |
+
var j, jLen = this.chars.length, found;
|
2018 |
+
for(i=0;i<len;i+=1){
|
2019 |
+
j = 0;
|
2020 |
+
found = false;
|
2021 |
+
while(j<jLen){
|
2022 |
+
if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
|
2023 |
+
found = true;
|
2024 |
+
}
|
2025 |
+
j += 1;
|
2026 |
+
}
|
2027 |
+
if(!found){
|
2028 |
+
this.chars.push(chars[i]);
|
2029 |
+
jLen += 1;
|
2030 |
+
}
|
2031 |
+
}
|
2032 |
+
}
|
2033 |
+
|
2034 |
+
function getCharData(char, style, font){
|
2035 |
+
var i = 0, len = this.chars.length;
|
2036 |
+
while( i < len) {
|
2037 |
+
if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
|
2038 |
+
|
2039 |
+
return this.chars[i];
|
2040 |
+
}
|
2041 |
+
i+= 1;
|
2042 |
+
}
|
2043 |
+
if((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char) && console && console.warn) {
|
2044 |
+
console.warn('Missing character from exported characters list: ', char, style, font);
|
2045 |
+
}
|
2046 |
+
return emptyChar;
|
2047 |
+
}
|
2048 |
+
|
2049 |
+
function measureText(char, fontName, size) {
|
2050 |
+
var fontData = this.getFontByName(fontName);
|
2051 |
+
var index = char.charCodeAt(0);
|
2052 |
+
if(!fontData.cache[index + 1]) {
|
2053 |
+
var tHelper = fontData.helper;
|
2054 |
+
//Canvas version
|
2055 |
+
//fontData.cache[index] = tHelper.measureText(char).width / 100;
|
2056 |
+
//SVG version
|
2057 |
+
//console.log(tHelper.getBBox().width)
|
2058 |
+
if (char === ' ') {
|
2059 |
+
tHelper.textContent = '|' + char + '|';
|
2060 |
+
var doubleSize = tHelper.getComputedTextLength();
|
2061 |
+
tHelper.textContent = '||';
|
2062 |
+
var singleSize = tHelper.getComputedTextLength();
|
2063 |
+
fontData.cache[index + 1] = (doubleSize - singleSize)/100;
|
2064 |
+
} else {
|
2065 |
+
tHelper.textContent = char;
|
2066 |
+
fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
|
2067 |
+
}
|
2068 |
+
}
|
2069 |
+
return fontData.cache[index + 1] * size;
|
2070 |
+
}
|
2071 |
+
|
2072 |
+
function getFontByName(name){
|
2073 |
+
var i = 0, len = this.fonts.length;
|
2074 |
+
while(i<len){
|
2075 |
+
if(this.fonts[i].fName === name) {
|
2076 |
+
return this.fonts[i];
|
2077 |
+
}
|
2078 |
+
i += 1;
|
2079 |
+
}
|
2080 |
+
return this.fonts[0];
|
2081 |
+
}
|
2082 |
+
|
2083 |
+
function getCombinedCharacterCodes() {
|
2084 |
+
return combinedCharacters;
|
2085 |
+
}
|
2086 |
+
|
2087 |
+
function loaded() {
|
2088 |
+
return this.isLoaded;
|
2089 |
+
}
|
2090 |
+
|
2091 |
+
var Font = function(){
|
2092 |
+
this.fonts = [];
|
2093 |
+
this.chars = null;
|
2094 |
+
this.typekitLoaded = 0;
|
2095 |
+
this.isLoaded = false;
|
2096 |
+
this.initTime = Date.now();
|
2097 |
+
};
|
2098 |
+
//TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
|
2099 |
+
Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
|
2100 |
+
|
2101 |
+
Font.prototype.addChars = addChars;
|
2102 |
+
Font.prototype.addFonts = addFonts;
|
2103 |
+
Font.prototype.getCharData = getCharData;
|
2104 |
+
Font.prototype.getFontByName = getFontByName;
|
2105 |
+
Font.prototype.measureText = measureText;
|
2106 |
+
Font.prototype.checkLoadedFonts = checkLoadedFonts;
|
2107 |
+
Font.prototype.loaded = loaded;
|
2108 |
+
|
2109 |
+
return Font;
|
2110 |
+
|
2111 |
+
}());
|
2112 |
+
var PropertyFactory = (function(){
|
2113 |
+
|
2114 |
+
var initFrame = initialDefaultFrame;
|
2115 |
+
var math_abs = Math.abs;
|
2116 |
+
|
2117 |
+
function interpolateValue(frameNum, caching) {
|
2118 |
+
var offsetTime = this.offsetTime;
|
2119 |
+
var newValue;
|
2120 |
+
if (this.propType === 'multidimensional') {
|
2121 |
+
newValue = createTypedArray('float32', this.pv.length);
|
2122 |
+
}
|
2123 |
+
var iterationIndex = caching.lastIndex;
|
2124 |
+
var i = iterationIndex;
|
2125 |
+
var len = this.keyframes.length - 1, flag = true;
|
2126 |
+
var keyData, nextKeyData;
|
2127 |
+
|
2128 |
+
while (flag) {
|
2129 |
+
keyData = this.keyframes[i];
|
2130 |
+
nextKeyData = this.keyframes[i + 1];
|
2131 |
+
if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
|
2132 |
+
if(keyData.h){
|
2133 |
+
keyData = nextKeyData;
|
2134 |
+
}
|
2135 |
+
iterationIndex = 0;
|
2136 |
+
break;
|
2137 |
+
}
|
2138 |
+
if ((nextKeyData.t - offsetTime) > frameNum){
|
2139 |
+
iterationIndex = i;
|
2140 |
+
break;
|
2141 |
+
}
|
2142 |
+
if (i < len - 1){
|
2143 |
+
i += 1;
|
2144 |
+
} else {
|
2145 |
+
iterationIndex = 0;
|
2146 |
+
flag = false;
|
2147 |
+
}
|
2148 |
+
}
|
2149 |
+
|
2150 |
+
var k, kLen, perc, jLen, j, fnc;
|
2151 |
+
var nextKeyTime = nextKeyData.t - offsetTime;
|
2152 |
+
var keyTime = keyData.t - offsetTime;
|
2153 |
+
var endValue;
|
2154 |
+
if (keyData.to) {
|
2155 |
+
if (!keyData.bezierData) {
|
2156 |
+
keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
|
2157 |
+
}
|
2158 |
+
var bezierData = keyData.bezierData;
|
2159 |
+
if (frameNum >= nextKeyTime || frameNum < keyTime) {
|
2160 |
+
var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
|
2161 |
+
kLen = bezierData.points[ind].point.length;
|
2162 |
+
for (k = 0; k < kLen; k += 1) {
|
2163 |
+
newValue[k] = bezierData.points[ind].point[k];
|
2164 |
+
}
|
2165 |
+
// caching._lastKeyframeIndex = -1;
|
2166 |
+
} else {
|
2167 |
+
if (keyData.__fnct) {
|
2168 |
+
fnc = keyData.__fnct;
|
2169 |
+
} else {
|
2170 |
+
fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
|
2171 |
+
keyData.__fnct = fnc;
|
2172 |
+
}
|
2173 |
+
perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
|
2174 |
+
var distanceInLine = bezierData.segmentLength*perc;
|
2175 |
+
|
2176 |
+
var segmentPerc;
|
2177 |
+
var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
|
2178 |
+
j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
|
2179 |
+
flag = true;
|
2180 |
+
jLen = bezierData.points.length;
|
2181 |
+
while (flag) {
|
2182 |
+
addedLength += bezierData.points[j].partialLength;
|
2183 |
+
if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
|
2184 |
+
kLen = bezierData.points[j].point.length;
|
2185 |
+
for (k = 0; k < kLen; k += 1) {
|
2186 |
+
newValue[k] = bezierData.points[j].point[k];
|
2187 |
+
}
|
2188 |
+
break;
|
2189 |
+
} else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
|
2190 |
+
segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
|
2191 |
+
kLen = bezierData.points[j].point.length;
|
2192 |
+
for (k = 0; k < kLen; k += 1) {
|
2193 |
+
newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
|
2194 |
+
}
|
2195 |
+
break;
|
2196 |
+
}
|
2197 |
+
if (j < jLen - 1){
|
2198 |
+
j += 1;
|
2199 |
+
} else {
|
2200 |
+
flag = false;
|
2201 |
+
}
|
2202 |
+
}
|
2203 |
+
caching._lastPoint = j;
|
2204 |
+
caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
|
2205 |
+
caching._lastKeyframeIndex = i;
|
2206 |
+
}
|
2207 |
+
} else {
|
2208 |
+
var outX, outY, inX, inY, keyValue;
|
2209 |
+
len = keyData.s.length;
|
2210 |
+
endValue = nextKeyData.s || keyData.e;
|
2211 |
+
if (this.sh && keyData.h !== 1) {
|
2212 |
+
if (frameNum >= nextKeyTime) {
|
2213 |
+
newValue[0] = endValue[0];
|
2214 |
+
newValue[1] = endValue[1];
|
2215 |
+
newValue[2] = endValue[2];
|
2216 |
+
} else if (frameNum <= keyTime) {
|
2217 |
+
newValue[0] = keyData.s[0];
|
2218 |
+
newValue[1] = keyData.s[1];
|
2219 |
+
newValue[2] = keyData.s[2];
|
2220 |
+
} else {
|
2221 |
+
var quatStart = createQuaternion(keyData.s);
|
2222 |
+
var quatEnd = createQuaternion(endValue);
|
2223 |
+
var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
|
2224 |
+
quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
|
2225 |
+
}
|
2226 |
+
|
2227 |
+
} else {
|
2228 |
+
for(i = 0; i < len; i += 1) {
|
2229 |
+
if (keyData.h !== 1) {
|
2230 |
+
if (frameNum >= nextKeyTime) {
|
2231 |
+
perc = 1;
|
2232 |
+
} else if(frameNum < keyTime) {
|
2233 |
+
perc = 0;
|
2234 |
+
} else {
|
2235 |
+
if(keyData.o.x.constructor === Array) {
|
2236 |
+
if (!keyData.__fnct) {
|
2237 |
+
keyData.__fnct = [];
|
2238 |
+
}
|
2239 |
+
if (!keyData.__fnct[i]) {
|
2240 |
+
outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
|
2241 |
+
outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
|
2242 |
+
inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
|
2243 |
+
inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
|
2244 |
+
fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
|
2245 |
+
keyData.__fnct[i] = fnc;
|
2246 |
+
} else {
|
2247 |
+
fnc = keyData.__fnct[i];
|
2248 |
+
}
|
2249 |
+
} else {
|
2250 |
+
if (!keyData.__fnct) {
|
2251 |
+
outX = keyData.o.x;
|
2252 |
+
outY = keyData.o.y;
|
2253 |
+
inX = keyData.i.x;
|
2254 |
+
inY = keyData.i.y;
|
2255 |
+
fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
|
2256 |
+
keyData.__fnct = fnc;
|
2257 |
+
} else {
|
2258 |
+
fnc = keyData.__fnct;
|
2259 |
+
}
|
2260 |
+
}
|
2261 |
+
perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
|
2262 |
+
}
|
2263 |
+
}
|
2264 |
+
|
2265 |
+
endValue = nextKeyData.s || keyData.e;
|
2266 |
+
keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
|
2267 |
+
|
2268 |
+
if (this.propType === 'multidimensional') {
|
2269 |
+
newValue[i] = keyValue;
|
2270 |
+
} else {
|
2271 |
+
newValue = keyValue;
|
2272 |
+
}
|
2273 |
+
}
|
2274 |
+
}
|
2275 |
+
}
|
2276 |
+
caching.lastIndex = iterationIndex;
|
2277 |
+
return newValue;
|
2278 |
+
}
|
2279 |
+
|
2280 |
+
//based on @Toji's https://github.com/toji/gl-matrix/
|
2281 |
+
function slerp(a, b, t) {
|
2282 |
+
var out = [];
|
2283 |
+
var ax = a[0], ay = a[1], az = a[2], aw = a[3],
|
2284 |
+
bx = b[0], by = b[1], bz = b[2], bw = b[3]
|
2285 |
+
|
2286 |
+
var omega, cosom, sinom, scale0, scale1;
|
2287 |
+
|
2288 |
+
cosom = ax * bx + ay * by + az * bz + aw * bw;
|
2289 |
+
if (cosom < 0.0) {
|
2290 |
+
cosom = -cosom;
|
2291 |
+
bx = -bx;
|
2292 |
+
by = -by;
|
2293 |
+
bz = -bz;
|
2294 |
+
bw = -bw;
|
2295 |
+
}
|
2296 |
+
if ((1.0 - cosom) > 0.000001) {
|
2297 |
+
omega = Math.acos(cosom);
|
2298 |
+
sinom = Math.sin(omega);
|
2299 |
+
scale0 = Math.sin((1.0 - t) * omega) / sinom;
|
2300 |
+
scale1 = Math.sin(t * omega) / sinom;
|
2301 |
+
} else {
|
2302 |
+
scale0 = 1.0 - t;
|
2303 |
+
scale1 = t;
|
2304 |
+
}
|
2305 |
+
out[0] = scale0 * ax + scale1 * bx;
|
2306 |
+
out[1] = scale0 * ay + scale1 * by;
|
2307 |
+
out[2] = scale0 * az + scale1 * bz;
|
2308 |
+
out[3] = scale0 * aw + scale1 * bw;
|
2309 |
+
|
2310 |
+
return out;
|
2311 |
+
}
|
2312 |
+
|
2313 |
+
function quaternionToEuler(out, quat) {
|
2314 |
+
var qx = quat[0];
|
2315 |
+
var qy = quat[1];
|
2316 |
+
var qz = quat[2];
|
2317 |
+
var qw = quat[3];
|
2318 |
+
var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
|
2319 |
+
var attitude = Math.asin(2*qx*qy + 2*qz*qw)
|
2320 |
+
var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
|
2321 |
+
out[0] = heading/degToRads;
|
2322 |
+
out[1] = attitude/degToRads;
|
2323 |
+
out[2] = bank/degToRads;
|
2324 |
+
}
|
2325 |
+
|
2326 |
+
function createQuaternion(values) {
|
2327 |
+
var heading = values[0] * degToRads;
|
2328 |
+
var attitude = values[1] * degToRads;
|
2329 |
+
var bank = values[2] * degToRads;
|
2330 |
+
var c1 = Math.cos(heading / 2);
|
2331 |
+
var c2 = Math.cos(attitude / 2);
|
2332 |
+
var c3 = Math.cos(bank / 2);
|
2333 |
+
var s1 = Math.sin(heading / 2);
|
2334 |
+
var s2 = Math.sin(attitude / 2);
|
2335 |
+
var s3 = Math.sin(bank / 2);
|
2336 |
+
var w = c1 * c2 * c3 - s1 * s2 * s3;
|
2337 |
+
var x = s1 * s2 * c3 + c1 * c2 * s3;
|
2338 |
+
var y = s1 * c2 * c3 + c1 * s2 * s3;
|
2339 |
+
var z = c1 * s2 * c3 - s1 * c2 * s3;
|
2340 |
+
|
2341 |
+
return [x,y,z,w];
|
2342 |
+
}
|
2343 |
+
|
2344 |
+
function getValueAtCurrentTime(){
|
2345 |
+
var frameNum = this.comp.renderedFrame - this.offsetTime;
|
2346 |
+
var initTime = this.keyframes[0].t - this.offsetTime;
|
2347 |
+
var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
|
2348 |
+
if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
|
2349 |
+
if(this._caching.lastFrame >= frameNum) {
|
2350 |
+
this._caching._lastKeyframeIndex = -1;
|
2351 |
+
this._caching.lastIndex = 0;
|
2352 |
+
}
|
2353 |
+
|
2354 |
+
var renderResult = this.interpolateValue(frameNum, this._caching);
|
2355 |
+
this.pv = renderResult;
|
2356 |
+
}
|
2357 |
+
this._caching.lastFrame = frameNum;
|
2358 |
+
return this.pv;
|
2359 |
+
}
|
2360 |
+
|
2361 |
+
function setVValue(val) {
|
2362 |
+
var multipliedValue;
|
2363 |
+
if(this.propType === 'unidimensional') {
|
2364 |
+
multipliedValue = val * this.mult;
|
2365 |
+
if(math_abs(this.v - multipliedValue) > 0.00001) {
|
2366 |
+
this.v = multipliedValue;
|
2367 |
+
this._mdf = true;
|
2368 |
+
}
|
2369 |
+
} else {
|
2370 |
+
var i = 0, len = this.v.length;
|
2371 |
+
while (i < len) {
|
2372 |
+
multipliedValue = val[i] * this.mult;
|
2373 |
+
if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
|
2374 |
+
this.v[i] = multipliedValue;
|
2375 |
+
this._mdf = true;
|
2376 |
+
}
|
2377 |
+
i += 1;
|
2378 |
+
}
|
2379 |
+
}
|
2380 |
+
}
|
2381 |
+
|
2382 |
+
function processEffectsSequence() {
|
2383 |
+
if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
|
2384 |
+
return;
|
2385 |
+
}
|
2386 |
+
if(this.lock) {
|
2387 |
+
this.setVValue(this.pv);
|
2388 |
+
return;
|
2389 |
+
}
|
2390 |
+
this.lock = true;
|
2391 |
+
this._mdf = this._isFirstFrame;
|
2392 |
+
var multipliedValue;
|
2393 |
+
var i, len = this.effectsSequence.length;
|
2394 |
+
var finalValue = this.kf ? this.pv : this.data.k;
|
2395 |
+
for(i = 0; i < len; i += 1) {
|
2396 |
+
finalValue = this.effectsSequence[i](finalValue);
|
2397 |
+
}
|
2398 |
+
this.setVValue(finalValue);
|
2399 |
+
this._isFirstFrame = false;
|
2400 |
+
this.lock = false;
|
2401 |
+
this.frameId = this.elem.globalData.frameId;
|
2402 |
+
}
|
2403 |
+
|
2404 |
+
function addEffect(effectFunction) {
|
2405 |
+
this.effectsSequence.push(effectFunction);
|
2406 |
+
this.container.addDynamicProperty(this);
|
2407 |
+
}
|
2408 |
+
|
2409 |
+
function ValueProperty(elem, data, mult, container){
|
2410 |
+
this.propType = 'unidimensional';
|
2411 |
+
this.mult = mult || 1;
|
2412 |
+
this.data = data;
|
2413 |
+
this.v = mult ? data.k * mult : data.k;
|
2414 |
+
this.pv = data.k;
|
2415 |
+
this._mdf = false;
|
2416 |
+
this.elem = elem;
|
2417 |
+
this.container = container;
|
2418 |
+
this.comp = elem.comp;
|
2419 |
+
this.k = false;
|
2420 |
+
this.kf = false;
|
2421 |
+
this.vel = 0;
|
2422 |
+
this.effectsSequence = [];
|
2423 |
+
this._isFirstFrame = true;
|
2424 |
+
this.getValue = processEffectsSequence;
|
2425 |
+
this.setVValue = setVValue;
|
2426 |
+
this.addEffect = addEffect;
|
2427 |
+
}
|
2428 |
+
|
2429 |
+
function MultiDimensionalProperty(elem, data, mult, container) {
|
2430 |
+
this.propType = 'multidimensional';
|
2431 |
+
this.mult = mult || 1;
|
2432 |
+
this.data = data;
|
2433 |
+
this._mdf = false;
|
2434 |
+
this.elem = elem;
|
2435 |
+
this.container = container;
|
2436 |
+
this.comp = elem.comp;
|
2437 |
+
this.k = false;
|
2438 |
+
this.kf = false;
|
2439 |
+
this.frameId = -1;
|
2440 |
+
var i, len = data.k.length;
|
2441 |
+
this.v = createTypedArray('float32', len);
|
2442 |
+
this.pv = createTypedArray('float32', len);
|
2443 |
+
var arr = createTypedArray('float32', len);
|
2444 |
+
this.vel = createTypedArray('float32', len);
|
2445 |
+
for (i = 0; i < len; i += 1) {
|
2446 |
+
this.v[i] = data.k[i] * this.mult;
|
2447 |
+
this.pv[i] = data.k[i];
|
2448 |
+
}
|
2449 |
+
this._isFirstFrame = true;
|
2450 |
+
this.effectsSequence = [];
|
2451 |
+
this.getValue = processEffectsSequence;
|
2452 |
+
this.setVValue = setVValue;
|
2453 |
+
this.addEffect = addEffect;
|
2454 |
+
}
|
2455 |
+
|
2456 |
+
function KeyframedValueProperty(elem, data, mult, container) {
|
2457 |
+
this.propType = 'unidimensional';
|
2458 |
+
this.keyframes = data.k;
|
2459 |
+
this.offsetTime = elem.data.st;
|
2460 |
+
this.frameId = -1;
|
2461 |
+
this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
|
2462 |
+
this.k = true;
|
2463 |
+
this.kf = true;
|
2464 |
+
this.data = data;
|
2465 |
+
this.mult = mult || 1;
|
2466 |
+
this.elem = elem;
|
2467 |
+
this.container = container;
|
2468 |
+
this.comp = elem.comp;
|
2469 |
+
this.v = initFrame;
|
2470 |
+
this.pv = initFrame;
|
2471 |
+
this._isFirstFrame = true;
|
2472 |
+
this.getValue = processEffectsSequence;
|
2473 |
+
this.setVValue = setVValue;
|
2474 |
+
this.interpolateValue = interpolateValue;
|
2475 |
+
this.effectsSequence = [getValueAtCurrentTime.bind(this)];
|
2476 |
+
this.addEffect = addEffect;
|
2477 |
+
}
|
2478 |
+
|
2479 |
+
function KeyframedMultidimensionalProperty(elem, data, mult, container){
|
2480 |
+
this.propType = 'multidimensional';
|
2481 |
+
var i, len = data.k.length;
|
2482 |
+
var s, e,to,ti;
|
2483 |
+
for (i = 0; i < len - 1; i += 1) {
|
2484 |
+
if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
|
2485 |
+
s = data.k[i].s;
|
2486 |
+
e = data.k[i + 1].s;
|
2487 |
+
to = data.k[i].to;
|
2488 |
+
ti = data.k[i].ti;
|
2489 |
+
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]))){
|
2490 |
+
data.k[i].to = null;
|
2491 |
+
data.k[i].ti = null;
|
2492 |
+
}
|
2493 |
+
if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
|
2494 |
+
if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
|
2495 |
+
data.k[i].to = null;
|
2496 |
+
data.k[i].ti = null;
|
2497 |
+
}
|
2498 |
+
}
|
2499 |
+
}
|
2500 |
+
}
|
2501 |
+
this.effectsSequence = [getValueAtCurrentTime.bind(this)];
|
2502 |
+
this.keyframes = data.k;
|
2503 |
+
this.offsetTime = elem.data.st;
|
2504 |
+
this.k = true;
|
2505 |
+
this.kf = true;
|
2506 |
+
this._isFirstFrame = true;
|
2507 |
+
this.mult = mult || 1;
|
2508 |
+
this.elem = elem;
|
2509 |
+
this.container = container;
|
2510 |
+
this.comp = elem.comp;
|
2511 |
+
this.getValue = processEffectsSequence;
|
2512 |
+
this.setVValue = setVValue;
|
2513 |
+
this.interpolateValue = interpolateValue;
|
2514 |
+
this.frameId = -1;
|
2515 |
+
var arrLen = data.k[0].s.length;
|
2516 |
+
this.v = createTypedArray('float32', arrLen);
|
2517 |
+
this.pv = createTypedArray('float32', arrLen);
|
2518 |
+
for (i = 0; i < arrLen; i += 1) {
|
2519 |
+
this.v[i] = initFrame;
|
2520 |
+
this.pv[i] = initFrame;
|
2521 |
+
}
|
2522 |
+
this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
|
2523 |
+
this.addEffect = addEffect;
|
2524 |
+
}
|
2525 |
+
|
2526 |
+
function getProp(elem,data,type, mult, container) {
|
2527 |
+
var p;
|
2528 |
+
if(!data.k.length){
|
2529 |
+
p = new ValueProperty(elem,data, mult, container);
|
2530 |
+
}else if(typeof(data.k[0]) === 'number'){
|
2531 |
+
p = new MultiDimensionalProperty(elem,data, mult, container);
|
2532 |
+
}else{
|
2533 |
+
switch(type){
|
2534 |
+
case 0:
|
2535 |
+
p = new KeyframedValueProperty(elem,data,mult, container);
|
2536 |
+
break;
|
2537 |
+
case 1:
|
2538 |
+
p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
|
2539 |
+
break;
|
2540 |
+
}
|
2541 |
+
}
|
2542 |
+
if(p.effectsSequence.length){
|
2543 |
+
container.addDynamicProperty(p);
|
2544 |
+
}
|
2545 |
+
return p;
|
2546 |
+
}
|
2547 |
+
|
2548 |
+
var ob = {
|
2549 |
+
getProp: getProp
|
2550 |
+
};
|
2551 |
+
return ob;
|
2552 |
+
}());
|
2553 |
+
var TransformPropertyFactory = (function() {
|
2554 |
+
|
2555 |
+
var defaultVector = [0,0]
|
2556 |
+
|
2557 |
+
function applyToMatrix(mat) {
|
2558 |
+
var _mdf = this._mdf;
|
2559 |
+
this.iterateDynamicProperties();
|
2560 |
+
this._mdf = this._mdf || _mdf;
|
2561 |
+
if (this.a) {
|
2562 |
+
mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
|
2563 |
+
}
|
2564 |
+
if (this.s) {
|
2565 |
+
mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
|
2566 |
+
}
|
2567 |
+
if (this.sk) {
|
2568 |
+
mat.skewFromAxis(-this.sk.v, this.sa.v);
|
2569 |
+
}
|
2570 |
+
if (this.r) {
|
2571 |
+
mat.rotate(-this.r.v);
|
2572 |
+
} else {
|
2573 |
+
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]);
|
2574 |
+
}
|
2575 |
+
if (this.data.p.s) {
|
2576 |
+
if (this.data.p.z) {
|
2577 |
+
mat.translate(this.px.v, this.py.v, -this.pz.v);
|
2578 |
+
} else {
|
2579 |
+
mat.translate(this.px.v, this.py.v, 0);
|
2580 |
+
}
|
2581 |
+
} else {
|
2582 |
+
mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
|
2583 |
+
}
|
2584 |
+
}
|
2585 |
+
function processKeys(forceRender){
|
2586 |
+
if (this.elem.globalData.frameId === this.frameId) {
|
2587 |
+
return;
|
2588 |
+
}
|
2589 |
+
if(this._isDirty) {
|
2590 |
+
this.precalculateMatrix();
|
2591 |
+
this._isDirty = false;
|
2592 |
+
}
|
2593 |
+
|
2594 |
+
this.iterateDynamicProperties();
|
2595 |
+
|
2596 |
+
if (this._mdf || forceRender) {
|
2597 |
+
this.v.cloneFromProps(this.pre.props);
|
2598 |
+
if (this.appliedTransformations < 1) {
|
2599 |
+
this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
|
2600 |
+
}
|
2601 |
+
if(this.appliedTransformations < 2) {
|
2602 |
+
this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
|
2603 |
+
}
|
2604 |
+
if (this.sk && this.appliedTransformations < 3) {
|
2605 |
+
this.v.skewFromAxis(-this.sk.v, this.sa.v);
|
2606 |
+
}
|
2607 |
+
if (this.r && this.appliedTransformations < 4) {
|
2608 |
+
this.v.rotate(-this.r.v);
|
2609 |
+
} else if (!this.r && this.appliedTransformations < 4){
|
2610 |
+
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]);
|
2611 |
+
}
|
2612 |
+
if (this.autoOriented) {
|
2613 |
+
var v1,v2, frameRate = this.elem.globalData.frameRate;
|
2614 |
+
if(this.p && this.p.keyframes && this.p.getValueAtTime) {
|
2615 |
+
if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
|
2616 |
+
v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
|
2617 |
+
v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
|
2618 |
+
} else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
|
2619 |
+
v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
|
2620 |
+
v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
|
2621 |
+
} else {
|
2622 |
+
v1 = this.p.pv;
|
2623 |
+
v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
|
2624 |
+
}
|
2625 |
+
} else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
|
2626 |
+
v1 = [];
|
2627 |
+
v2 = [];
|
2628 |
+
var px = this.px, py = this.py, frameRate;
|
2629 |
+
if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
|
2630 |
+
v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
|
2631 |
+
v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
|
2632 |
+
v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
|
2633 |
+
v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
|
2634 |
+
} else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
|
2635 |
+
v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
|
2636 |
+
v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
|
2637 |
+
v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
|
2638 |
+
v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
|
2639 |
+
} else {
|
2640 |
+
v1 = [px.pv, py.pv];
|
2641 |
+
v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
|
2642 |
+
v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
|
2643 |
+
}
|
2644 |
+
} else {
|
2645 |
+
v1 = v2 = defaultVector
|
2646 |
+
}
|
2647 |
+
this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
|
2648 |
+
}
|
2649 |
+
if(this.data.p && this.data.p.s){
|
2650 |
+
if(this.data.p.z) {
|
2651 |
+
this.v.translate(this.px.v, this.py.v, -this.pz.v);
|
2652 |
+
} else {
|
2653 |
+
this.v.translate(this.px.v, this.py.v, 0);
|
2654 |
+
}
|
2655 |
+
}else{
|
2656 |
+
this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
|
2657 |
+
}
|
2658 |
+
}
|
2659 |
+
this.frameId = this.elem.globalData.frameId;
|
2660 |
+
}
|
2661 |
+
|
2662 |
+
function precalculateMatrix() {
|
2663 |
+
if(!this.a.k) {
|
2664 |
+
this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
|
2665 |
+
this.appliedTransformations = 1;
|
2666 |
+
} else {
|
2667 |
+
return;
|
2668 |
+
}
|
2669 |
+
if(!this.s.effectsSequence.length) {
|
2670 |
+
this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
|
2671 |
+
this.appliedTransformations = 2;
|
2672 |
+
} else {
|
2673 |
+
return;
|
2674 |
+
}
|
2675 |
+
if(this.sk) {
|
2676 |
+
if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
|
2677 |
+
this.pre.skewFromAxis(-this.sk.v, this.sa.v);
|
2678 |
+
this.appliedTransformations = 3;
|
2679 |
+
} else {
|
2680 |
+
return;
|
2681 |
+
}
|
2682 |
+
}
|
2683 |
+
if (this.r) {
|
2684 |
+
if(!this.r.effectsSequence.length) {
|
2685 |
+
this.pre.rotate(-this.r.v);
|
2686 |
+
this.appliedTransformations = 4;
|
2687 |
+
} else {
|
2688 |
+
return;
|
2689 |
+
}
|
2690 |
+
} else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
|
2691 |
+
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]);
|
2692 |
+
this.appliedTransformations = 4;
|
2693 |
+
}
|
2694 |
+
}
|
2695 |
+
|
2696 |
+
function autoOrient(){
|
2697 |
+
//
|
2698 |
+
//var prevP = this.getValueAtTime();
|
2699 |
+
}
|
2700 |
+
|
2701 |
+
function addDynamicProperty(prop) {
|
2702 |
+
this._addDynamicProperty(prop);
|
2703 |
+
this.elem.addDynamicProperty(prop);
|
2704 |
+
this._isDirty = true;
|
2705 |
+
}
|
2706 |
+
|
2707 |
+
function TransformProperty(elem,data,container){
|
2708 |
+
this.elem = elem;
|
2709 |
+
this.frameId = -1;
|
2710 |
+
this.propType = 'transform';
|
2711 |
+
this.data = data;
|
2712 |
+
this.v = new Matrix();
|
2713 |
+
//Precalculated matrix with non animated properties
|
2714 |
+
this.pre = new Matrix();
|
2715 |
+
this.appliedTransformations = 0;
|
2716 |
+
this.initDynamicPropertyContainer(container || elem);
|
2717 |
+
if(data.p && data.p.s){
|
2718 |
+
this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
|
2719 |
+
this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
|
2720 |
+
if(data.p.z){
|
2721 |
+
this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
|
2722 |
+
}
|
2723 |
+
}else{
|
2724 |
+
this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
|
2725 |
+
}
|
2726 |
+
if(data.rx) {
|
2727 |
+
this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
|
2728 |
+
this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
|
2729 |
+
this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
|
2730 |
+
if(data.or.k[0].ti) {
|
2731 |
+
var i, len = data.or.k.length;
|
2732 |
+
for(i=0;i<len;i+=1) {
|
2733 |
+
data.or.k[i].to = data.or.k[i].ti = null;
|
2734 |
+
}
|
2735 |
+
}
|
2736 |
+
this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
|
2737 |
+
//sh Indicates it needs to be capped between -180 and 180
|
2738 |
+
this.or.sh = true;
|
2739 |
+
} else {
|
2740 |
+
this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
|
2741 |
+
}
|
2742 |
+
if(data.sk){
|
2743 |
+
this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
|
2744 |
+
this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
|
2745 |
+
}
|
2746 |
+
this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
|
2747 |
+
this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},1,0.01,this);
|
2748 |
+
// 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.
|
2749 |
+
if(data.o){
|
2750 |
+
this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
|
2751 |
+
} else {
|
2752 |
+
this.o = {_mdf:false,v:1};
|
2753 |
+
}
|
2754 |
+
this._isDirty = true;
|
2755 |
+
if(!this.dynamicProperties.length){
|
2756 |
+
this.getValue(true);
|
2757 |
+
}
|
2758 |
+
}
|
2759 |
+
|
2760 |
+
TransformProperty.prototype = {
|
2761 |
+
applyToMatrix: applyToMatrix,
|
2762 |
+
getValue: processKeys,
|
2763 |
+
precalculateMatrix: precalculateMatrix,
|
2764 |
+
autoOrient: autoOrient
|
2765 |
+
}
|
2766 |
+
|
2767 |
+
extendPrototype([DynamicPropertyContainer], TransformProperty);
|
2768 |
+
TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
|
2769 |
+
TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
|
2770 |
+
|
2771 |
+
function getTransformProperty(elem,data,container){
|
2772 |
+
return new TransformProperty(elem,data,container);
|
2773 |
+
}
|
2774 |
+
|
2775 |
+
return {
|
2776 |
+
getTransformProperty: getTransformProperty
|
2777 |
+
};
|
2778 |
+
|
2779 |
+
}());
|
2780 |
+
function ShapePath(){
|
2781 |
+
this.c = false;
|
2782 |
+
this._length = 0;
|
2783 |
+
this._maxLength = 8;
|
2784 |
+
this.v = createSizedArray(this._maxLength);
|
2785 |
+
this.o = createSizedArray(this._maxLength);
|
2786 |
+
this.i = createSizedArray(this._maxLength);
|
2787 |
+
}
|
2788 |
+
|
2789 |
+
ShapePath.prototype.setPathData = function(closed, len) {
|
2790 |
+
this.c = closed;
|
2791 |
+
this.setLength(len);
|
2792 |
+
var i = 0;
|
2793 |
+
while(i < len){
|
2794 |
+
this.v[i] = point_pool.newElement();
|
2795 |
+
this.o[i] = point_pool.newElement();
|
2796 |
+
this.i[i] = point_pool.newElement();
|
2797 |
+
i += 1;
|
2798 |
+
}
|
2799 |
+
};
|
2800 |
+
|
2801 |
+
ShapePath.prototype.setLength = function(len) {
|
2802 |
+
while(this._maxLength < len) {
|
2803 |
+
this.doubleArrayLength();
|
2804 |
+
}
|
2805 |
+
this._length = len;
|
2806 |
+
};
|
2807 |
+
|
2808 |
+
ShapePath.prototype.doubleArrayLength = function() {
|
2809 |
+
this.v = this.v.concat(createSizedArray(this._maxLength));
|
2810 |
+
this.i = this.i.concat(createSizedArray(this._maxLength));
|
2811 |
+
this.o = this.o.concat(createSizedArray(this._maxLength));
|
2812 |
+
this._maxLength *= 2;
|
2813 |
+
};
|
2814 |
+
|
2815 |
+
ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
|
2816 |
+
var arr;
|
2817 |
+
this._length = Math.max(this._length, pos + 1);
|
2818 |
+
if(this._length >= this._maxLength) {
|
2819 |
+
this.doubleArrayLength();
|
2820 |
+
}
|
2821 |
+
switch(type){
|
2822 |
+
case 'v':
|
2823 |
+
arr = this.v;
|
2824 |
+
break;
|
2825 |
+
case 'i':
|
2826 |
+
arr = this.i;
|
2827 |
+
break;
|
2828 |
+
case 'o':
|
2829 |
+
arr = this.o;
|
2830 |
+
break;
|
2831 |
+
}
|
2832 |
+
if(!arr[pos] || (arr[pos] && !replace)){
|
2833 |
+
arr[pos] = point_pool.newElement();
|
2834 |
+
}
|
2835 |
+
arr[pos][0] = x;
|
2836 |
+
arr[pos][1] = y;
|
2837 |
+
};
|
2838 |
+
|
2839 |
+
ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
|
2840 |
+
this.setXYAt(vX,vY,'v',pos, replace);
|
2841 |
+
this.setXYAt(oX,oY,'o',pos, replace);
|
2842 |
+
this.setXYAt(iX,iY,'i',pos, replace);
|
2843 |
+
};
|
2844 |
+
|
2845 |
+
ShapePath.prototype.reverse = function() {
|
2846 |
+
var newPath = new ShapePath();
|
2847 |
+
newPath.setPathData(this.c, this._length);
|
2848 |
+
var vertices = this.v, outPoints = this.o, inPoints = this.i;
|
2849 |
+
var init = 0;
|
2850 |
+
if (this.c) {
|
2851 |
+
newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
|
2852 |
+
init = 1;
|
2853 |
+
}
|
2854 |
+
var cnt = this._length - 1;
|
2855 |
+
var len = this._length;
|
2856 |
+
|
2857 |
+
var i;
|
2858 |
+
for (i = init; i < len; i += 1) {
|
2859 |
+
newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
|
2860 |
+
cnt -= 1;
|
2861 |
+
}
|
2862 |
+
return newPath;
|
2863 |
+
};
|
2864 |
+
var ShapePropertyFactory = (function(){
|
2865 |
+
|
2866 |
+
var initFrame = -999999;
|
2867 |
+
|
2868 |
+
function interpolateShape(frameNum, previousValue, caching) {
|
2869 |
+
var iterationIndex = caching.lastIndex;
|
2870 |
+
var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
|
2871 |
+
var kf = this.keyframes;
|
2872 |
+
if(frameNum < kf[0].t-this.offsetTime){
|
2873 |
+
keyPropS = kf[0].s[0];
|
2874 |
+
isHold = true;
|
2875 |
+
iterationIndex = 0;
|
2876 |
+
}else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
|
2877 |
+
keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
|
2878 |
+
/*if(kf[kf.length - 1].s){
|
2879 |
+
keyPropS = kf[kf.length - 1].s[0];
|
2880 |
+
}else{
|
2881 |
+
keyPropS = kf[kf.length - 2].e[0];
|
2882 |
+
}*/
|
2883 |
+
isHold = true;
|
2884 |
+
}else{
|
2885 |
+
var i = iterationIndex;
|
2886 |
+
var len = kf.length- 1,flag = true,keyData,nextKeyData;
|
2887 |
+
while(flag){
|
2888 |
+
keyData = kf[i];
|
2889 |
+
nextKeyData = kf[i+1];
|
2890 |
+
if((nextKeyData.t - this.offsetTime) > frameNum){
|
2891 |
+
break;
|
2892 |
+
}
|
2893 |
+
if(i < len - 1){
|
2894 |
+
i += 1;
|
2895 |
+
}else{
|
2896 |
+
flag = false;
|
2897 |
+
}
|
2898 |
+
}
|
2899 |
+
isHold = keyData.h === 1;
|
2900 |
+
iterationIndex = i;
|
2901 |
+
if(!isHold){
|
2902 |
+
if(frameNum >= nextKeyData.t-this.offsetTime){
|
2903 |
+
perc = 1;
|
2904 |
+
}else if(frameNum < keyData.t-this.offsetTime){
|
2905 |
+
perc = 0;
|
2906 |
+
}else{
|
2907 |
+
var fnc;
|
2908 |
+
if(keyData.__fnct){
|
2909 |
+
fnc = keyData.__fnct;
|
2910 |
+
}else{
|
2911 |
+
fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
|
2912 |
+
keyData.__fnct = fnc;
|
2913 |
+
}
|
2914 |
+
perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
|
2915 |
+
}
|
2916 |
+
keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
|
2917 |
+
}
|
2918 |
+
keyPropS = keyData.s[0];
|
2919 |
+
}
|
2920 |
+
jLen = previousValue._length;
|
2921 |
+
kLen = keyPropS.i[0].length;
|
2922 |
+
caching.lastIndex = iterationIndex;
|
2923 |
+
|
2924 |
+
for(j=0;j<jLen;j+=1){
|
2925 |
+
for(k=0;k<kLen;k+=1){
|
2926 |
+
vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
|
2927 |
+
previousValue.i[j][k] = vertexValue;
|
2928 |
+
vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
|
2929 |
+
previousValue.o[j][k] = vertexValue;
|
2930 |
+
vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
|
2931 |
+
previousValue.v[j][k] = vertexValue;
|
2932 |
+
}
|
2933 |
+
}
|
2934 |
+
}
|
2935 |
+
|
2936 |
+
function interpolateShapeCurrentTime(){
|
2937 |
+
var frameNum = this.comp.renderedFrame - this.offsetTime;
|
2938 |
+
var initTime = this.keyframes[0].t - this.offsetTime;
|
2939 |
+
var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
|
2940 |
+
var lastFrame = this._caching.lastFrame;
|
2941 |
+
if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
|
2942 |
+
////
|
2943 |
+
this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
|
2944 |
+
this.interpolateShape(frameNum, this.pv, this._caching);
|
2945 |
+
////
|
2946 |
+
}
|
2947 |
+
this._caching.lastFrame = frameNum;
|
2948 |
+
return this.pv;
|
2949 |
+
}
|
2950 |
+
|
2951 |
+
function resetShape(){
|
2952 |
+
this.paths = this.localShapeCollection;
|
2953 |
+
}
|
2954 |
+
|
2955 |
+
function shapesEqual(shape1, shape2) {
|
2956 |
+
if(shape1._length !== shape2._length || shape1.c !== shape2.c){
|
2957 |
+
return false;
|
2958 |
+
}
|
2959 |
+
var i, len = shape1._length;
|
2960 |
+
for(i = 0; i < len; i += 1) {
|
2961 |
+
if(shape1.v[i][0] !== shape2.v[i][0]
|
2962 |
+
|| shape1.v[i][1] !== shape2.v[i][1]
|
2963 |
+
|| shape1.o[i][0] !== shape2.o[i][0]
|
2964 |
+
|| shape1.o[i][1] !== shape2.o[i][1]
|
2965 |
+
|| shape1.i[i][0] !== shape2.i[i][0]
|
2966 |
+
|| shape1.i[i][1] !== shape2.i[i][1]) {
|
2967 |
+
return false;
|
2968 |
+
}
|
2969 |
+
}
|
2970 |
+
return true;
|
2971 |
+
}
|
2972 |
+
|
2973 |
+
function setVValue(newPath) {
|
2974 |
+
if(!shapesEqual(this.v, newPath)) {
|
2975 |
+
this.v = shape_pool.clone(newPath);
|
2976 |
+
this.localShapeCollection.releaseShapes();
|
2977 |
+
this.localShapeCollection.addShape(this.v);
|
2978 |
+
this._mdf = true;
|
2979 |
+
this.paths = this.localShapeCollection;
|
2980 |
+
}
|
2981 |
+
}
|
2982 |
+
|
2983 |
+
function processEffectsSequence() {
|
2984 |
+
if (this.elem.globalData.frameId === this.frameId) {
|
2985 |
+
return;
|
2986 |
+
} else if (!this.effectsSequence.length) {
|
2987 |
+
this._mdf = false;
|
2988 |
+
return;
|
2989 |
+
}
|
2990 |
+
if (this.lock) {
|
2991 |
+
this.setVValue(this.pv);
|
2992 |
+
return;
|
2993 |
+
}
|
2994 |
+
this.lock = true;
|
2995 |
+
this._mdf = false;
|
2996 |
+
var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
|
2997 |
+
var i, len = this.effectsSequence.length;
|
2998 |
+
for(i = 0; i < len; i += 1) {
|
2999 |
+
finalValue = this.effectsSequence[i](finalValue);
|
3000 |
+
}
|
3001 |
+
this.setVValue(finalValue);
|
3002 |
+
this.lock = false;
|
3003 |
+
this.frameId = this.elem.globalData.frameId;
|
3004 |
+
};
|
3005 |
+
|
3006 |
+
function ShapeProperty(elem, data, type){
|
3007 |
+
this.propType = 'shape';
|
3008 |
+
this.comp = elem.comp;
|
3009 |
+
this.container = elem;
|
3010 |
+
this.elem = elem;
|
3011 |
+
this.data = data;
|
3012 |
+
this.k = false;
|
3013 |
+
this.kf = false;
|
3014 |
+
this._mdf = false;
|
3015 |
+
var pathData = type === 3 ? data.pt.k : data.ks.k;
|
3016 |
+
this.v = shape_pool.clone(pathData);
|
3017 |
+
this.pv = shape_pool.clone(this.v);
|
3018 |
+
this.localShapeCollection = shapeCollection_pool.newShapeCollection();
|
3019 |
+
this.paths = this.localShapeCollection;
|
3020 |
+
this.paths.addShape(this.v);
|
3021 |
+
this.reset = resetShape;
|
3022 |
+
this.effectsSequence = [];
|
3023 |
+
}
|
3024 |
+
|
3025 |
+
function addEffect(effectFunction) {
|
3026 |
+
this.effectsSequence.push(effectFunction);
|
3027 |
+
this.container.addDynamicProperty(this);
|
3028 |
+
}
|
3029 |
+
|
3030 |
+
ShapeProperty.prototype.interpolateShape = interpolateShape;
|
3031 |
+
ShapeProperty.prototype.getValue = processEffectsSequence;
|
3032 |
+
ShapeProperty.prototype.setVValue = setVValue;
|
3033 |
+
ShapeProperty.prototype.addEffect = addEffect;
|
3034 |
+
|
3035 |
+
function KeyframedShapeProperty(elem,data,type){
|
3036 |
+
this.propType = 'shape';
|
3037 |
+
this.comp = elem.comp;
|
3038 |
+
this.elem = elem;
|
3039 |
+
this.container = elem;
|
3040 |
+
this.offsetTime = elem.data.st;
|
3041 |
+
this.keyframes = type === 3 ? data.pt.k : data.ks.k;
|
3042 |
+
this.k = true;
|
3043 |
+
this.kf = true;
|
3044 |
+
var i, len = this.keyframes[0].s[0].i.length;
|
3045 |
+
var jLen = this.keyframes[0].s[0].i[0].length;
|
3046 |
+
this.v = shape_pool.newElement();
|
3047 |
+
this.v.setPathData(this.keyframes[0].s[0].c, len);
|
3048 |
+
this.pv = shape_pool.clone(this.v);
|
3049 |
+
this.localShapeCollection = shapeCollection_pool.newShapeCollection();
|
3050 |
+
this.paths = this.localShapeCollection;
|
3051 |
+
this.paths.addShape(this.v);
|
3052 |
+
this.lastFrame = initFrame;
|
3053 |
+
this.reset = resetShape;
|
3054 |
+
this._caching = {lastFrame: initFrame, lastIndex: 0};
|
3055 |
+
this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
|
3056 |
+
}
|
3057 |
+
KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
|
3058 |
+
KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
|
3059 |
+
KeyframedShapeProperty.prototype.setVValue = setVValue;
|
3060 |
+
KeyframedShapeProperty.prototype.addEffect = addEffect;
|
3061 |
+
|
3062 |
+
var EllShapeProperty = (function(){
|
3063 |
+
|
3064 |
+
var cPoint = roundCorner;
|
3065 |
+
|
3066 |
+
function EllShapeProperty(elem,data) {
|
3067 |
+
/*this.v = {
|
3068 |
+
v: createSizedArray(4),
|
3069 |
+
i: createSizedArray(4),
|
3070 |
+
o: createSizedArray(4),
|
3071 |
+
c: true
|
3072 |
+
};*/
|
3073 |
+
this.v = shape_pool.newElement();
|
3074 |
+
this.v.setPathData(true, 4);
|
3075 |
+
this.localShapeCollection = shapeCollection_pool.newShapeCollection();
|
3076 |
+
this.paths = this.localShapeCollection;
|
3077 |
+
this.localShapeCollection.addShape(this.v);
|
3078 |
+
this.d = data.d;
|
3079 |
+
this.elem = elem;
|
3080 |
+
this.comp = elem.comp;
|
3081 |
+
this.frameId = -1;
|
3082 |
+
this.initDynamicPropertyContainer(elem);
|
3083 |
+
this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
|
3084 |
+
this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
|
3085 |
+
if(this.dynamicProperties.length){
|
3086 |
+
this.k = true;
|
3087 |
+
}else{
|
3088 |
+
this.k = false;
|
3089 |
+
this.convertEllToPath();
|
3090 |
+
}
|
3091 |
+
};
|
3092 |
+
|
3093 |
+
EllShapeProperty.prototype = {
|
3094 |
+
reset: resetShape,
|
3095 |
+
getValue: function (){
|
3096 |
+
if(this.elem.globalData.frameId === this.frameId){
|
3097 |
+
return;
|
3098 |
+
}
|
3099 |
+
this.frameId = this.elem.globalData.frameId;
|
3100 |
+
this.iterateDynamicProperties();
|
3101 |
+
|
3102 |
+
if(this._mdf){
|
3103 |
+
this.convertEllToPath();
|
3104 |
+
}
|
3105 |
+
},
|
3106 |
+
convertEllToPath: function() {
|
3107 |
+
var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
|
3108 |
+
var _cw = this.d !== 3;
|
3109 |
+
var _v = this.v;
|
3110 |
+
_v.v[0][0] = p0;
|
3111 |
+
_v.v[0][1] = p1 - s1;
|
3112 |
+
_v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
|
3113 |
+
_v.v[1][1] = p1;
|
3114 |
+
_v.v[2][0] = p0;
|
3115 |
+
_v.v[2][1] = p1 + s1;
|
3116 |
+
_v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
|
3117 |
+
_v.v[3][1] = p1;
|
3118 |
+
_v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
|
3119 |
+
_v.i[0][1] = p1 - s1;
|
3120 |
+
_v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
|
3121 |
+
_v.i[1][1] = p1 - s1 * cPoint;
|
3122 |
+
_v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
|
3123 |
+
_v.i[2][1] = p1 + s1;
|
3124 |
+
_v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
|
3125 |
+
_v.i[3][1] = p1 + s1 * cPoint;
|
3126 |
+
_v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
|
3127 |
+
_v.o[0][1] = p1 - s1;
|
3128 |
+
_v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
|
3129 |
+
_v.o[1][1] = p1 + s1 * cPoint;
|
3130 |
+
_v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
|
3131 |
+
_v.o[2][1] = p1 + s1;
|
3132 |
+
_v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
|
3133 |
+
_v.o[3][1] = p1 - s1 * cPoint;
|
3134 |
+
}
|
3135 |
+
}
|
3136 |
+
|
3137 |
+
extendPrototype([DynamicPropertyContainer], EllShapeProperty);
|
3138 |
+
|
3139 |
+
return EllShapeProperty;
|
3140 |
+
}());
|
3141 |
+
|
3142 |
+
var StarShapeProperty = (function() {
|
3143 |
+
|
3144 |
+
function StarShapeProperty(elem,data) {
|
3145 |
+
this.v = shape_pool.newElement();
|
3146 |
+
this.v.setPathData(true, 0);
|
3147 |
+
this.elem = elem;
|
3148 |
+
this.comp = elem.comp;
|
3149 |
+
this.data = data;
|
3150 |
+
this.frameId = -1;
|
3151 |
+
this.d = data.d;
|
3152 |
+
this.initDynamicPropertyContainer(elem);
|
3153 |
+
if(data.sy === 1){
|
3154 |
+
this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
|
3155 |
+
this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
|
3156 |
+
this.convertToPath = this.convertStarToPath;
|
3157 |
+
} else {
|
3158 |
+
this.convertToPath = this.convertPolygonToPath;
|
3159 |
+
}
|
3160 |
+
this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
|
3161 |
+
this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
|
3162 |
+
this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
|
3163 |
+
this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
|
3164 |
+
this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
|
3165 |
+
this.localShapeCollection = shapeCollection_pool.newShapeCollection();
|
3166 |
+
this.localShapeCollection.addShape(this.v);
|
3167 |
+
this.paths = this.localShapeCollection;
|
3168 |
+
if(this.dynamicProperties.length){
|
3169 |
+
this.k = true;
|
3170 |
+
}else{
|
3171 |
+
this.k = false;
|
3172 |
+
this.convertToPath();
|
3173 |
+
}
|
3174 |
+
};
|
3175 |
+
|
3176 |
+
StarShapeProperty.prototype = {
|
3177 |
+
reset: resetShape,
|
3178 |
+
getValue: function() {
|
3179 |
+
if(this.elem.globalData.frameId === this.frameId){
|
3180 |
+
return;
|
3181 |
+
}
|
3182 |
+
this.frameId = this.elem.globalData.frameId;
|
3183 |
+
this.iterateDynamicProperties();
|
3184 |
+
if(this._mdf){
|
3185 |
+
this.convertToPath();
|
3186 |
+
}
|
3187 |
+
},
|
3188 |
+
convertStarToPath: function() {
|
3189 |
+
var numPts = Math.floor(this.pt.v)*2;
|
3190 |
+
var angle = Math.PI*2/numPts;
|
3191 |
+
/*this.v.v.length = numPts;
|
3192 |
+
this.v.i.length = numPts;
|
3193 |
+
this.v.o.length = numPts;*/
|
3194 |
+
var longFlag = true;
|
3195 |
+
var longRad = this.or.v;
|
3196 |
+
var shortRad = this.ir.v;
|
3197 |
+
var longRound = this.os.v;
|
3198 |
+
var shortRound = this.is.v;
|
3199 |
+
var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
|
3200 |
+
var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
|
3201 |
+
var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
|
3202 |
+
currentAng += this.r.v;
|
3203 |
+
var dir = this.data.d === 3 ? -1 : 1;
|
3204 |
+
this.v._length = 0;
|
3205 |
+
for(i=0;i<numPts;i+=1){
|
3206 |
+
rad = longFlag ? longRad : shortRad;
|
3207 |
+
roundness = longFlag ? longRound : shortRound;
|
3208 |
+
perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
|
3209 |
+
var x = rad * Math.cos(currentAng);
|
3210 |
+
var y = rad * Math.sin(currentAng);
|
3211 |
+
var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
|
3212 |
+
var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
|
3213 |
+
x += + this.p.v[0];
|
3214 |
+
y += + this.p.v[1];
|
3215 |
+
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);
|
3216 |
+
|
3217 |
+
/*this.v.v[i] = [x,y];
|
3218 |
+
this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
|
3219 |
+
this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
|
3220 |
+
this.v._length = numPts;*/
|
3221 |
+
longFlag = !longFlag;
|
3222 |
+
currentAng += angle*dir;
|
3223 |
+
}
|
3224 |
+
},
|
3225 |
+
convertPolygonToPath: function() {
|
3226 |
+
var numPts = Math.floor(this.pt.v);
|
3227 |
+
var angle = Math.PI*2/numPts;
|
3228 |
+
var rad = this.or.v;
|
3229 |
+
var roundness = this.os.v;
|
3230 |
+
var perimSegment = 2*Math.PI*rad/(numPts*4);
|
3231 |
+
var i, currentAng = -Math.PI/ 2;
|
3232 |
+
var dir = this.data.d === 3 ? -1 : 1;
|
3233 |
+
currentAng += this.r.v;
|
3234 |
+
this.v._length = 0;
|
3235 |
+
for(i=0;i<numPts;i+=1){
|
3236 |
+
var x = rad * Math.cos(currentAng);
|
3237 |
+
var y = rad * Math.sin(currentAng);
|
3238 |
+
var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
|
3239 |
+
var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
|
3240 |
+
x += + this.p.v[0];
|
3241 |
+
y += + this.p.v[1];
|
3242 |
+
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);
|
3243 |
+
currentAng += angle*dir;
|
3244 |
+
}
|
3245 |
+
this.paths.length = 0;
|
3246 |
+
this.paths[0] = this.v;
|
3247 |
+
}
|
3248 |
+
|
3249 |
+
}
|
3250 |
+
extendPrototype([DynamicPropertyContainer], StarShapeProperty);
|
3251 |
+
|
3252 |
+
return StarShapeProperty;
|
3253 |
+
}());
|
3254 |
+
|
3255 |
+
var RectShapeProperty = (function() {
|
3256 |
+
|
3257 |
+
function RectShapeProperty(elem,data) {
|
3258 |
+
this.v = shape_pool.newElement();
|
3259 |
+
this.v.c = true;
|
3260 |
+
this.localShapeCollection = shapeCollection_pool.newShapeCollection();
|
3261 |
+
this.localShapeCollection.addShape(this.v);
|
3262 |
+
this.paths = this.localShapeCollection;
|
3263 |
+
this.elem = elem;
|
3264 |
+
this.comp = elem.comp;
|
3265 |
+
this.frameId = -1;
|
3266 |
+
this.d = data.d;
|
3267 |
+
this.initDynamicPropertyContainer(elem);
|
3268 |
+
this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
|
3269 |
+
this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
|
3270 |
+
this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
|
3271 |
+
if(this.dynamicProperties.length){
|
3272 |
+
this.k = true;
|
3273 |
+
}else{
|
3274 |
+
this.k = false;
|
3275 |
+
this.convertRectToPath();
|
3276 |
+
}
|
3277 |
+
};
|
3278 |
+
|
3279 |
+
RectShapeProperty.prototype = {
|
3280 |
+
convertRectToPath: function (){
|
3281 |
+
var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
|
3282 |
+
var round = bm_min(v0,v1,this.r.v);
|
3283 |
+
var cPoint = round*(1-roundCorner);
|
3284 |
+
this.v._length = 0;
|
3285 |
+
|
3286 |
+
if(this.d === 2 || this.d === 1) {
|
3287 |
+
this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
|
3288 |
+
this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
|
3289 |
+
if(round!== 0){
|
3290 |
+
this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
|
3291 |
+
this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
|
3292 |
+
this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
|
3293 |
+
this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
|
3294 |
+
this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
|
3295 |
+
this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
|
3296 |
+
} else {
|
3297 |
+
this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
|
3298 |
+
this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
|
3299 |
+
}
|
3300 |
+
}else{
|
3301 |
+
this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
|
3302 |
+
if(round!== 0){
|
3303 |
+
this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
|
3304 |
+
this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
|
3305 |
+
this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
|
3306 |
+
this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
|
3307 |
+
this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
|
3308 |
+
this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
|
3309 |
+
this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
|
3310 |
+
} else {
|
3311 |
+
this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
|
3312 |
+
this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
|
3313 |
+
this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
|
3314 |
+
|
3315 |
+
}
|
3316 |
+
}
|
3317 |
+
},
|
3318 |
+
getValue: function(frameNum){
|
3319 |
+
if(this.elem.globalData.frameId === this.frameId){
|
3320 |
+
return;
|
3321 |
+
}
|
3322 |
+
this.frameId = this.elem.globalData.frameId;
|
3323 |
+
this.iterateDynamicProperties();
|
3324 |
+
if(this._mdf){
|
3325 |
+
this.convertRectToPath();
|
3326 |
+
}
|
3327 |
+
|
3328 |
+
},
|
3329 |
+
reset: resetShape
|
3330 |
+
}
|
3331 |
+
extendPrototype([DynamicPropertyContainer], RectShapeProperty);
|
3332 |
+
|
3333 |
+
return RectShapeProperty;
|
3334 |
+
}());
|
3335 |
+
|
3336 |
+
function getShapeProp(elem,data,type){
|
3337 |
+
var prop;
|
3338 |
+
if(type === 3 || type === 4){
|
3339 |
+
var dataProp = type === 3 ? data.pt : data.ks;
|
3340 |
+
var keys = dataProp.k;
|
3341 |
+
if(keys.length){
|
3342 |
+
prop = new KeyframedShapeProperty(elem, data, type);
|
3343 |
+
}else{
|
3344 |
+
prop = new ShapeProperty(elem, data, type);
|
3345 |
+
}
|
3346 |
+
}else if(type === 5){
|
3347 |
+
prop = new RectShapeProperty(elem, data);
|
3348 |
+
}else if(type === 6){
|
3349 |
+
prop = new EllShapeProperty(elem, data);
|
3350 |
+
}else if(type === 7){
|
3351 |
+
prop = new StarShapeProperty(elem, data);
|
3352 |
+
}
|
3353 |
+
if(prop.k){
|
3354 |
+
elem.addDynamicProperty(prop);
|
3355 |
+
}
|
3356 |
+
return prop;
|
3357 |
+
}
|
3358 |
+
|
3359 |
+
function getConstructorFunction() {
|
3360 |
+
return ShapeProperty;
|
3361 |
+
}
|
3362 |
+
|
3363 |
+
function getKeyframedConstructorFunction() {
|
3364 |
+
return KeyframedShapeProperty;
|
3365 |
+
}
|
3366 |
+
|
3367 |
+
var ob = {};
|
3368 |
+
ob.getShapeProp = getShapeProp;
|
3369 |
+
ob.getConstructorFunction = getConstructorFunction;
|
3370 |
+
ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
|
3371 |
+
return ob;
|
3372 |
+
}());
|
3373 |
+
var ShapeModifiers = (function(){
|
3374 |
+
var ob = {};
|
3375 |
+
var modifiers = {};
|
3376 |
+
ob.registerModifier = registerModifier;
|
3377 |
+
ob.getModifier = getModifier;
|
3378 |
+
|
3379 |
+
function registerModifier(nm,factory){
|
3380 |
+
if(!modifiers[nm]){
|
3381 |
+
modifiers[nm] = factory;
|
3382 |
+
}
|
3383 |
+
}
|
3384 |
+
|
3385 |
+
function getModifier(nm,elem, data){
|
3386 |
+
return new modifiers[nm](elem, data);
|
3387 |
+
}
|
3388 |
+
|
3389 |
+
return ob;
|
3390 |
+
}());
|
3391 |
+
|
3392 |
+
function ShapeModifier(){}
|
3393 |
+
ShapeModifier.prototype.initModifierProperties = function(){};
|
3394 |
+
ShapeModifier.prototype.addShapeToModifier = function(){};
|
3395 |
+
ShapeModifier.prototype.addShape = function(data){
|
3396 |
+
if (!this.closed) {
|
3397 |
+
// 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.
|
3398 |
+
data.sh.container.addDynamicProperty(data.sh);
|
3399 |
+
var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
|
3400 |
+
this.shapes.push(shapeData);
|
3401 |
+
this.addShapeToModifier(shapeData);
|
3402 |
+
if (this._isAnimated) {
|
3403 |
+
data.setAsAnimated();
|
3404 |
+
}
|
3405 |
+
}
|
3406 |
+
};
|
3407 |
+
ShapeModifier.prototype.init = function(elem,data){
|
3408 |
+
this.shapes = [];
|
3409 |
+
this.elem = elem;
|
3410 |
+
this.initDynamicPropertyContainer(elem);
|
3411 |
+
this.initModifierProperties(elem,data);
|
3412 |
+
this.frameId = initialDefaultFrame;
|
3413 |
+
this.closed = false;
|
3414 |
+
this.k = false;
|
3415 |
+
if(this.dynamicProperties.length){
|
3416 |
+
this.k = true;
|
3417 |
+
}else{
|
3418 |
+
this.getValue(true);
|
3419 |
+
}
|
3420 |
+
};
|
3421 |
+
ShapeModifier.prototype.processKeys = function(){
|
3422 |
+
if(this.elem.globalData.frameId === this.frameId){
|
3423 |
+
return;
|
3424 |
+
}
|
3425 |
+
this.frameId = this.elem.globalData.frameId;
|
3426 |
+
this.iterateDynamicProperties();
|
3427 |
+
};
|
3428 |
+
|
3429 |
+
extendPrototype([DynamicPropertyContainer], ShapeModifier);
|
3430 |
+
function TrimModifier(){
|
3431 |
+
}
|
3432 |
+
extendPrototype([ShapeModifier], TrimModifier);
|
3433 |
+
TrimModifier.prototype.initModifierProperties = function(elem, data) {
|
3434 |
+
this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
|
3435 |
+
this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
|
3436 |
+
this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
|
3437 |
+
this.sValue = 0;
|
3438 |
+
this.eValue = 0;
|
3439 |
+
this.getValue = this.processKeys;
|
3440 |
+
this.m = data.m;
|
3441 |
+
this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
|
3442 |
+
};
|
3443 |
+
|
3444 |
+
TrimModifier.prototype.addShapeToModifier = function(shapeData){
|
3445 |
+
shapeData.pathsData = [];
|
3446 |
+
};
|
3447 |
+
|
3448 |
+
TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
|
3449 |
+
var segments = [];
|
3450 |
+
if (e <= 1) {
|
3451 |
+
segments.push({
|
3452 |
+
s: s,
|
3453 |
+
e: e
|
3454 |
+
});
|
3455 |
+
} else if (s >= 1) {
|
3456 |
+
segments.push({
|
3457 |
+
s: s - 1,
|
3458 |
+
e: e - 1
|
3459 |
+
});
|
3460 |
+
} else {
|
3461 |
+
segments.push({
|
3462 |
+
s: s,
|
3463 |
+
e: 1
|
3464 |
+
});
|
3465 |
+
segments.push({
|
3466 |
+
s: 0,
|
3467 |
+
e: e - 1
|
3468 |
+
});
|
3469 |
+
}
|
3470 |
+
var shapeSegments = [];
|
3471 |
+
var i, len = segments.length, segmentOb;
|
3472 |
+
for (i = 0; i < len; i += 1) {
|
3473 |
+
segmentOb = segments[i];
|
3474 |
+
if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
|
3475 |
+
|
3476 |
+
} else {
|
3477 |
+
var shapeS, shapeE;
|
3478 |
+
if (segmentOb.s * totalModifierLength <= addedLength) {
|
3479 |
+
shapeS = 0;
|
3480 |
+
} else {
|
3481 |
+
shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
|
3482 |
+
}
|
3483 |
+
if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
|
3484 |
+
shapeE = 1;
|
3485 |
+
} else {
|
3486 |
+
shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
|
3487 |
+
}
|
3488 |
+
shapeSegments.push([shapeS, shapeE]);
|
3489 |
+
}
|
3490 |
+
}
|
3491 |
+
if (!shapeSegments.length) {
|
3492 |
+
shapeSegments.push([0, 0]);
|
3493 |
+
}
|
3494 |
+
return shapeSegments;
|
3495 |
+
};
|
3496 |
+
|
3497 |
+
TrimModifier.prototype.releasePathsData = function(pathsData) {
|
3498 |
+
var i, len = pathsData.length;
|
3499 |
+
for (i = 0; i < len; i += 1) {
|
3500 |
+
segments_length_pool.release(pathsData[i]);
|
3501 |
+
}
|
3502 |
+
pathsData.length = 0;
|
3503 |
+
return pathsData;
|
3504 |
+
};
|
3505 |
+
|
3506 |
+
TrimModifier.prototype.processShapes = function(_isFirstFrame) {
|
3507 |
+
var s, e;
|
3508 |
+
if (this._mdf || _isFirstFrame) {
|
3509 |
+
var o = (this.o.v % 360) / 360;
|
3510 |
+
if (o < 0) {
|
3511 |
+
o += 1;
|
3512 |
+
}
|
3513 |
+
s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
|
3514 |
+
e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
|
3515 |
+
if (s === e) {
|
3516 |
+
|
3517 |
+
}
|
3518 |
+
if (s > e) {
|
3519 |
+
var _s = s;
|
3520 |
+
s = e;
|
3521 |
+
e = _s;
|
3522 |
+
}
|
3523 |
+
s = Math.round(s * 10000) * 0.0001;
|
3524 |
+
e = Math.round(e * 10000) * 0.0001;
|
3525 |
+
this.sValue = s;
|
3526 |
+
this.eValue = e;
|
3527 |
+
} else {
|
3528 |
+
s = this.sValue;
|
3529 |
+
e = this.eValue;
|
3530 |
+
}
|
3531 |
+
var shapePaths;
|
3532 |
+
var i, len = this.shapes.length, j, jLen;
|
3533 |
+
var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
|
3534 |
+
|
3535 |
+
if (e === s) {
|
3536 |
+
for (i = 0; i < len; i += 1) {
|
3537 |
+
this.shapes[i].localShapeCollection.releaseShapes();
|
3538 |
+
this.shapes[i].shape._mdf = true;
|
3539 |
+
this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
|
3540 |
+
}
|
3541 |
+
} else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
|
3542 |
+
var segments = [], shapeData, localShapeCollection;
|
3543 |
+
for (i = 0; i < len; i += 1) {
|
3544 |
+
shapeData = this.shapes[i];
|
3545 |
+
// if shape hasn't changed and trim properties haven't changed, cached previous path can be used
|
3546 |
+
if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
|
3547 |
+
shapeData.shape.paths = shapeData.localShapeCollection;
|
3548 |
+
} else {
|
3549 |
+
shapePaths = shapeData.shape.paths;
|
3550 |
+
jLen = shapePaths._length;
|
3551 |
+
totalShapeLength = 0;
|
3552 |
+
if (!shapeData.shape._mdf && shapeData.pathsData.length) {
|
3553 |
+
totalShapeLength = shapeData.totalShapeLength;
|
3554 |
+
} else {
|
3555 |
+
pathsData = this.releasePathsData(shapeData.pathsData);
|
3556 |
+
for (j = 0; j < jLen; j += 1) {
|
3557 |
+
pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
|
3558 |
+
pathsData.push(pathData);
|
3559 |
+
totalShapeLength += pathData.totalLength;
|
3560 |
+
}
|
3561 |
+
shapeData.totalShapeLength = totalShapeLength;
|
3562 |
+
shapeData.pathsData = pathsData;
|
3563 |
+
}
|
3564 |
+
|
3565 |
+
totalModifierLength += totalShapeLength;
|
3566 |
+
shapeData.shape._mdf = true;
|
3567 |
+
}
|
3568 |
+
}
|
3569 |
+
var shapeS = s, shapeE = e, addedLength = 0, edges;
|
3570 |
+
for (i = len - 1; i >= 0; i -= 1) {
|
3571 |
+
shapeData = this.shapes[i];
|
3572 |
+
if (shapeData.shape._mdf) {
|
3573 |
+
localShapeCollection = shapeData.localShapeCollection;
|
3574 |
+
localShapeCollection.releaseShapes();
|
3575 |
+
//if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
|
3576 |
+
if (this.m === 2 && len > 1) {
|
3577 |
+
edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
|
3578 |
+
addedLength += shapeData.totalShapeLength;
|
3579 |
+
} else {
|
3580 |
+
edges = [[shapeS, shapeE]];
|
3581 |
+
}
|
3582 |
+
jLen = edges.length;
|
3583 |
+
for (j = 0; j < jLen; j += 1) {
|
3584 |
+
shapeS = edges[j][0];
|
3585 |
+
shapeE = edges[j][1];
|
3586 |
+
segments.length = 0;
|
3587 |
+
if (shapeE <= 1) {
|
3588 |
+
segments.push({
|
3589 |
+
s:shapeData.totalShapeLength * shapeS,
|
3590 |
+
e:shapeData.totalShapeLength * shapeE
|
3591 |
+
});
|
3592 |
+
} else if (shapeS >= 1) {
|
3593 |
+
segments.push({
|
3594 |
+
s:shapeData.totalShapeLength * (shapeS - 1),
|
3595 |
+
e:shapeData.totalShapeLength * (shapeE - 1)
|
3596 |
+
});
|
3597 |
+
} else {
|
3598 |
+
segments.push({
|
3599 |
+
s:shapeData.totalShapeLength * shapeS,
|
3600 |
+
e:shapeData.totalShapeLength
|
3601 |
+
});
|
3602 |
+
segments.push({
|
3603 |
+
s:0,
|
3604 |
+
e:shapeData.totalShapeLength * (shapeE - 1)
|
3605 |
+
});
|
3606 |
+
}
|
3607 |
+
var newShapesData = this.addShapes(shapeData,segments[0]);
|
3608 |
+
if (segments[0].s !== segments[0].e) {
|
3609 |
+
if (segments.length > 1) {
|
3610 |
+
var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
|
3611 |
+
if (lastShapeInCollection.c) {
|
3612 |
+
var lastShape = newShapesData.pop();
|
3613 |
+
this.addPaths(newShapesData, localShapeCollection);
|
3614 |
+
newShapesData = this.addShapes(shapeData, segments[1], lastShape);
|
3615 |
+
} else {
|
3616 |
+
this.addPaths(newShapesData, localShapeCollection);
|
3617 |
+
newShapesData = this.addShapes(shapeData, segments[1]);
|
3618 |
+
}
|
3619 |
+
}
|
3620 |
+
this.addPaths(newShapesData, localShapeCollection);
|
3621 |
+
}
|
3622 |
+
|
3623 |
+
}
|
3624 |
+
shapeData.shape.paths = localShapeCollection;
|
3625 |
+
}
|
3626 |
+
}
|
3627 |
+
} else if (this._mdf) {
|
3628 |
+
for (i = 0; i < len; i += 1) {
|
3629 |
+
//Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
|
3630 |
+
//Don't remove this even if it's losing cached info.
|
3631 |
+
this.shapes[i].pathsData.length = 0;
|
3632 |
+
this.shapes[i].shape._mdf = true;
|
3633 |
+
}
|
3634 |
+
}
|
3635 |
+
};
|
3636 |
+
|
3637 |
+
TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
|
3638 |
+
var i, len = newPaths.length;
|
3639 |
+
for (i = 0; i < len; i += 1) {
|
3640 |
+
localShapeCollection.addShape(newPaths[i]);
|
3641 |
+
}
|
3642 |
+
};
|
3643 |
+
|
3644 |
+
TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
|
3645 |
+
shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
|
3646 |
+
shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
|
3647 |
+
if(newShape){
|
3648 |
+
shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
|
3649 |
+
}
|
3650 |
+
shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
|
3651 |
+
};
|
3652 |
+
|
3653 |
+
TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
|
3654 |
+
shapePath.setXYAt(points[1], points[5], 'o', pos);
|
3655 |
+
shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
|
3656 |
+
if(newShape){
|
3657 |
+
shapePath.setXYAt(points[0], points[4], 'v', pos);
|
3658 |
+
}
|
3659 |
+
shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
|
3660 |
+
};
|
3661 |
+
|
3662 |
+
TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
|
3663 |
+
var pathsData = shapeData.pathsData;
|
3664 |
+
var shapePaths = shapeData.shape.paths.shapes;
|
3665 |
+
var i, len = shapeData.shape.paths._length, j, jLen;
|
3666 |
+
var addedLength = 0;
|
3667 |
+
var currentLengthData,segmentCount;
|
3668 |
+
var lengths;
|
3669 |
+
var segment;
|
3670 |
+
var shapes = [];
|
3671 |
+
var initPos;
|
3672 |
+
var newShape = true;
|
3673 |
+
if (!shapePath) {
|
3674 |
+
shapePath = shape_pool.newElement();
|
3675 |
+
segmentCount = 0;
|
3676 |
+
initPos = 0;
|
3677 |
+
} else {
|
3678 |
+
segmentCount = shapePath._length;
|
3679 |
+
initPos = shapePath._length;
|
3680 |
+
}
|
3681 |
+
shapes.push(shapePath);
|
3682 |
+
for (i = 0; i < len; i += 1) {
|
3683 |
+
lengths = pathsData[i].lengths;
|
3684 |
+
shapePath.c = shapePaths[i].c;
|
3685 |
+
jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
|
3686 |
+
for (j = 1; j < jLen; j +=1) {
|
3687 |
+
currentLengthData = lengths[j-1];
|
3688 |
+
if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
|
3689 |
+
addedLength += currentLengthData.addedLength;
|
3690 |
+
shapePath.c = false;
|
3691 |
+
} else if(addedLength > shapeSegment.e) {
|
3692 |
+
shapePath.c = false;
|
3693 |
+
break;
|
3694 |
+
} else {
|
3695 |
+
if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
|
3696 |
+
this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
|
3697 |
+
newShape = false;
|
3698 |
+
} else {
|
3699 |
+
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]);
|
3700 |
+
this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
|
3701 |
+
// this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
|
3702 |
+
newShape = false;
|
3703 |
+
shapePath.c = false;
|
3704 |
+
}
|
3705 |
+
addedLength += currentLengthData.addedLength;
|
3706 |
+
segmentCount += 1;
|
3707 |
+
}
|
3708 |
+
}
|
3709 |
+
if (shapePaths[i].c && lengths.length) {
|
3710 |
+
currentLengthData = lengths[j - 1];
|
3711 |
+
if (addedLength <= shapeSegment.e) {
|
3712 |
+
var segmentLength = lengths[j - 1].addedLength;
|
3713 |
+
if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
|
3714 |
+
this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
|
3715 |
+
newShape = false;
|
3716 |
+
} else {
|
3717 |
+
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]);
|
3718 |
+
this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
|
3719 |
+
// this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
|
3720 |
+
newShape = false;
|
3721 |
+
shapePath.c = false;
|
3722 |
+
}
|
3723 |
+
} else {
|
3724 |
+
shapePath.c = false;
|
3725 |
+
}
|
3726 |
+
addedLength += currentLengthData.addedLength;
|
3727 |
+
segmentCount += 1;
|
3728 |
+
}
|
3729 |
+
if (shapePath._length) {
|
3730 |
+
shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
|
3731 |
+
shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
|
3732 |
+
}
|
3733 |
+
if (addedLength > shapeSegment.e) {
|
3734 |
+
break;
|
3735 |
+
}
|
3736 |
+
if (i < len - 1) {
|
3737 |
+
shapePath = shape_pool.newElement();
|
3738 |
+
newShape = true;
|
3739 |
+
shapes.push(shapePath);
|
3740 |
+
segmentCount = 0;
|
3741 |
+
}
|
3742 |
+
}
|
3743 |
+
return shapes;
|
3744 |
+
};
|
3745 |
+
|
3746 |
+
|
3747 |
+
ShapeModifiers.registerModifier('tm', TrimModifier);
|
3748 |
+
function RoundCornersModifier(){}
|
3749 |
+
extendPrototype([ShapeModifier],RoundCornersModifier);
|
3750 |
+
RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
|
3751 |
+
this.getValue = this.processKeys;
|
3752 |
+
this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
|
3753 |
+
this._isAnimated = !!this.rd.effectsSequence.length;
|
3754 |
+
};
|
3755 |
+
|
3756 |
+
RoundCornersModifier.prototype.processPath = function(path, round){
|
3757 |
+
var cloned_path = shape_pool.newElement();
|
3758 |
+
cloned_path.c = path.c;
|
3759 |
+
var i, len = path._length;
|
3760 |
+
var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
|
3761 |
+
var vX,vY,oX,oY,iX,iY;
|
3762 |
+
for(i=0;i<len;i+=1){
|
3763 |
+
currentV = path.v[i];
|
3764 |
+
currentO = path.o[i];
|
3765 |
+
currentI = path.i[i];
|
3766 |
+
if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
|
3767 |
+
if((i===0 || i === len - 1) && !path.c){
|
3768 |
+
cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
|
3769 |
+
/*cloned_path.v[index] = currentV;
|
3770 |
+
cloned_path.o[index] = currentO;
|
3771 |
+
cloned_path.i[index] = currentI;*/
|
3772 |
+
index += 1;
|
3773 |
+
} else {
|
3774 |
+
if(i===0){
|
3775 |
+
closerV = path.v[len-1];
|
3776 |
+
} else {
|
3777 |
+
closerV = path.v[i-1];
|
3778 |
+
}
|
3779 |
+
distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
|
3780 |
+
newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
|
3781 |
+
vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
|
3782 |
+
vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
|
3783 |
+
oX = vX-(vX-currentV[0])*roundCorner;
|
3784 |
+
oY = vY-(vY-currentV[1])*roundCorner;
|
3785 |
+
cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
|
3786 |
+
index += 1;
|
3787 |
+
|
3788 |
+
if(i === len - 1){
|
3789 |
+
closerV = path.v[0];
|
3790 |
+
} else {
|
3791 |
+
closerV = path.v[i+1];
|
3792 |
+
}
|
3793 |
+
distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
|
3794 |
+
newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
|
3795 |
+
vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
|
3796 |
+
vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
|
3797 |
+
iX = vX-(vX-currentV[0])*roundCorner;
|
3798 |
+
iY = vY-(vY-currentV[1])*roundCorner;
|
3799 |
+
cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
|
3800 |
+
index += 1;
|
3801 |
+
}
|
3802 |
+
} else {
|
3803 |
+
cloned_path.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);
|
3804 |
+
index += 1;
|
3805 |
+
}
|
3806 |
+
}
|
3807 |
+
return cloned_path;
|
3808 |
+
};
|
3809 |
+
|
3810 |
+
RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
|
3811 |
+
var shapePaths;
|
3812 |
+
var i, len = this.shapes.length;
|
3813 |
+
var j, jLen;
|
3814 |
+
var rd = this.rd.v;
|
3815 |
+
|
3816 |
+
if(rd !== 0){
|
3817 |
+
var shapeData, newPaths, localShapeCollection;
|
3818 |
+
for(i=0;i<len;i+=1){
|
3819 |
+
shapeData = this.shapes[i];
|
3820 |
+
newPaths = shapeData.shape.paths;
|
3821 |
+
localShapeCollection = shapeData.localShapeCollection;
|
3822 |
+
if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
|
3823 |
+
localShapeCollection.releaseShapes();
|
3824 |
+
shapeData.shape._mdf = true;
|
3825 |
+
shapePaths = shapeData.shape.paths.shapes;
|
3826 |
+
jLen = shapeData.shape.paths._length;
|
3827 |
+
for(j=0;j<jLen;j+=1){
|
3828 |
+
localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
|
3829 |
+
}
|
3830 |
+
}
|
3831 |
+
shapeData.shape.paths = shapeData.localShapeCollection;
|
3832 |
+
}
|
3833 |
+
|
3834 |
+
}
|
3835 |
+
if(!this.dynamicProperties.length){
|
3836 |
+
this._mdf = false;
|
3837 |
+
}
|
3838 |
+
};
|
3839 |
+
|
3840 |
+
ShapeModifiers.registerModifier('rd',RoundCornersModifier);
|
3841 |
+
function RepeaterModifier(){}
|
3842 |
+
extendPrototype([ShapeModifier], RepeaterModifier);
|
3843 |
+
|
3844 |
+
RepeaterModifier.prototype.initModifierProperties = function(elem,data){
|
3845 |
+
this.getValue = this.processKeys;
|
3846 |
+
this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
|
3847 |
+
this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
|
3848 |
+
this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
|
3849 |
+
this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
|
3850 |
+
this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
|
3851 |
+
this.data = data;
|
3852 |
+
if(!this.dynamicProperties.length){
|
3853 |
+
this.getValue(true);
|
3854 |
+
}
|
3855 |
+
this._isAnimated = !!this.dynamicProperties.length;
|
3856 |
+
this.pMatrix = new Matrix();
|
3857 |
+
this.rMatrix = new Matrix();
|
3858 |
+
this.sMatrix = new Matrix();
|
3859 |
+
this.tMatrix = new Matrix();
|
3860 |
+
this.matrix = new Matrix();
|
3861 |
+
};
|
3862 |
+
|
3863 |
+
RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
|
3864 |
+
var dir = inv ? -1 : 1;
|
3865 |
+
var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
|
3866 |
+
var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
|
3867 |
+
pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
|
3868 |
+
rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
|
3869 |
+
rMatrix.rotate(-transform.r.v * dir * perc);
|
3870 |
+
rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
|
3871 |
+
sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
|
3872 |
+
sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
|
3873 |
+
sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
|
3874 |
+
};
|
3875 |
+
|
3876 |
+
RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
|
3877 |
+
this.elem = elem;
|
3878 |
+
this.arr = arr;
|
3879 |
+
this.pos = pos;
|
3880 |
+
this.elemsData = elemsData;
|
3881 |
+
this._currentCopies = 0;
|
3882 |
+
this._elements = [];
|
3883 |
+
this._groups = [];
|
3884 |
+
this.frameId = -1;
|
3885 |
+
this.initDynamicPropertyContainer(elem);
|
3886 |
+
this.initModifierProperties(elem,arr[pos]);
|
3887 |
+
var cont = 0;
|
3888 |
+
while(pos>0){
|
3889 |
+
pos -= 1;
|
3890 |
+
//this._elements.unshift(arr.splice(pos,1)[0]);
|
3891 |
+
this._elements.unshift(arr[pos]);
|
3892 |
+
cont += 1;
|
3893 |
+
}
|
3894 |
+
if(this.dynamicProperties.length){
|
3895 |
+
this.k = true;
|
3896 |
+
}else{
|
3897 |
+
this.getValue(true);
|
3898 |
+
}
|
3899 |
+
};
|
3900 |
+
|
3901 |
+
RepeaterModifier.prototype.resetElements = function(elements){
|
3902 |
+
var i, len = elements.length;
|
3903 |
+
for(i = 0; i < len; i += 1) {
|
3904 |
+
elements[i]._processed = false;
|
3905 |
+
if(elements[i].ty === 'gr'){
|
3906 |
+
this.resetElements(elements[i].it);
|
3907 |
+
}
|
3908 |
+
}
|
3909 |
+
};
|
3910 |
+
|
3911 |
+
RepeaterModifier.prototype.cloneElements = function(elements){
|
3912 |
+
var i, len = elements.length;
|
3913 |
+
var newElements = JSON.parse(JSON.stringify(elements));
|
3914 |
+
this.resetElements(newElements);
|
3915 |
+
return newElements;
|
3916 |
+
};
|
3917 |
+
|
3918 |
+
RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
|
3919 |
+
var i, len = elements.length;
|
3920 |
+
for(i = 0; i < len; i += 1) {
|
3921 |
+
elements[i]._render = renderFlag;
|
3922 |
+
if(elements[i].ty === 'gr') {
|
3923 |
+
this.changeGroupRender(elements[i].it, renderFlag);
|
3924 |
+
}
|
3925 |
+
}
|
3926 |
+
};
|
3927 |
+
|
3928 |
+
RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
|
3929 |
+
var items, itemsTransform, i, dir, cont;
|
3930 |
+
if(this._mdf || _isFirstFrame){
|
3931 |
+
var copies = Math.ceil(this.c.v);
|
3932 |
+
if(this._groups.length < copies){
|
3933 |
+
while(this._groups.length < copies){
|
3934 |
+
var group = {
|
3935 |
+
it:this.cloneElements(this._elements),
|
3936 |
+
ty:'gr'
|
3937 |
+
};
|
3938 |
+
group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
|
3939 |
+
|
3940 |
+
this.arr.splice(0,0,group);
|
3941 |
+
this._groups.splice(0,0,group);
|
3942 |
+
this._currentCopies += 1;
|
3943 |
+
}
|
3944 |
+
this.elem.reloadShapes();
|
3945 |
+
}
|
3946 |
+
cont = 0;
|
3947 |
+
var renderFlag;
|
3948 |
+
for(i = 0; i <= this._groups.length - 1; i += 1){
|
3949 |
+
renderFlag = cont < copies;
|
3950 |
+
this._groups[i]._render = renderFlag;
|
3951 |
+
this.changeGroupRender(this._groups[i].it, renderFlag);
|
3952 |
+
cont += 1;
|
3953 |
+
}
|
3954 |
+
|
3955 |
+
this._currentCopies = copies;
|
3956 |
+
////
|
3957 |
+
|
3958 |
+
var offset = this.o.v;
|
3959 |
+
var offsetModulo = offset%1;
|
3960 |
+
var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
|
3961 |
+
var k;
|
3962 |
+
var tMat = this.tr.v.props;
|
3963 |
+
var pProps = this.pMatrix.props;
|
3964 |
+
var rProps = this.rMatrix.props;
|
3965 |
+
var sProps = this.sMatrix.props;
|
3966 |
+
this.pMatrix.reset();
|
3967 |
+
this.rMatrix.reset();
|
3968 |
+
this.sMatrix.reset();
|
3969 |
+
this.tMatrix.reset();
|
3970 |
+
this.matrix.reset();
|
3971 |
+
var iteration = 0;
|
3972 |
+
|
3973 |
+
if(offset > 0) {
|
3974 |
+
while(iteration<roundOffset){
|
3975 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
|
3976 |
+
iteration += 1;
|
3977 |
+
}
|
3978 |
+
if(offsetModulo){
|
3979 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
|
3980 |
+
iteration += offsetModulo;
|
3981 |
+
}
|
3982 |
+
} else if(offset < 0) {
|
3983 |
+
while(iteration>roundOffset){
|
3984 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
|
3985 |
+
iteration -= 1;
|
3986 |
+
}
|
3987 |
+
if(offsetModulo){
|
3988 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
|
3989 |
+
iteration -= offsetModulo;
|
3990 |
+
}
|
3991 |
+
}
|
3992 |
+
i = this.data.m === 1 ? 0 : this._currentCopies - 1;
|
3993 |
+
dir = this.data.m === 1 ? 1 : -1;
|
3994 |
+
cont = this._currentCopies;
|
3995 |
+
var j, jLen;
|
3996 |
+
while(cont){
|
3997 |
+
items = this.elemsData[i].it;
|
3998 |
+
itemsTransform = items[items.length - 1].transform.mProps.v.props;
|
3999 |
+
jLen = itemsTransform.length;
|
4000 |
+
items[items.length - 1].transform.mProps._mdf = true;
|
4001 |
+
items[items.length - 1].transform.op._mdf = true;
|
4002 |
+
items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
|
4003 |
+
if(iteration !== 0){
|
4004 |
+
if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
|
4005 |
+
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
|
4006 |
+
}
|
4007 |
+
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]);
|
4008 |
+
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]);
|
4009 |
+
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]);
|
4010 |
+
|
4011 |
+
for(j=0;j<jLen;j+=1) {
|
4012 |
+
itemsTransform[j] = this.matrix.props[j];
|
4013 |
+
}
|
4014 |
+
this.matrix.reset();
|
4015 |
+
} else {
|
4016 |
+
this.matrix.reset();
|
4017 |
+
for(j=0;j<jLen;j+=1) {
|
4018 |
+
itemsTransform[j] = this.matrix.props[j];
|
4019 |
+
}
|
4020 |
+
}
|
4021 |
+
iteration += 1;
|
4022 |
+
cont -= 1;
|
4023 |
+
i += dir;
|
4024 |
+
}
|
4025 |
+
} else {
|
4026 |
+
cont = this._currentCopies;
|
4027 |
+
i = 0;
|
4028 |
+
dir = 1;
|
4029 |
+
while(cont){
|
4030 |
+
items = this.elemsData[i].it;
|
4031 |
+
itemsTransform = items[items.length - 1].transform.mProps.v.props;
|
4032 |
+
items[items.length - 1].transform.mProps._mdf = false;
|
4033 |
+
items[items.length - 1].transform.op._mdf = false;
|
4034 |
+
cont -= 1;
|
4035 |
+
i += dir;
|
4036 |
+
}
|
4037 |
+
}
|
4038 |
+
};
|
4039 |
+
|
4040 |
+
RepeaterModifier.prototype.addShape = function(){};
|
4041 |
+
|
4042 |
+
ShapeModifiers.registerModifier('rp',RepeaterModifier);
|
4043 |
+
function ShapeCollection(){
|
4044 |
+
this._length = 0;
|
4045 |
+
this._maxLength = 4;
|
4046 |
+
this.shapes = createSizedArray(this._maxLength);
|
4047 |
+
}
|
4048 |
+
|
4049 |
+
ShapeCollection.prototype.addShape = function(shapeData){
|
4050 |
+
if(this._length === this._maxLength){
|
4051 |
+
this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
|
4052 |
+
this._maxLength *= 2;
|
4053 |
+
}
|
4054 |
+
this.shapes[this._length] = shapeData;
|
4055 |
+
this._length += 1;
|
4056 |
+
};
|
4057 |
+
|
4058 |
+
ShapeCollection.prototype.releaseShapes = function(){
|
4059 |
+
var i;
|
4060 |
+
for(i = 0; i < this._length; i += 1) {
|
4061 |
+
shape_pool.release(this.shapes[i]);
|
4062 |
+
}
|
4063 |
+
this._length = 0;
|
4064 |
+
};
|
4065 |
+
function DashProperty(elem, data, renderer, container) {
|
4066 |
+
this.elem = elem;
|
4067 |
+
this.frameId = -1;
|
4068 |
+
this.dataProps = createSizedArray(data.length);
|
4069 |
+
this.renderer = renderer;
|
4070 |
+
this.k = false;
|
4071 |
+
this.dashStr = '';
|
4072 |
+
this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
|
4073 |
+
this.dashoffset = createTypedArray('float32', 1);
|
4074 |
+
this.initDynamicPropertyContainer(container);
|
4075 |
+
var i, len = data.length || 0, prop;
|
4076 |
+
for(i = 0; i < len; i += 1) {
|
4077 |
+
prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
|
4078 |
+
this.k = prop.k || this.k;
|
4079 |
+
this.dataProps[i] = {n:data[i].n,p:prop};
|
4080 |
+
}
|
4081 |
+
if(!this.k){
|
4082 |
+
this.getValue(true);
|
4083 |
+
}
|
4084 |
+
this._isAnimated = this.k;
|
4085 |
+
}
|
4086 |
+
|
4087 |
+
DashProperty.prototype.getValue = function(forceRender) {
|
4088 |
+
if(this.elem.globalData.frameId === this.frameId && !forceRender){
|
4089 |
+
return;
|
4090 |
+
}
|
4091 |
+
this.frameId = this.elem.globalData.frameId;
|
4092 |
+
this.iterateDynamicProperties();
|
4093 |
+
this._mdf = this._mdf || forceRender;
|
4094 |
+
if (this._mdf) {
|
4095 |
+
var i = 0, len = this.dataProps.length;
|
4096 |
+
if(this.renderer === 'svg') {
|
4097 |
+
this.dashStr = '';
|
4098 |
+
}
|
4099 |
+
for(i=0;i<len;i+=1){
|
4100 |
+
if(this.dataProps[i].n != 'o'){
|
4101 |
+
if(this.renderer === 'svg') {
|
4102 |
+
this.dashStr += ' ' + this.dataProps[i].p.v;
|
4103 |
+
}else{
|
4104 |
+
this.dashArray[i] = this.dataProps[i].p.v;
|
4105 |
+
}
|
4106 |
+
}else{
|
4107 |
+
this.dashoffset[0] = this.dataProps[i].p.v;
|
4108 |
+
}
|
4109 |
+
}
|
4110 |
+
}
|
4111 |
+
};
|
4112 |
+
extendPrototype([DynamicPropertyContainer], DashProperty);
|
4113 |
+
function GradientProperty(elem,data,container){
|
4114 |
+
this.data = data;
|
4115 |
+
this.c = createTypedArray('uint8c', data.p*4);
|
4116 |
+
var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
|
4117 |
+
this.o = createTypedArray('float32', cLength);
|
4118 |
+
this._cmdf = false;
|
4119 |
+
this._omdf = false;
|
4120 |
+
this._collapsable = this.checkCollapsable();
|
4121 |
+
this._hasOpacity = cLength;
|
4122 |
+
this.initDynamicPropertyContainer(container);
|
4123 |
+
this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
|
4124 |
+
this.k = this.prop.k;
|
4125 |
+
this.getValue(true);
|
4126 |
+
}
|
4127 |
+
|
4128 |
+
GradientProperty.prototype.comparePoints = function(values, points) {
|
4129 |
+
var i = 0, len = this.o.length/2, diff;
|
4130 |
+
while(i < len) {
|
4131 |
+
diff = Math.abs(values[i*4] - values[points*4 + i*2]);
|
4132 |
+
if(diff > 0.01){
|
4133 |
+
return false;
|
4134 |
+
}
|
4135 |
+
i += 1;
|
4136 |
+
}
|
4137 |
+
return true;
|
4138 |
+
};
|
4139 |
+
|
4140 |
+
GradientProperty.prototype.checkCollapsable = function() {
|
4141 |
+
if (this.o.length/2 !== this.c.length/4) {
|
4142 |
+
return false;
|
4143 |
+
}
|
4144 |
+
if (this.data.k.k[0].s) {
|
4145 |
+
var i = 0, len = this.data.k.k.length;
|
4146 |
+
while (i < len) {
|
4147 |
+
if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
|
4148 |
+
return false;
|
4149 |
+
}
|
4150 |
+
i += 1;
|
4151 |
+
}
|
4152 |
+
} else if(!this.comparePoints(this.data.k.k, this.data.p)) {
|
4153 |
+
return false;
|
4154 |
+
}
|
4155 |
+
return true;
|
4156 |
+
};
|
4157 |
+
|
4158 |
+
GradientProperty.prototype.getValue = function(forceRender){
|
4159 |
+
this.prop.getValue();
|
4160 |
+
this._mdf = false;
|
4161 |
+
this._cmdf = false;
|
4162 |
+
this._omdf = false;
|
4163 |
+
if(this.prop._mdf || forceRender){
|
4164 |
+
var i, len = this.data.p*4;
|
4165 |
+
var mult, val;
|
4166 |
+
for(i=0;i<len;i+=1){
|
4167 |
+
mult = i%4 === 0 ? 100 : 255;
|
4168 |
+
val = Math.round(this.prop.v[i]*mult);
|
4169 |
+
if(this.c[i] !== val){
|
4170 |
+
this.c[i] = val;
|
4171 |
+
this._cmdf = !forceRender;
|
4172 |
+
}
|
4173 |
+
}
|
4174 |
+
if(this.o.length){
|
4175 |
+
len = this.prop.v.length;
|
4176 |
+
for(i=this.data.p*4;i<len;i+=1){
|
4177 |
+
mult = i%2 === 0 ? 100 : 1;
|
4178 |
+
val = i%2 === 0 ? Math.round(this.prop.v[i]*100):this.prop.v[i];
|
4179 |
+
if(this.o[i-this.data.p*4] !== val){
|
4180 |
+
this.o[i-this.data.p*4] = val;
|
4181 |
+
this._omdf = !forceRender;
|
4182 |
+
}
|
4183 |
+
}
|
4184 |
+
}
|
4185 |
+
this._mdf = !forceRender;
|
4186 |
+
}
|
4187 |
+
};
|
4188 |
+
|
4189 |
+
extendPrototype([DynamicPropertyContainer], GradientProperty);
|
4190 |
+
var buildShapeString = function(pathNodes, length, closed, mat) {
|
4191 |
+
if(length === 0) {
|
4192 |
+
return '';
|
4193 |
+
}
|
4194 |
+
var _o = pathNodes.o;
|
4195 |
+
var _i = pathNodes.i;
|
4196 |
+
var _v = pathNodes.v;
|
4197 |
+
var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
|
4198 |
+
for(i = 1; i < length; i += 1) {
|
4199 |
+
shapeString += " C" + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + " " + mat.applyToPointStringified(_i[i][0], _i[i][1]) + " " + mat.applyToPointStringified(_v[i][0], _v[i][1]);
|
4200 |
+
}
|
4201 |
+
if (closed && length) {
|
4202 |
+
shapeString += " C" + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + " " + mat.applyToPointStringified(_i[0][0], _i[0][1]) + " " + mat.applyToPointStringified(_v[0][0], _v[0][1]);
|
4203 |
+
shapeString += 'z';
|
4204 |
+
}
|
4205 |
+
return shapeString;
|
4206 |
+
}
|
4207 |
+
var ImagePreloader = (function(){
|
4208 |
+
|
4209 |
+
var proxyImage = (function(){
|
4210 |
+
var canvas = createTag('canvas');
|
4211 |
+
canvas.width = 1;
|
4212 |
+
canvas.height = 1;
|
4213 |
+
var ctx = canvas.getContext('2d');
|
4214 |
+
ctx.fillStyle = 'rgba(0,0,0,0)';
|
4215 |
+
ctx.fillRect(0, 0, 1, 1);
|
4216 |
+
return canvas;
|
4217 |
+
}())
|
4218 |
+
|
4219 |
+
function imageLoaded(){
|
4220 |
+
this.loadedAssets += 1;
|
4221 |
+
if(this.loadedAssets === this.totalImages){
|
4222 |
+
if(this.imagesLoadedCb) {
|
4223 |
+
this.imagesLoadedCb(null);
|
4224 |
+
}
|
4225 |
+
}
|
4226 |
+
}
|
4227 |
+
|
4228 |
+
function getAssetsPath(assetData, assetsPath, original_path) {
|
4229 |
+
var path = '';
|
4230 |
+
if (assetData.e) {
|
4231 |
+
path = assetData.p;
|
4232 |
+
} else if(assetsPath) {
|
4233 |
+
var imagePath = assetData.p;
|
4234 |
+
if (imagePath.indexOf('images/') !== -1) {
|
4235 |
+
imagePath = imagePath.split('/')[1];
|
4236 |
+
}
|
4237 |
+
path = assetsPath + imagePath;
|
4238 |
+
} else {
|
4239 |
+
path = original_path;
|
4240 |
+
path += assetData.u ? assetData.u : '';
|
4241 |
+
path += assetData.p;
|
4242 |
+
}
|
4243 |
+
return path;
|
4244 |
+
}
|
4245 |
+
|
4246 |
+
function createImageData(assetData) {
|
4247 |
+
var path = getAssetsPath(assetData, this.assetsPath, this.path);
|
4248 |
+
var img = createTag('img');
|
4249 |
+
img.crossOrigin = 'anonymous';
|
4250 |
+
img.addEventListener('load', this._imageLoaded.bind(this), false);
|
4251 |
+
img.addEventListener('error', function() {
|
4252 |
+
ob.img = proxyImage;
|
4253 |
+
this._imageLoaded();
|
4254 |
+
}.bind(this), false);
|
4255 |
+
img.src = path;
|
4256 |
+
var ob = {
|
4257 |
+
img: img,
|
4258 |
+
assetData: assetData
|
4259 |
+
}
|
4260 |
+
return ob;
|
4261 |
+
}
|
4262 |
+
|
4263 |
+
function loadAssets(assets, cb){
|
4264 |
+
this.imagesLoadedCb = cb;
|
4265 |
+
var i, len = assets.length;
|
4266 |
+
for (i = 0; i < len; i += 1) {
|
4267 |
+
if(!assets[i].layers){
|
4268 |
+
this.totalImages += 1;
|
4269 |
+
this.images.push(this._createImageData(assets[i]));
|
4270 |
+
}
|
4271 |
+
}
|
4272 |
+
}
|
4273 |
+
|
4274 |
+
function setPath(path){
|
4275 |
+
this.path = path || '';
|
4276 |
+
}
|
4277 |
+
|
4278 |
+
function setAssetsPath(path){
|
4279 |
+
this.assetsPath = path || '';
|
4280 |
+
}
|
4281 |
+
|
4282 |
+
function getImage(assetData) {
|
4283 |
+
var i = 0, len = this.images.length;
|
4284 |
+
while (i < len) {
|
4285 |
+
if (this.images[i].assetData === assetData) {
|
4286 |
+
return this.images[i].img;
|
4287 |
+
}
|
4288 |
+
i += 1;
|
4289 |
+
}
|
4290 |
+
}
|
4291 |
+
|
4292 |
+
function destroy() {
|
4293 |
+
this.imagesLoadedCb = null;
|
4294 |
+
this.images.length = 0;
|
4295 |
+
}
|
4296 |
+
|
4297 |
+
function loaded() {
|
4298 |
+
return this.totalImages === this.loadedAssets;
|
4299 |
+
}
|
4300 |
+
|
4301 |
+
return function ImagePreloader(){
|
4302 |
+
this.loadAssets = loadAssets;
|
4303 |
+
this.setAssetsPath = setAssetsPath;
|
4304 |
+
this.setPath = setPath;
|
4305 |
+
this.loaded = loaded;
|
4306 |
+
this.destroy = destroy;
|
4307 |
+
this.getImage = getImage;
|
4308 |
+
this._createImageData = createImageData;
|
4309 |
+
this._imageLoaded = imageLoaded;
|
4310 |
+
this.assetsPath = '';
|
4311 |
+
this.path = '';
|
4312 |
+
this.totalImages = 0;
|
4313 |
+
this.loadedAssets = 0;
|
4314 |
+
this.imagesLoadedCb = null;
|
4315 |
+
this.images = [];
|
4316 |
+
};
|
4317 |
+
}());
|
4318 |
+
var featureSupport = (function(){
|
4319 |
+
var ob = {
|
4320 |
+
maskType: true
|
4321 |
+
};
|
4322 |
+
if (/MSIE 10/i.test(navigator.userAgent) || /MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\/\d./i.test(navigator.userAgent)) {
|
4323 |
+
ob.maskType = false;
|
4324 |
+
}
|
4325 |
+
return ob;
|
4326 |
+
}());
|
4327 |
+
var filtersFactory = (function(){
|
4328 |
+
var ob = {};
|
4329 |
+
ob.createFilter = createFilter;
|
4330 |
+
ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
|
4331 |
+
|
4332 |
+
function createFilter(filId){
|
4333 |
+
var fil = createNS('filter');
|
4334 |
+
fil.setAttribute('id',filId);
|
4335 |
+
fil.setAttribute('filterUnits','objectBoundingBox');
|
4336 |
+
fil.setAttribute('x','0%');
|
4337 |
+
fil.setAttribute('y','0%');
|
4338 |
+
fil.setAttribute('width','100%');
|
4339 |
+
fil.setAttribute('height','100%');
|
4340 |
+
return fil;
|
4341 |
+
}
|
4342 |
+
|
4343 |
+
function createAlphaToLuminanceFilter(){
|
4344 |
+
var feColorMatrix = createNS('feColorMatrix');
|
4345 |
+
feColorMatrix.setAttribute('type','matrix');
|
4346 |
+
feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
|
4347 |
+
feColorMatrix.setAttribute('values','0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1');
|
4348 |
+
return feColorMatrix;
|
4349 |
+
}
|
4350 |
+
|
4351 |
+
return ob;
|
4352 |
+
}());
|
4353 |
+
var assetLoader = (function(){
|
4354 |
+
|
4355 |
+
function formatResponse(xhr) {
|
4356 |
+
if(xhr.response && typeof xhr.response === 'object') {
|
4357 |
+
return xhr.response;
|
4358 |
+
} else if(xhr.response && typeof xhr.response === 'string') {
|
4359 |
+
return JSON.parse(xhr.response);
|
4360 |
+
} else if(xhr.responseText) {
|
4361 |
+
return JSON.parse(xhr.responseText);
|
4362 |
+
}
|
4363 |
+
}
|
4364 |
+
|
4365 |
+
function loadAsset(path, callback, errorCallback) {
|
4366 |
+
var response;
|
4367 |
+
var xhr = new XMLHttpRequest();
|
4368 |
+
xhr.open('GET', path, true);
|
4369 |
+
// set responseType after calling open or IE will break.
|
4370 |
+
try {
|
4371 |
+
// This crashes on Android WebView prior to KitKat
|
4372 |
+
xhr.responseType = "json";
|
4373 |
+
} catch (err) {}
|
4374 |
+
xhr.send();
|
4375 |
+
xhr.onreadystatechange = function () {
|
4376 |
+
if (xhr.readyState == 4) {
|
4377 |
+
if(xhr.status == 200){
|
4378 |
+
response = formatResponse(xhr);
|
4379 |
+
callback(response);
|
4380 |
+
}else{
|
4381 |
+
try{
|
4382 |
+
response = formatResponse(xhr);
|
4383 |
+
callback(response);
|
4384 |
+
}catch(err){
|
4385 |
+
if(errorCallback) {
|
4386 |
+
errorCallback(err);
|
4387 |
+
}
|
4388 |
+
}
|
4389 |
+
}
|
4390 |
+
}
|
4391 |
+
};
|
4392 |
+
}
|
4393 |
+
return {
|
4394 |
+
load: loadAsset
|
4395 |
+
}
|
4396 |
+
}())
|
4397 |
+
|
4398 |
+
function TextAnimatorProperty(textData, renderType, elem){
|
4399 |
+
this._isFirstFrame = true;
|
4400 |
+
this._hasMaskedPath = false;
|
4401 |
+
this._frameId = -1;
|
4402 |
+
this._textData = textData;
|
4403 |
+
this._renderType = renderType;
|
4404 |
+
this._elem = elem;
|
4405 |
+
this._animatorsData = createSizedArray(this._textData.a.length);
|
4406 |
+
this._pathData = {};
|
4407 |
+
this._moreOptions = {
|
4408 |
+
alignment: {}
|
4409 |
+
};
|
4410 |
+
this.renderedLetters = [];
|
4411 |
+
this.lettersChangedFlag = false;
|
4412 |
+
this.initDynamicPropertyContainer(elem);
|
4413 |
+
|
4414 |
+
}
|
4415 |
+
|
4416 |
+
TextAnimatorProperty.prototype.searchProperties = function(){
|
4417 |
+
var i, len = this._textData.a.length, animatorProps;
|
4418 |
+
var getProp = PropertyFactory.getProp;
|
4419 |
+
for(i=0;i<len;i+=1){
|
4420 |
+
animatorProps = this._textData.a[i];
|
4421 |
+
this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
|
4422 |
+
}
|
4423 |
+
if(this._textData.p && 'm' in this._textData.p){
|
4424 |
+
this._pathData = {
|
4425 |
+
f: getProp(this._elem,this._textData.p.f,0,0,this),
|
4426 |
+
l: getProp(this._elem,this._textData.p.l,0,0,this),
|
4427 |
+
r: this._textData.p.r,
|
4428 |
+
m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
|
4429 |
+
};
|
4430 |
+
this._hasMaskedPath = true;
|
4431 |
+
} else {
|
4432 |
+
this._hasMaskedPath = false;
|
4433 |
+
}
|
4434 |
+
this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
|
4435 |
+
};
|
4436 |
+
|
4437 |
+
TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
|
4438 |
+
this.lettersChangedFlag = lettersChangedFlag;
|
4439 |
+
if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
|
4440 |
+
return;
|
4441 |
+
}
|
4442 |
+
this._isFirstFrame = false;
|
4443 |
+
var alignment = this._moreOptions.alignment.v;
|
4444 |
+
var animators = this._animatorsData;
|
4445 |
+
var textData = this._textData;
|
4446 |
+
var matrixHelper = this.mHelper;
|
4447 |
+
var renderType = this._renderType;
|
4448 |
+
var renderedLettersCount = this.renderedLetters.length;
|
4449 |
+
var data = this.data;
|
4450 |
+
var xPos,yPos;
|
4451 |
+
var i, len;
|
4452 |
+
var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
|
4453 |
+
if(this._hasMaskedPath) {
|
4454 |
+
mask = this._pathData.m;
|
4455 |
+
if(!this._pathData.n || this._pathData._mdf){
|
4456 |
+
var paths = mask.v;
|
4457 |
+
if(this._pathData.r){
|
4458 |
+
paths = paths.reverse();
|
4459 |
+
}
|
4460 |
+
// TODO: release bezier data cached from previous pathInfo: this._pathData.pi
|
4461 |
+
pathInfo = {
|
4462 |
+
tLength: 0,
|
4463 |
+
segments: []
|
4464 |
+
};
|
4465 |
+
len = paths._length - 1;
|
4466 |
+
var bezierData;
|
4467 |
+
totalLength = 0;
|
4468 |
+
for (i = 0; i < len; i += 1) {
|
4469 |
+
bezierData = bez.buildBezierData(paths.v[i]
|
4470 |
+
, paths.v[i + 1]
|
4471 |
+
, [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]]
|
4472 |
+
, [paths.i[i + 1][0] - paths.v[i + 1][0], paths.i[i + 1][1] - paths.v[i + 1][1]]);
|
4473 |
+
pathInfo.tLength += bezierData.segmentLength;
|
4474 |
+
pathInfo.segments.push(bezierData);
|
4475 |
+
totalLength += bezierData.segmentLength;
|
4476 |
+
}
|
4477 |
+
i = len;
|
4478 |
+
if (mask.v.c) {
|
4479 |
+
bezierData = bez.buildBezierData(paths.v[i]
|
4480 |
+
, paths.v[0]
|
4481 |
+
, [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]]
|
4482 |
+
, [paths.i[0][0] - paths.v[0][0], paths.i[0][1] - paths.v[0][1]]);
|
4483 |
+
pathInfo.tLength += bezierData.segmentLength;
|
4484 |
+
pathInfo.segments.push(bezierData);
|
4485 |
+
totalLength += bezierData.segmentLength;
|
4486 |
+
}
|
4487 |
+
this._pathData.pi = pathInfo;
|
4488 |
+
}
|
4489 |
+
pathInfo = this._pathData.pi;
|
4490 |
+
|
4491 |
+
currentLength = this._pathData.f.v;
|
4492 |
+
segmentInd = 0;
|
4493 |
+
pointInd = 1;
|
4494 |
+
segmentLength = 0;
|
4495 |
+
flag = true;
|
4496 |
+
segments = pathInfo.segments;
|
4497 |
+
if (currentLength < 0 && mask.v.c) {
|
4498 |
+
if (pathInfo.tLength < Math.abs(currentLength)) {
|
4499 |
+
currentLength = -Math.abs(currentLength) % pathInfo.tLength;
|
4500 |
+
}
|
4501 |
+
segmentInd = segments.length - 1;
|
4502 |
+
points = segments[segmentInd].points;
|
4503 |
+
pointInd = points.length - 1;
|
4504 |
+
while (currentLength < 0) {
|
4505 |
+
currentLength += points[pointInd].partialLength;
|
4506 |
+
pointInd -= 1;
|
4507 |
+
if (pointInd < 0) {
|
4508 |
+
segmentInd -= 1;
|
4509 |
+
points = segments[segmentInd].points;
|
4510 |
+
pointInd = points.length - 1;
|
4511 |
+
}
|
4512 |
+
}
|
4513 |
+
|
4514 |
+
}
|
4515 |
+
points = segments[segmentInd].points;
|
4516 |
+
prevPoint = points[pointInd - 1];
|
4517 |
+
currentPoint = points[pointInd];
|
4518 |
+
partialLength = currentPoint.partialLength;
|
4519 |
+
}
|
4520 |
+
|
4521 |
+
|
4522 |
+
len = letters.length;
|
4523 |
+
xPos = 0;
|
4524 |
+
yPos = 0;
|
4525 |
+
var yOff = documentData.finalSize * 1.2 * 0.714;
|
4526 |
+
var firstLine = true;
|
4527 |
+
var animatorProps, animatorSelector;
|
4528 |
+
var j, jLen;
|
4529 |
+
var letterValue;
|
4530 |
+
|
4531 |
+
jLen = animators.length;
|
4532 |
+
var lastLetter;
|
4533 |
+
|
4534 |
+
var mult, ind = -1, offf, xPathPos, yPathPos;
|
4535 |
+
var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
|
4536 |
+
var elemOpacity;
|
4537 |
+
var sc,sw,fc,k;
|
4538 |
+
var lineLength = 0;
|
4539 |
+
var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
|
4540 |
+
|
4541 |
+
//
|
4542 |
+
if(documentData.j === 2 || documentData.j === 1) {
|
4543 |
+
var animatorJustifyOffset = 0;
|
4544 |
+
var animatorFirstCharOffset = 0;
|
4545 |
+
var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
|
4546 |
+
var lastIndex = 0;
|
4547 |
+
var isNewLine = true;
|
4548 |
+
|
4549 |
+
for (i = 0; i < len; i += 1) {
|
4550 |
+
if (letters[i].n) {
|
4551 |
+
if(animatorJustifyOffset) {
|
4552 |
+
animatorJustifyOffset += animatorFirstCharOffset;
|
4553 |
+
}
|
4554 |
+
while (lastIndex < i) {
|
4555 |
+
letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
|
4556 |
+
lastIndex += 1;
|
4557 |
+
}
|
4558 |
+
animatorJustifyOffset = 0;
|
4559 |
+
isNewLine = true;
|
4560 |
+
} else {
|
4561 |
+
for (j = 0; j < jLen; j += 1) {
|
4562 |
+
animatorProps = animators[j].a;
|
4563 |
+
if (animatorProps.t.propType) {
|
4564 |
+
if (isNewLine && documentData.j === 2) {
|
4565 |
+
animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
|
4566 |
+
}
|
4567 |
+
animatorSelector = animators[j].s;
|
4568 |
+
mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
|
4569 |
+
if (mult.length) {
|
4570 |
+
animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
|
4571 |
+
} else {
|
4572 |
+
animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
|
4573 |
+
}
|
4574 |
+
}
|
4575 |
+
}
|
4576 |
+
isNewLine = false;
|
4577 |
+
}
|
4578 |
+
}
|
4579 |
+
if(animatorJustifyOffset) {
|
4580 |
+
animatorJustifyOffset += animatorFirstCharOffset;
|
4581 |
+
}
|
4582 |
+
while(lastIndex < i) {
|
4583 |
+
letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
|
4584 |
+
lastIndex += 1;
|
4585 |
+
}
|
4586 |
+
}
|
4587 |
+
//
|
4588 |
+
|
4589 |
+
for( i = 0; i < len; i += 1) {
|
4590 |
+
|
4591 |
+
matrixHelper.reset();
|
4592 |
+
elemOpacity = 1;
|
4593 |
+
if(letters[i].n) {
|
4594 |
+
xPos = 0;
|
4595 |
+
yPos += documentData.yOffset;
|
4596 |
+
yPos += firstLine ? 1 : 0;
|
4597 |
+
currentLength = initPathPos ;
|
4598 |
+
firstLine = false;
|
4599 |
+
lineLength = 0;
|
4600 |
+
if(this._hasMaskedPath) {
|
4601 |
+
segmentInd = initSegmentInd;
|
4602 |
+
pointInd = initPointInd;
|
4603 |
+
points = segments[segmentInd].points;
|
4604 |
+
prevPoint = points[pointInd - 1];
|
4605 |
+
currentPoint = points[pointInd];
|
4606 |
+
partialLength = currentPoint.partialLength;
|
4607 |
+
segmentLength = 0;
|
4608 |
+
}
|
4609 |
+
letterO = letterSw = letterFc = letterM = '';
|
4610 |
+
letterP = this.defaultPropsArray;
|
4611 |
+
}else{
|
4612 |
+
if(this._hasMaskedPath) {
|
4613 |
+
if(currentLine !== letters[i].line){
|
4614 |
+
switch(documentData.j){
|
4615 |
+
case 1:
|
4616 |
+
currentLength += totalLength - documentData.lineWidths[letters[i].line];
|
4617 |
+
break;
|
4618 |
+
case 2:
|
4619 |
+
currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
|
4620 |
+
break;
|
4621 |
+
}
|
4622 |
+
currentLine = letters[i].line;
|
4623 |
+
}
|
4624 |
+
if (ind !== letters[i].ind) {
|
4625 |
+
if (letters[ind]) {
|
4626 |
+
currentLength += letters[ind].extra;
|
4627 |
+
}
|
4628 |
+
currentLength += letters[i].an / 2;
|
4629 |
+
ind = letters[i].ind;
|
4630 |
+
}
|
4631 |
+
currentLength += alignment[0] * letters[i].an / 200;
|
4632 |
+
var animatorOffset = 0;
|
4633 |
+
for (j = 0; j < jLen; j += 1) {
|
4634 |
+
animatorProps = animators[j].a;
|
4635 |
+
if (animatorProps.p.propType) {
|
4636 |
+
animatorSelector = animators[j].s;
|
4637 |
+
mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
|
4638 |
+
if(mult.length){
|
4639 |
+
animatorOffset += animatorProps.p.v[0] * mult[0];
|
4640 |
+
} else{
|
4641 |
+
animatorOffset += animatorProps.p.v[0] * mult;
|
4642 |
+
}
|
4643 |
+
|
4644 |
+
}
|
4645 |
+
if (animatorProps.a.propType) {
|
4646 |
+
animatorSelector = animators[j].s;
|
4647 |
+
mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
|
4648 |
+
if(mult.length){
|
4649 |
+
animatorOffset += animatorProps.a.v[0] * mult[0];
|
4650 |
+
} else{
|
4651 |
+
animatorOffset += animatorProps.a.v[0] * mult;
|
4652 |
+
}
|
4653 |
+
|
4654 |
+
}
|
4655 |
+
}
|
4656 |
+
flag = true;
|
4657 |
+
while (flag) {
|
4658 |
+
if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
|
4659 |
+
perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
|
4660 |
+
xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
|
4661 |
+
yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
|
4662 |
+
matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
|
4663 |
+
flag = false;
|
4664 |
+
} else if (points) {
|
4665 |
+
segmentLength += currentPoint.partialLength;
|
4666 |
+
pointInd += 1;
|
4667 |
+
if (pointInd >= points.length) {
|
4668 |
+
pointInd = 0;
|
4669 |
+
segmentInd += 1;
|
4670 |
+
if (!segments[segmentInd]) {
|
4671 |
+
if (mask.v.c) {
|
4672 |
+
pointInd = 0;
|
4673 |
+
segmentInd = 0;
|
4674 |
+
points = segments[segmentInd].points;
|
4675 |
+
} else {
|
4676 |
+
segmentLength -= currentPoint.partialLength;
|
4677 |
+
points = null;
|
4678 |
+
}
|
4679 |
+
} else {
|
4680 |
+
points = segments[segmentInd].points;
|
4681 |
+
}
|
4682 |
+
}
|
4683 |
+
if (points) {
|
4684 |
+
prevPoint = currentPoint;
|
4685 |
+
currentPoint = points[pointInd];
|
4686 |
+
partialLength = currentPoint.partialLength;
|
4687 |
+
}
|
4688 |
+
}
|
4689 |
+
}
|
4690 |
+
offf = letters[i].an / 2 - letters[i].add;
|
4691 |
+
matrixHelper.translate(-offf, 0, 0);
|
4692 |
+
} else {
|
4693 |
+
offf = letters[i].an/2 - letters[i].add;
|
4694 |
+
matrixHelper.translate(-offf,0,0);
|
4695 |
+
|
4696 |
+
// Grouping alignment
|
4697 |
+
matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
|
4698 |
+
}
|
4699 |
+
|
4700 |
+
lineLength += letters[i].l/2;
|
4701 |
+
for(j=0;j<jLen;j+=1){
|
4702 |
+
animatorProps = animators[j].a;
|
4703 |
+
if (animatorProps.t.propType) {
|
4704 |
+
animatorSelector = animators[j].s;
|
4705 |
+
mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
|
4706 |
+
//This condition is to prevent applying tracking to first character in each line. Might be better to use a boolean "isNewLine"
|
4707 |
+
if(xPos !== 0 || documentData.j !== 0) {
|
4708 |
+
if(this._hasMaskedPath) {
|
4709 |
+
if(mult.length) {
|
4710 |
+
currentLength += animatorProps.t.v*mult[0];
|
4711 |
+
} else {
|
4712 |
+
currentLength += animatorProps.t.v*mult;
|
4713 |
+
}
|
4714 |
+
}else{
|
4715 |
+
if(mult.length) {
|
4716 |
+
xPos += animatorProps.t.v*mult[0];
|
4717 |
+
} else {
|
4718 |
+
xPos += animatorProps.t.v*mult;
|
4719 |
+
}
|
4720 |
+
}
|
4721 |
+
}
|
4722 |
+
}
|
4723 |
+
}
|
4724 |
+
lineLength += letters[i].l/2;
|
4725 |
+
if(documentData.strokeWidthAnim) {
|
4726 |
+
sw = documentData.sw || 0;
|
4727 |
+
}
|
4728 |
+
if(documentData.strokeColorAnim) {
|
4729 |
+
if(documentData.sc){
|
4730 |
+
sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
|
4731 |
+
}else{
|
4732 |
+
sc = [0,0,0];
|
4733 |
+
}
|
4734 |
+
}
|
4735 |
+
if(documentData.fillColorAnim && documentData.fc) {
|
4736 |
+
fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
|
4737 |
+
}
|
4738 |
+
for(j=0;j<jLen;j+=1){
|
4739 |
+
animatorProps = animators[j].a;
|
4740 |
+
if (animatorProps.a.propType) {
|
4741 |
+
animatorSelector = animators[j].s;
|
4742 |
+
mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
|
4743 |
+
|
4744 |
+
if(mult.length){
|
4745 |
+
matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
|
4746 |
+
} else {
|
4747 |
+
matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
|
4748 |
+
}
|
4749 |
+
}
|
4750 |
+
}
|
4751 |
+
for(j=0;j<jLen;j+=1){
|
4752 |
+
animatorProps = animators[j].a;
|
4753 |
+
if (animatorProps.s.propType) {
|
4754 |
+
animatorSelector = animators[j].s;
|
4755 |
+
mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
|
4756 |
+
if(mult.length){
|
4757 |
+
matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
|
4758 |
+
} else {
|
4759 |
+
matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
|
4760 |
+
}
|
4761 |
+
}
|
4762 |
+
}
|
4763 |
+
for(j=0;j<jLen;j+=1) {
|
4764 |
+
animatorProps = animators[j].a;
|
4765 |
+
animatorSelector = animators[j].s;
|
4766 |
+
mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
|
4767 |
+
if (animatorProps.sk.propType) {
|
4768 |
+
if(mult.length) {
|
4769 |
+
matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
|
4770 |
+
} else {
|
4771 |
+
matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
|
4772 |
+
}
|
4773 |
+
}
|
4774 |
+
if (animatorProps.r.propType) {
|
4775 |
+
if(mult.length) {
|
4776 |
+
matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
|
4777 |
+
} else {
|
4778 |
+
matrixHelper.rotateZ(-animatorProps.r.v * mult);
|
4779 |
+
}
|
4780 |
+
}
|
4781 |
+
if (animatorProps.ry.propType) {
|
4782 |
+
|
4783 |
+
if(mult.length) {
|
4784 |
+
matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
|
4785 |
+
}else{
|
4786 |
+
matrixHelper.rotateY(animatorProps.ry.v*mult);
|
4787 |
+
}
|
4788 |
+
}
|
4789 |
+
if (animatorProps.rx.propType) {
|
4790 |
+
if(mult.length) {
|
4791 |
+
matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
|
4792 |
+
} else {
|
4793 |
+
matrixHelper.rotateX(animatorProps.rx.v*mult);
|
4794 |
+
}
|
4795 |
+
}
|
4796 |
+
if (animatorProps.o.propType) {
|
4797 |
+
if(mult.length) {
|
4798 |
+
elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
|
4799 |
+
} else {
|
4800 |
+
elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
|
4801 |
+
}
|
4802 |
+
}
|
4803 |
+
if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
|
4804 |
+
if(mult.length) {
|
4805 |
+
sw += animatorProps.sw.v*mult[0];
|
4806 |
+
} else {
|
4807 |
+
sw += animatorProps.sw.v*mult;
|
4808 |
+
}
|
4809 |
+
}
|
4810 |
+
if (documentData.strokeColorAnim && animatorProps.sc.propType) {
|
4811 |
+
for(k=0;k<3;k+=1){
|
4812 |
+
if(mult.length) {
|
4813 |
+
sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
|
4814 |
+
} else {
|
4815 |
+
sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
|
4816 |
+
}
|
4817 |
+
}
|
4818 |
+
}
|
4819 |
+
if (documentData.fillColorAnim && documentData.fc) {
|
4820 |
+
if(animatorProps.fc.propType){
|
4821 |
+
for(k=0;k<3;k+=1){
|
4822 |
+
if(mult.length) {
|
4823 |
+
fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
|
4824 |
+
} else {
|
4825 |
+
fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
|
4826 |
+
}
|
4827 |
+
}
|
4828 |
+
}
|
4829 |
+
if(animatorProps.fh.propType){
|
4830 |
+
if(mult.length) {
|
4831 |
+
fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
|
4832 |
+
} else {
|
4833 |
+
fc = addHueToRGB(fc,animatorProps.fh.v*mult);
|
4834 |
+
}
|
4835 |
+
}
|
4836 |
+
if(animatorProps.fs.propType){
|
4837 |
+
if(mult.length) {
|
4838 |
+
fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
|
4839 |
+
} else {
|
4840 |
+
fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
|
4841 |
+
}
|
4842 |
+
}
|
4843 |
+
if(animatorProps.fb.propType){
|
4844 |
+
if(mult.length) {
|
4845 |
+
fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
|
4846 |
+
} else {
|
4847 |
+
fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
|
4848 |
+
}
|
4849 |
+
}
|
4850 |
+
}
|
4851 |
+
}
|
4852 |
+
|
4853 |
+
for(j=0;j<jLen;j+=1){
|
4854 |
+
animatorProps = animators[j].a;
|
4855 |
+
|
4856 |
+
if (animatorProps.p.propType) {
|
4857 |
+
animatorSelector = animators[j].s;
|
4858 |
+
mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
|
4859 |
+
if(this._hasMaskedPath) {
|
4860 |
+
if(mult.length) {
|
4861 |
+
matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
|
4862 |
+
} else {
|
4863 |
+
matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
|
4864 |
+
}
|
4865 |
+
}else{
|
4866 |
+
if(mult.length) {
|
4867 |
+
matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
|
4868 |
+
} else {
|
4869 |
+
matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
|
4870 |
+
|
4871 |
+
}
|
4872 |
+
}
|
4873 |
+
}
|
4874 |
+
}
|
4875 |
+
if(documentData.strokeWidthAnim){
|
4876 |
+
letterSw = sw < 0 ? 0 : sw;
|
4877 |
+
}
|
4878 |
+
if(documentData.strokeColorAnim){
|
4879 |
+
letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
|
4880 |
+
}
|
4881 |
+
if(documentData.fillColorAnim && documentData.fc){
|
4882 |
+
letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
|
4883 |
+
}
|
4884 |
+
|
4885 |
+
if(this._hasMaskedPath) {
|
4886 |
+
matrixHelper.translate(0,-documentData.ls);
|
4887 |
+
|
4888 |
+
matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
|
4889 |
+
if (textData.p.p) {
|
4890 |
+
tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
|
4891 |
+
var rot = Math.atan(tanAngle) * 180 / Math.PI;
|
4892 |
+
if (currentPoint.point[0] < prevPoint.point[0]) {
|
4893 |
+
rot += 180;
|
4894 |
+
}
|
4895 |
+
matrixHelper.rotate(-rot * Math.PI / 180);
|
4896 |
+
}
|
4897 |
+
matrixHelper.translate(xPathPos, yPathPos, 0);
|
4898 |
+
currentLength -= alignment[0]*letters[i].an/200;
|
4899 |
+
if(letters[i+1] && ind !== letters[i+1].ind){
|
4900 |
+
currentLength += letters[i].an / 2;
|
4901 |
+
currentLength += documentData.tr/1000*documentData.finalSize;
|
4902 |
+
}
|
4903 |
+
}else{
|
4904 |
+
|
4905 |
+
matrixHelper.translate(xPos,yPos,0);
|
4906 |
+
|
4907 |
+
if(documentData.ps){
|
4908 |
+
//matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
|
4909 |
+
matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
|
4910 |
+
}
|
4911 |
+
switch(documentData.j){
|
4912 |
+
case 1:
|
4913 |
+
matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
|
4914 |
+
break;
|
4915 |
+
case 2:
|
4916 |
+
matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
|
4917 |
+
break;
|
4918 |
+
}
|
4919 |
+
matrixHelper.translate(0,-documentData.ls);
|
4920 |
+
matrixHelper.translate(offf,0,0);
|
4921 |
+
matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
|
4922 |
+
xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
|
4923 |
+
}
|
4924 |
+
if(renderType === 'html'){
|
4925 |
+
letterM = matrixHelper.toCSS();
|
4926 |
+
}else if(renderType === 'svg'){
|
4927 |
+
letterM = matrixHelper.to2dCSS();
|
4928 |
+
}else{
|
4929 |
+
letterP = [matrixHelper.props[0],matrixHelper.props[1],matrixHelper.props[2],matrixHelper.props[3],matrixHelper.props[4],matrixHelper.props[5],matrixHelper.props[6],matrixHelper.props[7],matrixHelper.props[8],matrixHelper.props[9],matrixHelper.props[10],matrixHelper.props[11],matrixHelper.props[12],matrixHelper.props[13],matrixHelper.props[14],matrixHelper.props[15]];
|
4930 |
+
}
|
4931 |
+
letterO = elemOpacity;
|
4932 |
+
}
|
4933 |
+
|
4934 |
+
if(renderedLettersCount <= i) {
|
4935 |
+
letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
|
4936 |
+
this.renderedLetters.push(letterValue);
|
4937 |
+
renderedLettersCount += 1;
|
4938 |
+
this.lettersChangedFlag = true;
|
4939 |
+
} else {
|
4940 |
+
letterValue = this.renderedLetters[i];
|
4941 |
+
this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
|
4942 |
+
}
|
4943 |
+
}
|
4944 |
+
};
|
4945 |
+
|
4946 |
+
TextAnimatorProperty.prototype.getValue = function(){
|
4947 |
+
if(this._elem.globalData.frameId === this._frameId){
|
4948 |
+
return;
|
4949 |
+
}
|
4950 |
+
this._frameId = this._elem.globalData.frameId;
|
4951 |
+
this.iterateDynamicProperties();
|
4952 |
+
};
|
4953 |
+
|
4954 |
+
TextAnimatorProperty.prototype.mHelper = new Matrix();
|
4955 |
+
TextAnimatorProperty.prototype.defaultPropsArray = [];
|
4956 |
+
extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
|
4957 |
+
function TextAnimatorDataProperty(elem, animatorProps, container) {
|
4958 |
+
var defaultData = {propType:false};
|
4959 |
+
var getProp = PropertyFactory.getProp;
|
4960 |
+
var textAnimator_animatables = animatorProps.a;
|
4961 |
+
this.a = {
|
4962 |
+
r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
|
4963 |
+
rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
|
4964 |
+
ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
|
4965 |
+
sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
|
4966 |
+
sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
|
4967 |
+
s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
|
4968 |
+
a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
|
4969 |
+
o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
|
4970 |
+
p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
|
4971 |
+
sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
|
4972 |
+
sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
|
4973 |
+
fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
|
4974 |
+
fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
|
4975 |
+
fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
|
4976 |
+
fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
|
4977 |
+
t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
|
4978 |
+
};
|
4979 |
+
|
4980 |
+
this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
|
4981 |
+
this.s.t = animatorProps.s.t;
|
4982 |
+
}
|
4983 |
+
function LetterProps(o, sw, sc, fc, m, p){
|
4984 |
+
this.o = o;
|
4985 |
+
this.sw = sw;
|
4986 |
+
this.sc = sc;
|
4987 |
+
this.fc = fc;
|
4988 |
+
this.m = m;
|
4989 |
+
this.p = p;
|
4990 |
+
this._mdf = {
|
4991 |
+
o: true,
|
4992 |
+
sw: !!sw,
|
4993 |
+
sc: !!sc,
|
4994 |
+
fc: !!fc,
|
4995 |
+
m: true,
|
4996 |
+
p: true
|
4997 |
+
};
|
4998 |
+
}
|
4999 |
+
|
5000 |
+
LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
|
5001 |
+
this._mdf.o = false;
|
5002 |
+
this._mdf.sw = false;
|
5003 |
+
this._mdf.sc = false;
|
5004 |
+
this._mdf.fc = false;
|
5005 |
+
this._mdf.m = false;
|
5006 |
+
this._mdf.p = false;
|
5007 |
+
var updated = false;
|
5008 |
+
|
5009 |
+
if(this.o !== o) {
|
5010 |
+
this.o = o;
|
5011 |
+
this._mdf.o = true;
|
5012 |
+
updated = true;
|
5013 |
+
}
|
5014 |
+
if(this.sw !== sw) {
|
5015 |
+
this.sw = sw;
|
5016 |
+
this._mdf.sw = true;
|
5017 |
+
updated = true;
|
5018 |
+
}
|
5019 |
+
if(this.sc !== sc) {
|
5020 |
+
this.sc = sc;
|
5021 |
+
this._mdf.sc = true;
|
5022 |
+
updated = true;
|
5023 |
+
}
|
5024 |
+
if(this.fc !== fc) {
|
5025 |
+
this.fc = fc;
|
5026 |
+
this._mdf.fc = true;
|
5027 |
+
updated = true;
|
5028 |
+
}
|
5029 |
+
if(this.m !== m) {
|
5030 |
+
this.m = m;
|
5031 |
+
this._mdf.m = true;
|
5032 |
+
updated = true;
|
5033 |
+
}
|
5034 |
+
if(p.length && (this.p[0] !== p[0] || this.p[1] !== p[1] || this.p[4] !== p[4] || this.p[5] !== p[5] || this.p[12] !== p[12] || this.p[13] !== p[13])) {
|
5035 |
+
this.p = p;
|
5036 |
+
this._mdf.p = true;
|
5037 |
+
updated = true;
|
5038 |
+
}
|
5039 |
+
return updated;
|
5040 |
+
};
|
5041 |
+
function TextProperty(elem, data){
|
5042 |
+
this._frameId = initialDefaultFrame;
|
5043 |
+
this.pv = '';
|
5044 |
+
this.v = '';
|
5045 |
+
this.kf = false;
|
5046 |
+
this._isFirstFrame = true;
|
5047 |
+
this._mdf = false;
|
5048 |
+
this.data = data;
|
5049 |
+
this.elem = elem;
|
5050 |
+
this.comp = this.elem.comp;
|
5051 |
+
this.keysIndex = 0;
|
5052 |
+
this.canResize = false;
|
5053 |
+
this.minimumFontSize = 1;
|
5054 |
+
this.effectsSequence = [];
|
5055 |
+
this.currentData = {
|
5056 |
+
ascent: 0,
|
5057 |
+
boxWidth: this.defaultBoxWidth,
|
5058 |
+
f: '',
|
5059 |
+
fStyle: '',
|
5060 |
+
fWeight: '',
|
5061 |
+
fc: '',
|
5062 |
+
j: '',
|
5063 |
+
justifyOffset: '',
|
5064 |
+
l: [],
|
5065 |
+
lh: 0,
|
5066 |
+
lineWidths: [],
|
5067 |
+
ls: '',
|
5068 |
+
of: '',
|
5069 |
+
s: '',
|
5070 |
+
sc: '',
|
5071 |
+
sw: 0,
|
5072 |
+
t: 0,
|
5073 |
+
tr: 0,
|
5074 |
+
sz:0,
|
5075 |
+
ps:null,
|
5076 |
+
fillColorAnim: false,
|
5077 |
+
strokeColorAnim: false,
|
5078 |
+
strokeWidthAnim: false,
|
5079 |
+
yOffset: 0,
|
5080 |
+
finalSize:0,
|
5081 |
+
finalText:[],
|
5082 |
+
finalLineHeight: 0,
|
5083 |
+
__complete: false
|
5084 |
+
|
5085 |
+
};
|
5086 |
+
this.copyData(this.currentData, this.data.d.k[0].s);
|
5087 |
+
|
5088 |
+
if(!this.searchProperty()) {
|
5089 |
+
this.completeTextData(this.currentData);
|
5090 |
+
}
|
5091 |
+
}
|
5092 |
+
|
5093 |
+
TextProperty.prototype.defaultBoxWidth = [0,0];
|
5094 |
+
|
5095 |
+
TextProperty.prototype.copyData = function(obj, data) {
|
5096 |
+
for(var s in data) {
|
5097 |
+
if(data.hasOwnProperty(s)) {
|
5098 |
+
obj[s] = data[s];
|
5099 |
+
}
|
5100 |
+
}
|
5101 |
+
return obj;
|
5102 |
+
}
|
5103 |
+
|
5104 |
+
TextProperty.prototype.setCurrentData = function(data){
|
5105 |
+
if(!data.__complete) {
|
5106 |
+
this.completeTextData(data);
|
5107 |
+
}
|
5108 |
+
this.currentData = data;
|
5109 |
+
this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
|
5110 |
+
this._mdf = true;
|
5111 |
+
};
|
5112 |
+
|
5113 |
+
TextProperty.prototype.searchProperty = function() {
|
5114 |
+
return this.searchKeyframes();
|
5115 |
+
};
|
5116 |
+
|
5117 |
+
TextProperty.prototype.searchKeyframes = function() {
|
5118 |
+
this.kf = this.data.d.k.length > 1;
|
5119 |
+
if(this.kf) {
|
5120 |
+
this.addEffect(this.getKeyframeValue.bind(this));
|
5121 |
+
}
|
5122 |
+
return this.kf;
|
5123 |
+
}
|
5124 |
+
|
5125 |
+
TextProperty.prototype.addEffect = function(effectFunction) {
|
5126 |
+
this.effectsSequence.push(effectFunction);
|
5127 |
+
this.elem.addDynamicProperty(this);
|
5128 |
+
};
|
5129 |
+
|
5130 |
+
TextProperty.prototype.getValue = function(_finalValue) {
|
5131 |
+
if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
|
5132 |
+
return;
|
5133 |
+
}
|
5134 |
+
this.currentData.t = this.data.d.k[this.keysIndex].s.t;
|
5135 |
+
var currentValue = this.currentData;
|
5136 |
+
var currentIndex = this.keysIndex;
|
5137 |
+
if(this.lock) {
|
5138 |
+
this.setCurrentData(this.currentData);
|
5139 |
+
return;
|
5140 |
+
}
|
5141 |
+
this.lock = true;
|
5142 |
+
this._mdf = false;
|
5143 |
+
var multipliedValue;
|
5144 |
+
var i, len = this.effectsSequence.length;
|
5145 |
+
var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
|
5146 |
+
for(i = 0; i < len; i += 1) {
|
5147 |
+
//Checking if index changed to prevent creating a new object every time the expression updates.
|
5148 |
+
if(currentIndex !== this.keysIndex) {
|
5149 |
+
finalValue = this.effectsSequence[i](finalValue, finalValue.t);
|
5150 |
+
} else {
|
5151 |
+
finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
|
5152 |
+
}
|
5153 |
+
}
|
5154 |
+
if(currentValue !== finalValue) {
|
5155 |
+
this.setCurrentData(finalValue);
|
5156 |
+
}
|
5157 |
+
this.pv = this.v = this.currentData;
|
5158 |
+
this.lock = false;
|
5159 |
+
this.frameId = this.elem.globalData.frameId;
|
5160 |
+
}
|
5161 |
+
|
5162 |
+
TextProperty.prototype.getKeyframeValue = function() {
|
5163 |
+
var textKeys = this.data.d.k, textDocumentData;
|
5164 |
+
var frameNum = this.elem.comp.renderedFrame;
|
5165 |
+
var i = 0, len = textKeys.length;
|
5166 |
+
while(i <= len - 1) {
|
5167 |
+
textDocumentData = textKeys[i].s;
|
5168 |
+
if(i === len - 1 || textKeys[i+1].t > frameNum){
|
5169 |
+
break;
|
5170 |
+
}
|
5171 |
+
i += 1;
|
5172 |
+
}
|
5173 |
+
if(this.keysIndex !== i) {
|
5174 |
+
this.keysIndex = i;
|
5175 |
+
}
|
5176 |
+
return this.data.d.k[this.keysIndex].s;
|
5177 |
+
};
|
5178 |
+
|
5179 |
+
TextProperty.prototype.buildFinalText = function(text) {
|
5180 |
+
var combinedCharacters = FontManager.getCombinedCharacterCodes();
|
5181 |
+
var charactersArray = [];
|
5182 |
+
var i = 0, len = text.length;
|
5183 |
+
var charCode;
|
5184 |
+
while (i < len) {
|
5185 |
+
charCode = text.charCodeAt(i);
|
5186 |
+
if (combinedCharacters.indexOf(charCode) !== -1) {
|
5187 |
+
charactersArray[charactersArray.length - 1] += text.charAt(i);
|
5188 |
+
} else {
|
5189 |
+
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
|
5190 |
+
charCode = text.charCodeAt(i + 1);
|
5191 |
+
if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
|
5192 |
+
charactersArray.push(text.substr(i, 2));
|
5193 |
+
++i;
|
5194 |
+
} else {
|
5195 |
+
charactersArray.push(text.charAt(i));
|
5196 |
+
}
|
5197 |
+
} else {
|
5198 |
+
charactersArray.push(text.charAt(i));
|
5199 |
+
}
|
5200 |
+
}
|
5201 |
+
i += 1;
|
5202 |
+
}
|
5203 |
+
return charactersArray;
|
5204 |
+
}
|
5205 |
+
|
5206 |
+
TextProperty.prototype.completeTextData = function(documentData) {
|
5207 |
+
documentData.__complete = true;
|
5208 |
+
var fontManager = this.elem.globalData.fontManager;
|
5209 |
+
var data = this.data;
|
5210 |
+
var letters = [];
|
5211 |
+
var i, len;
|
5212 |
+
var newLineFlag, index = 0, val;
|
5213 |
+
var anchorGrouping = data.m.g;
|
5214 |
+
var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
|
5215 |
+
var lineWidth = 0;
|
5216 |
+
var maxLineWidth = 0;
|
5217 |
+
var j, jLen;
|
5218 |
+
var fontData = fontManager.getFontByName(documentData.f);
|
5219 |
+
var charData, cLength = 0;
|
5220 |
+
var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
|
5221 |
+
|
5222 |
+
var fWeight = 'normal', fStyle = 'normal';
|
5223 |
+
len = styles.length;
|
5224 |
+
var styleName;
|
5225 |
+
for(i=0;i<len;i+=1){
|
5226 |
+
styleName = styles[i].toLowerCase();
|
5227 |
+
switch(styleName) {
|
5228 |
+
case 'italic':
|
5229 |
+
fStyle = 'italic';
|
5230 |
+
break;
|
5231 |
+
case 'bold':
|
5232 |
+
fWeight = '700';
|
5233 |
+
break;
|
5234 |
+
case 'black':
|
5235 |
+
fWeight = '900';
|
5236 |
+
break;
|
5237 |
+
case 'medium':
|
5238 |
+
fWeight = '500';
|
5239 |
+
break;
|
5240 |
+
case 'regular':
|
5241 |
+
case 'normal':
|
5242 |
+
fWeight = '400';
|
5243 |
+
break;
|
5244 |
+
case 'light':
|
5245 |
+
case 'thin':
|
5246 |
+
fWeight = '200';
|
5247 |
+
break;
|
5248 |
+
}
|
5249 |
+
}
|
5250 |
+
documentData.fWeight = fontData.fWeight || fWeight;
|
5251 |
+
documentData.fStyle = fStyle;
|
5252 |
+
documentData.finalSize = documentData.s;
|
5253 |
+
documentData.finalText = this.buildFinalText(documentData.t);
|
5254 |
+
len = documentData.finalText.length;
|
5255 |
+
documentData.finalLineHeight = documentData.lh;
|
5256 |
+
var trackingOffset = documentData.tr/1000*documentData.finalSize;
|
5257 |
+
var charCode;
|
5258 |
+
if(documentData.sz){
|
5259 |
+
var flag = true;
|
5260 |
+
var boxWidth = documentData.sz[0];
|
5261 |
+
var boxHeight = documentData.sz[1];
|
5262 |
+
var currentHeight, finalText;
|
5263 |
+
while(flag) {
|
5264 |
+
finalText = this.buildFinalText(documentData.t);
|
5265 |
+
currentHeight = 0;
|
5266 |
+
lineWidth = 0;
|
5267 |
+
len = finalText.length;
|
5268 |
+
trackingOffset = documentData.tr/1000*documentData.finalSize;
|
5269 |
+
var lastSpaceIndex = -1;
|
5270 |
+
for(i=0;i<len;i+=1){
|
5271 |
+
charCode = finalText[i].charCodeAt(0);
|
5272 |
+
newLineFlag = false;
|
5273 |
+
if(finalText[i] === ' '){
|
5274 |
+
lastSpaceIndex = i;
|
5275 |
+
}else if(charCode === 13 || charCode === 3){
|
5276 |
+
lineWidth = 0;
|
5277 |
+
newLineFlag = true;
|
5278 |
+
currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
|
5279 |
+
}
|
5280 |
+
if(fontManager.chars){
|
5281 |
+
charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
|
5282 |
+
cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
|
5283 |
+
}else{
|
5284 |
+
//tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
|
5285 |
+
cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
|
5286 |
+
}
|
5287 |
+
if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
|
5288 |
+
if(lastSpaceIndex === -1){
|
5289 |
+
len += 1;
|
5290 |
+
} else {
|
5291 |
+
i = lastSpaceIndex;
|
5292 |
+
}
|
5293 |
+
currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
|
5294 |
+
finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
|
5295 |
+
//finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
|
5296 |
+
lastSpaceIndex = -1;
|
5297 |
+
lineWidth = 0;
|
5298 |
+
}else {
|
5299 |
+
lineWidth += cLength;
|
5300 |
+
lineWidth += trackingOffset;
|
5301 |
+
}
|
5302 |
+
}
|
5303 |
+
currentHeight += fontData.ascent*documentData.finalSize/100;
|
5304 |
+
if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
|
5305 |
+
documentData.finalSize -= 1;
|
5306 |
+
documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
|
5307 |
+
} else {
|
5308 |
+
documentData.finalText = finalText;
|
5309 |
+
len = documentData.finalText.length;
|
5310 |
+
flag = false;
|
5311 |
+
}
|
5312 |
+
}
|
5313 |
+
|
5314 |
+
}
|
5315 |
+
lineWidth = - trackingOffset;
|
5316 |
+
cLength = 0;
|
5317 |
+
var uncollapsedSpaces = 0;
|
5318 |
+
var currentChar;
|
5319 |
+
for (i = 0;i < len ;i += 1) {
|
5320 |
+
newLineFlag = false;
|
5321 |
+
currentChar = documentData.finalText[i];
|
5322 |
+
charCode = currentChar.charCodeAt(0);
|
5323 |
+
if (charCode === 13 || charCode === 3) {
|
5324 |
+
uncollapsedSpaces = 0;
|
5325 |
+
lineWidths.push(lineWidth);
|
5326 |
+
maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
|
5327 |
+
lineWidth = - 2 * trackingOffset;
|
5328 |
+
val = '';
|
5329 |
+
newLineFlag = true;
|
5330 |
+
currentLine += 1;
|
5331 |
+
}else{
|
5332 |
+
val = currentChar;
|
5333 |
+
}
|
5334 |
+
if(fontManager.chars){
|
5335 |
+
charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
|
5336 |
+
cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
|
5337 |
+
}else{
|
5338 |
+
//var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
|
5339 |
+
//tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
|
5340 |
+
cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
|
5341 |
+
}
|
5342 |
+
|
5343 |
+
//
|
5344 |
+
if(currentChar === ' '){
|
5345 |
+
uncollapsedSpaces += cLength + trackingOffset;
|
5346 |
+
} else {
|
5347 |
+
lineWidth += cLength + trackingOffset + uncollapsedSpaces;
|
5348 |
+
uncollapsedSpaces = 0;
|
5349 |
+
}
|
5350 |
+
letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
|
5351 |
+
if(anchorGrouping == 2){
|
5352 |
+
currentSize += cLength;
|
5353 |
+
if(val === '' || val === ' ' || i === len - 1){
|
5354 |
+
if(val === '' || val === ' '){
|
5355 |
+
currentSize -= cLength;
|
5356 |
+
}
|
5357 |
+
while(currentPos<=i){
|
5358 |
+
letters[currentPos].an = currentSize;
|
5359 |
+
letters[currentPos].ind = index;
|
5360 |
+
letters[currentPos].extra = cLength;
|
5361 |
+
currentPos += 1;
|
5362 |
+
}
|
5363 |
+
index += 1;
|
5364 |
+
currentSize = 0;
|
5365 |
+
}
|
5366 |
+
}else if(anchorGrouping == 3){
|
5367 |
+
currentSize += cLength;
|
5368 |
+
if(val === '' || i === len - 1){
|
5369 |
+
if(val === ''){
|
5370 |
+
currentSize -= cLength;
|
5371 |
+
}
|
5372 |
+
while(currentPos<=i){
|
5373 |
+
letters[currentPos].an = currentSize;
|
5374 |
+
letters[currentPos].ind = index;
|
5375 |
+
letters[currentPos].extra = cLength;
|
5376 |
+
currentPos += 1;
|
5377 |
+
}
|
5378 |
+
currentSize = 0;
|
5379 |
+
index += 1;
|
5380 |
+
}
|
5381 |
+
}else{
|
5382 |
+
letters[index].ind = index;
|
5383 |
+
letters[index].extra = 0;
|
5384 |
+
index += 1;
|
5385 |
+
}
|
5386 |
+
}
|
5387 |
+
documentData.l = letters;
|
5388 |
+
maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
|
5389 |
+
lineWidths.push(lineWidth);
|
5390 |
+
if(documentData.sz){
|
5391 |
+
documentData.boxWidth = documentData.sz[0];
|
5392 |
+
documentData.justifyOffset = 0;
|
5393 |
+
}else{
|
5394 |
+
documentData.boxWidth = maxLineWidth;
|
5395 |
+
switch(documentData.j){
|
5396 |
+
case 1:
|
5397 |
+
documentData.justifyOffset = - documentData.boxWidth;
|
5398 |
+
break;
|
5399 |
+
case 2:
|
5400 |
+
documentData.justifyOffset = - documentData.boxWidth/2;
|
5401 |
+
break;
|
5402 |
+
default:
|
5403 |
+
documentData.justifyOffset = 0;
|
5404 |
+
}
|
5405 |
+
}
|
5406 |
+
documentData.lineWidths = lineWidths;
|
5407 |
+
|
5408 |
+
var animators = data.a, animatorData, letterData;
|
5409 |
+
jLen = animators.length;
|
5410 |
+
var based, ind, indexes = [];
|
5411 |
+
for(j=0;j<jLen;j+=1){
|
5412 |
+
animatorData = animators[j];
|
5413 |
+
if(animatorData.a.sc){
|
5414 |
+
documentData.strokeColorAnim = true;
|
5415 |
+
}
|
5416 |
+
if(animatorData.a.sw){
|
5417 |
+
documentData.strokeWidthAnim = true;
|
5418 |
+
}
|
5419 |
+
if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
|
5420 |
+
documentData.fillColorAnim = true;
|
5421 |
+
}
|
5422 |
+
ind = 0;
|
5423 |
+
based = animatorData.s.b;
|
5424 |
+
for(i=0;i<len;i+=1){
|
5425 |
+
letterData = letters[i];
|
5426 |
+
letterData.anIndexes[j] = ind;
|
5427 |
+
if((based == 1 && letterData.val !== '') || (based == 2 && letterData.val !== '' && letterData.val !== ' ') || (based == 3 && (letterData.n || letterData.val == ' ' || i == len - 1)) || (based == 4 && (letterData.n || i == len - 1))){
|
5428 |
+
if(animatorData.s.rn === 1){
|
5429 |
+
indexes.push(ind);
|
5430 |
+
}
|
5431 |
+
ind += 1;
|
5432 |
+
}
|
5433 |
+
}
|
5434 |
+
data.a[j].s.totalChars = ind;
|
5435 |
+
var currentInd = -1, newInd;
|
5436 |
+
if(animatorData.s.rn === 1){
|
5437 |
+
for(i = 0; i < len; i += 1){
|
5438 |
+
letterData = letters[i];
|
5439 |
+
if(currentInd != letterData.anIndexes[j]){
|
5440 |
+
currentInd = letterData.anIndexes[j];
|
5441 |
+
newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
|
5442 |
+
}
|
5443 |
+
letterData.anIndexes[j] = newInd;
|
5444 |
+
}
|
5445 |
+
}
|
5446 |
+
}
|
5447 |
+
documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
|
5448 |
+
documentData.ls = documentData.ls || 0;
|
5449 |
+
documentData.ascent = fontData.ascent*documentData.finalSize/100;
|
5450 |
+
};
|
5451 |
+
|
5452 |
+
TextProperty.prototype.updateDocumentData = function(newData, index) {
|
5453 |
+
index = index === undefined ? this.keysIndex : index;
|
5454 |
+
var dData = this.copyData({}, this.data.d.k[index].s);
|
5455 |
+
dData = this.copyData(dData, newData);
|
5456 |
+
this.data.d.k[index].s = dData;
|
5457 |
+
this.recalculate(index);
|
5458 |
+
this.elem.addDynamicProperty(this);
|
5459 |
+
};
|
5460 |
+
|
5461 |
+
TextProperty.prototype.recalculate = function(index) {
|
5462 |
+
var dData = this.data.d.k[index].s;
|
5463 |
+
dData.__complete = false;
|
5464 |
+
this.keysIndex = 0;
|
5465 |
+
this._isFirstFrame = true;
|
5466 |
+
this.getValue(dData);
|
5467 |
+
}
|
5468 |
+
|
5469 |
+
TextProperty.prototype.canResizeFont = function(_canResize) {
|
5470 |
+
this.canResize = _canResize;
|
5471 |
+
this.recalculate(this.keysIndex);
|
5472 |
+
this.elem.addDynamicProperty(this);
|
5473 |
+
};
|
5474 |
+
|
5475 |
+
TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
|
5476 |
+
this.minimumFontSize = Math.floor(_fontValue) || 1;
|
5477 |
+
this.recalculate(this.keysIndex);
|
5478 |
+
this.elem.addDynamicProperty(this);
|
5479 |
+
};
|
5480 |
+
|
5481 |
+
var TextSelectorProp = (function(){
|
5482 |
+
var max = Math.max;
|
5483 |
+
var min = Math.min;
|
5484 |
+
var floor = Math.floor;
|
5485 |
+
|
5486 |
+
function TextSelectorProp(elem,data){
|
5487 |
+
this._currentTextLength = -1;
|
5488 |
+
this.k = false;
|
5489 |
+
this.data = data;
|
5490 |
+
this.elem = elem;
|
5491 |
+
this.comp = elem.comp;
|
5492 |
+
this.finalS = 0;
|
5493 |
+
this.finalE = 0;
|
5494 |
+
this.initDynamicPropertyContainer(elem);
|
5495 |
+
this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
|
5496 |
+
if('e' in data){
|
5497 |
+
this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
|
5498 |
+
}else{
|
5499 |
+
this.e = {v:100};
|
5500 |
+
}
|
5501 |
+
this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
|
5502 |
+
this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
|
5503 |
+
this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
|
5504 |
+
this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
|
5505 |
+
if(!this.dynamicProperties.length){
|
5506 |
+
this.getValue();
|
5507 |
+
}
|
5508 |
+
}
|
5509 |
+
|
5510 |
+
TextSelectorProp.prototype = {
|
5511 |
+
getMult: function(ind) {
|
5512 |
+
if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
|
5513 |
+
this.getValue();
|
5514 |
+
}
|
5515 |
+
//var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
|
5516 |
+
var x1 = 0;
|
5517 |
+
var y1 = 0;
|
5518 |
+
var x2 = 1;
|
5519 |
+
var y2 = 1;
|
5520 |
+
if(this.ne.v > 0) {
|
5521 |
+
x1 = this.ne.v / 100.0;
|
5522 |
+
}
|
5523 |
+
else {
|
5524 |
+
y1 = -this.ne.v / 100.0;
|
5525 |
+
}
|
5526 |
+
if(this.xe.v > 0) {
|
5527 |
+
x2 = 1.0 - this.xe.v / 100.0;
|
5528 |
+
}
|
5529 |
+
else {
|
5530 |
+
y2 = 1.0 + this.xe.v / 100.0;
|
5531 |
+
}
|
5532 |
+
var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
|
5533 |
+
|
5534 |
+
var mult = 0;
|
5535 |
+
var s = this.finalS;
|
5536 |
+
var e = this.finalE;
|
5537 |
+
var type = this.data.sh;
|
5538 |
+
if (type === 2){
|
5539 |
+
if (e === s) {
|
5540 |
+
mult = ind >= e ? 1 : 0;
|
5541 |
+
} else {
|
5542 |
+
mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
|
5543 |
+
}
|
5544 |
+
mult = easer(mult);
|
5545 |
+
} else if(type === 3) {
|
5546 |
+
if (e === s) {
|
5547 |
+
mult = ind >= e ? 0 : 1;
|
5548 |
+
}else{
|
5549 |
+
mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
|
5550 |
+
}
|
5551 |
+
|
5552 |
+
mult = easer(mult);
|
5553 |
+
} else if (type === 4) {
|
5554 |
+
if (e === s) {
|
5555 |
+
mult = 0;
|
5556 |
+
} else {
|
5557 |
+
mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
|
5558 |
+
if (mult < 0.5) {
|
5559 |
+
mult *= 2;
|
5560 |
+
} else {
|
5561 |
+
mult = 1 - 2 * (mult - 0.5);
|
5562 |
+
}
|
5563 |
+
}
|
5564 |
+
mult = easer(mult);
|
5565 |
+
} else if (type === 5) {
|
5566 |
+
if (e === s){
|
5567 |
+
mult = 0;
|
5568 |
+
} else {
|
5569 |
+
var tot = e - s;
|
5570 |
+
/*ind += 0.5;
|
5571 |
+
mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
|
5572 |
+
ind = min(max(0, ind + 0.5 - s), e - s);
|
5573 |
+
var x = -tot/2+ind;
|
5574 |
+
var a = tot/2;
|
5575 |
+
mult = Math.sqrt(1 - (x * x) / (a * a));
|
5576 |
+
}
|
5577 |
+
mult = easer(mult);
|
5578 |
+
} else if (type === 6) {
|
5579 |
+
if (e === s){
|
5580 |
+
mult = 0;
|
5581 |
+
} else {
|
5582 |
+
ind = min(max(0, ind + 0.5 - s), e - s);
|
5583 |
+
mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
|
5584 |
+
}
|
5585 |
+
mult = easer(mult);
|
5586 |
+
} else {
|
5587 |
+
if (ind >= floor(s)) {
|
5588 |
+
if (ind - s < 0) {
|
5589 |
+
mult = max(0, min(min(e, 1) - (s - ind), 1));
|
5590 |
+
} else {
|
5591 |
+
mult = max(0, min(e - ind, 1));
|
5592 |
+
}
|
5593 |
+
}
|
5594 |
+
mult = easer(mult);
|
5595 |
+
}
|
5596 |
+
return mult*this.a.v;
|
5597 |
+
},
|
5598 |
+
getValue: function(newCharsFlag) {
|
5599 |
+
this.iterateDynamicProperties();
|
5600 |
+
this._mdf = newCharsFlag || this._mdf;
|
5601 |
+
this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
|
5602 |
+
if(newCharsFlag && this.data.r === 2) {
|
5603 |
+
this.e.v = this._currentTextLength;
|
5604 |
+
}
|
5605 |
+
var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
|
5606 |
+
var o = this.o.v/divisor;
|
5607 |
+
var s = this.s.v/divisor + o;
|
5608 |
+
var e = (this.e.v/divisor) + o;
|
5609 |
+
if(s>e){
|
5610 |
+
var _s = s;
|
5611 |
+
s = e;
|
5612 |
+
e = _s;
|
5613 |
+
}
|
5614 |
+
this.finalS = s;
|
5615 |
+
this.finalE = e;
|
5616 |
+
}
|
5617 |
+
}
|
5618 |
+
extendPrototype([DynamicPropertyContainer], TextSelectorProp);
|
5619 |
+
|
5620 |
+
function getTextSelectorProp(elem, data,arr) {
|
5621 |
+
return new TextSelectorProp(elem, data, arr);
|
5622 |
+
}
|
5623 |
+
|
5624 |
+
return {
|
5625 |
+
getTextSelectorProp: getTextSelectorProp
|
5626 |
+
};
|
5627 |
+
}());
|
5628 |
+
|
5629 |
+
|
5630 |
+
var pool_factory = (function() {
|
5631 |
+
return function(initialLength, _create, _release, _clone) {
|
5632 |
+
|
5633 |
+
var _length = 0;
|
5634 |
+
var _maxLength = initialLength;
|
5635 |
+
var pool = createSizedArray(_maxLength);
|
5636 |
+
|
5637 |
+
var ob = {
|
5638 |
+
newElement: newElement,
|
5639 |
+
release: release
|
5640 |
+
};
|
5641 |
+
|
5642 |
+
function newElement(){
|
5643 |
+
var element;
|
5644 |
+
if(_length){
|
5645 |
+
_length -= 1;
|
5646 |
+
element = pool[_length];
|
5647 |
+
} else {
|
5648 |
+
element = _create();
|
5649 |
+
}
|
5650 |
+
return element;
|
5651 |
+
}
|
5652 |
+
|
5653 |
+
function release(element) {
|
5654 |
+
if(_length === _maxLength) {
|
5655 |
+
pool = pooling.double(pool);
|
5656 |
+
_maxLength = _maxLength*2;
|
5657 |
+
}
|
5658 |
+
if (_release) {
|
5659 |
+
_release(element);
|
5660 |
+
}
|
5661 |
+
pool[_length] = element;
|
5662 |
+
_length += 1;
|
5663 |
+
}
|
5664 |
+
|
5665 |
+
function clone() {
|
5666 |
+
var clonedElement = newElement();
|
5667 |
+
return _clone(clonedElement);
|
5668 |
+
}
|
5669 |
+
|
5670 |
+
return ob;
|
5671 |
+
};
|
5672 |
+
}());
|
5673 |
+
|
5674 |
+
var pooling = (function(){
|
5675 |
+
|
5676 |
+
function double(arr){
|
5677 |
+
return arr.concat(createSizedArray(arr.length));
|
5678 |
+
}
|
5679 |
+
|
5680 |
+
return {
|
5681 |
+
double: double
|
5682 |
+
};
|
5683 |
+
}());
|
5684 |
+
var point_pool = (function(){
|
5685 |
+
|
5686 |
+
function create() {
|
5687 |
+
return createTypedArray('float32', 2);
|
5688 |
+
}
|
5689 |
+
return pool_factory(8, create);
|
5690 |
+
}());
|
5691 |
+
var shape_pool = (function(){
|
5692 |
+
|
5693 |
+
function create() {
|
5694 |
+
return new ShapePath();
|
5695 |
+
}
|
5696 |
+
|
5697 |
+
function release(shapePath) {
|
5698 |
+
var len = shapePath._length, i;
|
5699 |
+
for(i = 0; i < len; i += 1) {
|
5700 |
+
point_pool.release(shapePath.v[i]);
|
5701 |
+
point_pool.release(shapePath.i[i]);
|
5702 |
+
point_pool.release(shapePath.o[i]);
|
5703 |
+
shapePath.v[i] = null;
|
5704 |
+
shapePath.i[i] = null;
|
5705 |
+
shapePath.o[i] = null;
|
5706 |
+
}
|
5707 |
+
shapePath._length = 0;
|
5708 |
+
shapePath.c = false;
|
5709 |
+
}
|
5710 |
+
|
5711 |
+
function clone(shape) {
|
5712 |
+
var cloned = factory.newElement();
|
5713 |
+
var i, len = shape._length === undefined ? shape.v.length : shape._length;
|
5714 |
+
cloned.setLength(len);
|
5715 |
+
cloned.c = shape.c;
|
5716 |
+
var pt;
|
5717 |
+
|
5718 |
+
for(i = 0; i < len; i += 1) {
|
5719 |
+
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);
|
5720 |
+
}
|
5721 |
+
return cloned;
|
5722 |
+
}
|
5723 |
+
|
5724 |
+
var factory = pool_factory(4, create, release);
|
5725 |
+
factory.clone = clone;
|
5726 |
+
|
5727 |
+
return factory;
|
5728 |
+
}());
|
5729 |
+
var shapeCollection_pool = (function(){
|
5730 |
+
var ob = {
|
5731 |
+
newShapeCollection: newShapeCollection,
|
5732 |
+
release: release
|
5733 |
+
};
|
5734 |
+
|
5735 |
+
var _length = 0;
|
5736 |
+
var _maxLength = 4;
|
5737 |
+
var pool = createSizedArray(_maxLength);
|
5738 |
+
|
5739 |
+
function newShapeCollection(){
|
5740 |
+
var shapeCollection;
|
5741 |
+
if(_length){
|
5742 |
+
_length -= 1;
|
5743 |
+
shapeCollection = pool[_length];
|
5744 |
+
} else {
|
5745 |
+
shapeCollection = new ShapeCollection();
|
5746 |
+
}
|
5747 |
+
return shapeCollection;
|
5748 |
+
}
|
5749 |
+
|
5750 |
+
function release(shapeCollection) {
|
5751 |
+
var i, len = shapeCollection._length;
|
5752 |
+
for(i = 0; i < len; i += 1) {
|
5753 |
+
shape_pool.release(shapeCollection.shapes[i]);
|
5754 |
+
}
|
5755 |
+
shapeCollection._length = 0;
|
5756 |
+
|
5757 |
+
if(_length === _maxLength) {
|
5758 |
+
pool = pooling.double(pool);
|
5759 |
+
_maxLength = _maxLength*2;
|
5760 |
+
}
|
5761 |
+
pool[_length] = shapeCollection;
|
5762 |
+
_length += 1;
|
5763 |
+
}
|
5764 |
+
|
5765 |
+
return ob;
|
5766 |
+
}());
|
5767 |
+
var segments_length_pool = (function(){
|
5768 |
+
|
5769 |
+
function create() {
|
5770 |
+
return {
|
5771 |
+
lengths: [],
|
5772 |
+
totalLength: 0
|
5773 |
+
};
|
5774 |
+
}
|
5775 |
+
|
5776 |
+
function release(element) {
|
5777 |
+
var i, len = element.lengths.length;
|
5778 |
+
for(i=0;i<len;i+=1) {
|
5779 |
+
bezier_length_pool.release(element.lengths[i]);
|
5780 |
+
}
|
5781 |
+
element.lengths.length = 0;
|
5782 |
+
}
|
5783 |
+
|
5784 |
+
return pool_factory(8, create, release);
|
5785 |
+
}());
|
5786 |
+
var bezier_length_pool = (function(){
|
5787 |
+
|
5788 |
+
function create() {
|
5789 |
+
return {
|
5790 |
+
addedLength: 0,
|
5791 |
+
percents: createTypedArray('float32', defaultCurveSegments),
|
5792 |
+
lengths: createTypedArray('float32', defaultCurveSegments),
|
5793 |
+
};
|
5794 |
+
}
|
5795 |
+
return pool_factory(8, create);
|
5796 |
+
}());
|
5797 |
+
function BaseRenderer(){}
|
5798 |
+
BaseRenderer.prototype.checkLayers = function(num){
|
5799 |
+
var i, len = this.layers.length, data;
|
5800 |
+
this.completeLayers = true;
|
5801 |
+
for (i = len - 1; i >= 0; i--) {
|
5802 |
+
if (!this.elements[i]) {
|
5803 |
+
data = this.layers[i];
|
5804 |
+
if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
|
5805 |
+
{
|
5806 |
+
this.buildItem(i);
|
5807 |
+
}
|
5808 |
+
}
|
5809 |
+
this.completeLayers = this.elements[i] ? this.completeLayers:false;
|
5810 |
+
}
|
5811 |
+
this.checkPendingElements();
|
5812 |
+
};
|
5813 |
+
|
5814 |
+
BaseRenderer.prototype.createItem = function(layer){
|
5815 |
+
switch(layer.ty){
|
5816 |
+
case 2:
|
5817 |
+
return this.createImage(layer);
|
5818 |
+
case 0:
|
5819 |
+
return this.createComp(layer);
|
5820 |
+
case 1:
|
5821 |
+
return this.createSolid(layer);
|
5822 |
+
case 3:
|
5823 |
+
return this.createNull(layer);
|
5824 |
+
case 4:
|
5825 |
+
return this.createShape(layer);
|
5826 |
+
case 5:
|
5827 |
+
return this.createText(layer);
|
5828 |
+
case 13:
|
5829 |
+
return this.createCamera(layer);
|
5830 |
+
}
|
5831 |
+
return this.createNull(layer);
|
5832 |
+
};
|
5833 |
+
|
5834 |
+
BaseRenderer.prototype.createCamera = function(){
|
5835 |
+
throw new Error('You\'re using a 3d camera. Try the html renderer.');
|
5836 |
+
};
|
5837 |
+
|
5838 |
+
BaseRenderer.prototype.buildAllItems = function(){
|
5839 |
+
var i, len = this.layers.length;
|
5840 |
+
for(i=0;i<len;i+=1){
|
5841 |
+
this.buildItem(i);
|
5842 |
+
}
|
5843 |
+
this.checkPendingElements();
|
5844 |
+
};
|
5845 |
+
|
5846 |
+
BaseRenderer.prototype.includeLayers = function(newLayers){
|
5847 |
+
this.completeLayers = false;
|
5848 |
+
var i, len = newLayers.length;
|
5849 |
+
var j, jLen = this.layers.length;
|
5850 |
+
for(i=0;i<len;i+=1){
|
5851 |
+
j = 0;
|
5852 |
+
while(j<jLen){
|
5853 |
+
if(this.layers[j].id == newLayers[i].id){
|
5854 |
+
this.layers[j] = newLayers[i];
|
5855 |
+
break;
|
5856 |
+
}
|
5857 |
+
j += 1;
|
5858 |
+
}
|
5859 |
+
}
|
5860 |
+
};
|
5861 |
+
|
5862 |
+
BaseRenderer.prototype.setProjectInterface = function(pInterface){
|
5863 |
+
this.globalData.projectInterface = pInterface;
|
5864 |
+
};
|
5865 |
+
|
5866 |
+
BaseRenderer.prototype.initItems = function(){
|
5867 |
+
if(!this.globalData.progressiveLoad){
|
5868 |
+
this.buildAllItems();
|
5869 |
+
}
|
5870 |
+
};
|
5871 |
+
BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
|
5872 |
+
var elements = this.elements;
|
5873 |
+
var layers = this.layers;
|
5874 |
+
var i=0, len = layers.length;
|
5875 |
+
while (i < len) {
|
5876 |
+
if (layers[i].ind == parentName) {
|
5877 |
+
if (!elements[i] || elements[i] === true) {
|
5878 |
+
this.buildItem(i);
|
5879 |
+
this.addPendingElement(element);
|
5880 |
+
} else {
|
5881 |
+
hierarchy.push(elements[i]);
|
5882 |
+
elements[i].setAsParent();
|
5883 |
+
if(layers[i].parent !== undefined) {
|
5884 |
+
this.buildElementParenting(element, layers[i].parent, hierarchy);
|
5885 |
+
} else {
|
5886 |
+
element.setHierarchy(hierarchy);
|
5887 |
+
}
|
5888 |
+
}
|
5889 |
+
}
|
5890 |
+
i += 1;
|
5891 |
+
}
|
5892 |
+
};
|
5893 |
+
|
5894 |
+
BaseRenderer.prototype.addPendingElement = function(element){
|
5895 |
+
this.pendingElements.push(element);
|
5896 |
+
};
|
5897 |
+
|
5898 |
+
BaseRenderer.prototype.searchExtraCompositions = function(assets){
|
5899 |
+
var i, len = assets.length;
|
5900 |
+
for(i=0;i<len;i+=1){
|
5901 |
+
if(assets[i].xt){
|
5902 |
+
var comp = this.createComp(assets[i]);
|
5903 |
+
comp.initExpressions();
|
5904 |
+
this.globalData.projectInterface.registerComposition(comp);
|
5905 |
+
}
|
5906 |
+
}
|
5907 |
+
};
|
5908 |
+
|
5909 |
+
BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
|
5910 |
+
this.globalData.fontManager = new FontManager();
|
5911 |
+
this.globalData.fontManager.addChars(animData.chars);
|
5912 |
+
this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
|
5913 |
+
this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
|
5914 |
+
this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
|
5915 |
+
this.globalData.imageLoader = this.animationItem.imagePreloader;
|
5916 |
+
this.globalData.frameId = 0;
|
5917 |
+
this.globalData.frameRate = animData.fr;
|
5918 |
+
this.globalData.nm = animData.nm;
|
5919 |
+
this.globalData.compSize = {
|
5920 |
+
w: animData.w,
|
5921 |
+
h: animData.h
|
5922 |
+
}
|
5923 |
+
}
|
5924 |
+
function SVGRenderer(animationItem, config){
|
5925 |
+
this.animationItem = animationItem;
|
5926 |
+
this.layers = null;
|
5927 |
+
this.renderedFrame = -1;
|
5928 |
+
this.svgElement = createNS('svg');
|
5929 |
+
var ariaLabel = '';
|
5930 |
+
if (config && config.title) {
|
5931 |
+
var titleElement = createNS('title');
|
5932 |
+
var titleId = createElementID();
|
5933 |
+
titleElement.setAttribute('id', titleId);
|
5934 |
+
titleElement.textContent = config.title;
|
5935 |
+
this.svgElement.appendChild(titleElement);
|
5936 |
+
ariaLabel += titleId;
|
5937 |
+
}
|
5938 |
+
if (config && config.description) {
|
5939 |
+
var descElement = createNS('desc');
|
5940 |
+
var descId = createElementID();
|
5941 |
+
descElement.setAttribute('id', descId);
|
5942 |
+
descElement.textContent = config.description;
|
5943 |
+
this.svgElement.appendChild(descElement);
|
5944 |
+
ariaLabel += ' ' + descId;
|
5945 |
+
}
|
5946 |
+
if (ariaLabel) {
|
5947 |
+
this.svgElement.setAttribute('aria-labelledby', ariaLabel)
|
5948 |
+
}
|
5949 |
+
var defs = createNS( 'defs');
|
5950 |
+
this.svgElement.appendChild(defs);
|
5951 |
+
var maskElement = createNS('g');
|
5952 |
+
this.svgElement.appendChild(maskElement);
|
5953 |
+
this.layerElement = maskElement;
|
5954 |
+
this.renderConfig = {
|
5955 |
+
preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
|
5956 |
+
imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
|
5957 |
+
progressiveLoad: (config && config.progressiveLoad) || false,
|
5958 |
+
hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
|
5959 |
+
viewBoxOnly: (config && config.viewBoxOnly) || false,
|
5960 |
+
viewBoxSize: (config && config.viewBoxSize) || false,
|
5961 |
+
className: (config && config.className) || '',
|
5962 |
+
id: (config && config.id) || '',
|
5963 |
+
focusable: config && config.focusable,
|
5964 |
+
filterSize: {
|
5965 |
+
width: config && config.filterSize && config.filterSize.width || '100%',
|
5966 |
+
height: config && config.filterSize && config.filterSize.height || '100%',
|
5967 |
+
x: config && config.filterSize && config.filterSize.x || '0%',
|
5968 |
+
y: config && config.filterSize && config.filterSize.y || '0%',
|
5969 |
+
}
|
5970 |
+
};
|
5971 |
+
|
5972 |
+
this.globalData = {
|
5973 |
+
_mdf: false,
|
5974 |
+
frameNum: -1,
|
5975 |
+
defs: defs,
|
5976 |
+
renderConfig: this.renderConfig
|
5977 |
+
};
|
5978 |
+
this.elements = [];
|
5979 |
+
this.pendingElements = [];
|
5980 |
+
this.destroyed = false;
|
5981 |
+
this.rendererType = 'svg';
|
5982 |
+
|
5983 |
+
}
|
5984 |
+
|
5985 |
+
extendPrototype([BaseRenderer],SVGRenderer);
|
5986 |
+
|
5987 |
+
SVGRenderer.prototype.createNull = function (data) {
|
5988 |
+
return new NullElement(data,this.globalData,this);
|
5989 |
+
};
|
5990 |
+
|
5991 |
+
SVGRenderer.prototype.createShape = function (data) {
|
5992 |
+
return new SVGShapeElement(data,this.globalData,this);
|
5993 |
+
};
|
5994 |
+
|
5995 |
+
SVGRenderer.prototype.createText = function (data) {
|
5996 |
+
return new SVGTextElement(data,this.globalData,this);
|
5997 |
+
|
5998 |
+
};
|
5999 |
+
|
6000 |
+
SVGRenderer.prototype.createImage = function (data) {
|
6001 |
+
return new IImageElement(data,this.globalData,this);
|
6002 |
+
};
|
6003 |
+
|
6004 |
+
SVGRenderer.prototype.createComp = function (data) {
|
6005 |
+
return new SVGCompElement(data,this.globalData,this);
|
6006 |
+
|
6007 |
+
};
|
6008 |
+
|
6009 |
+
SVGRenderer.prototype.createSolid = function (data) {
|
6010 |
+
return new ISolidElement(data,this.globalData,this);
|
6011 |
+
};
|
6012 |
+
|
6013 |
+
SVGRenderer.prototype.configAnimation = function(animData){
|
6014 |
+
this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
|
6015 |
+
if(this.renderConfig.viewBoxSize) {
|
6016 |
+
this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
|
6017 |
+
} else {
|
6018 |
+
this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
|
6019 |
+
}
|
6020 |
+
|
6021 |
+
if(!this.renderConfig.viewBoxOnly) {
|
6022 |
+
this.svgElement.setAttribute('width',animData.w);
|
6023 |
+
this.svgElement.setAttribute('height',animData.h);
|
6024 |
+
this.svgElement.style.width = '100%';
|
6025 |
+
this.svgElement.style.height = '100%';
|
6026 |
+
this.svgElement.style.transform = 'translate3d(0,0,0)';
|
6027 |
+
}
|
6028 |
+
if (this.renderConfig.className) {
|
6029 |
+
this.svgElement.setAttribute('class', this.renderConfig.className);
|
6030 |
+
}
|
6031 |
+
if (this.renderConfig.id) {
|
6032 |
+
this.svgElement.setAttribute('id', this.renderConfig.id);
|
6033 |
+
}
|
6034 |
+
if (this.renderConfig.focusable !== undefined) {
|
6035 |
+
this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
|
6036 |
+
}
|
6037 |
+
this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
|
6038 |
+
//this.layerElement.style.transform = 'translate3d(0,0,0)';
|
6039 |
+
//this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
|
6040 |
+
this.animationItem.wrapper.appendChild(this.svgElement);
|
6041 |
+
//Mask animation
|
6042 |
+
var defs = this.globalData.defs;
|
6043 |
+
|
6044 |
+
this.setupGlobalData(animData, defs);
|
6045 |
+
this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
|
6046 |
+
this.data = animData;
|
6047 |
+
|
6048 |
+
var maskElement = createNS( 'clipPath');
|
6049 |
+
var rect = createNS('rect');
|
6050 |
+
rect.setAttribute('width',animData.w);
|
6051 |
+
rect.setAttribute('height',animData.h);
|
6052 |
+
rect.setAttribute('x',0);
|
6053 |
+
rect.setAttribute('y',0);
|
6054 |
+
var maskId = createElementID();
|
6055 |
+
maskElement.setAttribute('id', maskId);
|
6056 |
+
maskElement.appendChild(rect);
|
6057 |
+
this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
|
6058 |
+
|
6059 |
+
defs.appendChild(maskElement);
|
6060 |
+
this.layers = animData.layers;
|
6061 |
+
this.elements = createSizedArray(animData.layers.length);
|
6062 |
+
};
|
6063 |
+
|
6064 |
+
|
6065 |
+
SVGRenderer.prototype.destroy = function () {
|
6066 |
+
this.animationItem.wrapper.innerHTML = '';
|
6067 |
+
this.layerElement = null;
|
6068 |
+
this.globalData.defs = null;
|
6069 |
+
var i, len = this.layers ? this.layers.length : 0;
|
6070 |
+
for (i = 0; i < len; i++) {
|
6071 |
+
if(this.elements[i]){
|
6072 |
+
this.elements[i].destroy();
|
6073 |
+
}
|
6074 |
+
}
|
6075 |
+
this.elements.length = 0;
|
6076 |
+
this.destroyed = true;
|
6077 |
+
this.animationItem = null;
|
6078 |
+
};
|
6079 |
+
|
6080 |
+
SVGRenderer.prototype.updateContainerSize = function () {
|
6081 |
+
};
|
6082 |
+
|
6083 |
+
SVGRenderer.prototype.buildItem = function(pos){
|
6084 |
+
var elements = this.elements;
|
6085 |
+
if(elements[pos] || this.layers[pos].ty == 99){
|
6086 |
+
return;
|
6087 |
+
}
|
6088 |
+
elements[pos] = true;
|
6089 |
+
var element = this.createItem(this.layers[pos]);
|
6090 |
+
|
6091 |
+
elements[pos] = element;
|
6092 |
+
if(expressionsPlugin){
|
6093 |
+
if(this.layers[pos].ty === 0){
|
6094 |
+
this.globalData.projectInterface.registerComposition(element);
|
6095 |
+
}
|
6096 |
+
element.initExpressions();
|
6097 |
+
}
|
6098 |
+
this.appendElementInPos(element,pos);
|
6099 |
+
if(this.layers[pos].tt){
|
6100 |
+
if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
|
6101 |
+
this.buildItem(pos - 1);
|
6102 |
+
this.addPendingElement(element);
|
6103 |
+
} else {
|
6104 |
+
element.setMatte(elements[pos - 1].layerId);
|
6105 |
+
}
|
6106 |
+
}
|
6107 |
+
};
|
6108 |
+
|
6109 |
+
SVGRenderer.prototype.checkPendingElements = function(){
|
6110 |
+
while(this.pendingElements.length){
|
6111 |
+
var element = this.pendingElements.pop();
|
6112 |
+
element.checkParenting();
|
6113 |
+
if(element.data.tt){
|
6114 |
+
var i = 0, len = this.elements.length;
|
6115 |
+
while(i<len){
|
6116 |
+
if(this.elements[i] === element){
|
6117 |
+
element.setMatte(this.elements[i - 1].layerId);
|
6118 |
+
break;
|
6119 |
+
}
|
6120 |
+
i += 1;
|
6121 |
+
}
|
6122 |
+
}
|
6123 |
+
}
|
6124 |
+
};
|
6125 |
+
|
6126 |
+
SVGRenderer.prototype.renderFrame = function(num){
|
6127 |
+
if(this.renderedFrame === num || this.destroyed){
|
6128 |
+
return;
|
6129 |
+
}
|
6130 |
+
if(num === null){
|
6131 |
+
num = this.renderedFrame;
|
6132 |
+
}else{
|
6133 |
+
this.renderedFrame = num;
|
6134 |
+
}
|
6135 |
+
// console.log('-------');
|
6136 |
+
// console.log('FRAME ',num);
|
6137 |
+
this.globalData.frameNum = num;
|
6138 |
+
this.globalData.frameId += 1;
|
6139 |
+
this.globalData.projectInterface.currentFrame = num;
|
6140 |
+
this.globalData._mdf = false;
|
6141 |
+
var i, len = this.layers.length;
|
6142 |
+
if(!this.completeLayers){
|
6143 |
+
this.checkLayers(num);
|
6144 |
+
}
|
6145 |
+
for (i = len - 1; i >= 0; i--) {
|
6146 |
+
if(this.completeLayers || this.elements[i]){
|
6147 |
+
this.elements[i].prepareFrame(num - this.layers[i].st);
|
6148 |
+
}
|
6149 |
+
}
|
6150 |
+
if(this.globalData._mdf) {
|
6151 |
+
for (i = 0; i < len; i += 1) {
|
6152 |
+
if(this.completeLayers || this.elements[i]){
|
6153 |
+
this.elements[i].renderFrame();
|
6154 |
+
}
|
6155 |
+
}
|
6156 |
+
}
|
6157 |
+
};
|
6158 |
+
|
6159 |
+
SVGRenderer.prototype.appendElementInPos = function(element, pos){
|
6160 |
+
var newElement = element.getBaseElement();
|
6161 |
+
if(!newElement){
|
6162 |
+
return;
|
6163 |
+
}
|
6164 |
+
var i = 0;
|
6165 |
+
var nextElement;
|
6166 |
+
while(i<pos){
|
6167 |
+
if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
|
6168 |
+
nextElement = this.elements[i].getBaseElement();
|
6169 |
+
}
|
6170 |
+
i += 1;
|
6171 |
+
}
|
6172 |
+
if(nextElement){
|
6173 |
+
this.layerElement.insertBefore(newElement, nextElement);
|
6174 |
+
} else {
|
6175 |
+
this.layerElement.appendChild(newElement);
|
6176 |
+
}
|
6177 |
+
};
|
6178 |
+
|
6179 |
+
SVGRenderer.prototype.hide = function(){
|
6180 |
+
this.layerElement.style.display = 'none';
|
6181 |
+
};
|
6182 |
+
|
6183 |
+
SVGRenderer.prototype.show = function(){
|
6184 |
+
this.layerElement.style.display = 'block';
|
6185 |
+
};
|
6186 |
+
|
6187 |
+
function CanvasRenderer(animationItem, config){
|
6188 |
+
this.animationItem = animationItem;
|
6189 |
+
this.renderConfig = {
|
6190 |
+
clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
|
6191 |
+
context: (config && config.context) || null,
|
6192 |
+
progressiveLoad: (config && config.progressiveLoad) || false,
|
6193 |
+
preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
|
6194 |
+
imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
|
6195 |
+
className: (config && config.className) || '',
|
6196 |
+
id: (config && config.id) || '',
|
6197 |
+
};
|
6198 |
+
this.renderConfig.dpr = (config && config.dpr) || 1;
|
6199 |
+
if (this.animationItem.wrapper) {
|
6200 |
+
this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
|
6201 |
+
}
|
6202 |
+
this.renderedFrame = -1;
|
6203 |
+
this.globalData = {
|
6204 |
+
frameNum: -1,
|
6205 |
+
_mdf: false,
|
6206 |
+
renderConfig: this.renderConfig,
|
6207 |
+
currentGlobalAlpha: -1
|
6208 |
+
};
|
6209 |
+
this.contextData = new CVContextData();
|
6210 |
+
this.elements = [];
|
6211 |
+
this.pendingElements = [];
|
6212 |
+
this.transformMat = new Matrix();
|
6213 |
+
this.completeLayers = false;
|
6214 |
+
this.rendererType = 'canvas';
|
6215 |
+
}
|
6216 |
+
extendPrototype([BaseRenderer],CanvasRenderer);
|
6217 |
+
|
6218 |
+
CanvasRenderer.prototype.createShape = function (data) {
|
6219 |
+
return new CVShapeElement(data, this.globalData, this);
|
6220 |
+
};
|
6221 |
+
|
6222 |
+
CanvasRenderer.prototype.createText = function (data) {
|
6223 |
+
return new CVTextElement(data, this.globalData, this);
|
6224 |
+
};
|
6225 |
+
|
6226 |
+
CanvasRenderer.prototype.createImage = function (data) {
|
6227 |
+
return new CVImageElement(data, this.globalData, this);
|
6228 |
+
};
|
6229 |
+
|
6230 |
+
CanvasRenderer.prototype.createComp = function (data) {
|
6231 |
+
return new CVCompElement(data, this.globalData, this);
|
6232 |
+
};
|
6233 |
+
|
6234 |
+
CanvasRenderer.prototype.createSolid = function (data) {
|
6235 |
+
return new CVSolidElement(data, this.globalData, this);
|
6236 |
+
};
|
6237 |
+
|
6238 |
+
CanvasRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
|
6239 |
+
|
6240 |
+
CanvasRenderer.prototype.ctxTransform = function(props){
|
6241 |
+
if(props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0){
|
6242 |
+
return;
|
6243 |
+
}
|
6244 |
+
if(!this.renderConfig.clearCanvas){
|
6245 |
+
this.canvasContext.transform(props[0],props[1],props[4],props[5],props[12],props[13]);
|
6246 |
+
return;
|
6247 |
+
}
|
6248 |
+
this.transformMat.cloneFromProps(props);
|
6249 |
+
var cProps = this.contextData.cTr.props;
|
6250 |
+
this.transformMat.transform(cProps[0],cProps[1],cProps[2],cProps[3],cProps[4],cProps[5],cProps[6],cProps[7],cProps[8],cProps[9],cProps[10],cProps[11],cProps[12],cProps[13],cProps[14],cProps[15]);
|
6251 |
+
//this.contextData.cTr.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]);
|
6252 |
+
this.contextData.cTr.cloneFromProps(this.transformMat.props);
|
6253 |
+
var trProps = this.contextData.cTr.props;
|
6254 |
+
this.canvasContext.setTransform(trProps[0],trProps[1],trProps[4],trProps[5],trProps[12],trProps[13]);
|
6255 |
+
};
|
6256 |
+
|
6257 |
+
CanvasRenderer.prototype.ctxOpacity = function(op){
|
6258 |
+
/*if(op === 1){
|
6259 |
+
return;
|
6260 |
+
}*/
|
6261 |
+
if(!this.renderConfig.clearCanvas){
|
6262 |
+
this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
|
6263 |
+
this.globalData.currentGlobalAlpha = this.contextData.cO;
|
6264 |
+
return;
|
6265 |
+
}
|
6266 |
+
this.contextData.cO *= op < 0 ? 0 : op;
|
6267 |
+
if(this.globalData.currentGlobalAlpha !== this.contextData.cO) {
|
6268 |
+
this.canvasContext.globalAlpha = this.contextData.cO;
|
6269 |
+
this.globalData.currentGlobalAlpha = this.contextData.cO;
|
6270 |
+
}
|
6271 |
+
};
|
6272 |
+
|
6273 |
+
CanvasRenderer.prototype.reset = function(){
|
6274 |
+
if(!this.renderConfig.clearCanvas){
|
6275 |
+
this.canvasContext.restore();
|
6276 |
+
return;
|
6277 |
+
}
|
6278 |
+
this.contextData.reset();
|
6279 |
+
};
|
6280 |
+
|
6281 |
+
CanvasRenderer.prototype.save = function(actionFlag){
|
6282 |
+
if(!this.renderConfig.clearCanvas){
|
6283 |
+
this.canvasContext.save();
|
6284 |
+
return;
|
6285 |
+
}
|
6286 |
+
if(actionFlag){
|
6287 |
+
this.canvasContext.save();
|
6288 |
+
}
|
6289 |
+
var props = this.contextData.cTr.props;
|
6290 |
+
if(this.contextData._length <= this.contextData.cArrPos) {
|
6291 |
+
this.contextData.duplicate();
|
6292 |
+
}
|
6293 |
+
var i, arr = this.contextData.saved[this.contextData.cArrPos];
|
6294 |
+
for (i = 0; i < 16; i += 1) {
|
6295 |
+
arr[i] = props[i];
|
6296 |
+
}
|
6297 |
+
this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
|
6298 |
+
this.contextData.cArrPos += 1;
|
6299 |
+
};
|
6300 |
+
|
6301 |
+
CanvasRenderer.prototype.restore = function(actionFlag){
|
6302 |
+
if(!this.renderConfig.clearCanvas){
|
6303 |
+
this.canvasContext.restore();
|
6304 |
+
return;
|
6305 |
+
}
|
6306 |
+
if(actionFlag){
|
6307 |
+
this.canvasContext.restore();
|
6308 |
+
this.globalData.blendMode = 'source-over';
|
6309 |
+
}
|
6310 |
+
this.contextData.cArrPos -= 1;
|
6311 |
+
var popped = this.contextData.saved[this.contextData.cArrPos];
|
6312 |
+
var i,arr = this.contextData.cTr.props;
|
6313 |
+
for(i=0;i<16;i+=1){
|
6314 |
+
arr[i] = popped[i];
|
6315 |
+
}
|
6316 |
+
this.canvasContext.setTransform(popped[0],popped[1],popped[4],popped[5],popped[12],popped[13]);
|
6317 |
+
popped = this.contextData.savedOp[this.contextData.cArrPos];
|
6318 |
+
this.contextData.cO = popped;
|
6319 |
+
if(this.globalData.currentGlobalAlpha !== popped) {
|
6320 |
+
this.canvasContext.globalAlpha = popped;
|
6321 |
+
this.globalData.currentGlobalAlpha = popped;
|
6322 |
+
}
|
6323 |
+
};
|
6324 |
+
|
6325 |
+
CanvasRenderer.prototype.configAnimation = function(animData){
|
6326 |
+
if(this.animationItem.wrapper){
|
6327 |
+
this.animationItem.container = createTag('canvas');
|
6328 |
+
this.animationItem.container.style.width = '100%';
|
6329 |
+
this.animationItem.container.style.height = '100%';
|
6330 |
+
//this.animationItem.container.style.transform = 'translate3d(0,0,0)';
|
6331 |
+
//this.animationItem.container.style.webkitTransform = 'translate3d(0,0,0)';
|
6332 |
+
this.animationItem.container.style.transformOrigin = this.animationItem.container.style.mozTransformOrigin = this.animationItem.container.style.webkitTransformOrigin = this.animationItem.container.style['-webkit-transform'] = "0px 0px 0px";
|
6333 |
+
this.animationItem.wrapper.appendChild(this.animationItem.container);
|
6334 |
+
this.canvasContext = this.animationItem.container.getContext('2d');
|
6335 |
+
if(this.renderConfig.className) {
|
6336 |
+
this.animationItem.container.setAttribute('class', this.renderConfig.className);
|
6337 |
+
}
|
6338 |
+
if(this.renderConfig.id) {
|
6339 |
+
this.animationItem.container.setAttribute('id', this.renderConfig.id);
|
6340 |
+
}
|
6341 |
+
}else{
|
6342 |
+
this.canvasContext = this.renderConfig.context;
|
6343 |
+
}
|
6344 |
+
this.data = animData;
|
6345 |
+
this.layers = animData.layers;
|
6346 |
+
this.transformCanvas = {
|
6347 |
+
w: animData.w,
|
6348 |
+
h:animData.h,
|
6349 |
+
sx:0,
|
6350 |
+
sy:0,
|
6351 |
+
tx:0,
|
6352 |
+
ty:0
|
6353 |
+
};
|
6354 |
+
this.setupGlobalData(animData, document.body);
|
6355 |
+
this.globalData.canvasContext = this.canvasContext;
|
6356 |
+
this.globalData.renderer = this;
|
6357 |
+
this.globalData.isDashed = false;
|
6358 |
+
this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
|
6359 |
+
this.globalData.transformCanvas = this.transformCanvas;
|
6360 |
+
this.elements = createSizedArray(animData.layers.length);
|
6361 |
+
|
6362 |
+
this.updateContainerSize();
|
6363 |
+
};
|
6364 |
+
|
6365 |
+
CanvasRenderer.prototype.updateContainerSize = function () {
|
6366 |
+
this.reset();
|
6367 |
+
var elementWidth,elementHeight;
|
6368 |
+
if(this.animationItem.wrapper && this.animationItem.container){
|
6369 |
+
elementWidth = this.animationItem.wrapper.offsetWidth;
|
6370 |
+
elementHeight = this.animationItem.wrapper.offsetHeight;
|
6371 |
+
this.animationItem.container.setAttribute('width',elementWidth * this.renderConfig.dpr );
|
6372 |
+
this.animationItem.container.setAttribute('height',elementHeight * this.renderConfig.dpr);
|
6373 |
+
}else{
|
6374 |
+
elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
|
6375 |
+
elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
|
6376 |
+
}
|
6377 |
+
var elementRel,animationRel;
|
6378 |
+
if(this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1){
|
6379 |
+
var par = this.renderConfig.preserveAspectRatio.split(' ');
|
6380 |
+
var fillType = par[1] || 'meet';
|
6381 |
+
var pos = par[0] || 'xMidYMid';
|
6382 |
+
var xPos = pos.substr(0,4);
|
6383 |
+
var yPos = pos.substr(4);
|
6384 |
+
elementRel = elementWidth/elementHeight;
|
6385 |
+
animationRel = this.transformCanvas.w/this.transformCanvas.h;
|
6386 |
+
if(animationRel>elementRel && fillType === 'meet' || animationRel<elementRel && fillType === 'slice'){
|
6387 |
+
this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
|
6388 |
+
this.transformCanvas.sy = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
|
6389 |
+
}else{
|
6390 |
+
this.transformCanvas.sx = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
|
6391 |
+
this.transformCanvas.sy = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
|
6392 |
+
}
|
6393 |
+
|
6394 |
+
if(xPos === 'xMid' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
|
6395 |
+
this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))/2*this.renderConfig.dpr;
|
6396 |
+
} else if(xPos === 'xMax' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
|
6397 |
+
this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))*this.renderConfig.dpr;
|
6398 |
+
} else {
|
6399 |
+
this.transformCanvas.tx = 0;
|
6400 |
+
}
|
6401 |
+
if(yPos === 'YMid' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
|
6402 |
+
this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w))/2)*this.renderConfig.dpr;
|
6403 |
+
} else if(yPos === 'YMax' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
|
6404 |
+
this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w)))*this.renderConfig.dpr;
|
6405 |
+
} else {
|
6406 |
+
this.transformCanvas.ty = 0;
|
6407 |
+
}
|
6408 |
+
|
6409 |
+
}else if(this.renderConfig.preserveAspectRatio == 'none'){
|
6410 |
+
this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
|
6411 |
+
this.transformCanvas.sy = elementHeight/(this.transformCanvas.h/this.renderConfig.dpr);
|
6412 |
+
this.transformCanvas.tx = 0;
|
6413 |
+
this.transformCanvas.ty = 0;
|
6414 |
+
}else{
|
6415 |
+
this.transformCanvas.sx = this.renderConfig.dpr;
|
6416 |
+
this.transformCanvas.sy = this.renderConfig.dpr;
|
6417 |
+
this.transformCanvas.tx = 0;
|
6418 |
+
this.transformCanvas.ty = 0;
|
6419 |
+
}
|
6420 |
+
this.transformCanvas.props = [this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1];
|
6421 |
+
/*var i, len = this.elements.length;
|
6422 |
+
for(i=0;i<len;i+=1){
|
6423 |
+
if(this.elements[i] && this.elements[i].data.ty === 0){
|
6424 |
+
this.elements[i].resize(this.globalData.transformCanvas);
|
6425 |
+
}
|
6426 |
+
}*/
|
6427 |
+
this.ctxTransform(this.transformCanvas.props);
|
6428 |
+
this.canvasContext.beginPath();
|
6429 |
+
this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
|
6430 |
+
this.canvasContext.closePath();
|
6431 |
+
this.canvasContext.clip();
|
6432 |
+
|
6433 |
+
this.renderFrame(this.renderedFrame, true);
|
6434 |
+
};
|
6435 |
+
|
6436 |
+
CanvasRenderer.prototype.destroy = function () {
|
6437 |
+
if(this.renderConfig.clearCanvas) {
|
6438 |
+
this.animationItem.wrapper.innerHTML = '';
|
6439 |
+
}
|
6440 |
+
var i, len = this.layers ? this.layers.length : 0;
|
6441 |
+
for (i = len - 1; i >= 0; i-=1) {
|
6442 |
+
if(this.elements[i]) {
|
6443 |
+
this.elements[i].destroy();
|
6444 |
+
}
|
6445 |
+
}
|
6446 |
+
this.elements.length = 0;
|
6447 |
+
this.globalData.canvasContext = null;
|
6448 |
+
this.animationItem.container = null;
|
6449 |
+
this.destroyed = true;
|
6450 |
+
};
|
6451 |
+
|
6452 |
+
CanvasRenderer.prototype.renderFrame = function(num, forceRender){
|
6453 |
+
if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){
|
6454 |
+
return;
|
6455 |
+
}
|
6456 |
+
this.renderedFrame = num;
|
6457 |
+
this.globalData.frameNum = num - this.animationItem._isFirstFrame;
|
6458 |
+
this.globalData.frameId += 1;
|
6459 |
+
this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
|
6460 |
+
this.globalData.projectInterface.currentFrame = num;
|
6461 |
+
|
6462 |
+
// console.log('--------');
|
6463 |
+
// console.log('NEW: ',num);
|
6464 |
+
var i, len = this.layers.length;
|
6465 |
+
if(!this.completeLayers){
|
6466 |
+
this.checkLayers(num);
|
6467 |
+
}
|
6468 |
+
|
6469 |
+
for (i = 0; i < len; i++) {
|
6470 |
+
if(this.completeLayers || this.elements[i]){
|
6471 |
+
this.elements[i].prepareFrame(num - this.layers[i].st);
|
6472 |
+
}
|
6473 |
+
}
|
6474 |
+
if(this.globalData._mdf) {
|
6475 |
+
if(this.renderConfig.clearCanvas === true){
|
6476 |
+
this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
|
6477 |
+
}else{
|
6478 |
+
this.save();
|
6479 |
+
}
|
6480 |
+
for (i = len - 1; i >= 0; i-=1) {
|
6481 |
+
if(this.completeLayers || this.elements[i]){
|
6482 |
+
this.elements[i].renderFrame();
|
6483 |
+
}
|
6484 |
+
}
|
6485 |
+
if(this.renderConfig.clearCanvas !== true){
|
6486 |
+
this.restore();
|
6487 |
+
}
|
6488 |
+
}
|
6489 |
+
};
|
6490 |
+
|
6491 |
+
CanvasRenderer.prototype.buildItem = function(pos){
|
6492 |
+
var elements = this.elements;
|
6493 |
+
if(elements[pos] || this.layers[pos].ty == 99){
|
6494 |
+
return;
|
6495 |
+
}
|
6496 |
+
var element = this.createItem(this.layers[pos], this,this.globalData);
|
6497 |
+
elements[pos] = element;
|
6498 |
+
element.initExpressions();
|
6499 |
+
/*if(this.layers[pos].ty === 0){
|
6500 |
+
element.resize(this.globalData.transformCanvas);
|
6501 |
+
}*/
|
6502 |
+
};
|
6503 |
+
|
6504 |
+
CanvasRenderer.prototype.checkPendingElements = function(){
|
6505 |
+
while(this.pendingElements.length){
|
6506 |
+
var element = this.pendingElements.pop();
|
6507 |
+
element.checkParenting();
|
6508 |
+
}
|
6509 |
+
};
|
6510 |
+
|
6511 |
+
CanvasRenderer.prototype.hide = function(){
|
6512 |
+
this.animationItem.container.style.display = 'none';
|
6513 |
+
};
|
6514 |
+
|
6515 |
+
CanvasRenderer.prototype.show = function(){
|
6516 |
+
this.animationItem.container.style.display = 'block';
|
6517 |
+
};
|
6518 |
+
|
6519 |
+
function HybridRenderer(animationItem, config){
|
6520 |
+
this.animationItem = animationItem;
|
6521 |
+
this.layers = null;
|
6522 |
+
this.renderedFrame = -1;
|
6523 |
+
this.renderConfig = {
|
6524 |
+
className: (config && config.className) || '',
|
6525 |
+
imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
|
6526 |
+
hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
|
6527 |
+
filterSize: {
|
6528 |
+
width: config && config.filterSize && config.filterSize.width || '400%',
|
6529 |
+
height: config && config.filterSize && config.filterSize.height || '400%',
|
6530 |
+
x: config && config.filterSize && config.filterSize.x || '-100%',
|
6531 |
+
y: config && config.filterSize && config.filterSize.y || '-100%',
|
6532 |
+
}
|
6533 |
+
};
|
6534 |
+
this.globalData = {
|
6535 |
+
_mdf: false,
|
6536 |
+
frameNum: -1,
|
6537 |
+
renderConfig: this.renderConfig
|
6538 |
+
};
|
6539 |
+
this.pendingElements = [];
|
6540 |
+
this.elements = [];
|
6541 |
+
this.threeDElements = [];
|
6542 |
+
this.destroyed = false;
|
6543 |
+
this.camera = null;
|
6544 |
+
this.supports3d = true;
|
6545 |
+
this.rendererType = 'html';
|
6546 |
+
|
6547 |
+
}
|
6548 |
+
|
6549 |
+
extendPrototype([BaseRenderer],HybridRenderer);
|
6550 |
+
|
6551 |
+
HybridRenderer.prototype.buildItem = SVGRenderer.prototype.buildItem;
|
6552 |
+
|
6553 |
+
HybridRenderer.prototype.checkPendingElements = function(){
|
6554 |
+
while(this.pendingElements.length){
|
6555 |
+
var element = this.pendingElements.pop();
|
6556 |
+
element.checkParenting();
|
6557 |
+
}
|
6558 |
+
};
|
6559 |
+
|
6560 |
+
HybridRenderer.prototype.appendElementInPos = function(element, pos){
|
6561 |
+
var newDOMElement = element.getBaseElement();
|
6562 |
+
if(!newDOMElement){
|
6563 |
+
return;
|
6564 |
+
}
|
6565 |
+
var layer = this.layers[pos];
|
6566 |
+
if(!layer.ddd || !this.supports3d){
|
6567 |
+
if(this.threeDElements) {
|
6568 |
+
this.addTo3dContainer(newDOMElement,pos);
|
6569 |
+
} else {
|
6570 |
+
var i = 0;
|
6571 |
+
var nextDOMElement, nextLayer, tmpDOMElement;
|
6572 |
+
while(i<pos){
|
6573 |
+
if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement){
|
6574 |
+
nextLayer = this.elements[i];
|
6575 |
+
tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
|
6576 |
+
nextDOMElement = tmpDOMElement || nextDOMElement;
|
6577 |
+
}
|
6578 |
+
i += 1;
|
6579 |
+
}
|
6580 |
+
if(nextDOMElement){
|
6581 |
+
if(!layer.ddd || !this.supports3d){
|
6582 |
+
this.layerElement.insertBefore(newDOMElement, nextDOMElement);
|
6583 |
+
}
|
6584 |
+
} else {
|
6585 |
+
if(!layer.ddd || !this.supports3d){
|
6586 |
+
this.layerElement.appendChild(newDOMElement);
|
6587 |
+
}
|
6588 |
+
}
|
6589 |
+
}
|
6590 |
+
|
6591 |
+
} else {
|
6592 |
+
this.addTo3dContainer(newDOMElement,pos);
|
6593 |
+
}
|
6594 |
+
};
|
6595 |
+
|
6596 |
+
HybridRenderer.prototype.createShape = function (data) {
|
6597 |
+
if(!this.supports3d){
|
6598 |
+
return new SVGShapeElement(data, this.globalData, this);
|
6599 |
+
}
|
6600 |
+
return new HShapeElement(data, this.globalData, this);
|
6601 |
+
};
|
6602 |
+
|
6603 |
+
HybridRenderer.prototype.createText = function (data) {
|
6604 |
+
if(!this.supports3d){
|
6605 |
+
return new SVGTextElement(data, this.globalData, this);
|
6606 |
+
}
|
6607 |
+
return new HTextElement(data, this.globalData, this);
|
6608 |
+
};
|
6609 |
+
|
6610 |
+
HybridRenderer.prototype.createCamera = function (data) {
|
6611 |
+
this.camera = new HCameraElement(data, this.globalData, this);
|
6612 |
+
return this.camera;
|
6613 |
+
};
|
6614 |
+
|
6615 |
+
HybridRenderer.prototype.createImage = function (data) {
|
6616 |
+
if(!this.supports3d){
|
6617 |
+
return new IImageElement(data, this.globalData, this);
|
6618 |
+
}
|
6619 |
+
return new HImageElement(data, this.globalData, this);
|
6620 |
+
};
|
6621 |
+
|
6622 |
+
HybridRenderer.prototype.createComp = function (data) {
|
6623 |
+
if(!this.supports3d){
|
6624 |
+
return new SVGCompElement(data, this.globalData, this);
|
6625 |
+
}
|
6626 |
+
return new HCompElement(data, this.globalData, this);
|
6627 |
+
|
6628 |
+
};
|
6629 |
+
|
6630 |
+
HybridRenderer.prototype.createSolid = function (data) {
|
6631 |
+
if(!this.supports3d){
|
6632 |
+
return new ISolidElement(data, this.globalData, this);
|
6633 |
+
}
|
6634 |
+
return new HSolidElement(data, this.globalData, this);
|
6635 |
+
};
|
6636 |
+
|
6637 |
+
HybridRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
|
6638 |
+
|
6639 |
+
HybridRenderer.prototype.getThreeDContainerByPos = function(pos){
|
6640 |
+
var i = 0, len = this.threeDElements.length;
|
6641 |
+
while(i<len) {
|
6642 |
+
if(this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
|
6643 |
+
return this.threeDElements[i].perspectiveElem;
|
6644 |
+
}
|
6645 |
+
i += 1;
|
6646 |
+
}
|
6647 |
+
};
|
6648 |
+
|
6649 |
+
HybridRenderer.prototype.createThreeDContainer = function(pos, type){
|
6650 |
+
var perspectiveElem = createTag('div');
|
6651 |
+
styleDiv(perspectiveElem);
|
6652 |
+
var container = createTag('div');
|
6653 |
+
styleDiv(container);
|
6654 |
+
if(type === '3d') {
|
6655 |
+
perspectiveElem.style.width = this.globalData.compSize.w+'px';
|
6656 |
+
perspectiveElem.style.height = this.globalData.compSize.h+'px';
|
6657 |
+
perspectiveElem.style.transformOrigin = perspectiveElem.style.mozTransformOrigin = perspectiveElem.style.webkitTransformOrigin = "50% 50%";
|
6658 |
+
container.style.transform = container.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
|
6659 |
+
}
|
6660 |
+
|
6661 |
+
perspectiveElem.appendChild(container);
|
6662 |
+
//this.resizerElem.appendChild(perspectiveElem);
|
6663 |
+
var threeDContainerData = {
|
6664 |
+
container:container,
|
6665 |
+
perspectiveElem:perspectiveElem,
|
6666 |
+
startPos: pos,
|
6667 |
+
endPos: pos,
|
6668 |
+
type: type
|
6669 |
+
};
|
6670 |
+
this.threeDElements.push(threeDContainerData);
|
6671 |
+
return threeDContainerData;
|
6672 |
+
};
|
6673 |
+
|
6674 |
+
HybridRenderer.prototype.build3dContainers = function(){
|
6675 |
+
var i, len = this.layers.length;
|
6676 |
+
var lastThreeDContainerData;
|
6677 |
+
var currentContainer = '';
|
6678 |
+
for(i=0;i<len;i+=1){
|
6679 |
+
if(this.layers[i].ddd && this.layers[i].ty !== 3){
|
6680 |
+
if(currentContainer !== '3d'){
|
6681 |
+
currentContainer = '3d';
|
6682 |
+
lastThreeDContainerData = this.createThreeDContainer(i,'3d');
|
6683 |
+
}
|
6684 |
+
lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
|
6685 |
+
} else {
|
6686 |
+
if(currentContainer !== '2d'){
|
6687 |
+
currentContainer = '2d';
|
6688 |
+
lastThreeDContainerData = this.createThreeDContainer(i,'2d');
|
6689 |
+
}
|
6690 |
+
lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
|
6691 |
+
}
|
6692 |
+
}
|
6693 |
+
len = this.threeDElements.length;
|
6694 |
+
for(i = len - 1; i >= 0; i --) {
|
6695 |
+
this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
|
6696 |
+
}
|
6697 |
+
};
|
6698 |
+
|
6699 |
+
HybridRenderer.prototype.addTo3dContainer = function(elem,pos){
|
6700 |
+
var i = 0, len = this.threeDElements.length;
|
6701 |
+
while(i<len){
|
6702 |
+
if(pos <= this.threeDElements[i].endPos){
|
6703 |
+
var j = this.threeDElements[i].startPos;
|
6704 |
+
var nextElement;
|
6705 |
+
while(j<pos){
|
6706 |
+
if(this.elements[j] && this.elements[j].getBaseElement){
|
6707 |
+
nextElement = this.elements[j].getBaseElement();
|
6708 |
+
}
|
6709 |
+
j += 1;
|
6710 |
+
}
|
6711 |
+
if(nextElement){
|
6712 |
+
this.threeDElements[i].container.insertBefore(elem, nextElement);
|
6713 |
+
} else {
|
6714 |
+
this.threeDElements[i].container.appendChild(elem);
|
6715 |
+
}
|
6716 |
+
break;
|
6717 |
+
}
|
6718 |
+
i += 1;
|
6719 |
+
}
|
6720 |
+
};
|
6721 |
+
|
6722 |
+
HybridRenderer.prototype.configAnimation = function(animData){
|
6723 |
+
var resizerElem = createTag('div');
|
6724 |
+
var wrapper = this.animationItem.wrapper;
|
6725 |
+
resizerElem.style.width = animData.w+'px';
|
6726 |
+
resizerElem.style.height = animData.h+'px';
|
6727 |
+
this.resizerElem = resizerElem;
|
6728 |
+
styleDiv(resizerElem);
|
6729 |
+
resizerElem.style.transformStyle = resizerElem.style.webkitTransformStyle = resizerElem.style.mozTransformStyle = "flat";
|
6730 |
+
if(this.renderConfig.className) {
|
6731 |
+
resizerElem.setAttribute('class', this.renderConfig.className);
|
6732 |
+
}
|
6733 |
+
wrapper.appendChild(resizerElem);
|
6734 |
+
|
6735 |
+
resizerElem.style.overflow = 'hidden';
|
6736 |
+
var svg = createNS('svg');
|
6737 |
+
svg.setAttribute('width','1');
|
6738 |
+
svg.setAttribute('height','1');
|
6739 |
+
styleDiv(svg);
|
6740 |
+
this.resizerElem.appendChild(svg);
|
6741 |
+
var defs = createNS('defs');
|
6742 |
+
svg.appendChild(defs);
|
6743 |
+
this.data = animData;
|
6744 |
+
//Mask animation
|
6745 |
+
this.setupGlobalData(animData, svg);
|
6746 |
+
this.globalData.defs = defs;
|
6747 |
+
this.layers = animData.layers;
|
6748 |
+
this.layerElement = this.resizerElem;
|
6749 |
+
this.build3dContainers();
|
6750 |
+
this.updateContainerSize();
|
6751 |
+
};
|
6752 |
+
|
6753 |
+
HybridRenderer.prototype.destroy = function () {
|
6754 |
+
this.animationItem.wrapper.innerHTML = '';
|
6755 |
+
this.animationItem.container = null;
|
6756 |
+
this.globalData.defs = null;
|
6757 |
+
var i, len = this.layers ? this.layers.length : 0;
|
6758 |
+
for (i = 0; i < len; i++) {
|
6759 |
+
this.elements[i].destroy();
|
6760 |
+
}
|
6761 |
+
this.elements.length = 0;
|
6762 |
+
this.destroyed = true;
|
6763 |
+
this.animationItem = null;
|
6764 |
+
};
|
6765 |
+
|
6766 |
+
HybridRenderer.prototype.updateContainerSize = function () {
|
6767 |
+
var elementWidth = this.animationItem.wrapper.offsetWidth;
|
6768 |
+
var elementHeight = this.animationItem.wrapper.offsetHeight;
|
6769 |
+
var elementRel = elementWidth/elementHeight;
|
6770 |
+
var animationRel = this.globalData.compSize.w/this.globalData.compSize.h;
|
6771 |
+
var sx,sy,tx,ty;
|
6772 |
+
if(animationRel>elementRel){
|
6773 |
+
sx = elementWidth/(this.globalData.compSize.w);
|
6774 |
+
sy = elementWidth/(this.globalData.compSize.w);
|
6775 |
+
tx = 0;
|
6776 |
+
ty = ((elementHeight-this.globalData.compSize.h*(elementWidth/this.globalData.compSize.w))/2);
|
6777 |
+
}else{
|
6778 |
+
sx = elementHeight/(this.globalData.compSize.h);
|
6779 |
+
sy = elementHeight/(this.globalData.compSize.h);
|
6780 |
+
tx = (elementWidth-this.globalData.compSize.w*(elementHeight/this.globalData.compSize.h))/2;
|
6781 |
+
ty = 0;
|
6782 |
+
}
|
6783 |
+
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)';
|
6784 |
+
};
|
6785 |
+
|
6786 |
+
HybridRenderer.prototype.renderFrame = SVGRenderer.prototype.renderFrame;
|
6787 |
+
|
6788 |
+
HybridRenderer.prototype.hide = function(){
|
6789 |
+
this.resizerElem.style.display = 'none';
|
6790 |
+
};
|
6791 |
+
|
6792 |
+
HybridRenderer.prototype.show = function(){
|
6793 |
+
this.resizerElem.style.display = 'block';
|
6794 |
+
};
|
6795 |
+
|
6796 |
+
HybridRenderer.prototype.initItems = function(){
|
6797 |
+
this.buildAllItems();
|
6798 |
+
if(this.camera){
|
6799 |
+
this.camera.setup();
|
6800 |
+
} else {
|
6801 |
+
var cWidth = this.globalData.compSize.w;
|
6802 |
+
var cHeight = this.globalData.compSize.h;
|
6803 |
+
var i, len = this.threeDElements.length;
|
6804 |
+
for(i=0;i<len;i+=1){
|
6805 |
+
this.threeDElements[i].perspectiveElem.style.perspective = this.threeDElements[i].perspectiveElem.style.webkitPerspective = Math.sqrt(Math.pow(cWidth,2) + Math.pow(cHeight,2)) + 'px';
|
6806 |
+
}
|
6807 |
+
}
|
6808 |
+
};
|
6809 |
+
|
6810 |
+
HybridRenderer.prototype.searchExtraCompositions = function(assets){
|
6811 |
+
var i, len = assets.length;
|
6812 |
+
var floatingContainer = createTag('div');
|
6813 |
+
for(i=0;i<len;i+=1){
|
6814 |
+
if(assets[i].xt){
|
6815 |
+
var comp = this.createComp(assets[i],floatingContainer,this.globalData.comp,null);
|
6816 |
+
comp.initExpressions();
|
6817 |
+
this.globalData.projectInterface.registerComposition(comp);
|
6818 |
+
}
|
6819 |
+
}
|
6820 |
+
};
|
6821 |
+
|
6822 |
+
function MaskElement(data,element,globalData) {
|
6823 |
+
this.data = data;
|
6824 |
+
this.element = element;
|
6825 |
+
this.globalData = globalData;
|
6826 |
+
this.storedData = [];
|
6827 |
+
this.masksProperties = this.data.masksProperties || [];
|
6828 |
+
this.maskElement = null;
|
6829 |
+
var defs = this.globalData.defs;
|
6830 |
+
var i, len = this.masksProperties ? this.masksProperties.length : 0;
|
6831 |
+
this.viewData = createSizedArray(len);
|
6832 |
+
this.solidPath = '';
|
6833 |
+
|
6834 |
+
|
6835 |
+
var path, properties = this.masksProperties;
|
6836 |
+
var count = 0;
|
6837 |
+
var currentMasks = [];
|
6838 |
+
var j, jLen;
|
6839 |
+
var layerId = createElementID();
|
6840 |
+
var rect, expansor, feMorph,x;
|
6841 |
+
var maskType = 'clipPath', maskRef = 'clip-path';
|
6842 |
+
for (i = 0; i < len; i++) {
|
6843 |
+
if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
|
6844 |
+
maskType = 'mask';
|
6845 |
+
maskRef = 'mask';
|
6846 |
+
}
|
6847 |
+
|
6848 |
+
if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
|
6849 |
+
rect = createNS( 'rect');
|
6850 |
+
rect.setAttribute('fill', '#ffffff');
|
6851 |
+
rect.setAttribute('width', this.element.comp.data.w || 0);
|
6852 |
+
rect.setAttribute('height', this.element.comp.data.h || 0);
|
6853 |
+
currentMasks.push(rect);
|
6854 |
+
} else {
|
6855 |
+
rect = null;
|
6856 |
+
}
|
6857 |
+
|
6858 |
+
path = createNS( 'path');
|
6859 |
+
if(properties[i].mode == 'n') {
|
6860 |
+
// TODO move this to a factory or to a constructor
|
6861 |
+
this.viewData[i] = {
|
6862 |
+
op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
|
6863 |
+
prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
|
6864 |
+
elem: path,
|
6865 |
+
lastPath: ''
|
6866 |
+
};
|
6867 |
+
defs.appendChild(path);
|
6868 |
+
continue;
|
6869 |
+
}
|
6870 |
+
count += 1;
|
6871 |
+
|
6872 |
+
path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
|
6873 |
+
path.setAttribute('clip-rule','nonzero');
|
6874 |
+
var filterID;
|
6875 |
+
|
6876 |
+
if (properties[i].x.k !== 0) {
|
6877 |
+
maskType = 'mask';
|
6878 |
+
maskRef = 'mask';
|
6879 |
+
x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
|
6880 |
+
filterID = createElementID();
|
6881 |
+
expansor = createNS('filter');
|
6882 |
+
expansor.setAttribute('id',filterID);
|
6883 |
+
feMorph = createNS('feMorphology');
|
6884 |
+
feMorph.setAttribute('operator','erode');
|
6885 |
+
feMorph.setAttribute('in','SourceGraphic');
|
6886 |
+
feMorph.setAttribute('radius','0');
|
6887 |
+
expansor.appendChild(feMorph);
|
6888 |
+
defs.appendChild(expansor);
|
6889 |
+
path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
|
6890 |
+
} else {
|
6891 |
+
feMorph = null;
|
6892 |
+
x = null;
|
6893 |
+
}
|
6894 |
+
|
6895 |
+
// TODO move this to a factory or to a constructor
|
6896 |
+
this.storedData[i] = {
|
6897 |
+
elem: path,
|
6898 |
+
x: x,
|
6899 |
+
expan: feMorph,
|
6900 |
+
lastPath: '',
|
6901 |
+
lastOperator:'',
|
6902 |
+
filterId:filterID,
|
6903 |
+
lastRadius:0
|
6904 |
+
};
|
6905 |
+
if(properties[i].mode == 'i'){
|
6906 |
+
jLen = currentMasks.length;
|
6907 |
+
var g = createNS('g');
|
6908 |
+
for(j=0;j<jLen;j+=1){
|
6909 |
+
g.appendChild(currentMasks[j]);
|
6910 |
+
}
|
6911 |
+
var mask = createNS('mask');
|
6912 |
+
mask.setAttribute('mask-type','alpha');
|
6913 |
+
mask.setAttribute('id',layerId+'_'+count);
|
6914 |
+
mask.appendChild(path);
|
6915 |
+
defs.appendChild(mask);
|
6916 |
+
g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
|
6917 |
+
|
6918 |
+
currentMasks.length = 0;
|
6919 |
+
currentMasks.push(g);
|
6920 |
+
}else{
|
6921 |
+
currentMasks.push(path);
|
6922 |
+
}
|
6923 |
+
if(properties[i].inv && !this.solidPath){
|
6924 |
+
this.solidPath = this.createLayerSolidPath();
|
6925 |
+
}
|
6926 |
+
// TODO move this to a factory or to a constructor
|
6927 |
+
this.viewData[i] = {
|
6928 |
+
elem: path,
|
6929 |
+
lastPath: '',
|
6930 |
+
op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
|
6931 |
+
prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
|
6932 |
+
invRect: rect
|
6933 |
+
};
|
6934 |
+
if(!this.viewData[i].prop.k){
|
6935 |
+
this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
|
6936 |
+
}
|
6937 |
+
}
|
6938 |
+
|
6939 |
+
this.maskElement = createNS( maskType);
|
6940 |
+
|
6941 |
+
len = currentMasks.length;
|
6942 |
+
for(i=0;i<len;i+=1){
|
6943 |
+
this.maskElement.appendChild(currentMasks[i]);
|
6944 |
+
}
|
6945 |
+
|
6946 |
+
if(count > 0){
|
6947 |
+
this.maskElement.setAttribute('id', layerId);
|
6948 |
+
this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
|
6949 |
+
defs.appendChild(this.maskElement);
|
6950 |
+
}
|
6951 |
+
if (this.viewData.length) {
|
6952 |
+
this.element.addRenderableComponent(this);
|
6953 |
+
}
|
6954 |
+
|
6955 |
+
}
|
6956 |
+
|
6957 |
+
MaskElement.prototype.getMaskProperty = function(pos){
|
6958 |
+
return this.viewData[pos].prop;
|
6959 |
+
};
|
6960 |
+
|
6961 |
+
MaskElement.prototype.renderFrame = function (isFirstFrame) {
|
6962 |
+
var finalMat = this.element.finalTransform.mat;
|
6963 |
+
var i, len = this.masksProperties.length;
|
6964 |
+
for (i = 0; i < len; i++) {
|
6965 |
+
if(this.viewData[i].prop._mdf || isFirstFrame){
|
6966 |
+
this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
|
6967 |
+
}
|
6968 |
+
if(this.viewData[i].op._mdf || isFirstFrame){
|
6969 |
+
this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
|
6970 |
+
}
|
6971 |
+
if(this.masksProperties[i].mode !== 'n'){
|
6972 |
+
if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
|
6973 |
+
this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
|
6974 |
+
}
|
6975 |
+
if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
|
6976 |
+
var feMorph = this.storedData[i].expan;
|
6977 |
+
if(this.storedData[i].x.v < 0){
|
6978 |
+
if(this.storedData[i].lastOperator !== 'erode'){
|
6979 |
+
this.storedData[i].lastOperator = 'erode';
|
6980 |
+
this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
|
6981 |
+
}
|
6982 |
+
feMorph.setAttribute('radius',-this.storedData[i].x.v);
|
6983 |
+
}else{
|
6984 |
+
if(this.storedData[i].lastOperator !== 'dilate'){
|
6985 |
+
this.storedData[i].lastOperator = 'dilate';
|
6986 |
+
this.storedData[i].elem.setAttribute('filter',null);
|
6987 |
+
}
|
6988 |
+
this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
|
6989 |
+
|
6990 |
+
}
|
6991 |
+
}
|
6992 |
+
}
|
6993 |
+
}
|
6994 |
+
};
|
6995 |
+
|
6996 |
+
MaskElement.prototype.getMaskelement = function () {
|
6997 |
+
return this.maskElement;
|
6998 |
+
};
|
6999 |
+
|
7000 |
+
MaskElement.prototype.createLayerSolidPath = function(){
|
7001 |
+
var path = 'M0,0 ';
|
7002 |
+
path += ' h' + this.globalData.compSize.w ;
|
7003 |
+
path += ' v' + this.globalData.compSize.h ;
|
7004 |
+
path += ' h-' + this.globalData.compSize.w ;
|
7005 |
+
path += ' v-' + this.globalData.compSize.h + ' ';
|
7006 |
+
return path;
|
7007 |
+
};
|
7008 |
+
|
7009 |
+
MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
|
7010 |
+
var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
|
7011 |
+
var i, len;
|
7012 |
+
len = pathNodes._length;
|
7013 |
+
for(i=1;i<len;i+=1){
|
7014 |
+
//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];
|
7015 |
+
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];
|
7016 |
+
}
|
7017 |
+
//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];
|
7018 |
+
if(pathNodes.c && len > 1){
|
7019 |
+
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];
|
7020 |
+
}
|
7021 |
+
//pathNodes.__renderedString = pathString;
|
7022 |
+
|
7023 |
+
if(viewData.lastPath !== pathString){
|
7024 |
+
var pathShapeValue = '';
|
7025 |
+
if(viewData.elem){
|
7026 |
+
if(pathNodes.c){
|
7027 |
+
pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
|
7028 |
+
}
|
7029 |
+
viewData.elem.setAttribute('d',pathShapeValue);
|
7030 |
+
}
|
7031 |
+
viewData.lastPath = pathString;
|
7032 |
+
}
|
7033 |
+
};
|
7034 |
+
|
7035 |
+
MaskElement.prototype.destroy = function(){
|
7036 |
+
this.element = null;
|
7037 |
+
this.globalData = null;
|
7038 |
+
this.maskElement = null;
|
7039 |
+
this.data = null;
|
7040 |
+
this.masksProperties = null;
|
7041 |
+
};
|
7042 |
+
|
7043 |
+
/**
|
7044 |
+
* @file
|
7045 |
+
* Handles AE's layer parenting property.
|
7046 |
+
*
|
7047 |
+
*/
|
7048 |
+
|
7049 |
+
function HierarchyElement(){}
|
7050 |
+
|
7051 |
+
HierarchyElement.prototype = {
|
7052 |
+
/**
|
7053 |
+
* @function
|
7054 |
+
* Initializes hierarchy properties
|
7055 |
+
*
|
7056 |
+
*/
|
7057 |
+
initHierarchy: function() {
|
7058 |
+
//element's parent list
|
7059 |
+
this.hierarchy = [];
|
7060 |
+
//if element is parent of another layer _isParent will be true
|
7061 |
+
this._isParent = false;
|
7062 |
+
this.checkParenting();
|
7063 |
+
},
|
7064 |
+
/**
|
7065 |
+
* @function
|
7066 |
+
* Sets layer's hierarchy.
|
7067 |
+
* @param {array} hierarch
|
7068 |
+
* layer's parent list
|
7069 |
+
*
|
7070 |
+
*/
|
7071 |
+
setHierarchy: function(hierarchy){
|
7072 |
+
this.hierarchy = hierarchy;
|
7073 |
+
},
|
7074 |
+
/**
|
7075 |
+
* @function
|
7076 |
+
* Sets layer as parent.
|
7077 |
+
*
|
7078 |
+
*/
|
7079 |
+
setAsParent: function() {
|
7080 |
+
this._isParent = true;
|
7081 |
+
},
|
7082 |
+
/**
|
7083 |
+
* @function
|
7084 |
+
* Searches layer's parenting chain
|
7085 |
+
*
|
7086 |
+
*/
|
7087 |
+
checkParenting: function(){
|
7088 |
+
if (this.data.parent !== undefined){
|
7089 |
+
this.comp.buildElementParenting(this, this.data.parent, []);
|
7090 |
+
}
|
7091 |
+
}
|
7092 |
+
};
|
7093 |
+
/**
|
7094 |
+
* @file
|
7095 |
+
* Handles element's layer frame update.
|
7096 |
+
* Checks layer in point and out point
|
7097 |
+
*
|
7098 |
+
*/
|
7099 |
+
|
7100 |
+
function FrameElement(){}
|
7101 |
+
|
7102 |
+
FrameElement.prototype = {
|
7103 |
+
/**
|
7104 |
+
* @function
|
7105 |
+
* Initializes frame related properties.
|
7106 |
+
*
|
7107 |
+
*/
|
7108 |
+
initFrame: function(){
|
7109 |
+
//set to true when inpoint is rendered
|
7110 |
+
this._isFirstFrame = false;
|
7111 |
+
//list of animated properties
|
7112 |
+
this.dynamicProperties = [];
|
7113 |
+
// If layer has been modified in current tick this will be true
|
7114 |
+
this._mdf = false;
|
7115 |
+
},
|
7116 |
+
/**
|
7117 |
+
* @function
|
7118 |
+
* Calculates all dynamic values
|
7119 |
+
*
|
7120 |
+
* @param {number} num
|
7121 |
+
* current frame number in Layer's time
|
7122 |
+
* @param {boolean} isVisible
|
7123 |
+
* if layers is currently in range
|
7124 |
+
*
|
7125 |
+
*/
|
7126 |
+
prepareProperties: function(num, isVisible) {
|
7127 |
+
var i, len = this.dynamicProperties.length;
|
7128 |
+
for (i = 0;i < len; i += 1) {
|
7129 |
+
if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
|
7130 |
+
this.dynamicProperties[i].getValue();
|
7131 |
+
if (this.dynamicProperties[i]._mdf) {
|
7132 |
+
this.globalData._mdf = true;
|
7133 |
+
this._mdf = true;
|
7134 |
+
}
|
7135 |
+
}
|
7136 |
+
}
|
7137 |
+
},
|
7138 |
+
addDynamicProperty: function(prop) {
|
7139 |
+
if(this.dynamicProperties.indexOf(prop) === -1) {
|
7140 |
+
this.dynamicProperties.push(prop);
|
7141 |
+
}
|
7142 |
+
}
|
7143 |
+
};
|
7144 |
+
function TransformElement(){}
|
7145 |
+
|
7146 |
+
TransformElement.prototype = {
|
7147 |
+
initTransform: function() {
|
7148 |
+
this.finalTransform = {
|
7149 |
+
mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
|
7150 |
+
_matMdf: false,
|
7151 |
+
_opMdf: false,
|
7152 |
+
mat: new Matrix()
|
7153 |
+
};
|
7154 |
+
if (this.data.ao) {
|
7155 |
+
this.finalTransform.mProp.autoOriented = true;
|
7156 |
+
}
|
7157 |
+
|
7158 |
+
//TODO: check TYPE 11: Guided elements
|
7159 |
+
if (this.data.ty !== 11) {
|
7160 |
+
//this.createElements();
|
7161 |
+
}
|
7162 |
+
},
|
7163 |
+
renderTransform: function() {
|
7164 |
+
|
7165 |
+
this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
|
7166 |
+
this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
|
7167 |
+
|
7168 |
+
if (this.hierarchy) {
|
7169 |
+
var mat;
|
7170 |
+
var finalMat = this.finalTransform.mat;
|
7171 |
+
var i = 0, len = this.hierarchy.length;
|
7172 |
+
//Checking if any of the transformation matrices in the hierarchy chain has changed.
|
7173 |
+
if (!this.finalTransform._matMdf) {
|
7174 |
+
while (i < len) {
|
7175 |
+
if (this.hierarchy[i].finalTransform.mProp._mdf) {
|
7176 |
+
this.finalTransform._matMdf = true;
|
7177 |
+
break;
|
7178 |
+
}
|
7179 |
+
i += 1;
|
7180 |
+
}
|
7181 |
+
}
|
7182 |
+
|
7183 |
+
if (this.finalTransform._matMdf) {
|
7184 |
+
mat = this.finalTransform.mProp.v.props;
|
7185 |
+
finalMat.cloneFromProps(mat);
|
7186 |
+
for (i = 0; i < len; i += 1) {
|
7187 |
+
mat = this.hierarchy[i].finalTransform.mProp.v.props;
|
7188 |
+
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]);
|
7189 |
+
}
|
7190 |
+
}
|
7191 |
+
}
|
7192 |
+
},
|
7193 |
+
globalToLocal: function(pt) {
|
7194 |
+
var transforms = [];
|
7195 |
+
transforms.push(this.finalTransform);
|
7196 |
+
var flag = true;
|
7197 |
+
var comp = this.comp;
|
7198 |
+
while (flag) {
|
7199 |
+
if (comp.finalTransform) {
|
7200 |
+
if (comp.data.hasMask) {
|
7201 |
+
transforms.splice(0, 0, comp.finalTransform);
|
7202 |
+
}
|
7203 |
+
comp = comp.comp;
|
7204 |
+
} else {
|
7205 |
+
flag = false;
|
7206 |
+
}
|
7207 |
+
}
|
7208 |
+
var i, len = transforms.length,ptNew;
|
7209 |
+
for (i = 0; i < len; i += 1) {
|
7210 |
+
ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
|
7211 |
+
//ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
|
7212 |
+
pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
|
7213 |
+
}
|
7214 |
+
return pt;
|
7215 |
+
},
|
7216 |
+
mHelper: new Matrix()
|
7217 |
+
};
|
7218 |
+
function RenderableElement(){
|
7219 |
+
|
7220 |
+
}
|
7221 |
+
|
7222 |
+
RenderableElement.prototype = {
|
7223 |
+
initRenderable: function() {
|
7224 |
+
//layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
|
7225 |
+
this.isInRange = false;
|
7226 |
+
//layer's display state
|
7227 |
+
this.hidden = false;
|
7228 |
+
// If layer's transparency equals 0, it can be hidden
|
7229 |
+
this.isTransparent = false;
|
7230 |
+
//list of animated components
|
7231 |
+
this.renderableComponents = [];
|
7232 |
+
},
|
7233 |
+
addRenderableComponent: function(component) {
|
7234 |
+
if(this.renderableComponents.indexOf(component) === -1) {
|
7235 |
+
this.renderableComponents.push(component);
|
7236 |
+
}
|
7237 |
+
},
|
7238 |
+
removeRenderableComponent: function(component) {
|
7239 |
+
if(this.renderableComponents.indexOf(component) !== -1) {
|
7240 |
+
this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
|
7241 |
+
}
|
7242 |
+
},
|
7243 |
+
prepareRenderableFrame: function(num) {
|
7244 |
+
this.checkLayerLimits(num);
|
7245 |
+
},
|
7246 |
+
checkTransparency: function(){
|
7247 |
+
if(this.finalTransform.mProp.o.v <= 0) {
|
7248 |
+
if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
|
7249 |
+
this.isTransparent = true;
|
7250 |
+
this.hide();
|
7251 |
+
}
|
7252 |
+
} else if(this.isTransparent) {
|
7253 |
+
this.isTransparent = false;
|
7254 |
+
this.show();
|
7255 |
+
}
|
7256 |
+
},
|
7257 |
+
/**
|
7258 |
+
* @function
|
7259 |
+
* Initializes frame related properties.
|
7260 |
+
*
|
7261 |
+
* @param {number} num
|
7262 |
+
* current frame number in Layer's time
|
7263 |
+
*
|
7264 |
+
*/
|
7265 |
+
checkLayerLimits: function(num) {
|
7266 |
+
if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
|
7267 |
+
{
|
7268 |
+
if(this.isInRange !== true){
|
7269 |
+
this.globalData._mdf = true;
|
7270 |
+
this._mdf = true;
|
7271 |
+
this.isInRange = true;
|
7272 |
+
this.show();
|
7273 |
+
}
|
7274 |
+
} else {
|
7275 |
+
if(this.isInRange !== false){
|
7276 |
+
this.globalData._mdf = true;
|
7277 |
+
this.isInRange = false;
|
7278 |
+
this.hide();
|
7279 |
+
}
|
7280 |
+
}
|
7281 |
+
},
|
7282 |
+
renderRenderable: function() {
|
7283 |
+
var i, len = this.renderableComponents.length;
|
7284 |
+
for(i = 0; i < len; i += 1) {
|
7285 |
+
this.renderableComponents[i].renderFrame(this._isFirstFrame);
|
7286 |
+
}
|
7287 |
+
/*this.maskManager.renderFrame(this.finalTransform.mat);
|
7288 |
+
this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
|
7289 |
+
},
|
7290 |
+
sourceRectAtTime: function(){
|
7291 |
+
return {
|
7292 |
+
top:0,
|
7293 |
+
left:0,
|
7294 |
+
width:100,
|
7295 |
+
height:100
|
7296 |
+
};
|
7297 |
+
},
|
7298 |
+
getLayerSize: function(){
|
7299 |
+
if(this.data.ty === 5){
|
7300 |
+
return {w:this.data.textData.width,h:this.data.textData.height};
|
7301 |
+
}else{
|
7302 |
+
return {w:this.data.width,h:this.data.height};
|
7303 |
+
}
|
7304 |
+
}
|
7305 |
+
};
|
7306 |
+
function RenderableDOMElement() {}
|
7307 |
+
|
7308 |
+
(function(){
|
7309 |
+
var _prototype = {
|
7310 |
+
initElement: function(data,globalData,comp) {
|
7311 |
+
this.initFrame();
|
7312 |
+
this.initBaseData(data, globalData, comp);
|
7313 |
+
this.initTransform(data, globalData, comp);
|
7314 |
+
this.initHierarchy();
|
7315 |
+
this.initRenderable();
|
7316 |
+
this.initRendererElement();
|
7317 |
+
this.createContainerElements();
|
7318 |
+
this.createRenderableComponents();
|
7319 |
+
this.createContent();
|
7320 |
+
this.hide();
|
7321 |
+
},
|
7322 |
+
hide: function(){
|
7323 |
+
if (!this.hidden && (!this.isInRange || this.isTransparent)) {
|
7324 |
+
var elem = this.baseElement || this.layerElement;
|
7325 |
+
elem.style.display = 'none';
|
7326 |
+
this.hidden = true;
|
7327 |
+
}
|
7328 |
+
},
|
7329 |
+
show: function(){
|
7330 |
+
if (this.isInRange && !this.isTransparent){
|
7331 |
+
if (!this.data.hd) {
|
7332 |
+
var elem = this.baseElement || this.layerElement;
|
7333 |
+
elem.style.display = 'block';
|
7334 |
+
}
|
7335 |
+
this.hidden = false;
|
7336 |
+
this._isFirstFrame = true;
|
7337 |
+
}
|
7338 |
+
},
|
7339 |
+
renderFrame: function() {
|
7340 |
+
//If it is exported as hidden (data.hd === true) no need to render
|
7341 |
+
//If it is not visible no need to render
|
7342 |
+
if (this.data.hd || this.hidden) {
|
7343 |
+
return;
|
7344 |
+
}
|
7345 |
+
this.renderTransform();
|
7346 |
+
this.renderRenderable();
|
7347 |
+
this.renderElement();
|
7348 |
+
this.renderInnerContent();
|
7349 |
+
if (this._isFirstFrame) {
|
7350 |
+
this._isFirstFrame = false;
|
7351 |
+
}
|
7352 |
+
},
|
7353 |
+
renderInnerContent: function() {},
|
7354 |
+
prepareFrame: function(num) {
|
7355 |
+
this._mdf = false;
|
7356 |
+
this.prepareRenderableFrame(num);
|
7357 |
+
this.prepareProperties(num, this.isInRange);
|
7358 |
+
this.checkTransparency();
|
7359 |
+
},
|
7360 |
+
destroy: function(){
|
7361 |
+
this.innerElem = null;
|
7362 |
+
this.destroyBaseElement();
|
7363 |
+
}
|
7364 |
+
};
|
7365 |
+
extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
|
7366 |
+
}());
|
7367 |
+
function ProcessedElement(element, position) {
|
7368 |
+
this.elem = element;
|
7369 |
+
this.pos = position;
|
7370 |
+
}
|
7371 |
+
function SVGStyleData(data, level) {
|
7372 |
+
this.data = data;
|
7373 |
+
this.type = data.ty;
|
7374 |
+
this.d = '';
|
7375 |
+
this.lvl = level;
|
7376 |
+
this._mdf = false;
|
7377 |
+
this.closed = data.hd === true;
|
7378 |
+
this.pElem = createNS('path');
|
7379 |
+
this.msElem = null;
|
7380 |
+
}
|
7381 |
+
|
7382 |
+
SVGStyleData.prototype.reset = function() {
|
7383 |
+
this.d = '';
|
7384 |
+
this._mdf = false;
|
7385 |
+
};
|
7386 |
+
function SVGShapeData(transformers, level, shape) {
|
7387 |
+
this.caches = [];
|
7388 |
+
this.styles = [];
|
7389 |
+
this.transformers = transformers;
|
7390 |
+
this.lStr = '';
|
7391 |
+
this.sh = shape;
|
7392 |
+
this.lvl = level;
|
7393 |
+
//TODO find if there are some cases where _isAnimated can be false.
|
7394 |
+
// For now, since shapes add up with other shapes. They have to be calculated every time.
|
7395 |
+
// One way of finding out is checking if all styles associated to this shape depend only of this shape
|
7396 |
+
this._isAnimated = !!shape.k;
|
7397 |
+
// TODO: commenting this for now since all shapes are animated
|
7398 |
+
var i = 0, len = transformers.length;
|
7399 |
+
while(i < len) {
|
7400 |
+
if(transformers[i].mProps.dynamicProperties.length) {
|
7401 |
+
this._isAnimated = true;
|
7402 |
+
break;
|
7403 |
+
}
|
7404 |
+
i += 1;
|
7405 |
+
}
|
7406 |
+
}
|
7407 |
+
|
7408 |
+
SVGShapeData.prototype.setAsAnimated = function() {
|
7409 |
+
this._isAnimated = true;
|
7410 |
+
}
|
7411 |
+
function SVGTransformData(mProps, op, container) {
|
7412 |
+
this.transform = {
|
7413 |
+
mProps: mProps,
|
7414 |
+
op: op,
|
7415 |
+
container: container
|
7416 |
+
};
|
7417 |
+
this.elements = [];
|
7418 |
+
this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
|
7419 |
+
}
|
7420 |
+
function SVGStrokeStyleData(elem, data, styleOb){
|
7421 |
+
this.initDynamicPropertyContainer(elem);
|
7422 |
+
this.getValue = this.iterateDynamicProperties;
|
7423 |
+
this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
|
7424 |
+
this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
|
7425 |
+
this.d = new DashProperty(elem,data.d||{},'svg',this);
|
7426 |
+
this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
|
7427 |
+
this.style = styleOb;
|
7428 |
+
this._isAnimated = !!this._isAnimated;
|
7429 |
+
}
|
7430 |
+
|
7431 |
+
extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
|
7432 |
+
function SVGFillStyleData(elem, data, styleOb){
|
7433 |
+
this.initDynamicPropertyContainer(elem);
|
7434 |
+
this.getValue = this.iterateDynamicProperties;
|
7435 |
+
this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
|
7436 |
+
this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
|
7437 |
+
this.style = styleOb;
|
7438 |
+
}
|
7439 |
+
|
7440 |
+
extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
|
7441 |
+
function SVGGradientFillStyleData(elem, data, styleOb){
|
7442 |
+
this.initDynamicPropertyContainer(elem);
|
7443 |
+
this.getValue = this.iterateDynamicProperties;
|
7444 |
+
this.initGradientData(elem, data, styleOb);
|
7445 |
+
}
|
7446 |
+
|
7447 |
+
SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){
|
7448 |
+
this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
|
7449 |
+
this.s = PropertyFactory.getProp(elem,data.s,1,null,this);
|
7450 |
+
this.e = PropertyFactory.getProp(elem,data.e,1,null,this);
|
7451 |
+
this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this);
|
7452 |
+
this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this);
|
7453 |
+
this.g = new GradientProperty(elem,data.g,this);
|
7454 |
+
this.style = styleOb;
|
7455 |
+
this.stops = [];
|
7456 |
+
this.setGradientData(styleOb.pElem, data);
|
7457 |
+
this.setGradientOpacity(data, styleOb);
|
7458 |
+
this._isAnimated = !!this._isAnimated;
|
7459 |
+
|
7460 |
+
};
|
7461 |
+
|
7462 |
+
SVGGradientFillStyleData.prototype.setGradientData = function(pathElement,data){
|
7463 |
+
|
7464 |
+
var gradientId = createElementID();
|
7465 |
+
var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
|
7466 |
+
gfill.setAttribute('id',gradientId);
|
7467 |
+
gfill.setAttribute('spreadMethod','pad');
|
7468 |
+
gfill.setAttribute('gradientUnits','userSpaceOnUse');
|
7469 |
+
var stops = [];
|
7470 |
+
var stop, j, jLen;
|
7471 |
+
jLen = data.g.p*4;
|
7472 |
+
for(j=0;j<jLen;j+=4){
|
7473 |
+
stop = createNS('stop');
|
7474 |
+
gfill.appendChild(stop);
|
7475 |
+
stops.push(stop);
|
7476 |
+
}
|
7477 |
+
pathElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+gradientId+')');
|
7478 |
+
|
7479 |
+
this.gf = gfill;
|
7480 |
+
this.cst = stops;
|
7481 |
+
};
|
7482 |
+
|
7483 |
+
SVGGradientFillStyleData.prototype.setGradientOpacity = function(data, styleOb){
|
7484 |
+
if(this.g._hasOpacity && !this.g._collapsable){
|
7485 |
+
var stop, j, jLen;
|
7486 |
+
var mask = createNS("mask");
|
7487 |
+
var maskElement = createNS( 'path');
|
7488 |
+
mask.appendChild(maskElement);
|
7489 |
+
var opacityId = createElementID();
|
7490 |
+
var maskId = createElementID();
|
7491 |
+
mask.setAttribute('id',maskId);
|
7492 |
+
var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
|
7493 |
+
opFill.setAttribute('id',opacityId);
|
7494 |
+
opFill.setAttribute('spreadMethod','pad');
|
7495 |
+
opFill.setAttribute('gradientUnits','userSpaceOnUse');
|
7496 |
+
jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
|
7497 |
+
var stops = this.stops;
|
7498 |
+
for(j=data.g.p*4;j<jLen;j+=2){
|
7499 |
+
stop = createNS('stop');
|
7500 |
+
stop.setAttribute('stop-color','rgb(255,255,255)');
|
7501 |
+
opFill.appendChild(stop);
|
7502 |
+
stops.push(stop);
|
7503 |
+
}
|
7504 |
+
maskElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+opacityId+')');
|
7505 |
+
this.of = opFill;
|
7506 |
+
this.ms = mask;
|
7507 |
+
this.ost = stops;
|
7508 |
+
this.maskId = maskId;
|
7509 |
+
styleOb.msElem = maskElement;
|
7510 |
+
}
|
7511 |
+
};
|
7512 |
+
|
7513 |
+
extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
|
7514 |
+
function SVGGradientStrokeStyleData(elem, data, styleOb){
|
7515 |
+
this.initDynamicPropertyContainer(elem);
|
7516 |
+
this.getValue = this.iterateDynamicProperties;
|
7517 |
+
this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
|
7518 |
+
this.d = new DashProperty(elem,data.d||{},'svg',this);
|
7519 |
+
this.initGradientData(elem, data, styleOb);
|
7520 |
+
this._isAnimated = !!this._isAnimated;
|
7521 |
+
}
|
7522 |
+
|
7523 |
+
extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
|
7524 |
+
function ShapeGroupData() {
|
7525 |
+
this.it = [];
|
7526 |
+
this.prevViewData = [];
|
7527 |
+
this.gr = createNS('g');
|
7528 |
+
}
|
7529 |
+
var SVGElementsRenderer = (function() {
|
7530 |
+
var _identityMatrix = new Matrix();
|
7531 |
+
var _matrixHelper = new Matrix();
|
7532 |
+
|
7533 |
+
var ob = {
|
7534 |
+
createRenderFunction: createRenderFunction
|
7535 |
+
}
|
7536 |
+
|
7537 |
+
function createRenderFunction(data) {
|
7538 |
+
var ty = data.ty;
|
7539 |
+
switch(data.ty) {
|
7540 |
+
case 'fl':
|
7541 |
+
return renderFill;
|
7542 |
+
case 'gf':
|
7543 |
+
return renderGradient;
|
7544 |
+
case 'gs':
|
7545 |
+
return renderGradientStroke;
|
7546 |
+
case 'st':
|
7547 |
+
return renderStroke;
|
7548 |
+
case 'sh':
|
7549 |
+
case 'el':
|
7550 |
+
case 'rc':
|
7551 |
+
case 'sr':
|
7552 |
+
return renderPath;
|
7553 |
+
case 'tr':
|
7554 |
+
return renderContentTransform;
|
7555 |
+
}
|
7556 |
+
}
|
7557 |
+
|
7558 |
+
function renderContentTransform(styleData, itemData, isFirstFrame) {
|
7559 |
+
if(isFirstFrame || itemData.transform.op._mdf){
|
7560 |
+
itemData.transform.container.setAttribute('opacity',itemData.transform.op.v);
|
7561 |
+
}
|
7562 |
+
if(isFirstFrame || itemData.transform.mProps._mdf){
|
7563 |
+
itemData.transform.container.setAttribute('transform',itemData.transform.mProps.v.to2dCSS());
|
7564 |
+
}
|
7565 |
+
}
|
7566 |
+
|
7567 |
+
function renderPath(styleData, itemData, isFirstFrame) {
|
7568 |
+
var j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = itemData.styles.length;
|
7569 |
+
var lvl = itemData.lvl;
|
7570 |
+
var paths, mat, props, iterations, k;
|
7571 |
+
for(l=0;l<lLen;l+=1){
|
7572 |
+
redraw = itemData.sh._mdf || isFirstFrame;
|
7573 |
+
if(itemData.styles[l].lvl < lvl){
|
7574 |
+
mat = _matrixHelper.reset();
|
7575 |
+
iterations = lvl - itemData.styles[l].lvl;
|
7576 |
+
k = itemData.transformers.length-1;
|
7577 |
+
while(!redraw && iterations > 0) {
|
7578 |
+
redraw = itemData.transformers[k].mProps._mdf || redraw;
|
7579 |
+
iterations --;
|
7580 |
+
k --;
|
7581 |
+
}
|
7582 |
+
if(redraw) {
|
7583 |
+
iterations = lvl - itemData.styles[l].lvl;
|
7584 |
+
k = itemData.transformers.length-1;
|
7585 |
+
while(iterations > 0) {
|
7586 |
+
props = itemData.transformers[k].mProps.v.props;
|
7587 |
+
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]);
|
7588 |
+
iterations --;
|
7589 |
+
k --;
|
7590 |
+
}
|
7591 |
+
}
|
7592 |
+
} else {
|
7593 |
+
mat = _identityMatrix;
|
7594 |
+
}
|
7595 |
+
paths = itemData.sh.paths;
|
7596 |
+
jLen = paths._length;
|
7597 |
+
if(redraw){
|
7598 |
+
pathStringTransformed = '';
|
7599 |
+
for(j=0;j<jLen;j+=1){
|
7600 |
+
pathNodes = paths.shapes[j];
|
7601 |
+
if(pathNodes && pathNodes._length){
|
7602 |
+
pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
|
7603 |
+
}
|
7604 |
+
}
|
7605 |
+
itemData.caches[l] = pathStringTransformed;
|
7606 |
+
} else {
|
7607 |
+
pathStringTransformed = itemData.caches[l];
|
7608 |
+
}
|
7609 |
+
itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
|
7610 |
+
itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
|
7611 |
+
}
|
7612 |
+
}
|
7613 |
+
|
7614 |
+
function renderFill (styleData,itemData, isFirstFrame){
|
7615 |
+
var styleElem = itemData.style;
|
7616 |
+
|
7617 |
+
if(itemData.c._mdf || isFirstFrame){
|
7618 |
+
styleElem.pElem.setAttribute('fill','rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')');
|
7619 |
+
}
|
7620 |
+
if(itemData.o._mdf || isFirstFrame){
|
7621 |
+
styleElem.pElem.setAttribute('fill-opacity',itemData.o.v);
|
7622 |
+
}
|
7623 |
+
};
|
7624 |
+
|
7625 |
+
function renderGradientStroke (styleData, itemData, isFirstFrame) {
|
7626 |
+
renderGradient(styleData, itemData, isFirstFrame);
|
7627 |
+
renderStroke(styleData, itemData, isFirstFrame);
|
7628 |
+
}
|
7629 |
+
|
7630 |
+
function renderGradient(styleData, itemData, isFirstFrame) {
|
7631 |
+
var gfill = itemData.gf;
|
7632 |
+
var hasOpacity = itemData.g._hasOpacity;
|
7633 |
+
var pt1 = itemData.s.v, pt2 = itemData.e.v;
|
7634 |
+
|
7635 |
+
if (itemData.o._mdf || isFirstFrame) {
|
7636 |
+
var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
|
7637 |
+
itemData.style.pElem.setAttribute(attr, itemData.o.v);
|
7638 |
+
}
|
7639 |
+
if (itemData.s._mdf || isFirstFrame) {
|
7640 |
+
var attr1 = styleData.t === 1 ? 'x1' : 'cx';
|
7641 |
+
var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
|
7642 |
+
gfill.setAttribute(attr1, pt1[0]);
|
7643 |
+
gfill.setAttribute(attr2, pt1[1]);
|
7644 |
+
if (hasOpacity && !itemData.g._collapsable) {
|
7645 |
+
itemData.of.setAttribute(attr1, pt1[0]);
|
7646 |
+
itemData.of.setAttribute(attr2, pt1[1]);
|
7647 |
+
}
|
7648 |
+
}
|
7649 |
+
var stops, i, len, stop;
|
7650 |
+
if (itemData.g._cmdf || isFirstFrame) {
|
7651 |
+
stops = itemData.cst;
|
7652 |
+
var cValues = itemData.g.c;
|
7653 |
+
len = stops.length;
|
7654 |
+
for (i = 0; i < len; i += 1){
|
7655 |
+
stop = stops[i];
|
7656 |
+
stop.setAttribute('offset', cValues[i * 4] + '%');
|
7657 |
+
stop.setAttribute('stop-color','rgb('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ')');
|
7658 |
+
}
|
7659 |
+
}
|
7660 |
+
if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
|
7661 |
+
var oValues = itemData.g.o;
|
7662 |
+
if(itemData.g._collapsable) {
|
7663 |
+
stops = itemData.cst;
|
7664 |
+
} else {
|
7665 |
+
stops = itemData.ost;
|
7666 |
+
}
|
7667 |
+
len = stops.length;
|
7668 |
+
for (i = 0; i < len; i += 1) {
|
7669 |
+
stop = stops[i];
|
7670 |
+
if(!itemData.g._collapsable) {
|
7671 |
+
stop.setAttribute('offset', oValues[i * 2] + '%');
|
7672 |
+
}
|
7673 |
+
stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
|
7674 |
+
}
|
7675 |
+
}
|
7676 |
+
if (styleData.t === 1) {
|
7677 |
+
if (itemData.e._mdf || isFirstFrame) {
|
7678 |
+
gfill.setAttribute('x2', pt2[0]);
|
7679 |
+
gfill.setAttribute('y2', pt2[1]);
|
7680 |
+
if (hasOpacity && !itemData.g._collapsable) {
|
7681 |
+
itemData.of.setAttribute('x2', pt2[0]);
|
7682 |
+
itemData.of.setAttribute('y2', pt2[1]);
|
7683 |
+
}
|
7684 |
+
}
|
7685 |
+
} else {
|
7686 |
+
var rad;
|
7687 |
+
if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
|
7688 |
+
rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
|
7689 |
+
gfill.setAttribute('r', rad);
|
7690 |
+
if(hasOpacity && !itemData.g._collapsable){
|
7691 |
+
itemData.of.setAttribute('r', rad);
|
7692 |
+
}
|
7693 |
+
}
|
7694 |
+
if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
|
7695 |
+
if (!rad) {
|
7696 |
+
rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
|
7697 |
+
}
|
7698 |
+
var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
|
7699 |
+
|
7700 |
+
var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
|
7701 |
+
var dist = rad * percent;
|
7702 |
+
var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
|
7703 |
+
var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
|
7704 |
+
gfill.setAttribute('fx', x);
|
7705 |
+
gfill.setAttribute('fy', y);
|
7706 |
+
if (hasOpacity && !itemData.g._collapsable) {
|
7707 |
+
itemData.of.setAttribute('fx', x);
|
7708 |
+
itemData.of.setAttribute('fy', y);
|
7709 |
+
}
|
7710 |
+
}
|
7711 |
+
//gfill.setAttribute('fy','200');
|
7712 |
+
}
|
7713 |
+
};
|
7714 |
+
|
7715 |
+
function renderStroke(styleData, itemData, isFirstFrame) {
|
7716 |
+
var styleElem = itemData.style;
|
7717 |
+
var d = itemData.d;
|
7718 |
+
if (d && (d._mdf || isFirstFrame) && d.dashStr) {
|
7719 |
+
styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
|
7720 |
+
styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
|
7721 |
+
}
|
7722 |
+
if(itemData.c && (itemData.c._mdf || isFirstFrame)){
|
7723 |
+
styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
|
7724 |
+
}
|
7725 |
+
if(itemData.o._mdf || isFirstFrame){
|
7726 |
+
styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
|
7727 |
+
}
|
7728 |
+
if(itemData.w._mdf || isFirstFrame){
|
7729 |
+
styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
|
7730 |
+
if(styleElem.msElem){
|
7731 |
+
styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
|
7732 |
+
}
|
7733 |
+
}
|
7734 |
+
};
|
7735 |
+
|
7736 |
+
return ob;
|
7737 |
+
}())
|
7738 |
+
function ShapeTransformManager() {
|
7739 |
+
this.sequences = {};
|
7740 |
+
this.sequenceList = [];
|
7741 |
+
this.transform_key_count = 0;
|
7742 |
+
}
|
7743 |
+
|
7744 |
+
ShapeTransformManager.prototype = {
|
7745 |
+
addTransformSequence: function(transforms) {
|
7746 |
+
var i, len = transforms.length;
|
7747 |
+
var key = '_';
|
7748 |
+
for(i = 0; i < len; i += 1) {
|
7749 |
+
key += transforms[i].transform.key + '_';
|
7750 |
+
}
|
7751 |
+
var sequence = this.sequences[key];
|
7752 |
+
if(!sequence) {
|
7753 |
+
sequence = {
|
7754 |
+
transforms: [].concat(transforms),
|
7755 |
+
finalTransform: new Matrix(),
|
7756 |
+
_mdf: false
|
7757 |
+
};
|
7758 |
+
this.sequences[key] = sequence;
|
7759 |
+
this.sequenceList.push(sequence);
|
7760 |
+
}
|
7761 |
+
return sequence;
|
7762 |
+
},
|
7763 |
+
processSequence: function(sequence, isFirstFrame) {
|
7764 |
+
var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
|
7765 |
+
while (i < len && !isFirstFrame) {
|
7766 |
+
if (sequence.transforms[i].transform.mProps._mdf) {
|
7767 |
+
_mdf = true;
|
7768 |
+
break;
|
7769 |
+
}
|
7770 |
+
i += 1
|
7771 |
+
}
|
7772 |
+
if (_mdf) {
|
7773 |
+
var props;
|
7774 |
+
sequence.finalTransform.reset();
|
7775 |
+
for (i = len - 1; i >= 0; i -= 1) {
|
7776 |
+
props = sequence.transforms[i].transform.mProps.v.props;
|
7777 |
+
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]);
|
7778 |
+
}
|
7779 |
+
}
|
7780 |
+
sequence._mdf = _mdf;
|
7781 |
+
|
7782 |
+
},
|
7783 |
+
processSequences: function(isFirstFrame) {
|
7784 |
+
var i, len = this.sequenceList.length;
|
7785 |
+
for (i = 0; i < len; i += 1) {
|
7786 |
+
this.processSequence(this.sequenceList[i], isFirstFrame);
|
7787 |
+
}
|
7788 |
+
|
7789 |
+
},
|
7790 |
+
getNewKey: function() {
|
7791 |
+
return '_' + this.transform_key_count++;
|
7792 |
+
}
|
7793 |
+
}
|
7794 |
+
function CVShapeData(element, data, styles, transformsManager) {
|
7795 |
+
this.styledShapes = [];
|
7796 |
+
this.tr = [0,0,0,0,0,0];
|
7797 |
+
var ty = 4;
|
7798 |
+
if(data.ty == 'rc'){
|
7799 |
+
ty = 5;
|
7800 |
+
}else if(data.ty == 'el'){
|
7801 |
+
ty = 6;
|
7802 |
+
}else if(data.ty == 'sr'){
|
7803 |
+
ty = 7;
|
7804 |
+
}
|
7805 |
+
this.sh = ShapePropertyFactory.getShapeProp(element,data,ty,element);
|
7806 |
+
var i , len = styles.length,styledShape;
|
7807 |
+
for (i = 0; i < len; i += 1) {
|
7808 |
+
if (!styles[i].closed) {
|
7809 |
+
styledShape = {
|
7810 |
+
transforms: transformsManager.addTransformSequence(styles[i].transforms),
|
7811 |
+
trNodes: []
|
7812 |
+
}
|
7813 |
+
this.styledShapes.push(styledShape);
|
7814 |
+
styles[i].elements.push(styledShape);
|
7815 |
+
}
|
7816 |
+
}
|
7817 |
+
}
|
7818 |
+
|
7819 |
+
CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;
|
7820 |
+
function BaseElement(){
|
7821 |
+
}
|
7822 |
+
|
7823 |
+
BaseElement.prototype = {
|
7824 |
+
checkMasks: function(){
|
7825 |
+
if(!this.data.hasMask){
|
7826 |
+
return false;
|
7827 |
+
}
|
7828 |
+
var i = 0, len = this.data.masksProperties.length;
|
7829 |
+
while(i<len) {
|
7830 |
+
if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
|
7831 |
+
return true;
|
7832 |
+
}
|
7833 |
+
i += 1;
|
7834 |
+
}
|
7835 |
+
return false;
|
7836 |
+
},
|
7837 |
+
initExpressions: function(){
|
7838 |
+
this.layerInterface = LayerExpressionInterface(this);
|
7839 |
+
if(this.data.hasMask && this.maskManager) {
|
7840 |
+
this.layerInterface.registerMaskInterface(this.maskManager);
|
7841 |
+
}
|
7842 |
+
var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
|
7843 |
+
this.layerInterface.registerEffectsInterface(effectsInterface);
|
7844 |
+
|
7845 |
+
if(this.data.ty === 0 || this.data.xt){
|
7846 |
+
this.compInterface = CompExpressionInterface(this);
|
7847 |
+
} else if(this.data.ty === 4){
|
7848 |
+
this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
|
7849 |
+
this.layerInterface.content = this.layerInterface.shapeInterface;
|
7850 |
+
} else if(this.data.ty === 5){
|
7851 |
+
this.layerInterface.textInterface = TextExpressionInterface(this);
|
7852 |
+
this.layerInterface.text = this.layerInterface.textInterface;
|
7853 |
+
}
|
7854 |
+
},
|
7855 |
+
setBlendMode: function(){
|
7856 |
+
var blendModeValue = getBlendMode(this.data.bm);
|
7857 |
+
var elem = this.baseElement || this.layerElement;
|
7858 |
+
|
7859 |
+
elem.style['mix-blend-mode'] = blendModeValue;
|
7860 |
+
},
|
7861 |
+
initBaseData: function(data, globalData, comp){
|
7862 |
+
this.globalData = globalData;
|
7863 |
+
this.comp = comp;
|
7864 |
+
this.data = data;
|
7865 |
+
this.layerId = createElementID();
|
7866 |
+
|
7867 |
+
//Stretch factor for old animations missing this property.
|
7868 |
+
if(!this.data.sr){
|
7869 |
+
this.data.sr = 1;
|
7870 |
+
}
|
7871 |
+
// effects manager
|
7872 |
+
this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
|
7873 |
+
|
7874 |
+
},
|
7875 |
+
getType: function(){
|
7876 |
+
return this.type;
|
7877 |
+
}
|
7878 |
+
,sourceRectAtTime: function(){}
|
7879 |
+
}
|
7880 |
+
function NullElement(data,globalData,comp){
|
7881 |
+
this.initFrame();
|
7882 |
+
this.initBaseData(data, globalData, comp);
|
7883 |
+
this.initFrame();
|
7884 |
+
this.initTransform(data, globalData, comp);
|
7885 |
+
this.initHierarchy();
|
7886 |
+
}
|
7887 |
+
|
7888 |
+
NullElement.prototype.prepareFrame = function(num) {
|
7889 |
+
this.prepareProperties(num, true);
|
7890 |
+
};
|
7891 |
+
|
7892 |
+
NullElement.prototype.renderFrame = function() {
|
7893 |
+
};
|
7894 |
+
|
7895 |
+
NullElement.prototype.getBaseElement = function() {
|
7896 |
+
return null;
|
7897 |
+
};
|
7898 |
+
|
7899 |
+
NullElement.prototype.destroy = function() {
|
7900 |
+
};
|
7901 |
+
|
7902 |
+
NullElement.prototype.sourceRectAtTime = function() {
|
7903 |
+
};
|
7904 |
+
|
7905 |
+
NullElement.prototype.hide = function() {
|
7906 |
+
};
|
7907 |
+
|
7908 |
+
extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
|
7909 |
+
|
7910 |
+
function SVGBaseElement(){
|
7911 |
+
}
|
7912 |
+
|
7913 |
+
SVGBaseElement.prototype = {
|
7914 |
+
initRendererElement: function() {
|
7915 |
+
this.layerElement = createNS('g');
|
7916 |
+
},
|
7917 |
+
createContainerElements: function(){
|
7918 |
+
this.matteElement = createNS('g');
|
7919 |
+
this.transformedElement = this.layerElement;
|
7920 |
+
this.maskedElement = this.layerElement;
|
7921 |
+
this._sizeChanged = false;
|
7922 |
+
var layerElementParent = null;
|
7923 |
+
//If this layer acts as a mask for the following layer
|
7924 |
+
var filId, fil, gg;
|
7925 |
+
if (this.data.td) {
|
7926 |
+
if (this.data.td == 3 || this.data.td == 1) {
|
7927 |
+
var masker = createNS('mask');
|
7928 |
+
masker.setAttribute('id', this.layerId);
|
7929 |
+
masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
|
7930 |
+
masker.appendChild(this.layerElement);
|
7931 |
+
layerElementParent = masker;
|
7932 |
+
this.globalData.defs.appendChild(masker);
|
7933 |
+
// This is only for IE and Edge when mask if of type alpha
|
7934 |
+
if (!featureSupport.maskType && this.data.td == 1) {
|
7935 |
+
masker.setAttribute('mask-type', 'luminance');
|
7936 |
+
filId = createElementID();
|
7937 |
+
fil = filtersFactory.createFilter(filId);
|
7938 |
+
this.globalData.defs.appendChild(fil);
|
7939 |
+
fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
|
7940 |
+
gg = createNS('g');
|
7941 |
+
gg.appendChild(this.layerElement);
|
7942 |
+
layerElementParent = gg;
|
7943 |
+
masker.appendChild(gg);
|
7944 |
+
gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
|
7945 |
+
}
|
7946 |
+
} else if(this.data.td == 2) {
|
7947 |
+
var maskGroup = createNS('mask');
|
7948 |
+
maskGroup.setAttribute('id', this.layerId);
|
7949 |
+
maskGroup.setAttribute('mask-type','alpha');
|
7950 |
+
var maskGrouper = createNS('g');
|
7951 |
+
maskGroup.appendChild(maskGrouper);
|
7952 |
+
filId = createElementID();
|
7953 |
+
fil = filtersFactory.createFilter(filId);
|
7954 |
+
////
|
7955 |
+
|
7956 |
+
// This solution doesn't work on Android when meta tag with viewport attribute is set
|
7957 |
+
/*var feColorMatrix = createNS('feColorMatrix');
|
7958 |
+
feColorMatrix.setAttribute('type', 'matrix');
|
7959 |
+
feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
|
7960 |
+
feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
|
7961 |
+
fil.appendChild(feColorMatrix);*/
|
7962 |
+
////
|
7963 |
+
var feCTr = createNS('feComponentTransfer');
|
7964 |
+
feCTr.setAttribute('in','SourceGraphic');
|
7965 |
+
fil.appendChild(feCTr);
|
7966 |
+
var feFunc = createNS('feFuncA');
|
7967 |
+
feFunc.setAttribute('type','table');
|
7968 |
+
feFunc.setAttribute('tableValues','1.0 0.0');
|
7969 |
+
feCTr.appendChild(feFunc);
|
7970 |
+
////
|
7971 |
+
this.globalData.defs.appendChild(fil);
|
7972 |
+
var alphaRect = createNS('rect');
|
7973 |
+
alphaRect.setAttribute('width', this.comp.data.w);
|
7974 |
+
alphaRect.setAttribute('height', this.comp.data.h);
|
7975 |
+
alphaRect.setAttribute('x','0');
|
7976 |
+
alphaRect.setAttribute('y','0');
|
7977 |
+
alphaRect.setAttribute('fill','#ffffff');
|
7978 |
+
alphaRect.setAttribute('opacity','0');
|
7979 |
+
maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
|
7980 |
+
maskGrouper.appendChild(alphaRect);
|
7981 |
+
maskGrouper.appendChild(this.layerElement);
|
7982 |
+
layerElementParent = maskGrouper;
|
7983 |
+
if (!featureSupport.maskType) {
|
7984 |
+
maskGroup.setAttribute('mask-type', 'luminance');
|
7985 |
+
fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
|
7986 |
+
gg = createNS('g');
|
7987 |
+
maskGrouper.appendChild(alphaRect);
|
7988 |
+
gg.appendChild(this.layerElement);
|
7989 |
+
layerElementParent = gg;
|
7990 |
+
maskGrouper.appendChild(gg);
|
7991 |
+
}
|
7992 |
+
this.globalData.defs.appendChild(maskGroup);
|
7993 |
+
}
|
7994 |
+
} else if (this.data.tt) {
|
7995 |
+
this.matteElement.appendChild(this.layerElement);
|
7996 |
+
layerElementParent = this.matteElement;
|
7997 |
+
this.baseElement = this.matteElement;
|
7998 |
+
} else {
|
7999 |
+
this.baseElement = this.layerElement;
|
8000 |
+
}
|
8001 |
+
if (this.data.ln) {
|
8002 |
+
this.layerElement.setAttribute('id', this.data.ln);
|
8003 |
+
}
|
8004 |
+
if (this.data.cl) {
|
8005 |
+
this.layerElement.setAttribute('class', this.data.cl);
|
8006 |
+
}
|
8007 |
+
//Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
|
8008 |
+
if (this.data.ty === 0 && !this.data.hd) {
|
8009 |
+
var cp = createNS( 'clipPath');
|
8010 |
+
var pt = createNS('path');
|
8011 |
+
pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
|
8012 |
+
var clipId = createElementID();
|
8013 |
+
cp.setAttribute('id',clipId);
|
8014 |
+
cp.appendChild(pt);
|
8015 |
+
this.globalData.defs.appendChild(cp);
|
8016 |
+
|
8017 |
+
if (this.checkMasks()) {
|
8018 |
+
var cpGroup = createNS('g');
|
8019 |
+
cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
|
8020 |
+
cpGroup.appendChild(this.layerElement);
|
8021 |
+
this.transformedElement = cpGroup;
|
8022 |
+
if (layerElementParent) {
|
8023 |
+
layerElementParent.appendChild(this.transformedElement);
|
8024 |
+
} else {
|
8025 |
+
this.baseElement = this.transformedElement;
|
8026 |
+
}
|
8027 |
+
} else {
|
8028 |
+
this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
|
8029 |
+
}
|
8030 |
+
|
8031 |
+
}
|
8032 |
+
if (this.data.bm !== 0) {
|
8033 |
+
this.setBlendMode();
|
8034 |
+
}
|
8035 |
+
|
8036 |
+
},
|
8037 |
+
renderElement: function() {
|
8038 |
+
if (this.finalTransform._matMdf) {
|
8039 |
+
this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
|
8040 |
+
}
|
8041 |
+
if (this.finalTransform._opMdf) {
|
8042 |
+
this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
|
8043 |
+
}
|
8044 |
+
},
|
8045 |
+
destroyBaseElement: function() {
|
8046 |
+
this.layerElement = null;
|
8047 |
+
this.matteElement = null;
|
8048 |
+
this.maskManager.destroy();
|
8049 |
+
},
|
8050 |
+
getBaseElement: function() {
|
8051 |
+
if (this.data.hd) {
|
8052 |
+
return null;
|
8053 |
+
}
|
8054 |
+
return this.baseElement;
|
8055 |
+
},
|
8056 |
+
createRenderableComponents: function() {
|
8057 |
+
this.maskManager = new MaskElement(this.data, this, this.globalData);
|
8058 |
+
this.renderableEffectsManager = new SVGEffects(this);
|
8059 |
+
},
|
8060 |
+
setMatte: function(id) {
|
8061 |
+
if (!this.matteElement) {
|
8062 |
+
return;
|
8063 |
+
}
|
8064 |
+
this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
|
8065 |
+
}
|
8066 |
+
};
|
8067 |
+
function IShapeElement(){
|
8068 |
+
}
|
8069 |
+
|
8070 |
+
IShapeElement.prototype = {
|
8071 |
+
addShapeToModifiers: function(data) {
|
8072 |
+
var i, len = this.shapeModifiers.length;
|
8073 |
+
for(i=0;i<len;i+=1){
|
8074 |
+
this.shapeModifiers[i].addShape(data);
|
8075 |
+
}
|
8076 |
+
},
|
8077 |
+
isShapeInAnimatedModifiers: function(data) {
|
8078 |
+
var i = 0, len = this.shapeModifiers.length;
|
8079 |
+
while(i < len) {
|
8080 |
+
if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
|
8081 |
+
return true;
|
8082 |
+
}
|
8083 |
+
}
|
8084 |
+
return false;
|
8085 |
+
},
|
8086 |
+
renderModifiers: function() {
|
8087 |
+
if(!this.shapeModifiers.length){
|
8088 |
+
return;
|
8089 |
+
}
|
8090 |
+
var i, len = this.shapes.length;
|
8091 |
+
for(i=0;i<len;i+=1){
|
8092 |
+
this.shapes[i].sh.reset();
|
8093 |
+
}
|
8094 |
+
|
8095 |
+
len = this.shapeModifiers.length;
|
8096 |
+
for(i=len-1;i>=0;i-=1){
|
8097 |
+
this.shapeModifiers[i].processShapes(this._isFirstFrame);
|
8098 |
+
}
|
8099 |
+
},
|
8100 |
+
lcEnum: {
|
8101 |
+
'1': 'butt',
|
8102 |
+
'2': 'round',
|
8103 |
+
'3': 'square'
|
8104 |
+
},
|
8105 |
+
ljEnum: {
|
8106 |
+
'1': 'miter',
|
8107 |
+
'2': 'round',
|
8108 |
+
'3': 'bevel'
|
8109 |
+
},
|
8110 |
+
searchProcessedElement: function(elem){
|
8111 |
+
var elements = this.processedElements;
|
8112 |
+
var i = 0, len = elements.length;
|
8113 |
+
while (i < len) {
|
8114 |
+
if (elements[i].elem === elem) {
|
8115 |
+
return elements[i].pos;
|
8116 |
+
}
|
8117 |
+
i += 1;
|
8118 |
+
}
|
8119 |
+
return 0;
|
8120 |
+
},
|
8121 |
+
addProcessedElement: function(elem, pos){
|
8122 |
+
var elements = this.processedElements;
|
8123 |
+
var i = elements.length;
|
8124 |
+
while(i) {
|
8125 |
+
i -= 1;
|
8126 |
+
if (elements[i].elem === elem) {
|
8127 |
+
elements[i].pos = pos;
|
8128 |
+
return;
|
8129 |
+
}
|
8130 |
+
}
|
8131 |
+
elements.push(new ProcessedElement(elem, pos));
|
8132 |
+
},
|
8133 |
+
prepareFrame: function(num) {
|
8134 |
+
this.prepareRenderableFrame(num);
|
8135 |
+
this.prepareProperties(num, this.isInRange);
|
8136 |
+
}
|
8137 |
+
};
|
8138 |
+
function ITextElement(){
|
8139 |
+
}
|
8140 |
+
|
8141 |
+
ITextElement.prototype.initElement = function(data,globalData,comp){
|
8142 |
+
this.lettersChangedFlag = true;
|
8143 |
+
this.initFrame();
|
8144 |
+
this.initBaseData(data, globalData, comp);
|
8145 |
+
this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
|
8146 |
+
this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
|
8147 |
+
this.initTransform(data, globalData, comp);
|
8148 |
+
this.initHierarchy();
|
8149 |
+
this.initRenderable();
|
8150 |
+
this.initRendererElement();
|
8151 |
+
this.createContainerElements();
|
8152 |
+
this.createRenderableComponents();
|
8153 |
+
this.createContent();
|
8154 |
+
this.hide();
|
8155 |
+
this.textAnimator.searchProperties(this.dynamicProperties);
|
8156 |
+
};
|
8157 |
+
|
8158 |
+
ITextElement.prototype.prepareFrame = function(num) {
|
8159 |
+
this._mdf = false;
|
8160 |
+
this.prepareRenderableFrame(num);
|
8161 |
+
this.prepareProperties(num, this.isInRange);
|
8162 |
+
if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
|
8163 |
+
this.buildNewText();
|
8164 |
+
this.textProperty._isFirstFrame = false;
|
8165 |
+
this.textProperty._mdf = false;
|
8166 |
+
}
|
8167 |
+
};
|
8168 |
+
|
8169 |
+
ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
|
8170 |
+
var j,jLen = shapes.length;
|
8171 |
+
var k, kLen, pathNodes;
|
8172 |
+
var shapeStr = '';
|
8173 |
+
for(j=0;j<jLen;j+=1){
|
8174 |
+
pathNodes = shapes[j].ks.k;
|
8175 |
+
shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
|
8176 |
+
}
|
8177 |
+
return shapeStr;
|
8178 |
+
};
|
8179 |
+
|
8180 |
+
ITextElement.prototype.updateDocumentData = function(newData, index) {
|
8181 |
+
this.textProperty.updateDocumentData(newData, index);
|
8182 |
+
};
|
8183 |
+
|
8184 |
+
ITextElement.prototype.canResizeFont = function(_canResize) {
|
8185 |
+
this.textProperty.canResizeFont(_canResize);
|
8186 |
+
};
|
8187 |
+
|
8188 |
+
ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
|
8189 |
+
this.textProperty.setMinimumFontSize(_fontSize);
|
8190 |
+
};
|
8191 |
+
|
8192 |
+
ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
|
8193 |
+
if(documentData.ps){
|
8194 |
+
matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
|
8195 |
+
}
|
8196 |
+
matrixHelper.translate(0,-documentData.ls,0);
|
8197 |
+
switch(documentData.j){
|
8198 |
+
case 1:
|
8199 |
+
matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
|
8200 |
+
break;
|
8201 |
+
case 2:
|
8202 |
+
matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
|
8203 |
+
break;
|
8204 |
+
}
|
8205 |
+
matrixHelper.translate(xPos, yPos, 0);
|
8206 |
+
};
|
8207 |
+
|
8208 |
+
|
8209 |
+
ITextElement.prototype.buildColor = function(colorData) {
|
8210 |
+
return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
|
8211 |
+
};
|
8212 |
+
|
8213 |
+
ITextElement.prototype.emptyProp = new LetterProps();
|
8214 |
+
|
8215 |
+
ITextElement.prototype.destroy = function(){
|
8216 |
+
|
8217 |
+
};
|
8218 |
+
function ICompElement(){}
|
8219 |
+
|
8220 |
+
extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
|
8221 |
+
|
8222 |
+
ICompElement.prototype.initElement = function(data,globalData,comp) {
|
8223 |
+
this.initFrame();
|
8224 |
+
this.initBaseData(data, globalData, comp);
|
8225 |
+
this.initTransform(data, globalData, comp);
|
8226 |
+
this.initRenderable();
|
8227 |
+
this.initHierarchy();
|
8228 |
+
this.initRendererElement();
|
8229 |
+
this.createContainerElements();
|
8230 |
+
this.createRenderableComponents();
|
8231 |
+
if(this.data.xt || !globalData.progressiveLoad){
|
8232 |
+
this.buildAllItems();
|
8233 |
+
}
|
8234 |
+
this.hide();
|
8235 |
+
};
|
8236 |
+
|
8237 |
+
/*ICompElement.prototype.hide = function(){
|
8238 |
+
if(!this.hidden){
|
8239 |
+
this.hideElement();
|
8240 |
+
var i,len = this.elements.length;
|
8241 |
+
for( i = 0; i < len; i+=1 ){
|
8242 |
+
if(this.elements[i]){
|
8243 |
+
this.elements[i].hide();
|
8244 |
+
}
|
8245 |
+
}
|
8246 |
+
}
|
8247 |
+
};*/
|
8248 |
+
|
8249 |
+
ICompElement.prototype.prepareFrame = function(num){
|
8250 |
+
this._mdf = false;
|
8251 |
+
this.prepareRenderableFrame(num);
|
8252 |
+
this.prepareProperties(num, this.isInRange);
|
8253 |
+
if(!this.isInRange && !this.data.xt){
|
8254 |
+
return;
|
8255 |
+
}
|
8256 |
+
|
8257 |
+
if (!this.tm._placeholder) {
|
8258 |
+
var timeRemapped = this.tm.v;
|
8259 |
+
if(timeRemapped === this.data.op){
|
8260 |
+
timeRemapped = this.data.op - 1;
|
8261 |
+
}
|
8262 |
+
this.renderedFrame = timeRemapped;
|
8263 |
+
} else {
|
8264 |
+
this.renderedFrame = num/this.data.sr;
|
8265 |
+
}
|
8266 |
+
var i,len = this.elements.length;
|
8267 |
+
if(!this.completeLayers){
|
8268 |
+
this.checkLayers(this.renderedFrame);
|
8269 |
+
}
|
8270 |
+
//This iteration needs to be backwards because of how expressions connect between each other
|
8271 |
+
for( i = len - 1; i >= 0; i -= 1 ){
|
8272 |
+
if(this.completeLayers || this.elements[i]){
|
8273 |
+
this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
|
8274 |
+
if(this.elements[i]._mdf) {
|
8275 |
+
this._mdf = true;
|
8276 |
+
}
|
8277 |
+
}
|
8278 |
+
}
|
8279 |
+
};
|
8280 |
+
|
8281 |
+
ICompElement.prototype.renderInnerContent = function() {
|
8282 |
+
var i,len = this.layers.length;
|
8283 |
+
for( i = 0; i < len; i += 1 ){
|
8284 |
+
if(this.completeLayers || this.elements[i]){
|
8285 |
+
this.elements[i].renderFrame();
|
8286 |
+
}
|
8287 |
+
}
|
8288 |
+
};
|
8289 |
+
|
8290 |
+
ICompElement.prototype.setElements = function(elems){
|
8291 |
+
this.elements = elems;
|
8292 |
+
};
|
8293 |
+
|
8294 |
+
ICompElement.prototype.getElements = function(){
|
8295 |
+
return this.elements;
|
8296 |
+
};
|
8297 |
+
|
8298 |
+
ICompElement.prototype.destroyElements = function(){
|
8299 |
+
var i,len = this.layers.length;
|
8300 |
+
for( i = 0; i < len; i+=1 ){
|
8301 |
+
if(this.elements[i]){
|
8302 |
+
this.elements[i].destroy();
|
8303 |
+
}
|
8304 |
+
}
|
8305 |
+
};
|
8306 |
+
|
8307 |
+
ICompElement.prototype.destroy = function(){
|
8308 |
+
this.destroyElements();
|
8309 |
+
this.destroyBaseElement();
|
8310 |
+
};
|
8311 |
+
|
8312 |
+
function IImageElement(data,globalData,comp){
|
8313 |
+
this.assetData = globalData.getAssetData(data.refId);
|
8314 |
+
this.initElement(data,globalData,comp);
|
8315 |
+
this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
|
8316 |
+
}
|
8317 |
+
|
8318 |
+
extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
|
8319 |
+
|
8320 |
+
IImageElement.prototype.createContent = function(){
|
8321 |
+
|
8322 |
+
var assetPath = this.globalData.getAssetsPath(this.assetData);
|
8323 |
+
|
8324 |
+
this.innerElem = createNS('image');
|
8325 |
+
this.innerElem.setAttribute('width',this.assetData.w+"px");
|
8326 |
+
this.innerElem.setAttribute('height',this.assetData.h+"px");
|
8327 |
+
this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
|
8328 |
+
this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
|
8329 |
+
|
8330 |
+
this.layerElement.appendChild(this.innerElem);
|
8331 |
+
};
|
8332 |
+
|
8333 |
+
IImageElement.prototype.sourceRectAtTime = function() {
|
8334 |
+
return this.sourceRect;
|
8335 |
+
}
|
8336 |
+
function ISolidElement(data,globalData,comp){
|
8337 |
+
this.initElement(data,globalData,comp);
|
8338 |
+
}
|
8339 |
+
extendPrototype([IImageElement], ISolidElement);
|
8340 |
+
|
8341 |
+
ISolidElement.prototype.createContent = function(){
|
8342 |
+
|
8343 |
+
var rect = createNS('rect');
|
8344 |
+
////rect.style.width = this.data.sw;
|
8345 |
+
////rect.style.height = this.data.sh;
|
8346 |
+
////rect.style.fill = this.data.sc;
|
8347 |
+
rect.setAttribute('width',this.data.sw);
|
8348 |
+
rect.setAttribute('height',this.data.sh);
|
8349 |
+
rect.setAttribute('fill',this.data.sc);
|
8350 |
+
this.layerElement.appendChild(rect);
|
8351 |
+
};
|
8352 |
+
function SVGCompElement(data,globalData,comp){
|
8353 |
+
this.layers = data.layers;
|
8354 |
+
this.supports3d = true;
|
8355 |
+
this.completeLayers = false;
|
8356 |
+
this.pendingElements = [];
|
8357 |
+
this.elements = this.layers ? createSizedArray(this.layers.length) : [];
|
8358 |
+
//this.layerElement = createNS('g');
|
8359 |
+
this.initElement(data,globalData,comp);
|
8360 |
+
this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
|
8361 |
+
}
|
8362 |
+
|
8363 |
+
extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement);
|
8364 |
+
function SVGTextElement(data,globalData,comp){
|
8365 |
+
this.textSpans = [];
|
8366 |
+
this.renderType = 'svg';
|
8367 |
+
this.initElement(data,globalData,comp);
|
8368 |
+
}
|
8369 |
+
|
8370 |
+
extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], SVGTextElement);
|
8371 |
+
|
8372 |
+
SVGTextElement.prototype.createContent = function(){
|
8373 |
+
|
8374 |
+
if (this.data.singleShape && !this.globalData.fontManager.chars) {
|
8375 |
+
this.textContainer = createNS('text');
|
8376 |
+
}
|
8377 |
+
};
|
8378 |
+
|
8379 |
+
SVGTextElement.prototype.buildTextContents = function(textArray) {
|
8380 |
+
var i = 0, len = textArray.length;
|
8381 |
+
var textContents = [], currentTextContent = '';
|
8382 |
+
while (i < len) {
|
8383 |
+
if(textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
|
8384 |
+
textContents.push(currentTextContent);
|
8385 |
+
currentTextContent = '';
|
8386 |
+
} else {
|
8387 |
+
currentTextContent += textArray[i];
|
8388 |
+
}
|
8389 |
+
i += 1;
|
8390 |
+
}
|
8391 |
+
textContents.push(currentTextContent);
|
8392 |
+
return textContents;
|
8393 |
+
}
|
8394 |
+
|
8395 |
+
SVGTextElement.prototype.buildNewText = function(){
|
8396 |
+
var i, len;
|
8397 |
+
|
8398 |
+
var documentData = this.textProperty.currentData;
|
8399 |
+
this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
|
8400 |
+
if(documentData.fc) {
|
8401 |
+
this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
|
8402 |
+
}else{
|
8403 |
+
this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
|
8404 |
+
}
|
8405 |
+
if(documentData.sc){
|
8406 |
+
this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
|
8407 |
+
this.layerElement.setAttribute('stroke-width', documentData.sw);
|
8408 |
+
}
|
8409 |
+
this.layerElement.setAttribute('font-size', documentData.finalSize);
|
8410 |
+
var fontData = this.globalData.fontManager.getFontByName(documentData.f);
|
8411 |
+
if(fontData.fClass){
|
8412 |
+
this.layerElement.setAttribute('class',fontData.fClass);
|
8413 |
+
} else {
|
8414 |
+
this.layerElement.setAttribute('font-family', fontData.fFamily);
|
8415 |
+
var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
|
8416 |
+
this.layerElement.setAttribute('font-style', fStyle);
|
8417 |
+
this.layerElement.setAttribute('font-weight', fWeight);
|
8418 |
+
}
|
8419 |
+
this.layerElement.setAttribute('aria-label', documentData.t);
|
8420 |
+
|
8421 |
+
var letters = documentData.l || [];
|
8422 |
+
var usesGlyphs = !!this.globalData.fontManager.chars;
|
8423 |
+
len = letters.length;
|
8424 |
+
|
8425 |
+
var tSpan;
|
8426 |
+
var matrixHelper = this.mHelper;
|
8427 |
+
var shapes, shapeStr = '', singleShape = this.data.singleShape;
|
8428 |
+
var xPos = 0, yPos = 0, firstLine = true;
|
8429 |
+
var trackingOffset = documentData.tr/1000*documentData.finalSize;
|
8430 |
+
if(singleShape && !usesGlyphs && !documentData.sz) {
|
8431 |
+
var tElement = this.textContainer;
|
8432 |
+
var justify = 'start';
|
8433 |
+
switch(documentData.j) {
|
8434 |
+
case 1:
|
8435 |
+
justify = 'end';
|
8436 |
+
break;
|
8437 |
+
case 2:
|
8438 |
+
justify = 'middle';
|
8439 |
+
break;
|
8440 |
+
}
|
8441 |
+
tElement.setAttribute('text-anchor',justify);
|
8442 |
+
tElement.setAttribute('letter-spacing',trackingOffset);
|
8443 |
+
var textContent = this.buildTextContents(documentData.finalText);
|
8444 |
+
len = textContent.length;
|
8445 |
+
yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
|
8446 |
+
for ( i = 0; i < len; i += 1) {
|
8447 |
+
tSpan = this.textSpans[i] || createNS('tspan');
|
8448 |
+
tSpan.textContent = textContent[i];
|
8449 |
+
tSpan.setAttribute('x', 0);
|
8450 |
+
tSpan.setAttribute('y', yPos);
|
8451 |
+
tSpan.style.display = 'inherit';
|
8452 |
+
tElement.appendChild(tSpan);
|
8453 |
+
this.textSpans[i] = tSpan;
|
8454 |
+
yPos += documentData.finalLineHeight;
|
8455 |
+
}
|
8456 |
+
|
8457 |
+
this.layerElement.appendChild(tElement);
|
8458 |
+
} else {
|
8459 |
+
var cachedSpansLength = this.textSpans.length;
|
8460 |
+
var shapeData, charData;
|
8461 |
+
for (i = 0; i < len; i += 1) {
|
8462 |
+
if(!usesGlyphs || !singleShape || i === 0){
|
8463 |
+
tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs?'path':'text');
|
8464 |
+
if (cachedSpansLength <= i) {
|
8465 |
+
tSpan.setAttribute('stroke-linecap', 'butt');
|
8466 |
+
tSpan.setAttribute('stroke-linejoin','round');
|
8467 |
+
tSpan.setAttribute('stroke-miterlimit','4');
|
8468 |
+
this.textSpans[i] = tSpan;
|
8469 |
+
this.layerElement.appendChild(tSpan);
|
8470 |
+
}
|
8471 |
+
tSpan.style.display = 'inherit';
|
8472 |
+
}
|
8473 |
+
|
8474 |
+
matrixHelper.reset();
|
8475 |
+
matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
|
8476 |
+
if (singleShape) {
|
8477 |
+
if(letters[i].n) {
|
8478 |
+
xPos = -trackingOffset;
|
8479 |
+
yPos += documentData.yOffset;
|
8480 |
+
yPos += firstLine ? 1 : 0;
|
8481 |
+
firstLine = false;
|
8482 |
+
}
|
8483 |
+
this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
|
8484 |
+
xPos += letters[i].l || 0;
|
8485 |
+
//xPos += letters[i].val === ' ' ? 0 : trackingOffset;
|
8486 |
+
xPos += trackingOffset;
|
8487 |
+
}
|
8488 |
+
if(usesGlyphs) {
|
8489 |
+
charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
|
8490 |
+
shapeData = charData && charData.data || {};
|
8491 |
+
shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
|
8492 |
+
if(!singleShape){
|
8493 |
+
tSpan.setAttribute('d',this.createPathShape(matrixHelper,shapes));
|
8494 |
+
} else {
|
8495 |
+
shapeStr += this.createPathShape(matrixHelper,shapes);
|
8496 |
+
}
|
8497 |
+
} else {
|
8498 |
+
if(singleShape) {
|
8499 |
+
tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")");
|
8500 |
+
}
|
8501 |
+
tSpan.textContent = letters[i].val;
|
8502 |
+
tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
|
8503 |
+
}
|
8504 |
+
//
|
8505 |
+
}
|
8506 |
+
if (singleShape && tSpan) {
|
8507 |
+
tSpan.setAttribute('d',shapeStr);
|
8508 |
+
}
|
8509 |
+
}
|
8510 |
+
while (i < this.textSpans.length){
|
8511 |
+
this.textSpans[i].style.display = 'none';
|
8512 |
+
i += 1;
|
8513 |
+
}
|
8514 |
+
|
8515 |
+
this._sizeChanged = true;
|
8516 |
+
};
|
8517 |
+
|
8518 |
+
SVGTextElement.prototype.sourceRectAtTime = function(time){
|
8519 |
+
this.prepareFrame(this.comp.renderedFrame - this.data.st);
|
8520 |
+
this.renderInnerContent();
|
8521 |
+
if(this._sizeChanged){
|
8522 |
+
this._sizeChanged = false;
|
8523 |
+
var textBox = this.layerElement.getBBox();
|
8524 |
+
this.bbox = {
|
8525 |
+
top: textBox.y,
|
8526 |
+
left: textBox.x,
|
8527 |
+
width: textBox.width,
|
8528 |
+
height: textBox.height
|
8529 |
+
};
|
8530 |
+
}
|
8531 |
+
return this.bbox;
|
8532 |
+
};
|
8533 |
+
|
8534 |
+
SVGTextElement.prototype.renderInnerContent = function(){
|
8535 |
+
|
8536 |
+
if(!this.data.singleShape){
|
8537 |
+
this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
|
8538 |
+
if(this.lettersChangedFlag || this.textAnimator.lettersChangedFlag){
|
8539 |
+
this._sizeChanged = true;
|
8540 |
+
var i,len;
|
8541 |
+
var renderedLetters = this.textAnimator.renderedLetters;
|
8542 |
+
|
8543 |
+
var letters = this.textProperty.currentData.l;
|
8544 |
+
|
8545 |
+
len = letters.length;
|
8546 |
+
var renderedLetter, textSpan;
|
8547 |
+
for(i=0;i<len;i+=1){
|
8548 |
+
if(letters[i].n){
|
8549 |
+
continue;
|
8550 |
+
}
|
8551 |
+
renderedLetter = renderedLetters[i];
|
8552 |
+
textSpan = this.textSpans[i];
|
8553 |
+
if(renderedLetter._mdf.m) {
|
8554 |
+
textSpan.setAttribute('transform',renderedLetter.m);
|
8555 |
+
}
|
8556 |
+
if(renderedLetter._mdf.o) {
|
8557 |
+
textSpan.setAttribute('opacity',renderedLetter.o);
|
8558 |
+
}
|
8559 |
+
if(renderedLetter._mdf.sw){
|
8560 |
+
textSpan.setAttribute('stroke-width',renderedLetter.sw);
|
8561 |
+
}
|
8562 |
+
if(renderedLetter._mdf.sc){
|
8563 |
+
textSpan.setAttribute('stroke',renderedLetter.sc);
|
8564 |
+
}
|
8565 |
+
if(renderedLetter._mdf.fc){
|
8566 |
+
textSpan.setAttribute('fill',renderedLetter.fc);
|
8567 |
+
}
|
8568 |
+
}
|
8569 |
+
}
|
8570 |
+
}
|
8571 |
+
};
|
8572 |
+
|
8573 |
+
function SVGShapeElement(data,globalData,comp){
|
8574 |
+
//List of drawable elements
|
8575 |
+
this.shapes = [];
|
8576 |
+
// Full shape data
|
8577 |
+
this.shapesData = data.shapes;
|
8578 |
+
//List of styles that will be applied to shapes
|
8579 |
+
this.stylesList = [];
|
8580 |
+
//List of modifiers that will be applied to shapes
|
8581 |
+
this.shapeModifiers = [];
|
8582 |
+
//List of items in shape tree
|
8583 |
+
this.itemsData = [];
|
8584 |
+
//List of items in previous shape tree
|
8585 |
+
this.processedElements = [];
|
8586 |
+
// List of animated components
|
8587 |
+
this.animatedContents = [];
|
8588 |
+
this.initElement(data,globalData,comp);
|
8589 |
+
//Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
|
8590 |
+
// List of elements that have been created
|
8591 |
+
this.prevViewData = [];
|
8592 |
+
//Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
|
8593 |
+
}
|
8594 |
+
|
8595 |
+
extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
|
8596 |
+
|
8597 |
+
SVGShapeElement.prototype.initSecondaryElement = function() {
|
8598 |
+
};
|
8599 |
+
|
8600 |
+
SVGShapeElement.prototype.identityMatrix = new Matrix();
|
8601 |
+
|
8602 |
+
SVGShapeElement.prototype.buildExpressionInterface = function(){};
|
8603 |
+
|
8604 |
+
SVGShapeElement.prototype.createContent = function(){
|
8605 |
+
this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
|
8606 |
+
this.filterUniqueShapes();
|
8607 |
+
};
|
8608 |
+
|
8609 |
+
/*
|
8610 |
+
This method searches for multiple shapes that affect a single element and one of them is animated
|
8611 |
+
*/
|
8612 |
+
SVGShapeElement.prototype.filterUniqueShapes = function(){
|
8613 |
+
var i, len = this.shapes.length, shape;
|
8614 |
+
var j, jLen = this.stylesList.length;
|
8615 |
+
var style, count = 0;
|
8616 |
+
var tempShapes = [];
|
8617 |
+
var areAnimated = false;
|
8618 |
+
for(j = 0; j < jLen; j += 1) {
|
8619 |
+
style = this.stylesList[j];
|
8620 |
+
areAnimated = false;
|
8621 |
+
tempShapes.length = 0;
|
8622 |
+
for(i = 0; i < len; i += 1) {
|
8623 |
+
shape = this.shapes[i];
|
8624 |
+
if(shape.styles.indexOf(style) !== -1) {
|
8625 |
+
tempShapes.push(shape);
|
8626 |
+
areAnimated = shape._isAnimated || areAnimated;
|
8627 |
+
}
|
8628 |
+
}
|
8629 |
+
if(tempShapes.length > 1 && areAnimated) {
|
8630 |
+
this.setShapesAsAnimated(tempShapes);
|
8631 |
+
}
|
8632 |
+
}
|
8633 |
+
}
|
8634 |
+
|
8635 |
+
SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
|
8636 |
+
var i, len = shapes.length;
|
8637 |
+
for(i = 0; i < len; i += 1) {
|
8638 |
+
shapes[i].setAsAnimated();
|
8639 |
+
}
|
8640 |
+
}
|
8641 |
+
|
8642 |
+
SVGShapeElement.prototype.createStyleElement = function(data, level){
|
8643 |
+
//TODO: prevent drawing of hidden styles
|
8644 |
+
var elementData;
|
8645 |
+
var styleOb = new SVGStyleData(data, level);
|
8646 |
+
|
8647 |
+
var pathElement = styleOb.pElem;
|
8648 |
+
if(data.ty === 'st') {
|
8649 |
+
elementData = new SVGStrokeStyleData(this, data, styleOb);
|
8650 |
+
} else if(data.ty === 'fl') {
|
8651 |
+
elementData = new SVGFillStyleData(this, data, styleOb);
|
8652 |
+
} else if(data.ty === 'gf' || data.ty === 'gs') {
|
8653 |
+
var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
|
8654 |
+
elementData = new gradientConstructor(this, data, styleOb);
|
8655 |
+
this.globalData.defs.appendChild(elementData.gf);
|
8656 |
+
if (elementData.maskId) {
|
8657 |
+
this.globalData.defs.appendChild(elementData.ms);
|
8658 |
+
this.globalData.defs.appendChild(elementData.of);
|
8659 |
+
pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
|
8660 |
+
}
|
8661 |
+
}
|
8662 |
+
|
8663 |
+
if(data.ty === 'st' || data.ty === 'gs') {
|
8664 |
+
pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
|
8665 |
+
pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
|
8666 |
+
pathElement.setAttribute('fill-opacity','0');
|
8667 |
+
if(data.lj === 1) {
|
8668 |
+
pathElement.setAttribute('stroke-miterlimit',data.ml);
|
8669 |
+
}
|
8670 |
+
}
|
8671 |
+
|
8672 |
+
if(data.r === 2) {
|
8673 |
+
pathElement.setAttribute('fill-rule', 'evenodd');
|
8674 |
+
}
|
8675 |
+
|
8676 |
+
if(data.ln){
|
8677 |
+
pathElement.setAttribute('id',data.ln);
|
8678 |
+
}
|
8679 |
+
if(data.cl){
|
8680 |
+
pathElement.setAttribute('class',data.cl);
|
8681 |
+
}
|
8682 |
+
if(data.bm){
|
8683 |
+
pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
|
8684 |
+
}
|
8685 |
+
this.stylesList.push(styleOb);
|
8686 |
+
this.addToAnimatedContents(data, elementData);
|
8687 |
+
return elementData;
|
8688 |
+
};
|
8689 |
+
|
8690 |
+
SVGShapeElement.prototype.createGroupElement = function(data) {
|
8691 |
+
var elementData = new ShapeGroupData();
|
8692 |
+
if(data.ln){
|
8693 |
+
elementData.gr.setAttribute('id',data.ln);
|
8694 |
+
}
|
8695 |
+
if(data.cl){
|
8696 |
+
elementData.gr.setAttribute('class',data.cl);
|
8697 |
+
}
|
8698 |
+
if(data.bm){
|
8699 |
+
elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
|
8700 |
+
}
|
8701 |
+
return elementData;
|
8702 |
+
};
|
8703 |
+
|
8704 |
+
SVGShapeElement.prototype.createTransformElement = function(data, container) {
|
8705 |
+
var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
|
8706 |
+
var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
|
8707 |
+
this.addToAnimatedContents(data, elementData);
|
8708 |
+
return elementData;
|
8709 |
+
};
|
8710 |
+
|
8711 |
+
SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
|
8712 |
+
var ty = 4;
|
8713 |
+
if(data.ty === 'rc'){
|
8714 |
+
ty = 5;
|
8715 |
+
}else if(data.ty === 'el'){
|
8716 |
+
ty = 6;
|
8717 |
+
}else if(data.ty === 'sr'){
|
8718 |
+
ty = 7;
|
8719 |
+
}
|
8720 |
+
var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
|
8721 |
+
var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
|
8722 |
+
this.shapes.push(elementData);
|
8723 |
+
this.addShapeToModifiers(elementData);
|
8724 |
+
this.addToAnimatedContents(data, elementData);
|
8725 |
+
return elementData;
|
8726 |
+
};
|
8727 |
+
|
8728 |
+
SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
|
8729 |
+
var i = 0, len = this.animatedContents.length;
|
8730 |
+
while(i < len) {
|
8731 |
+
if(this.animatedContents[i].element === element) {
|
8732 |
+
return;
|
8733 |
+
}
|
8734 |
+
i += 1;
|
8735 |
+
}
|
8736 |
+
this.animatedContents.push({
|
8737 |
+
fn: SVGElementsRenderer.createRenderFunction(data),
|
8738 |
+
element: element,
|
8739 |
+
data: data
|
8740 |
+
});
|
8741 |
+
};
|
8742 |
+
|
8743 |
+
SVGShapeElement.prototype.setElementStyles = function(elementData){
|
8744 |
+
var arr = elementData.styles;
|
8745 |
+
var j, jLen = this.stylesList.length;
|
8746 |
+
for (j = 0; j < jLen; j += 1) {
|
8747 |
+
if (!this.stylesList[j].closed) {
|
8748 |
+
arr.push(this.stylesList[j]);
|
8749 |
+
}
|
8750 |
+
}
|
8751 |
+
};
|
8752 |
+
|
8753 |
+
SVGShapeElement.prototype.reloadShapes = function(){
|
8754 |
+
this._isFirstFrame = true;
|
8755 |
+
var i, len = this.itemsData.length;
|
8756 |
+
for( i = 0; i < len; i += 1) {
|
8757 |
+
this.prevViewData[i] = this.itemsData[i];
|
8758 |
+
}
|
8759 |
+
this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
|
8760 |
+
this.filterUniqueShapes();
|
8761 |
+
len = this.dynamicProperties.length;
|
8762 |
+
for(i = 0; i < len; i += 1) {
|
8763 |
+
this.dynamicProperties[i].getValue();
|
8764 |
+
}
|
8765 |
+
this.renderModifiers();
|
8766 |
+
};
|
8767 |
+
|
8768 |
+
SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
|
8769 |
+
var ownTransformers = [].concat(transformers);
|
8770 |
+
var i, len = arr.length - 1;
|
8771 |
+
var j, jLen;
|
8772 |
+
var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
|
8773 |
+
for(i=len;i>=0;i-=1){
|
8774 |
+
processedPos = this.searchProcessedElement(arr[i]);
|
8775 |
+
if(!processedPos){
|
8776 |
+
arr[i]._render = render;
|
8777 |
+
} else {
|
8778 |
+
itemsData[i] = prevViewData[processedPos - 1];
|
8779 |
+
}
|
8780 |
+
if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
|
8781 |
+
if(!processedPos){
|
8782 |
+
itemsData[i] = this.createStyleElement(arr[i], level);
|
8783 |
+
} else {
|
8784 |
+
itemsData[i].style.closed = false;
|
8785 |
+
}
|
8786 |
+
if(arr[i]._render){
|
8787 |
+
container.appendChild(itemsData[i].style.pElem);
|
8788 |
+
}
|
8789 |
+
ownStyles.push(itemsData[i].style);
|
8790 |
+
}else if(arr[i].ty == 'gr'){
|
8791 |
+
if(!processedPos){
|
8792 |
+
itemsData[i] = this.createGroupElement(arr[i]);
|
8793 |
+
} else {
|
8794 |
+
jLen = itemsData[i].it.length;
|
8795 |
+
for(j=0;j<jLen;j+=1){
|
8796 |
+
itemsData[i].prevViewData[j] = itemsData[i].it[j];
|
8797 |
+
}
|
8798 |
+
}
|
8799 |
+
this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
|
8800 |
+
if(arr[i]._render){
|
8801 |
+
container.appendChild(itemsData[i].gr);
|
8802 |
+
}
|
8803 |
+
}else if(arr[i].ty == 'tr'){
|
8804 |
+
if(!processedPos){
|
8805 |
+
itemsData[i] = this.createTransformElement(arr[i], container);
|
8806 |
+
}
|
8807 |
+
currentTransform = itemsData[i].transform;
|
8808 |
+
ownTransformers.push(currentTransform);
|
8809 |
+
}else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
|
8810 |
+
if(!processedPos){
|
8811 |
+
itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
|
8812 |
+
}
|
8813 |
+
this.setElementStyles(itemsData[i]);
|
8814 |
+
|
8815 |
+
}else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms'){
|
8816 |
+
if(!processedPos){
|
8817 |
+
modifier = ShapeModifiers.getModifier(arr[i].ty);
|
8818 |
+
modifier.init(this,arr[i]);
|
8819 |
+
itemsData[i] = modifier;
|
8820 |
+
this.shapeModifiers.push(modifier);
|
8821 |
+
} else {
|
8822 |
+
modifier = itemsData[i];
|
8823 |
+
modifier.closed = false;
|
8824 |
+
}
|
8825 |
+
ownModifiers.push(modifier);
|
8826 |
+
}else if(arr[i].ty == 'rp'){
|
8827 |
+
if(!processedPos){
|
8828 |
+
modifier = ShapeModifiers.getModifier(arr[i].ty);
|
8829 |
+
itemsData[i] = modifier;
|
8830 |
+
modifier.init(this,arr,i,itemsData);
|
8831 |
+
this.shapeModifiers.push(modifier);
|
8832 |
+
render = false;
|
8833 |
+
}else{
|
8834 |
+
modifier = itemsData[i];
|
8835 |
+
modifier.closed = true;
|
8836 |
+
}
|
8837 |
+
ownModifiers.push(modifier);
|
8838 |
+
}
|
8839 |
+
this.addProcessedElement(arr[i], i + 1);
|
8840 |
+
}
|
8841 |
+
len = ownStyles.length;
|
8842 |
+
for(i=0;i<len;i+=1){
|
8843 |
+
ownStyles[i].closed = true;
|
8844 |
+
}
|
8845 |
+
len = ownModifiers.length;
|
8846 |
+
for(i=0;i<len;i+=1){
|
8847 |
+
ownModifiers[i].closed = true;
|
8848 |
+
}
|
8849 |
+
};
|
8850 |
+
|
8851 |
+
SVGShapeElement.prototype.renderInnerContent = function() {
|
8852 |
+
this.renderModifiers();
|
8853 |
+
var i, len = this.stylesList.length;
|
8854 |
+
for(i=0;i<len;i+=1){
|
8855 |
+
this.stylesList[i].reset();
|
8856 |
+
}
|
8857 |
+
this.renderShape();
|
8858 |
+
|
8859 |
+
for (i = 0; i < len; i += 1) {
|
8860 |
+
if (this.stylesList[i]._mdf || this._isFirstFrame) {
|
8861 |
+
if(this.stylesList[i].msElem){
|
8862 |
+
this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
|
8863 |
+
//Adding M0 0 fixes same mask bug on all browsers
|
8864 |
+
this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
|
8865 |
+
}
|
8866 |
+
this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
|
8867 |
+
}
|
8868 |
+
}
|
8869 |
+
};
|
8870 |
+
|
8871 |
+
SVGShapeElement.prototype.renderShape = function() {
|
8872 |
+
var i, len = this.animatedContents.length;
|
8873 |
+
var animatedContent;
|
8874 |
+
for(i = 0; i < len; i += 1) {
|
8875 |
+
animatedContent = this.animatedContents[i];
|
8876 |
+
if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
|
8877 |
+
animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
|
8878 |
+
}
|
8879 |
+
}
|
8880 |
+
}
|
8881 |
+
|
8882 |
+
SVGShapeElement.prototype.destroy = function(){
|
8883 |
+
this.destroyBaseElement();
|
8884 |
+
this.shapesData = null;
|
8885 |
+
this.itemsData = null;
|
8886 |
+
};
|
8887 |
+
|
8888 |
+
function SVGTintFilter(filter, filterManager){
|
8889 |
+
this.filterManager = filterManager;
|
8890 |
+
var feColorMatrix = createNS('feColorMatrix');
|
8891 |
+
feColorMatrix.setAttribute('type','matrix');
|
8892 |
+
feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
|
8893 |
+
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');
|
8894 |
+
feColorMatrix.setAttribute('result','f1');
|
8895 |
+
filter.appendChild(feColorMatrix);
|
8896 |
+
feColorMatrix = createNS('feColorMatrix');
|
8897 |
+
feColorMatrix.setAttribute('type','matrix');
|
8898 |
+
feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
|
8899 |
+
feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
|
8900 |
+
feColorMatrix.setAttribute('result','f2');
|
8901 |
+
filter.appendChild(feColorMatrix);
|
8902 |
+
this.matrixFilter = feColorMatrix;
|
8903 |
+
if(filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k){
|
8904 |
+
var feMerge = createNS('feMerge');
|
8905 |
+
filter.appendChild(feMerge);
|
8906 |
+
var feMergeNode;
|
8907 |
+
feMergeNode = createNS('feMergeNode');
|
8908 |
+
feMergeNode.setAttribute('in','SourceGraphic');
|
8909 |
+
feMerge.appendChild(feMergeNode);
|
8910 |
+
feMergeNode = createNS('feMergeNode');
|
8911 |
+
feMergeNode.setAttribute('in','f2');
|
8912 |
+
feMerge.appendChild(feMergeNode);
|
8913 |
+
}
|
8914 |
+
}
|
8915 |
+
|
8916 |
+
SVGTintFilter.prototype.renderFrame = function(forceRender){
|
8917 |
+
if(forceRender || this.filterManager._mdf){
|
8918 |
+
var colorBlack = this.filterManager.effectElements[0].p.v;
|
8919 |
+
var colorWhite = this.filterManager.effectElements[1].p.v;
|
8920 |
+
var opacity = this.filterManager.effectElements[2].p.v/100;
|
8921 |
+
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');
|
8922 |
+
}
|
8923 |
+
};
|
8924 |
+
function SVGFillFilter(filter, filterManager){
|
8925 |
+
this.filterManager = filterManager;
|
8926 |
+
var feColorMatrix = createNS('feColorMatrix');
|
8927 |
+
feColorMatrix.setAttribute('type','matrix');
|
8928 |
+
feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
|
8929 |
+
feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
|
8930 |
+
filter.appendChild(feColorMatrix);
|
8931 |
+
this.matrixFilter = feColorMatrix;
|
8932 |
+
}
|
8933 |
+
SVGFillFilter.prototype.renderFrame = function(forceRender){
|
8934 |
+
if(forceRender || this.filterManager._mdf){
|
8935 |
+
var color = this.filterManager.effectElements[2].p.v;
|
8936 |
+
var opacity = this.filterManager.effectElements[6].p.v;
|
8937 |
+
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');
|
8938 |
+
}
|
8939 |
+
};
|
8940 |
+
function SVGGaussianBlurEffect(filter, filterManager){
|
8941 |
+
// Outset the filter region by 100% on all sides to accommodate blur expansion.
|
8942 |
+
filter.setAttribute('x','-100%');
|
8943 |
+
filter.setAttribute('y','-100%');
|
8944 |
+
filter.setAttribute('width','300%');
|
8945 |
+
filter.setAttribute('height','300%');
|
8946 |
+
|
8947 |
+
this.filterManager = filterManager;
|
8948 |
+
var feGaussianBlur = createNS('feGaussianBlur');
|
8949 |
+
filter.appendChild(feGaussianBlur);
|
8950 |
+
this.feGaussianBlur = feGaussianBlur;
|
8951 |
+
}
|
8952 |
+
|
8953 |
+
SVGGaussianBlurEffect.prototype.renderFrame = function(forceRender){
|
8954 |
+
if(forceRender || this.filterManager._mdf){
|
8955 |
+
// Empirical value, matching AE's blur appearance.
|
8956 |
+
var kBlurrinessToSigma = 0.3;
|
8957 |
+
var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
|
8958 |
+
|
8959 |
+
// Dimensions mapping:
|
8960 |
+
//
|
8961 |
+
// 1 -> horizontal & vertical
|
8962 |
+
// 2 -> horizontal only
|
8963 |
+
// 3 -> vertical only
|
8964 |
+
//
|
8965 |
+
var dimensions = this.filterManager.effectElements[1].p.v;
|
8966 |
+
var sigmaX = (dimensions == 3) ? 0 : sigma;
|
8967 |
+
var sigmaY = (dimensions == 2) ? 0 : sigma;
|
8968 |
+
|
8969 |
+
this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + " " + sigmaY);
|
8970 |
+
|
8971 |
+
// Repeat edges mapping:
|
8972 |
+
//
|
8973 |
+
// 0 -> off -> duplicate
|
8974 |
+
// 1 -> on -> wrap
|
8975 |
+
var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate';
|
8976 |
+
this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
|
8977 |
+
}
|
8978 |
+
}
|
8979 |
+
function SVGStrokeEffect(elem, filterManager){
|
8980 |
+
this.initialized = false;
|
8981 |
+
this.filterManager = filterManager;
|
8982 |
+
this.elem = elem;
|
8983 |
+
this.paths = [];
|
8984 |
+
}
|
8985 |
+
|
8986 |
+
SVGStrokeEffect.prototype.initialize = function(){
|
8987 |
+
|
8988 |
+
var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
|
8989 |
+
var path,groupPath, i, len;
|
8990 |
+
if(this.filterManager.effectElements[1].p.v === 1){
|
8991 |
+
len = this.elem.maskManager.masksProperties.length;
|
8992 |
+
i = 0;
|
8993 |
+
} else {
|
8994 |
+
i = this.filterManager.effectElements[0].p.v - 1;
|
8995 |
+
len = i + 1;
|
8996 |
+
}
|
8997 |
+
groupPath = createNS('g');
|
8998 |
+
groupPath.setAttribute('fill','none');
|
8999 |
+
groupPath.setAttribute('stroke-linecap','round');
|
9000 |
+
groupPath.setAttribute('stroke-dashoffset',1);
|
9001 |
+
for(i;i<len;i+=1){
|
9002 |
+
path = createNS('path');
|
9003 |
+
groupPath.appendChild(path);
|
9004 |
+
this.paths.push({p:path,m:i});
|
9005 |
+
}
|
9006 |
+
if(this.filterManager.effectElements[10].p.v === 3){
|
9007 |
+
var mask = createNS('mask');
|
9008 |
+
var id = createElementID();
|
9009 |
+
mask.setAttribute('id',id);
|
9010 |
+
mask.setAttribute('mask-type','alpha');
|
9011 |
+
mask.appendChild(groupPath);
|
9012 |
+
this.elem.globalData.defs.appendChild(mask);
|
9013 |
+
var g = createNS('g');
|
9014 |
+
g.setAttribute('mask','url(' + locationHref + '#'+id+')');
|
9015 |
+
while (elemChildren[0]) {
|
9016 |
+
g.appendChild(elemChildren[0]);
|
9017 |
+
}
|
9018 |
+
this.elem.layerElement.appendChild(g);
|
9019 |
+
this.masker = mask;
|
9020 |
+
groupPath.setAttribute('stroke','#fff');
|
9021 |
+
} else if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
|
9022 |
+
if(this.filterManager.effectElements[10].p.v === 2){
|
9023 |
+
elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
|
9024 |
+
while(elemChildren.length){
|
9025 |
+
this.elem.layerElement.removeChild(elemChildren[0]);
|
9026 |
+
}
|
9027 |
+
}
|
9028 |
+
this.elem.layerElement.appendChild(groupPath);
|
9029 |
+
this.elem.layerElement.removeAttribute('mask');
|
9030 |
+
groupPath.setAttribute('stroke','#fff');
|
9031 |
+
}
|
9032 |
+
this.initialized = true;
|
9033 |
+
this.pathMasker = groupPath;
|
9034 |
+
};
|
9035 |
+
|
9036 |
+
SVGStrokeEffect.prototype.renderFrame = function(forceRender){
|
9037 |
+
if(!this.initialized){
|
9038 |
+
this.initialize();
|
9039 |
+
}
|
9040 |
+
var i, len = this.paths.length;
|
9041 |
+
var mask, path;
|
9042 |
+
for(i=0;i<len;i+=1){
|
9043 |
+
if(this.paths[i].m === -1) {
|
9044 |
+
continue;
|
9045 |
+
}
|
9046 |
+
mask = this.elem.maskManager.viewData[this.paths[i].m];
|
9047 |
+
path = this.paths[i].p;
|
9048 |
+
if(forceRender || this.filterManager._mdf || mask.prop._mdf){
|
9049 |
+
path.setAttribute('d',mask.lastPath);
|
9050 |
+
}
|
9051 |
+
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){
|
9052 |
+
var dasharrayValue;
|
9053 |
+
if(this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100){
|
9054 |
+
var s = Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
|
9055 |
+
var e = Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
|
9056 |
+
var l = path.getTotalLength();
|
9057 |
+
dasharrayValue = '0 0 0 ' + l*s + ' ';
|
9058 |
+
var lineLength = l*(e-s);
|
9059 |
+
var segment = 1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
|
9060 |
+
var units = Math.floor(lineLength/segment);
|
9061 |
+
var j;
|
9062 |
+
for(j=0;j<units;j+=1){
|
9063 |
+
dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100 + ' ';
|
9064 |
+
}
|
9065 |
+
dasharrayValue += '0 ' + l*10 + ' 0 0';
|
9066 |
+
} else {
|
9067 |
+
dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
|
9068 |
+
}
|
9069 |
+
path.setAttribute('stroke-dasharray',dasharrayValue);
|
9070 |
+
}
|
9071 |
+
}
|
9072 |
+
if(forceRender || this.filterManager.effectElements[4].p._mdf){
|
9073 |
+
this.pathMasker.setAttribute('stroke-width',this.filterManager.effectElements[4].p.v*2);
|
9074 |
+
}
|
9075 |
+
|
9076 |
+
if(forceRender || this.filterManager.effectElements[6].p._mdf){
|
9077 |
+
this.pathMasker.setAttribute('opacity',this.filterManager.effectElements[6].p.v);
|
9078 |
+
}
|
9079 |
+
if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
|
9080 |
+
if(forceRender || this.filterManager.effectElements[3].p._mdf){
|
9081 |
+
var color = this.filterManager.effectElements[3].p.v;
|
9082 |
+
this.pathMasker.setAttribute('stroke','rgb('+bm_floor(color[0]*255)+','+bm_floor(color[1]*255)+','+bm_floor(color[2]*255)+')');
|
9083 |
+
}
|
9084 |
+
}
|
9085 |
+
};
|
9086 |
+
function SVGTritoneFilter(filter, filterManager){
|
9087 |
+
this.filterManager = filterManager;
|
9088 |
+
var feColorMatrix = createNS('feColorMatrix');
|
9089 |
+
feColorMatrix.setAttribute('type','matrix');
|
9090 |
+
feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
|
9091 |
+
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');
|
9092 |
+
feColorMatrix.setAttribute('result','f1');
|
9093 |
+
filter.appendChild(feColorMatrix);
|
9094 |
+
var feComponentTransfer = createNS('feComponentTransfer');
|
9095 |
+
feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
|
9096 |
+
filter.appendChild(feComponentTransfer);
|
9097 |
+
this.matrixFilter = feComponentTransfer;
|
9098 |
+
var feFuncR = createNS('feFuncR');
|
9099 |
+
feFuncR.setAttribute('type','table');
|
9100 |
+
feComponentTransfer.appendChild(feFuncR);
|
9101 |
+
this.feFuncR = feFuncR;
|
9102 |
+
var feFuncG = createNS('feFuncG');
|
9103 |
+
feFuncG.setAttribute('type','table');
|
9104 |
+
feComponentTransfer.appendChild(feFuncG);
|
9105 |
+
this.feFuncG = feFuncG;
|
9106 |
+
var feFuncB = createNS('feFuncB');
|
9107 |
+
feFuncB.setAttribute('type','table');
|
9108 |
+
feComponentTransfer.appendChild(feFuncB);
|
9109 |
+
this.feFuncB = feFuncB;
|
9110 |
+
}
|
9111 |
+
|
9112 |
+
SVGTritoneFilter.prototype.renderFrame = function(forceRender){
|
9113 |
+
if(forceRender || this.filterManager._mdf){
|
9114 |
+
var color1 = this.filterManager.effectElements[0].p.v;
|
9115 |
+
var color2 = this.filterManager.effectElements[1].p.v;
|
9116 |
+
var color3 = this.filterManager.effectElements[2].p.v;
|
9117 |
+
var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
|
9118 |
+
var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
|
9119 |
+
var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
|
9120 |
+
this.feFuncR.setAttribute('tableValues', tableR);
|
9121 |
+
this.feFuncG.setAttribute('tableValues', tableG);
|
9122 |
+
this.feFuncB.setAttribute('tableValues', tableB);
|
9123 |
+
//var opacity = this.filterManager.effectElements[2].p.v/100;
|
9124 |
+
//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');
|
9125 |
+
}
|
9126 |
+
};
|
9127 |
+
function SVGProLevelsFilter(filter, filterManager){
|
9128 |
+
this.filterManager = filterManager;
|
9129 |
+
var effectElements = this.filterManager.effectElements;
|
9130 |
+
var feComponentTransfer = createNS('feComponentTransfer');
|
9131 |
+
var feFuncR, feFuncG, feFuncB;
|
9132 |
+
|
9133 |
+
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){
|
9134 |
+
this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
|
9135 |
+
}
|
9136 |
+
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){
|
9137 |
+
this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
|
9138 |
+
}
|
9139 |
+
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){
|
9140 |
+
this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
|
9141 |
+
}
|
9142 |
+
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){
|
9143 |
+
this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
|
9144 |
+
}
|
9145 |
+
|
9146 |
+
if(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA){
|
9147 |
+
feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
|
9148 |
+
filter.appendChild(feComponentTransfer);
|
9149 |
+
feComponentTransfer = createNS('feComponentTransfer');
|
9150 |
+
}
|
9151 |
+
|
9152 |
+
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){
|
9153 |
+
|
9154 |
+
feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
|
9155 |
+
filter.appendChild(feComponentTransfer);
|
9156 |
+
this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
|
9157 |
+
this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
|
9158 |
+
this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
|
9159 |
+
}
|
9160 |
+
}
|
9161 |
+
|
9162 |
+
SVGProLevelsFilter.prototype.createFeFunc = function(type, feComponentTransfer) {
|
9163 |
+
var feFunc = createNS(type);
|
9164 |
+
feFunc.setAttribute('type','table');
|
9165 |
+
feComponentTransfer.appendChild(feFunc);
|
9166 |
+
return feFunc;
|
9167 |
+
};
|
9168 |
+
|
9169 |
+
SVGProLevelsFilter.prototype.getTableValue = function(inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
|
9170 |
+
var cnt = 0;
|
9171 |
+
var segments = 256;
|
9172 |
+
var perc;
|
9173 |
+
var min = Math.min(inputBlack, inputWhite);
|
9174 |
+
var max = Math.max(inputBlack, inputWhite);
|
9175 |
+
var table = Array.call(null,{length:segments});
|
9176 |
+
var colorValue;
|
9177 |
+
var pos = 0;
|
9178 |
+
var outputDelta = outputWhite - outputBlack;
|
9179 |
+
var inputDelta = inputWhite - inputBlack;
|
9180 |
+
while(cnt <= 256) {
|
9181 |
+
perc = cnt/256;
|
9182 |
+
if(perc <= min){
|
9183 |
+
colorValue = inputDelta < 0 ? outputWhite : outputBlack;
|
9184 |
+
} else if(perc >= max){
|
9185 |
+
colorValue = inputDelta < 0 ? outputBlack : outputWhite;
|
9186 |
+
} else {
|
9187 |
+
colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
|
9188 |
+
}
|
9189 |
+
table[pos++] = colorValue;
|
9190 |
+
cnt += 256/(segments-1);
|
9191 |
+
}
|
9192 |
+
return table.join(' ');
|
9193 |
+
};
|
9194 |
+
|
9195 |
+
SVGProLevelsFilter.prototype.renderFrame = function(forceRender){
|
9196 |
+
if(forceRender || this.filterManager._mdf){
|
9197 |
+
var val, cnt, perc, bezier;
|
9198 |
+
var effectElements = this.filterManager.effectElements;
|
9199 |
+
if(this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)){
|
9200 |
+
val = this.getTableValue(effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v,effectElements[7].p.v);
|
9201 |
+
this.feFuncRComposed.setAttribute('tableValues',val);
|
9202 |
+
this.feFuncGComposed.setAttribute('tableValues',val);
|
9203 |
+
this.feFuncBComposed.setAttribute('tableValues',val);
|
9204 |
+
}
|
9205 |
+
|
9206 |
+
|
9207 |
+
if(this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)){
|
9208 |
+
val = this.getTableValue(effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v,effectElements[14].p.v);
|
9209 |
+
this.feFuncR.setAttribute('tableValues',val);
|
9210 |
+
}
|
9211 |
+
|
9212 |
+
if(this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)){
|
9213 |
+
val = this.getTableValue(effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v,effectElements[21].p.v);
|
9214 |
+
this.feFuncG.setAttribute('tableValues',val);
|
9215 |
+
}
|
9216 |
+
|
9217 |
+
if(this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)){
|
9218 |
+
val = this.getTableValue(effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v,effectElements[28].p.v);
|
9219 |
+
this.feFuncB.setAttribute('tableValues',val);
|
9220 |
+
}
|
9221 |
+
|
9222 |
+
if(this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)){
|
9223 |
+
val = this.getTableValue(effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v,effectElements[35].p.v);
|
9224 |
+
this.feFuncA.setAttribute('tableValues',val);
|
9225 |
+
}
|
9226 |
+
|
9227 |
+
}
|
9228 |
+
};
|
9229 |
+
function SVGDropShadowEffect(filter, filterManager) {
|
9230 |
+
var filterSize = filterManager.container.globalData.renderConfig.filterSize
|
9231 |
+
filter.setAttribute('x', filterSize.x);
|
9232 |
+
filter.setAttribute('y', filterSize.y);
|
9233 |
+
filter.setAttribute('width', filterSize.width);
|
9234 |
+
filter.setAttribute('height', filterSize.height);
|
9235 |
+
this.filterManager = filterManager;
|
9236 |
+
|
9237 |
+
var feGaussianBlur = createNS('feGaussianBlur');
|
9238 |
+
feGaussianBlur.setAttribute('in','SourceAlpha');
|
9239 |
+
feGaussianBlur.setAttribute('result','drop_shadow_1');
|
9240 |
+
feGaussianBlur.setAttribute('stdDeviation','0');
|
9241 |
+
this.feGaussianBlur = feGaussianBlur;
|
9242 |
+
filter.appendChild(feGaussianBlur);
|
9243 |
+
|
9244 |
+
var feOffset = createNS('feOffset');
|
9245 |
+
feOffset.setAttribute('dx','25');
|
9246 |
+
feOffset.setAttribute('dy','0');
|
9247 |
+
feOffset.setAttribute('in','drop_shadow_1');
|
9248 |
+
feOffset.setAttribute('result','drop_shadow_2');
|
9249 |
+
this.feOffset = feOffset;
|
9250 |
+
filter.appendChild(feOffset);
|
9251 |
+
var feFlood = createNS('feFlood');
|
9252 |
+
feFlood.setAttribute('flood-color','#00ff00');
|
9253 |
+
feFlood.setAttribute('flood-opacity','1');
|
9254 |
+
feFlood.setAttribute('result','drop_shadow_3');
|
9255 |
+
this.feFlood = feFlood;
|
9256 |
+
filter.appendChild(feFlood);
|
9257 |
+
|
9258 |
+
var feComposite = createNS('feComposite');
|
9259 |
+
feComposite.setAttribute('in','drop_shadow_3');
|
9260 |
+
feComposite.setAttribute('in2','drop_shadow_2');
|
9261 |
+
feComposite.setAttribute('operator','in');
|
9262 |
+
feComposite.setAttribute('result','drop_shadow_4');
|
9263 |
+
filter.appendChild(feComposite);
|
9264 |
+
|
9265 |
+
|
9266 |
+
var feMerge = createNS('feMerge');
|
9267 |
+
filter.appendChild(feMerge);
|
9268 |
+
var feMergeNode;
|
9269 |
+
feMergeNode = createNS('feMergeNode');
|
9270 |
+
feMerge.appendChild(feMergeNode);
|
9271 |
+
feMergeNode = createNS('feMergeNode');
|
9272 |
+
feMergeNode.setAttribute('in','SourceGraphic');
|
9273 |
+
this.feMergeNode = feMergeNode;
|
9274 |
+
this.feMerge = feMerge;
|
9275 |
+
this.originalNodeAdded = false;
|
9276 |
+
feMerge.appendChild(feMergeNode);
|
9277 |
+
}
|
9278 |
+
|
9279 |
+
SVGDropShadowEffect.prototype.renderFrame = function(forceRender){
|
9280 |
+
if(forceRender || this.filterManager._mdf){
|
9281 |
+
if(forceRender || this.filterManager.effectElements[4].p._mdf){
|
9282 |
+
this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
|
9283 |
+
}
|
9284 |
+
if(forceRender || this.filterManager.effectElements[0].p._mdf){
|
9285 |
+
var col = this.filterManager.effectElements[0].p.v;
|
9286 |
+
this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255)));
|
9287 |
+
}
|
9288 |
+
if(forceRender || this.filterManager.effectElements[1].p._mdf){
|
9289 |
+
this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255);
|
9290 |
+
}
|
9291 |
+
if(forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf){
|
9292 |
+
var distance = this.filterManager.effectElements[3].p.v;
|
9293 |
+
var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
|
9294 |
+
var x = distance * Math.cos(angle);
|
9295 |
+
var y = distance * Math.sin(angle);
|
9296 |
+
this.feOffset.setAttribute('dx', x);
|
9297 |
+
this.feOffset.setAttribute('dy', y);
|
9298 |
+
}
|
9299 |
+
/*if(forceRender || this.filterManager.effectElements[5].p._mdf){
|
9300 |
+
if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
|
9301 |
+
this.feMerge.removeChild(this.feMergeNode);
|
9302 |
+
this.originalNodeAdded = false;
|
9303 |
+
} else if(this.filterManager.effectElements[5].p.v === 0 && !this.originalNodeAdded) {
|
9304 |
+
this.feMerge.appendChild(this.feMergeNode);
|
9305 |
+
this.originalNodeAdded = true;
|
9306 |
+
}
|
9307 |
+
}*/
|
9308 |
+
}
|
9309 |
+
};
|
9310 |
+
var _svgMatteSymbols = [];
|
9311 |
+
|
9312 |
+
function SVGMatte3Effect(filterElem, filterManager, elem){
|
9313 |
+
this.initialized = false;
|
9314 |
+
this.filterManager = filterManager;
|
9315 |
+
this.filterElem = filterElem;
|
9316 |
+
this.elem = elem;
|
9317 |
+
elem.matteElement = createNS('g');
|
9318 |
+
elem.matteElement.appendChild(elem.layerElement);
|
9319 |
+
elem.matteElement.appendChild(elem.transformedElement);
|
9320 |
+
elem.baseElement = elem.matteElement;
|
9321 |
+
}
|
9322 |
+
|
9323 |
+
SVGMatte3Effect.prototype.findSymbol = function(mask) {
|
9324 |
+
var i = 0, len = _svgMatteSymbols.length;
|
9325 |
+
while(i < len) {
|
9326 |
+
if(_svgMatteSymbols[i] === mask) {
|
9327 |
+
return _svgMatteSymbols[i];
|
9328 |
+
}
|
9329 |
+
i += 1;
|
9330 |
+
}
|
9331 |
+
return null;
|
9332 |
+
};
|
9333 |
+
|
9334 |
+
SVGMatte3Effect.prototype.replaceInParent = function(mask, symbolId) {
|
9335 |
+
var parentNode = mask.layerElement.parentNode;
|
9336 |
+
if(!parentNode) {
|
9337 |
+
return;
|
9338 |
+
}
|
9339 |
+
var children = parentNode.children;
|
9340 |
+
var i = 0, len = children.length;
|
9341 |
+
while (i < len) {
|
9342 |
+
if (children[i] === mask.layerElement) {
|
9343 |
+
break;
|
9344 |
+
}
|
9345 |
+
i += 1;
|
9346 |
+
}
|
9347 |
+
var nextChild;
|
9348 |
+
if (i <= len - 2) {
|
9349 |
+
nextChild = children[i + 1];
|
9350 |
+
}
|
9351 |
+
var useElem = createNS('use');
|
9352 |
+
useElem.setAttribute('href', '#' + symbolId);
|
9353 |
+
if(nextChild) {
|
9354 |
+
parentNode.insertBefore(useElem, nextChild);
|
9355 |
+
} else {
|
9356 |
+
parentNode.appendChild(useElem);
|
9357 |
+
}
|
9358 |
+
};
|
9359 |
+
|
9360 |
+
SVGMatte3Effect.prototype.setElementAsMask = function(elem, mask) {
|
9361 |
+
if(!this.findSymbol(mask)) {
|
9362 |
+
var symbolId = createElementID();
|
9363 |
+
var masker = createNS('mask');
|
9364 |
+
masker.setAttribute('id', mask.layerId);
|
9365 |
+
masker.setAttribute('mask-type', 'alpha');
|
9366 |
+
_svgMatteSymbols.push(mask);
|
9367 |
+
var defs = elem.globalData.defs;
|
9368 |
+
defs.appendChild(masker);
|
9369 |
+
var symbol = createNS('symbol');
|
9370 |
+
symbol.setAttribute('id', symbolId);
|
9371 |
+
this.replaceInParent(mask, symbolId);
|
9372 |
+
symbol.appendChild(mask.layerElement);
|
9373 |
+
defs.appendChild(symbol);
|
9374 |
+
var useElem = createNS('use');
|
9375 |
+
useElem.setAttribute('href', '#' + symbolId);
|
9376 |
+
masker.appendChild(useElem);
|
9377 |
+
mask.data.hd = false;
|
9378 |
+
mask.show();
|
9379 |
+
}
|
9380 |
+
elem.setMatte(mask.layerId);
|
9381 |
+
};
|
9382 |
+
|
9383 |
+
SVGMatte3Effect.prototype.initialize = function() {
|
9384 |
+
var ind = this.filterManager.effectElements[0].p.v;
|
9385 |
+
var elements = this.elem.comp.elements;
|
9386 |
+
var i = 0, len = elements.length;
|
9387 |
+
while (i < len) {
|
9388 |
+
if (elements[i] && elements[i].data.ind === ind) {
|
9389 |
+
this.setElementAsMask(this.elem, elements[i]);
|
9390 |
+
}
|
9391 |
+
i += 1;
|
9392 |
+
}
|
9393 |
+
this.initialized = true;
|
9394 |
+
};
|
9395 |
+
|
9396 |
+
SVGMatte3Effect.prototype.renderFrame = function() {
|
9397 |
+
if(!this.initialized) {
|
9398 |
+
this.initialize();
|
9399 |
+
}
|
9400 |
+
};
|
9401 |
+
function SVGEffects(elem){
|
9402 |
+
var i, len = elem.data.ef ? elem.data.ef.length : 0;
|
9403 |
+
var filId = createElementID();
|
9404 |
+
var fil = filtersFactory.createFilter(filId);
|
9405 |
+
var count = 0;
|
9406 |
+
this.filters = [];
|
9407 |
+
var filterManager;
|
9408 |
+
for(i=0;i<len;i+=1){
|
9409 |
+
filterManager = null;
|
9410 |
+
if(elem.data.ef[i].ty === 20){
|
9411 |
+
count += 1;
|
9412 |
+
filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
|
9413 |
+
}else if(elem.data.ef[i].ty === 21){
|
9414 |
+
count += 1;
|
9415 |
+
filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
|
9416 |
+
}else if(elem.data.ef[i].ty === 22){
|
9417 |
+
filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
|
9418 |
+
}else if(elem.data.ef[i].ty === 23){
|
9419 |
+
count += 1;
|
9420 |
+
filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
|
9421 |
+
}else if(elem.data.ef[i].ty === 24){
|
9422 |
+
count += 1;
|
9423 |
+
filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
|
9424 |
+
}else if(elem.data.ef[i].ty === 25){
|
9425 |
+
count += 1;
|
9426 |
+
filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
|
9427 |
+
}else if(elem.data.ef[i].ty === 28){
|
9428 |
+
//count += 1;
|
9429 |
+
filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
|
9430 |
+
}else if(elem.data.ef[i].ty === 29){
|
9431 |
+
count += 1;
|
9432 |
+
filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
|
9433 |
+
}
|
9434 |
+
if(filterManager) {
|
9435 |
+
this.filters.push(filterManager);
|
9436 |
+
}
|
9437 |
+
}
|
9438 |
+
if(count){
|
9439 |
+
elem.globalData.defs.appendChild(fil);
|
9440 |
+
elem.layerElement.setAttribute('filter','url(' + locationHref + '#'+filId+')');
|
9441 |
+
}
|
9442 |
+
if (this.filters.length) {
|
9443 |
+
elem.addRenderableComponent(this);
|
9444 |
+
}
|
9445 |
+
}
|
9446 |
+
|
9447 |
+
SVGEffects.prototype.renderFrame = function(_isFirstFrame){
|
9448 |
+
var i, len = this.filters.length;
|
9449 |
+
for(i=0;i<len;i+=1){
|
9450 |
+
this.filters[i].renderFrame(_isFirstFrame);
|
9451 |
+
}
|
9452 |
+
};
|
9453 |
+
function CVContextData() {
|
9454 |
+
this.saved = [];
|
9455 |
+
this.cArrPos = 0;
|
9456 |
+
this.cTr = new Matrix();
|
9457 |
+
this.cO = 1;
|
9458 |
+
var i, len = 15;
|
9459 |
+
this.savedOp = createTypedArray('float32', len);
|
9460 |
+
for(i=0;i<len;i+=1){
|
9461 |
+
this.saved[i] = createTypedArray('float32', 16);
|
9462 |
+
}
|
9463 |
+
this._length = len;
|
9464 |
+
}
|
9465 |
+
|
9466 |
+
CVContextData.prototype.duplicate = function() {
|
9467 |
+
var newLength = this._length * 2;
|
9468 |
+
var currentSavedOp = this.savedOp;
|
9469 |
+
this.savedOp = createTypedArray('float32', newLength);
|
9470 |
+
this.savedOp.set(currentSavedOp);
|
9471 |
+
var i = 0;
|
9472 |
+
for(i = this._length; i < newLength; i += 1) {
|
9473 |
+
this.saved[i] = createTypedArray('float32', 16);
|
9474 |
+
}
|
9475 |
+
this._length = newLength;
|
9476 |
+
};
|
9477 |
+
|
9478 |
+
CVContextData.prototype.reset = function() {
|
9479 |
+
this.cArrPos = 0;
|
9480 |
+
this.cTr.reset();
|
9481 |
+
this.cO = 1;
|
9482 |
+
};
|
9483 |
+
function CVBaseElement(){
|
9484 |
+
}
|
9485 |
+
|
9486 |
+
CVBaseElement.prototype = {
|
9487 |
+
createElements: function(){},
|
9488 |
+
initRendererElement: function(){},
|
9489 |
+
createContainerElements: function(){
|
9490 |
+
this.canvasContext = this.globalData.canvasContext;
|
9491 |
+
this.renderableEffectsManager = new CVEffects(this);
|
9492 |
+
},
|
9493 |
+
createContent: function(){},
|
9494 |
+
setBlendMode: function(){
|
9495 |
+
var globalData = this.globalData;
|
9496 |
+
if(globalData.blendMode !== this.data.bm) {
|
9497 |
+
globalData.blendMode = this.data.bm;
|
9498 |
+
var blendModeValue = getBlendMode(this.data.bm);
|
9499 |
+
globalData.canvasContext.globalCompositeOperation = blendModeValue;
|
9500 |
+
}
|
9501 |
+
},
|
9502 |
+
createRenderableComponents: function(){
|
9503 |
+
this.maskManager = new CVMaskElement(this.data, this);
|
9504 |
+
},
|
9505 |
+
hideElement: function(){
|
9506 |
+
if (!this.hidden && (!this.isInRange || this.isTransparent)) {
|
9507 |
+
this.hidden = true;
|
9508 |
+
}
|
9509 |
+
},
|
9510 |
+
showElement: function(){
|
9511 |
+
if (this.isInRange && !this.isTransparent){
|
9512 |
+
this.hidden = false;
|
9513 |
+
this._isFirstFrame = true;
|
9514 |
+
this.maskManager._isFirstFrame = true;
|
9515 |
+
}
|
9516 |
+
},
|
9517 |
+
renderFrame: function() {
|
9518 |
+
if (this.hidden || this.data.hd) {
|
9519 |
+
return;
|
9520 |
+
}
|
9521 |
+
this.renderTransform();
|
9522 |
+
this.renderRenderable();
|
9523 |
+
this.setBlendMode();
|
9524 |
+
var forceRealStack = this.data.ty === 0;
|
9525 |
+
this.globalData.renderer.save(forceRealStack);
|
9526 |
+
this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
|
9527 |
+
this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
|
9528 |
+
this.renderInnerContent();
|
9529 |
+
this.globalData.renderer.restore(forceRealStack);
|
9530 |
+
if(this.maskManager.hasMasks) {
|
9531 |
+
this.globalData.renderer.restore(true);
|
9532 |
+
}
|
9533 |
+
if (this._isFirstFrame) {
|
9534 |
+
this._isFirstFrame = false;
|
9535 |
+
}
|
9536 |
+
},
|
9537 |
+
destroy: function(){
|
9538 |
+
this.canvasContext = null;
|
9539 |
+
this.data = null;
|
9540 |
+
this.globalData = null;
|
9541 |
+
this.maskManager.destroy();
|
9542 |
+
},
|
9543 |
+
mHelper: new Matrix()
|
9544 |
+
};
|
9545 |
+
CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;
|
9546 |
+
CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;
|
9547 |
+
|
9548 |
+
function CVImageElement(data, globalData, comp){
|
9549 |
+
this.assetData = globalData.getAssetData(data.refId);
|
9550 |
+
this.img = globalData.imageLoader.getImage(this.assetData);
|
9551 |
+
this.initElement(data,globalData,comp);
|
9552 |
+
}
|
9553 |
+
extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement);
|
9554 |
+
|
9555 |
+
CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement;
|
9556 |
+
CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
|
9557 |
+
|
9558 |
+
CVImageElement.prototype.createContent = function(){
|
9559 |
+
|
9560 |
+
if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
|
9561 |
+
var canvas = createTag('canvas');
|
9562 |
+
canvas.width = this.assetData.w;
|
9563 |
+
canvas.height = this.assetData.h;
|
9564 |
+
var ctx = canvas.getContext('2d');
|
9565 |
+
|
9566 |
+
var imgW = this.img.width;
|
9567 |
+
var imgH = this.img.height;
|
9568 |
+
var imgRel = imgW / imgH;
|
9569 |
+
var canvasRel = this.assetData.w/this.assetData.h;
|
9570 |
+
var widthCrop, heightCrop;
|
9571 |
+
var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
|
9572 |
+
if((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) {
|
9573 |
+
heightCrop = imgH;
|
9574 |
+
widthCrop = heightCrop*canvasRel;
|
9575 |
+
} else {
|
9576 |
+
widthCrop = imgW;
|
9577 |
+
heightCrop = widthCrop/canvasRel;
|
9578 |
+
}
|
9579 |
+
ctx.drawImage(this.img,(imgW-widthCrop)/2,(imgH-heightCrop)/2,widthCrop,heightCrop,0,0,this.assetData.w,this.assetData.h);
|
9580 |
+
this.img = canvas;
|
9581 |
+
}
|
9582 |
+
|
9583 |
+
};
|
9584 |
+
|
9585 |
+
CVImageElement.prototype.renderInnerContent = function(parentMatrix){
|
9586 |
+
this.canvasContext.drawImage(this.img, 0, 0);
|
9587 |
+
};
|
9588 |
+
|
9589 |
+
CVImageElement.prototype.destroy = function(){
|
9590 |
+
this.img = null;
|
9591 |
+
};
|
9592 |
+
function CVCompElement(data, globalData, comp) {
|
9593 |
+
this.completeLayers = false;
|
9594 |
+
this.layers = data.layers;
|
9595 |
+
this.pendingElements = [];
|
9596 |
+
this.elements = createSizedArray(this.layers.length);
|
9597 |
+
this.initElement(data, globalData, comp);
|
9598 |
+
this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate, this) : {_placeholder:true};
|
9599 |
+
}
|
9600 |
+
|
9601 |
+
extendPrototype([CanvasRenderer, ICompElement, CVBaseElement], CVCompElement);
|
9602 |
+
|
9603 |
+
CVCompElement.prototype.renderInnerContent = function() {
|
9604 |
+
var ctx = this.canvasContext;
|
9605 |
+
ctx.beginPath();
|
9606 |
+
ctx.moveTo(0, 0);
|
9607 |
+
ctx.lineTo(this.data.w, 0);
|
9608 |
+
ctx.lineTo(this.data.w, this.data.h);
|
9609 |
+
ctx.lineTo(0, this.data.h);
|
9610 |
+
ctx.lineTo(0, 0);
|
9611 |
+
ctx.clip();
|
9612 |
+
var i,len = this.layers.length;
|
9613 |
+
for( i = len - 1; i >= 0; i -= 1 ){
|
9614 |
+
if(this.completeLayers || this.elements[i]){
|
9615 |
+
this.elements[i].renderFrame();
|
9616 |
+
}
|
9617 |
+
}
|
9618 |
+
};
|
9619 |
+
|
9620 |
+
CVCompElement.prototype.destroy = function(){
|
9621 |
+
var i,len = this.layers.length;
|
9622 |
+
for( i = len - 1; i >= 0; i -= 1 ){
|
9623 |
+
if(this.elements[i]) {
|
9624 |
+
this.elements[i].destroy();
|
9625 |
+
}
|
9626 |
+
}
|
9627 |
+
this.layers = null;
|
9628 |
+
this.elements = null;
|
9629 |
+
};
|
9630 |
+
|
9631 |
+
function CVMaskElement(data,element){
|
9632 |
+
this.data = data;
|
9633 |
+
this.element = element;
|
9634 |
+
this.masksProperties = this.data.masksProperties || [];
|
9635 |
+
this.viewData = createSizedArray(this.masksProperties.length);
|
9636 |
+
var i, len = this.masksProperties.length, hasMasks = false;
|
9637 |
+
for (i = 0; i < len; i++) {
|
9638 |
+
if(this.masksProperties[i].mode !== 'n'){
|
9639 |
+
hasMasks = true;
|
9640 |
+
}
|
9641 |
+
this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);
|
9642 |
+
}
|
9643 |
+
this.hasMasks = hasMasks;
|
9644 |
+
if(hasMasks) {
|
9645 |
+
this.element.addRenderableComponent(this);
|
9646 |
+
}
|
9647 |
+
}
|
9648 |
+
|
9649 |
+
CVMaskElement.prototype.renderFrame = function () {
|
9650 |
+
if(!this.hasMasks){
|
9651 |
+
return;
|
9652 |
+
}
|
9653 |
+
var transform = this.element.finalTransform.mat;
|
9654 |
+
var ctx = this.element.canvasContext;
|
9655 |
+
var i, len = this.masksProperties.length;
|
9656 |
+
var pt,pts,data;
|
9657 |
+
ctx.beginPath();
|
9658 |
+
for (i = 0; i < len; i++) {
|
9659 |
+
if(this.masksProperties[i].mode !== 'n'){
|
9660 |
+
if (this.masksProperties[i].inv) {
|
9661 |
+
ctx.moveTo(0, 0);
|
9662 |
+
ctx.lineTo(this.element.globalData.compSize.w, 0);
|
9663 |
+
ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
|
9664 |
+
ctx.lineTo(0, this.element.globalData.compSize.h);
|
9665 |
+
ctx.lineTo(0, 0);
|
9666 |
+
}
|
9667 |
+
data = this.viewData[i].v;
|
9668 |
+
pt = transform.applyToPointArray(data.v[0][0],data.v[0][1],0);
|
9669 |
+
ctx.moveTo(pt[0], pt[1]);
|
9670 |
+
var j, jLen = data._length;
|
9671 |
+
for (j = 1; j < jLen; j++) {
|
9672 |
+
pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
|
9673 |
+
ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
|
9674 |
+
}
|
9675 |
+
pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
|
9676 |
+
ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
|
9677 |
+
}
|
9678 |
+
}
|
9679 |
+
this.element.globalData.renderer.save(true);
|
9680 |
+
ctx.clip();
|
9681 |
+
};
|
9682 |
+
|
9683 |
+
CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;
|
9684 |
+
|
9685 |
+
CVMaskElement.prototype.destroy = function(){
|
9686 |
+
this.element = null;
|
9687 |
+
};
|
9688 |
+
function CVShapeElement(data, globalData, comp) {
|
9689 |
+
this.shapes = [];
|
9690 |
+
this.shapesData = data.shapes;
|
9691 |
+
this.stylesList = [];
|
9692 |
+
this.itemsData = [];
|
9693 |
+
this.prevViewData = [];
|
9694 |
+
this.shapeModifiers = [];
|
9695 |
+
this.processedElements = [];
|
9696 |
+
this.transformsManager = new ShapeTransformManager();
|
9697 |
+
this.initElement(data, globalData, comp);
|
9698 |
+
}
|
9699 |
+
|
9700 |
+
extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement], CVShapeElement);
|
9701 |
+
|
9702 |
+
CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;
|
9703 |
+
|
9704 |
+
CVShapeElement.prototype.transformHelper = {opacity:1,_opMdf:false};
|
9705 |
+
|
9706 |
+
CVShapeElement.prototype.dashResetter = [];
|
9707 |
+
|
9708 |
+
CVShapeElement.prototype.createContent = function(){
|
9709 |
+
this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
|
9710 |
+
};
|
9711 |
+
|
9712 |
+
CVShapeElement.prototype.createStyleElement = function(data, transforms) {
|
9713 |
+
var styleElem = {
|
9714 |
+
data: data,
|
9715 |
+
type: data.ty,
|
9716 |
+
preTransforms: this.transformsManager.addTransformSequence(transforms),
|
9717 |
+
transforms: [],
|
9718 |
+
elements: [],
|
9719 |
+
closed: data.hd === true
|
9720 |
+
};
|
9721 |
+
var elementData = {};
|
9722 |
+
if(data.ty == 'fl' || data.ty == 'st'){
|
9723 |
+
elementData.c = PropertyFactory.getProp(this,data.c,1,255,this);
|
9724 |
+
if(!elementData.c.k){
|
9725 |
+
styleElem.co = 'rgb('+bm_floor(elementData.c.v[0])+','+bm_floor(elementData.c.v[1])+','+bm_floor(elementData.c.v[2])+')';
|
9726 |
+
}
|
9727 |
+
} else if (data.ty === 'gf' || data.ty === 'gs') {
|
9728 |
+
elementData.s = PropertyFactory.getProp(this,data.s,1,null,this);
|
9729 |
+
elementData.e = PropertyFactory.getProp(this,data.e,1,null,this);
|
9730 |
+
elementData.h = PropertyFactory.getProp(this,data.h||{k:0},0,0.01,this);
|
9731 |
+
elementData.a = PropertyFactory.getProp(this,data.a||{k:0},0,degToRads,this);
|
9732 |
+
elementData.g = new GradientProperty(this,data.g,this);
|
9733 |
+
}
|
9734 |
+
elementData.o = PropertyFactory.getProp(this,data.o,0,0.01,this);
|
9735 |
+
if(data.ty == 'st' || data.ty == 'gs') {
|
9736 |
+
styleElem.lc = this.lcEnum[data.lc] || 'round';
|
9737 |
+
styleElem.lj = this.ljEnum[data.lj] || 'round';
|
9738 |
+
if(data.lj == 1) {
|
9739 |
+
styleElem.ml = data.ml;
|
9740 |
+
}
|
9741 |
+
elementData.w = PropertyFactory.getProp(this,data.w,0,null,this);
|
9742 |
+
if(!elementData.w.k){
|
9743 |
+
styleElem.wi = elementData.w.v;
|
9744 |
+
}
|
9745 |
+
if(data.d){
|
9746 |
+
var d = new DashProperty(this,data.d,'canvas', this);
|
9747 |
+
elementData.d = d;
|
9748 |
+
if(!elementData.d.k){
|
9749 |
+
styleElem.da = elementData.d.dashArray;
|
9750 |
+
styleElem.do = elementData.d.dashoffset[0];
|
9751 |
+
}
|
9752 |
+
}
|
9753 |
+
} else {
|
9754 |
+
styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
|
9755 |
+
}
|
9756 |
+
this.stylesList.push(styleElem);
|
9757 |
+
elementData.style = styleElem;
|
9758 |
+
return elementData;
|
9759 |
+
};
|
9760 |
+
|
9761 |
+
CVShapeElement.prototype.createGroupElement = function(data) {
|
9762 |
+
var elementData = {
|
9763 |
+
it: [],
|
9764 |
+
prevViewData: []
|
9765 |
+
};
|
9766 |
+
return elementData;
|
9767 |
+
};
|
9768 |
+
|
9769 |
+
CVShapeElement.prototype.createTransformElement = function(data) {
|
9770 |
+
var elementData = {
|
9771 |
+
transform : {
|
9772 |
+
opacity: 1,
|
9773 |
+
_opMdf:false,
|
9774 |
+
key: this.transformsManager.getNewKey(),
|
9775 |
+
op: PropertyFactory.getProp(this,data.o,0,0.01,this),
|
9776 |
+
mProps: TransformPropertyFactory.getTransformProperty(this,data,this)
|
9777 |
+
}
|
9778 |
+
};
|
9779 |
+
return elementData;
|
9780 |
+
};
|
9781 |
+
|
9782 |
+
CVShapeElement.prototype.createShapeElement = function(data) {
|
9783 |
+
var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
|
9784 |
+
|
9785 |
+
this.shapes.push(elementData);
|
9786 |
+
this.addShapeToModifiers(elementData);
|
9787 |
+
return elementData;
|
9788 |
+
};
|
9789 |
+
|
9790 |
+
CVShapeElement.prototype.reloadShapes = function() {
|
9791 |
+
this._isFirstFrame = true;
|
9792 |
+
var i, len = this.itemsData.length;
|
9793 |
+
for (i = 0; i < len; i += 1) {
|
9794 |
+
this.prevViewData[i] = this.itemsData[i];
|
9795 |
+
}
|
9796 |
+
this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
|
9797 |
+
len = this.dynamicProperties.length;
|
9798 |
+
for (i = 0; i < len; i += 1) {
|
9799 |
+
this.dynamicProperties[i].getValue();
|
9800 |
+
}
|
9801 |
+
this.renderModifiers();
|
9802 |
+
this.transformsManager.processSequences(this._isFirstFrame);
|
9803 |
+
};
|
9804 |
+
|
9805 |
+
CVShapeElement.prototype.addTransformToStyleList = function(transform) {
|
9806 |
+
var i, len = this.stylesList.length;
|
9807 |
+
for (i = 0; i < len; i += 1) {
|
9808 |
+
if(!this.stylesList[i].closed) {
|
9809 |
+
this.stylesList[i].transforms.push(transform);
|
9810 |
+
}
|
9811 |
+
}
|
9812 |
+
}
|
9813 |
+
|
9814 |
+
CVShapeElement.prototype.removeTransformFromStyleList = function() {
|
9815 |
+
var i, len = this.stylesList.length;
|
9816 |
+
for (i = 0; i < len; i += 1) {
|
9817 |
+
if(!this.stylesList[i].closed) {
|
9818 |
+
this.stylesList[i].transforms.pop();
|
9819 |
+
}
|
9820 |
+
}
|
9821 |
+
}
|
9822 |
+
|
9823 |
+
CVShapeElement.prototype.closeStyles = function(styles) {
|
9824 |
+
var i, len = styles.length, j, jLen;
|
9825 |
+
for (i = 0; i < len; i += 1) {
|
9826 |
+
styles[i].closed = true;
|
9827 |
+
}
|
9828 |
+
}
|
9829 |
+
|
9830 |
+
CVShapeElement.prototype.searchShapes = function(arr,itemsData, prevViewData, shouldRender, transforms){
|
9831 |
+
var i, len = arr.length - 1;
|
9832 |
+
var j, jLen;
|
9833 |
+
var ownStyles = [], ownModifiers = [], processedPos, modifier, currentTransform;
|
9834 |
+
var ownTransforms = [].concat(transforms);
|
9835 |
+
for(i=len;i>=0;i-=1){
|
9836 |
+
processedPos = this.searchProcessedElement(arr[i]);
|
9837 |
+
if(!processedPos){
|
9838 |
+
arr[i]._shouldRender = shouldRender;
|
9839 |
+
} else {
|
9840 |
+
itemsData[i] = prevViewData[processedPos - 1];
|
9841 |
+
}
|
9842 |
+
if(arr[i].ty == 'fl' || arr[i].ty == 'st'|| arr[i].ty == 'gf'|| arr[i].ty == 'gs'){
|
9843 |
+
if(!processedPos){
|
9844 |
+
itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
|
9845 |
+
} else {
|
9846 |
+
itemsData[i].style.closed = false;
|
9847 |
+
}
|
9848 |
+
|
9849 |
+
ownStyles.push(itemsData[i].style);
|
9850 |
+
}else if(arr[i].ty == 'gr'){
|
9851 |
+
if(!processedPos){
|
9852 |
+
itemsData[i] = this.createGroupElement(arr[i]);
|
9853 |
+
} else {
|
9854 |
+
jLen = itemsData[i].it.length;
|
9855 |
+
for(j=0;j<jLen;j+=1){
|
9856 |
+
itemsData[i].prevViewData[j] = itemsData[i].it[j];
|
9857 |
+
}
|
9858 |
+
}
|
9859 |
+
this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData, shouldRender, ownTransforms);
|
9860 |
+
}else if(arr[i].ty == 'tr'){
|
9861 |
+
if(!processedPos){
|
9862 |
+
currentTransform = this.createTransformElement(arr[i]);
|
9863 |
+
itemsData[i] = currentTransform;
|
9864 |
+
}
|
9865 |
+
ownTransforms.push(itemsData[i]);
|
9866 |
+
this.addTransformToStyleList(itemsData[i]);
|
9867 |
+
}else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
|
9868 |
+
if(!processedPos){
|
9869 |
+
itemsData[i] = this.createShapeElement(arr[i]);
|
9870 |
+
}
|
9871 |
+
|
9872 |
+
}else if(arr[i].ty == 'tm' || arr[i].ty == 'rd'){
|
9873 |
+
if(!processedPos){
|
9874 |
+
modifier = ShapeModifiers.getModifier(arr[i].ty);
|
9875 |
+
modifier.init(this,arr[i]);
|
9876 |
+
itemsData[i] = modifier;
|
9877 |
+
this.shapeModifiers.push(modifier);
|
9878 |
+
} else {
|
9879 |
+
modifier = itemsData[i];
|
9880 |
+
modifier.closed = false;
|
9881 |
+
}
|
9882 |
+
ownModifiers.push(modifier);
|
9883 |
+
} else if(arr[i].ty == 'rp'){
|
9884 |
+
if(!processedPos){
|
9885 |
+
modifier = ShapeModifiers.getModifier(arr[i].ty);
|
9886 |
+
itemsData[i] = modifier;
|
9887 |
+
modifier.init(this,arr,i,itemsData);
|
9888 |
+
this.shapeModifiers.push(modifier);
|
9889 |
+
shouldRender = false;
|
9890 |
+
}else{
|
9891 |
+
modifier = itemsData[i];
|
9892 |
+
modifier.closed = true;
|
9893 |
+
}
|
9894 |
+
ownModifiers.push(modifier);
|
9895 |
+
}
|
9896 |
+
this.addProcessedElement(arr[i], i + 1);
|
9897 |
+
}
|
9898 |
+
this.removeTransformFromStyleList();
|
9899 |
+
this.closeStyles(ownStyles);
|
9900 |
+
len = ownModifiers.length;
|
9901 |
+
for(i=0;i<len;i+=1){
|
9902 |
+
ownModifiers[i].closed = true;
|
9903 |
+
}
|
9904 |
+
};
|
9905 |
+
|
9906 |
+
CVShapeElement.prototype.renderInnerContent = function() {
|
9907 |
+
this.transformHelper.opacity = 1;
|
9908 |
+
this.transformHelper._opMdf = false;
|
9909 |
+
this.renderModifiers();
|
9910 |
+
this.transformsManager.processSequences(this._isFirstFrame);
|
9911 |
+
this.renderShape(this.transformHelper,this.shapesData,this.itemsData,true);
|
9912 |
+
};
|
9913 |
+
|
9914 |
+
CVShapeElement.prototype.renderShapeTransform = function(parentTransform, groupTransform) {
|
9915 |
+
var props, groupMatrix;
|
9916 |
+
if(parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
|
9917 |
+
groupTransform.opacity = parentTransform.opacity;
|
9918 |
+
groupTransform.opacity *= groupTransform.op.v;
|
9919 |
+
groupTransform._opMdf = true;
|
9920 |
+
}
|
9921 |
+
};
|
9922 |
+
|
9923 |
+
CVShapeElement.prototype.drawLayer = function() {
|
9924 |
+
var i, len = this.stylesList.length;
|
9925 |
+
var j, jLen, k, kLen,elems,nodes, renderer = this.globalData.renderer, ctx = this.globalData.canvasContext, type, currentStyle;
|
9926 |
+
for(i=0;i<len;i+=1){
|
9927 |
+
currentStyle = this.stylesList[i];
|
9928 |
+
type = currentStyle.type;
|
9929 |
+
|
9930 |
+
//Skipping style when
|
9931 |
+
//Stroke width equals 0
|
9932 |
+
//style should not be rendered (extra unused repeaters)
|
9933 |
+
//current opacity equals 0
|
9934 |
+
//global opacity equals 0
|
9935 |
+
if(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0){
|
9936 |
+
continue;
|
9937 |
+
}
|
9938 |
+
renderer.save();
|
9939 |
+
elems = currentStyle.elements;
|
9940 |
+
if(type === 'st' || type === 'gs'){
|
9941 |
+
ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
|
9942 |
+
ctx.lineWidth = currentStyle.wi;
|
9943 |
+
ctx.lineCap = currentStyle.lc;
|
9944 |
+
ctx.lineJoin = currentStyle.lj;
|
9945 |
+
ctx.miterLimit = currentStyle.ml || 0;
|
9946 |
+
} else {
|
9947 |
+
ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
|
9948 |
+
}
|
9949 |
+
renderer.ctxOpacity(currentStyle.coOp);
|
9950 |
+
if(type !== 'st' && type !== 'gs'){
|
9951 |
+
ctx.beginPath();
|
9952 |
+
}
|
9953 |
+
renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
|
9954 |
+
jLen = elems.length;
|
9955 |
+
for(j=0;j<jLen;j+=1){
|
9956 |
+
if(type === 'st' || type === 'gs'){
|
9957 |
+
ctx.beginPath();
|
9958 |
+
if(currentStyle.da){
|
9959 |
+
ctx.setLineDash(currentStyle.da);
|
9960 |
+
ctx.lineDashOffset = currentStyle.do;
|
9961 |
+
}
|
9962 |
+
}
|
9963 |
+
nodes = elems[j].trNodes;
|
9964 |
+
kLen = nodes.length;
|
9965 |
+
|
9966 |
+
for(k=0;k<kLen;k+=1){
|
9967 |
+
if(nodes[k].t == 'm'){
|
9968 |
+
ctx.moveTo(nodes[k].p[0],nodes[k].p[1]);
|
9969 |
+
}else if(nodes[k].t == 'c'){
|
9970 |
+
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]);
|
9971 |
+
}else{
|
9972 |
+
ctx.closePath();
|
9973 |
+
}
|
9974 |
+
}
|
9975 |
+
if(type === 'st' || type === 'gs'){
|
9976 |
+
ctx.stroke();
|
9977 |
+
if(currentStyle.da){
|
9978 |
+
ctx.setLineDash(this.dashResetter);
|
9979 |
+
}
|
9980 |
+
}
|
9981 |
+
}
|
9982 |
+
if(type !== 'st' && type !== 'gs'){
|
9983 |
+
ctx.fill(currentStyle.r);
|
9984 |
+
}
|
9985 |
+
renderer.restore();
|
9986 |
+
}
|
9987 |
+
};
|
9988 |
+
|
9989 |
+
CVShapeElement.prototype.renderShape = function(parentTransform,items,data,isMain){
|
9990 |
+
var i, len = items.length - 1;
|
9991 |
+
var groupTransform;
|
9992 |
+
groupTransform = parentTransform;
|
9993 |
+
for(i=len;i>=0;i-=1){
|
9994 |
+
if(items[i].ty == 'tr'){
|
9995 |
+
groupTransform = data[i].transform;
|
9996 |
+
this.renderShapeTransform(parentTransform, groupTransform);
|
9997 |
+
}else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc' || items[i].ty == 'sr'){
|
9998 |
+
this.renderPath(items[i],data[i]);
|
9999 |
+
}else if(items[i].ty == 'fl'){
|
10000 |
+
this.renderFill(items[i],data[i],groupTransform);
|
10001 |
+
}else if(items[i].ty == 'st'){
|
10002 |
+
this.renderStroke(items[i],data[i],groupTransform);
|
10003 |
+
}else if(items[i].ty == 'gf' || items[i].ty == 'gs'){
|
10004 |
+
this.renderGradientFill(items[i],data[i],groupTransform);
|
10005 |
+
}else if(items[i].ty == 'gr'){
|
10006 |
+
this.renderShape(groupTransform,items[i].it,data[i].it);
|
10007 |
+
}else if(items[i].ty == 'tm'){
|
10008 |
+
//
|
10009 |
+
}
|
10010 |
+
}
|
10011 |
+
if(isMain){
|
10012 |
+
this.drawLayer();
|
10013 |
+
}
|
10014 |
+
|
10015 |
+
};
|
10016 |
+
|
10017 |
+
CVShapeElement.prototype.renderStyledShape = function(styledShape, shape){
|
10018 |
+
if(this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
|
10019 |
+
var shapeNodes = styledShape.trNodes;
|
10020 |
+
var paths = shape.paths;
|
10021 |
+
var i, len, j, jLen = paths._length;
|
10022 |
+
shapeNodes.length = 0;
|
10023 |
+
var groupTransformMat = styledShape.transforms.finalTransform;
|
10024 |
+
for (j = 0; j < jLen; j += 1) {
|
10025 |
+
var pathNodes = paths.shapes[j];
|
10026 |
+
if(pathNodes && pathNodes.v){
|
10027 |
+
len = pathNodes._length;
|
10028 |
+
for (i = 1; i < len; i += 1) {
|
10029 |
+
if (i === 1) {
|
10030 |
+
shapeNodes.push({
|
10031 |
+
t: 'm',
|
10032 |
+
p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
|
10033 |
+
});
|
10034 |
+
}
|
10035 |
+
shapeNodes.push({
|
10036 |
+
t: 'c',
|
10037 |
+
pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])
|
10038 |
+
});
|
10039 |
+
}
|
10040 |
+
if (len === 1) {
|
10041 |
+
shapeNodes.push({
|
10042 |
+
t: 'm',
|
10043 |
+
p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
|
10044 |
+
});
|
10045 |
+
}
|
10046 |
+
if (pathNodes.c && len) {
|
10047 |
+
shapeNodes.push({
|
10048 |
+
t: 'c',
|
10049 |
+
pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])
|
10050 |
+
});
|
10051 |
+
shapeNodes.push({
|
10052 |
+
t: 'z'
|
10053 |
+
});
|
10054 |
+
}
|
10055 |
+
}
|
10056 |
+
}
|
10057 |
+
styledShape.trNodes = shapeNodes;
|
10058 |
+
}
|
10059 |
+
}
|
10060 |
+
|
10061 |
+
CVShapeElement.prototype.renderPath = function(pathData,itemData){
|
10062 |
+
if(pathData.hd !== true && pathData._shouldRender) {
|
10063 |
+
var i, len = itemData.styledShapes.length;
|
10064 |
+
for (i = 0; i < len; i += 1) {
|
10065 |
+
this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
|
10066 |
+
}
|
10067 |
+
}
|
10068 |
+
};
|
10069 |
+
|
10070 |
+
CVShapeElement.prototype.renderFill = function(styleData,itemData, groupTransform){
|
10071 |
+
var styleElem = itemData.style;
|
10072 |
+
|
10073 |
+
if (itemData.c._mdf || this._isFirstFrame) {
|
10074 |
+
styleElem.co = 'rgb('
|
10075 |
+
+ bm_floor(itemData.c.v[0]) + ','
|
10076 |
+
+ bm_floor(itemData.c.v[1]) + ','
|
10077 |
+
+ bm_floor(itemData.c.v[2]) + ')';
|
10078 |
+
}
|
10079 |
+
if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
|
10080 |
+
styleElem.coOp = itemData.o.v * groupTransform.opacity;
|
10081 |
+
}
|
10082 |
+
};
|
10083 |
+
|
10084 |
+
CVShapeElement.prototype.renderGradientFill = function(styleData,itemData, groupTransform){
|
10085 |
+
var styleElem = itemData.style;
|
10086 |
+
if(!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
|
10087 |
+
var ctx = this.globalData.canvasContext;
|
10088 |
+
var grd;
|
10089 |
+
var pt1 = itemData.s.v, pt2 = itemData.e.v;
|
10090 |
+
if (styleData.t === 1) {
|
10091 |
+
grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
|
10092 |
+
} else {
|
10093 |
+
var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
|
10094 |
+
var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
|
10095 |
+
|
10096 |
+
var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
|
10097 |
+
var dist = rad * percent;
|
10098 |
+
var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
|
10099 |
+
var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
|
10100 |
+
var grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
|
10101 |
+
}
|
10102 |
+
|
10103 |
+
var i, len = styleData.g.p;
|
10104 |
+
var cValues = itemData.g.c;
|
10105 |
+
var opacity = 1;
|
10106 |
+
|
10107 |
+
for (i = 0; i < len; i += 1){
|
10108 |
+
if(itemData.g._hasOpacity && itemData.g._collapsable) {
|
10109 |
+
opacity = itemData.g.o[i*2 + 1];
|
10110 |
+
}
|
10111 |
+
grd.addColorStop(cValues[i * 4] / 100,'rgba('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ',' + opacity + ')');
|
10112 |
+
}
|
10113 |
+
styleElem.grd = grd;
|
10114 |
+
}
|
10115 |
+
styleElem.coOp = itemData.o.v*groupTransform.opacity;
|
10116 |
+
|
10117 |
+
};
|
10118 |
+
|
10119 |
+
CVShapeElement.prototype.renderStroke = function(styleData,itemData, groupTransform){
|
10120 |
+
var styleElem = itemData.style;
|
10121 |
+
var d = itemData.d;
|
10122 |
+
if(d && (d._mdf || this._isFirstFrame)){
|
10123 |
+
styleElem.da = d.dashArray;
|
10124 |
+
styleElem.do = d.dashoffset[0];
|
10125 |
+
}
|
10126 |
+
if(itemData.c._mdf || this._isFirstFrame){
|
10127 |
+
styleElem.co = 'rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')';
|
10128 |
+
}
|
10129 |
+
if(itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame){
|
10130 |
+
styleElem.coOp = itemData.o.v*groupTransform.opacity;
|
10131 |
+
}
|
10132 |
+
if(itemData.w._mdf || this._isFirstFrame){
|
10133 |
+
styleElem.wi = itemData.w.v;
|
10134 |
+
}
|
10135 |
+
};
|
10136 |
+
|
10137 |
+
|
10138 |
+
CVShapeElement.prototype.destroy = function(){
|
10139 |
+
this.shapesData = null;
|
10140 |
+
this.globalData = null;
|
10141 |
+
this.canvasContext = null;
|
10142 |
+
this.stylesList.length = 0;
|
10143 |
+
this.itemsData.length = 0;
|
10144 |
+
};
|
10145 |
+
|
10146 |
+
|
10147 |
+
function CVSolidElement(data, globalData, comp) {
|
10148 |
+
this.initElement(data,globalData,comp);
|
10149 |
+
}
|
10150 |
+
extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);
|
10151 |
+
|
10152 |
+
CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;
|
10153 |
+
CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
|
10154 |
+
|
10155 |
+
CVSolidElement.prototype.renderInnerContent = function() {
|
10156 |
+
var ctx = this.canvasContext;
|
10157 |
+
ctx.fillStyle = this.data.sc;
|
10158 |
+
ctx.fillRect(0, 0, this.data.sw, this.data.sh);
|
10159 |
+
//
|
10160 |
+
};
|
10161 |
+
function CVTextElement(data, globalData, comp){
|
10162 |
+
this.textSpans = [];
|
10163 |
+
this.yOffset = 0;
|
10164 |
+
this.fillColorAnim = false;
|
10165 |
+
this.strokeColorAnim = false;
|
10166 |
+
this.strokeWidthAnim = false;
|
10167 |
+
this.stroke = false;
|
10168 |
+
this.fill = false;
|
10169 |
+
this.justifyOffset = 0;
|
10170 |
+
this.currentRender = null;
|
10171 |
+
this.renderType = 'canvas';
|
10172 |
+
this.values = {
|
10173 |
+
fill: 'rgba(0,0,0,0)',
|
10174 |
+
stroke: 'rgba(0,0,0,0)',
|
10175 |
+
sWidth: 0,
|
10176 |
+
fValue: ''
|
10177 |
+
};
|
10178 |
+
this.initElement(data,globalData,comp);
|
10179 |
+
}
|
10180 |
+
extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement], CVTextElement);
|
10181 |
+
|
10182 |
+
CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d');
|
10183 |
+
|
10184 |
+
CVTextElement.prototype.buildNewText = function(){
|
10185 |
+
var documentData = this.textProperty.currentData;
|
10186 |
+
this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
|
10187 |
+
|
10188 |
+
var hasFill = false;
|
10189 |
+
if(documentData.fc) {
|
10190 |
+
hasFill = true;
|
10191 |
+
this.values.fill = this.buildColor(documentData.fc);
|
10192 |
+
}else{
|
10193 |
+
this.values.fill = 'rgba(0,0,0,0)';
|
10194 |
+
}
|
10195 |
+
this.fill = hasFill;
|
10196 |
+
var hasStroke = false;
|
10197 |
+
if(documentData.sc){
|
10198 |
+
hasStroke = true;
|
10199 |
+
this.values.stroke = this.buildColor(documentData.sc);
|
10200 |
+
this.values.sWidth = documentData.sw;
|
10201 |
+
}
|
10202 |
+
var fontData = this.globalData.fontManager.getFontByName(documentData.f);
|
10203 |
+
var i, len;
|
10204 |
+
var letters = documentData.l;
|
10205 |
+
var matrixHelper = this.mHelper;
|
10206 |
+
this.stroke = hasStroke;
|
10207 |
+
this.values.fValue = documentData.finalSize + 'px '+ this.globalData.fontManager.getFontByName(documentData.f).fFamily;
|
10208 |
+
len = documentData.finalText.length;
|
10209 |
+
//this.tHelper.font = this.values.fValue;
|
10210 |
+
var charData, shapeData, k, kLen, shapes, j, jLen, pathNodes, commands, pathArr, singleShape = this.data.singleShape;
|
10211 |
+
var trackingOffset = documentData.tr/1000*documentData.finalSize;
|
10212 |
+
var xPos = 0, yPos = 0, firstLine = true;
|
10213 |
+
var cnt = 0;
|
10214 |
+
for (i = 0; i < len; i += 1) {
|
10215 |
+
charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
|
10216 |
+
shapeData = charData && charData.data || {};
|
10217 |
+
matrixHelper.reset();
|
10218 |
+
if(singleShape && letters[i].n) {
|
10219 |
+
xPos = -trackingOffset;
|
10220 |
+
yPos += documentData.yOffset;
|
10221 |
+
yPos += firstLine ? 1 : 0;
|
10222 |
+
firstLine = false;
|
10223 |
+
}
|
10224 |
+
|
10225 |
+
shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
|
10226 |
+
jLen = shapes.length;
|
10227 |
+
matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
|
10228 |
+
if(singleShape){
|
10229 |
+
this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
|
10230 |
+
}
|
10231 |
+
commands = createSizedArray(jLen);
|
10232 |
+
for(j=0;j<jLen;j+=1){
|
10233 |
+
kLen = shapes[j].ks.k.i.length;
|
10234 |
+
pathNodes = shapes[j].ks.k;
|
10235 |
+
pathArr = [];
|
10236 |
+
for(k=1;k<kLen;k+=1){
|
10237 |
+
if(k==1){
|
10238 |
+
pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0],pathNodes.v[0][1],0),matrixHelper.applyToY(pathNodes.v[0][0],pathNodes.v[0][1],0));
|
10239 |
+
}
|
10240 |
+
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));
|
10241 |
+
}
|
10242 |
+
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));
|
10243 |
+
commands[j] = pathArr;
|
10244 |
+
}
|
10245 |
+
if(singleShape){
|
10246 |
+
xPos += letters[i].l;
|
10247 |
+
xPos += trackingOffset;
|
10248 |
+
}
|
10249 |
+
if(this.textSpans[cnt]){
|
10250 |
+
this.textSpans[cnt].elem = commands;
|
10251 |
+
} else {
|
10252 |
+
this.textSpans[cnt] = {elem: commands};
|
10253 |
+
}
|
10254 |
+
cnt +=1;
|
10255 |
+
}
|
10256 |
+
};
|
10257 |
+
|
10258 |
+
CVTextElement.prototype.renderInnerContent = function(){
|
10259 |
+
var ctx = this.canvasContext;
|
10260 |
+
var finalMat = this.finalTransform.mat.props;
|
10261 |
+
ctx.font = this.values.fValue;
|
10262 |
+
ctx.lineCap = 'butt';
|
10263 |
+
ctx.lineJoin = 'miter';
|
10264 |
+
ctx.miterLimit = 4;
|
10265 |
+
|
10266 |
+
if(!this.data.singleShape){
|
10267 |
+
this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
|
10268 |
+
}
|
10269 |
+
|
10270 |
+
var i,len, j, jLen, k, kLen;
|
10271 |
+
var renderedLetters = this.textAnimator.renderedLetters;
|
10272 |
+
|
10273 |
+
var letters = this.textProperty.currentData.l;
|
10274 |
+
|
10275 |
+
len = letters.length;
|
10276 |
+
var renderedLetter;
|
10277 |
+
var lastFill = null, lastStroke = null, lastStrokeW = null, commands, pathArr;
|
10278 |
+
for(i=0;i<len;i+=1){
|
10279 |
+
if(letters[i].n){
|
10280 |
+
continue;
|
10281 |
+
}
|
10282 |
+
renderedLetter = renderedLetters[i];
|
10283 |
+
if(renderedLetter){
|
10284 |
+
this.globalData.renderer.save();
|
10285 |
+
this.globalData.renderer.ctxTransform(renderedLetter.p);
|
10286 |
+
this.globalData.renderer.ctxOpacity(renderedLetter.o);
|
10287 |
+
}
|
10288 |
+
if(this.fill){
|
10289 |
+
if(renderedLetter && renderedLetter.fc){
|
10290 |
+
if(lastFill !== renderedLetter.fc){
|
10291 |
+
lastFill = renderedLetter.fc;
|
10292 |
+
ctx.fillStyle = renderedLetter.fc;
|
10293 |
+
}
|
10294 |
+
}else if(lastFill !== this.values.fill){
|
10295 |
+
lastFill = this.values.fill;
|
10296 |
+
ctx.fillStyle = this.values.fill;
|
10297 |
+
}
|
10298 |
+
commands = this.textSpans[i].elem;
|
10299 |
+
jLen = commands.length;
|
10300 |
+
this.globalData.canvasContext.beginPath();
|
10301 |
+
for(j=0;j<jLen;j+=1) {
|
10302 |
+
pathArr = commands[j];
|
10303 |
+
kLen = pathArr.length;
|
10304 |
+
this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
|
10305 |
+
for (k = 2; k < kLen; k += 6) {
|
10306 |
+
this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
|
10307 |
+
}
|
10308 |
+
}
|
10309 |
+
this.globalData.canvasContext.closePath();
|
10310 |
+
this.globalData.canvasContext.fill();
|
10311 |
+
///ctx.fillText(this.textSpans[i].val,0,0);
|
10312 |
+
}
|
10313 |
+
if(this.stroke){
|
10314 |
+
if(renderedLetter && renderedLetter.sw){
|
10315 |
+
if(lastStrokeW !== renderedLetter.sw){
|
10316 |
+
lastStrokeW = renderedLetter.sw;
|
10317 |
+
ctx.lineWidth = renderedLetter.sw;
|
10318 |
+
}
|
10319 |
+
}else if(lastStrokeW !== this.values.sWidth){
|
10320 |
+
lastStrokeW = this.values.sWidth;
|
10321 |
+
ctx.lineWidth = this.values.sWidth;
|
10322 |
+
}
|
10323 |
+
if(renderedLetter && renderedLetter.sc){
|
10324 |
+
if(lastStroke !== renderedLetter.sc){
|
10325 |
+
lastStroke = renderedLetter.sc;
|
10326 |
+
ctx.strokeStyle = renderedLetter.sc;
|
10327 |
+
}
|
10328 |
+
}else if(lastStroke !== this.values.stroke){
|
10329 |
+
lastStroke = this.values.stroke;
|
10330 |
+
ctx.strokeStyle = this.values.stroke;
|
10331 |
+
}
|
10332 |
+
commands = this.textSpans[i].elem;
|
10333 |
+
jLen = commands.length;
|
10334 |
+
this.globalData.canvasContext.beginPath();
|
10335 |
+
for(j=0;j<jLen;j+=1) {
|
10336 |
+
pathArr = commands[j];
|
10337 |
+
kLen = pathArr.length;
|
10338 |
+
this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
|
10339 |
+
for (k = 2; k < kLen; k += 6) {
|
10340 |
+
this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
|
10341 |
+
}
|
10342 |
+
}
|
10343 |
+
this.globalData.canvasContext.closePath();
|
10344 |
+
this.globalData.canvasContext.stroke();
|
10345 |
+
///ctx.strokeText(letters[i].val,0,0);
|
10346 |
+
}
|
10347 |
+
if(renderedLetter) {
|
10348 |
+
this.globalData.renderer.restore();
|
10349 |
+
}
|
10350 |
+
}
|
10351 |
+
};
|
10352 |
+
function CVEffects() {
|
10353 |
+
|
10354 |
+
}
|
10355 |
+
CVEffects.prototype.renderFrame = function(){};
|
10356 |
+
function HBaseElement(data,globalData,comp){}
|
10357 |
+
HBaseElement.prototype = {
|
10358 |
+
checkBlendMode: function(){},
|
10359 |
+
initRendererElement: function(){
|
10360 |
+
this.baseElement = createTag(this.data.tg || 'div');
|
10361 |
+
if(this.data.hasMask) {
|
10362 |
+
this.svgElement = createNS('svg');
|
10363 |
+
this.layerElement = createNS('g');
|
10364 |
+
this.maskedElement = this.layerElement;
|
10365 |
+
this.svgElement.appendChild(this.layerElement);
|
10366 |
+
this.baseElement.appendChild(this.svgElement);
|
10367 |
+
} else {
|
10368 |
+
this.layerElement = this.baseElement;
|
10369 |
+
}
|
10370 |
+
styleDiv(this.baseElement);
|
10371 |
+
},
|
10372 |
+
createContainerElements: function(){
|
10373 |
+
this.renderableEffectsManager = new CVEffects(this);
|
10374 |
+
this.transformedElement = this.baseElement;
|
10375 |
+
this.maskedElement = this.layerElement;
|
10376 |
+
if (this.data.ln) {
|
10377 |
+
this.layerElement.setAttribute('id',this.data.ln);
|
10378 |
+
}
|
10379 |
+
if (this.data.cl) {
|
10380 |
+
this.layerElement.setAttribute('class', this.data.cl);
|
10381 |
+
}
|
10382 |
+
if (this.data.bm !== 0) {
|
10383 |
+
this.setBlendMode();
|
10384 |
+
}
|
10385 |
+
},
|
10386 |
+
renderElement: function() {
|
10387 |
+
if(this.finalTransform._matMdf){
|
10388 |
+
this.transformedElement.style.transform = this.transformedElement.style.webkitTransform = this.finalTransform.mat.toCSS();
|
10389 |
+
}
|
10390 |
+
if(this.finalTransform._opMdf){
|
10391 |
+
this.transformedElement.style.opacity = this.finalTransform.mProp.o.v;
|
10392 |
+
}
|
10393 |
+
},
|
10394 |
+
renderFrame: function() {
|
10395 |
+
//If it is exported as hidden (data.hd === true) no need to render
|
10396 |
+
//If it is not visible no need to render
|
10397 |
+
if (this.data.hd || this.hidden) {
|
10398 |
+
return;
|
10399 |
+
}
|
10400 |
+
this.renderTransform();
|
10401 |
+
this.renderRenderable();
|
10402 |
+
this.renderElement();
|
10403 |
+
this.renderInnerContent();
|
10404 |
+
if (this._isFirstFrame) {
|
10405 |
+
this._isFirstFrame = false;
|
10406 |
+
}
|
10407 |
+
},
|
10408 |
+
destroy: function(){
|
10409 |
+
this.layerElement = null;
|
10410 |
+
this.transformedElement = null;
|
10411 |
+
if(this.matteElement) {
|
10412 |
+
this.matteElement = null;
|
10413 |
+
}
|
10414 |
+
if(this.maskManager) {
|
10415 |
+
this.maskManager.destroy();
|
10416 |
+
this.maskManager = null;
|
10417 |
+
}
|
10418 |
+
},
|
10419 |
+
createRenderableComponents: function(){
|
10420 |
+
this.maskManager = new MaskElement(this.data, this, this.globalData);
|
10421 |
+
},
|
10422 |
+
addEffects: function(){
|
10423 |
+
},
|
10424 |
+
setMatte: function(){}
|
10425 |
+
};
|
10426 |
+
HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;
|
10427 |
+
HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;
|
10428 |
+
HBaseElement.prototype.buildElementParenting = HybridRenderer.prototype.buildElementParenting;
|
10429 |
+
function HSolidElement(data,globalData,comp){
|
10430 |
+
this.initElement(data,globalData,comp);
|
10431 |
+
}
|
10432 |
+
extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], HSolidElement);
|
10433 |
+
|
10434 |
+
HSolidElement.prototype.createContent = function(){
|
10435 |
+
var rect;
|
10436 |
+
if(this.data.hasMask){
|
10437 |
+
rect = createNS('rect');
|
10438 |
+
rect.setAttribute('width',this.data.sw);
|
10439 |
+
rect.setAttribute('height',this.data.sh);
|
10440 |
+
rect.setAttribute('fill',this.data.sc);
|
10441 |
+
this.svgElement.setAttribute('width',this.data.sw);
|
10442 |
+
this.svgElement.setAttribute('height',this.data.sh);
|
10443 |
+
} else {
|
10444 |
+
rect = createTag('div');
|
10445 |
+
rect.style.width = this.data.sw + 'px';
|
10446 |
+
rect.style.height = this.data.sh + 'px';
|
10447 |
+
rect.style.backgroundColor = this.data.sc;
|
10448 |
+
}
|
10449 |
+
this.layerElement.appendChild(rect);
|
10450 |
+
};
|
10451 |
+
|
10452 |
+
function HCompElement(data,globalData,comp){
|
10453 |
+
this.layers = data.layers;
|
10454 |
+
this.supports3d = !data.hasMask;
|
10455 |
+
this.completeLayers = false;
|
10456 |
+
this.pendingElements = [];
|
10457 |
+
this.elements = this.layers ? createSizedArray(this.layers.length) : [];
|
10458 |
+
this.initElement(data,globalData,comp);
|
10459 |
+
this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
|
10460 |
+
}
|
10461 |
+
|
10462 |
+
extendPrototype([HybridRenderer, ICompElement, HBaseElement], HCompElement);
|
10463 |
+
HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements;
|
10464 |
+
|
10465 |
+
HCompElement.prototype.createContainerElements = function(){
|
10466 |
+
this._createBaseContainerElements();
|
10467 |
+
//divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
|
10468 |
+
if(this.data.hasMask){
|
10469 |
+
this.svgElement.setAttribute('width',this.data.w);
|
10470 |
+
this.svgElement.setAttribute('height',this.data.h);
|
10471 |
+
this.transformedElement = this.baseElement;
|
10472 |
+
} else {
|
10473 |
+
this.transformedElement = this.layerElement;
|
10474 |
+
}
|
10475 |
+
};
|
10476 |
+
|
10477 |
+
HCompElement.prototype.addTo3dContainer = function(elem,pos) {
|
10478 |
+
var j = 0;
|
10479 |
+
var nextElement;
|
10480 |
+
while(j<pos){
|
10481 |
+
if(this.elements[j] && this.elements[j].getBaseElement){
|
10482 |
+
nextElement = this.elements[j].getBaseElement();
|
10483 |
+
}
|
10484 |
+
j += 1;
|
10485 |
+
}
|
10486 |
+
if(nextElement){
|
10487 |
+
this.layerElement.insertBefore(elem, nextElement);
|
10488 |
+
} else {
|
10489 |
+
this.layerElement.appendChild(elem);
|
10490 |
+
}
|
10491 |
+
}
|
10492 |
+
|
10493 |
+
function HShapeElement(data,globalData,comp){
|
10494 |
+
//List of drawable elements
|
10495 |
+
this.shapes = [];
|
10496 |
+
// Full shape data
|
10497 |
+
this.shapesData = data.shapes;
|
10498 |
+
//List of styles that will be applied to shapes
|
10499 |
+
this.stylesList = [];
|
10500 |
+
//List of modifiers that will be applied to shapes
|
10501 |
+
this.shapeModifiers = [];
|
10502 |
+
//List of items in shape tree
|
10503 |
+
this.itemsData = [];
|
10504 |
+
//List of items in previous shape tree
|
10505 |
+
this.processedElements = [];
|
10506 |
+
// List of animated components
|
10507 |
+
this.animatedContents = [];
|
10508 |
+
this.shapesContainer = createNS('g');
|
10509 |
+
this.initElement(data,globalData,comp);
|
10510 |
+
//Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
|
10511 |
+
// List of elements that have been created
|
10512 |
+
this.prevViewData = [];
|
10513 |
+
this.currentBBox = {
|
10514 |
+
x:999999,
|
10515 |
+
y: -999999,
|
10516 |
+
h: 0,
|
10517 |
+
w: 0
|
10518 |
+
};
|
10519 |
+
}
|
10520 |
+
extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement], HShapeElement);
|
10521 |
+
HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent;
|
10522 |
+
|
10523 |
+
HShapeElement.prototype.createContent = function(){
|
10524 |
+
var cont;
|
10525 |
+
this.baseElement.style.fontSize = 0;
|
10526 |
+
if (this.data.hasMask) {
|
10527 |
+
this.layerElement.appendChild(this.shapesContainer);
|
10528 |
+
cont = this.svgElement;
|
10529 |
+
} else {
|
10530 |
+
cont = createNS('svg');
|
10531 |
+
var size = this.comp.data ? this.comp.data : this.globalData.compSize;
|
10532 |
+
cont.setAttribute('width',size.w);
|
10533 |
+
cont.setAttribute('height',size.h);
|
10534 |
+
cont.appendChild(this.shapesContainer);
|
10535 |
+
this.layerElement.appendChild(cont);
|
10536 |
+
}
|
10537 |
+
|
10538 |
+
this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0, [], true);
|
10539 |
+
this.filterUniqueShapes();
|
10540 |
+
this.shapeCont = cont;
|
10541 |
+
};
|
10542 |
+
|
10543 |
+
HShapeElement.prototype.getTransformedPoint = function(transformers, point) {
|
10544 |
+
var i, len = transformers.length;
|
10545 |
+
for(i = 0; i < len; i += 1) {
|
10546 |
+
point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
|
10547 |
+
}
|
10548 |
+
return point;
|
10549 |
+
}
|
10550 |
+
|
10551 |
+
HShapeElement.prototype.calculateShapeBoundingBox = function(item, boundingBox) {
|
10552 |
+
var shape = item.sh.v;
|
10553 |
+
var transformers = item.transformers;
|
10554 |
+
var i, len = shape._length, vPoint, oPoint, nextIPoint, nextVPoint, bounds;
|
10555 |
+
if (len <= 1) {
|
10556 |
+
return;
|
10557 |
+
}
|
10558 |
+
for (i = 0; i < len - 1; i += 1) {
|
10559 |
+
vPoint = this.getTransformedPoint(transformers, shape.v[i]);
|
10560 |
+
oPoint = this.getTransformedPoint(transformers, shape.o[i]);
|
10561 |
+
nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
|
10562 |
+
nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
|
10563 |
+
this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
|
10564 |
+
}
|
10565 |
+
if(shape.c) {
|
10566 |
+
vPoint = this.getTransformedPoint(transformers, shape.v[i]);
|
10567 |
+
oPoint = this.getTransformedPoint(transformers, shape.o[i]);
|
10568 |
+
nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
|
10569 |
+
nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
|
10570 |
+
this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
|
10571 |
+
}
|
10572 |
+
}
|
10573 |
+
|
10574 |
+
HShapeElement.prototype.checkBounds = function(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
|
10575 |
+
this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
|
10576 |
+
var bounds = this.shapeBoundingBox;
|
10577 |
+
boundingBox.x = bm_min(bounds.left, boundingBox.x);
|
10578 |
+
boundingBox.xMax = bm_max(bounds.right, boundingBox.xMax);
|
10579 |
+
boundingBox.y = bm_min(bounds.top, boundingBox.y);
|
10580 |
+
boundingBox.yMax = bm_max(bounds.bottom, boundingBox.yMax);
|
10581 |
+
}
|
10582 |
+
|
10583 |
+
HShapeElement.prototype.shapeBoundingBox = {
|
10584 |
+
left:0,
|
10585 |
+
right:0,
|
10586 |
+
top:0,
|
10587 |
+
bottom:0,
|
10588 |
+
}
|
10589 |
+
|
10590 |
+
HShapeElement.prototype.tempBoundingBox = {
|
10591 |
+
x:0,
|
10592 |
+
xMax:0,
|
10593 |
+
y:0,
|
10594 |
+
yMax:0,
|
10595 |
+
width:0,
|
10596 |
+
height:0
|
10597 |
+
}
|
10598 |
+
|
10599 |
+
HShapeElement.prototype.getBoundsOfCurve = function(p0, p1, p2, p3) {
|
10600 |
+
|
10601 |
+
var bounds = [[p0[0],p3[0]], [p0[1],p3[1]]];
|
10602 |
+
|
10603 |
+
for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) {
|
10604 |
+
|
10605 |
+
b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
|
10606 |
+
a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
|
10607 |
+
c = 3 * p1[i] - 3 * p0[i];
|
10608 |
+
|
10609 |
+
b = b | 0;
|
10610 |
+
a = a | 0;
|
10611 |
+
c = c | 0;
|
10612 |
+
|
10613 |
+
if (a === 0) {
|
10614 |
+
|
10615 |
+
if (b === 0) {
|
10616 |
+
continue;
|
10617 |
+
}
|
10618 |
+
|
10619 |
+
t = -c / b;
|
10620 |
+
|
10621 |
+
if (0 < t && t < 1) {
|
10622 |
+
bounds[i].push(this.calculateF(t,p0,p1,p2,p3,i));
|
10623 |
+
}
|
10624 |
+
continue;
|
10625 |
+
}
|
10626 |
+
|
10627 |
+
b2ac = b * b - 4 * c * a;
|
10628 |
+
|
10629 |
+
if (b2ac < 0) {
|
10630 |
+
continue;
|
10631 |
+
}
|
10632 |
+
|
10633 |
+
t1 = (-b + bm_sqrt(b2ac))/(2 * a);
|
10634 |
+
if (0 < t1 && t1 < 1) bounds[i].push(this.calculateF(t1,p0,p1,p2,p3,i));
|
10635 |
+
|
10636 |
+
t2 = (-b - bm_sqrt(b2ac))/(2 * a);
|
10637 |
+
if (0 < t2 && t2 < 1) bounds[i].push(this.calculateF(t2,p0,p1,p2,p3,i));
|
10638 |
+
|
10639 |
+
}
|
10640 |
+
|
10641 |
+
this.shapeBoundingBox.left = bm_min.apply(null, bounds[0]);
|
10642 |
+
this.shapeBoundingBox.top = bm_min.apply(null, bounds[1]);
|
10643 |
+
this.shapeBoundingBox.right = bm_max.apply(null, bounds[0]);
|
10644 |
+
this.shapeBoundingBox.bottom = bm_max.apply(null, bounds[1]);
|
10645 |
+
};
|
10646 |
+
|
10647 |
+
HShapeElement.prototype.calculateF = function(t, p0, p1, p2, p3, i) {
|
10648 |
+
return bm_pow(1-t, 3) * p0[i]
|
10649 |
+
+ 3 * bm_pow(1-t, 2) * t * p1[i]
|
10650 |
+
+ 3 * (1-t) * bm_pow(t, 2) * p2[i]
|
10651 |
+
+ bm_pow(t, 3) * p3[i];
|
10652 |
+
}
|
10653 |
+
|
10654 |
+
HShapeElement.prototype.calculateBoundingBox = function(itemsData, boundingBox) {
|
10655 |
+
var i, len = itemsData.length, path;
|
10656 |
+
for(i = 0; i < len; i += 1) {
|
10657 |
+
if(itemsData[i] && itemsData[i].sh) {
|
10658 |
+
this.calculateShapeBoundingBox(itemsData[i], boundingBox)
|
10659 |
+
} else if(itemsData[i] && itemsData[i].it) {
|
10660 |
+
this.calculateBoundingBox(itemsData[i].it, boundingBox)
|
10661 |
+
}
|
10662 |
+
}
|
10663 |
+
}
|
10664 |
+
|
10665 |
+
HShapeElement.prototype.currentBoxContains = function(box) {
|
10666 |
+
return this.currentBBox.x <= box.x
|
10667 |
+
&& this.currentBBox.y <= box.y
|
10668 |
+
&& this.currentBBox.width + this.currentBBox.x >= box.x + box.width
|
10669 |
+
&& this.currentBBox.height + this.currentBBox.y >= box.y + box.height
|
10670 |
+
}
|
10671 |
+
|
10672 |
+
HShapeElement.prototype.renderInnerContent = function() {
|
10673 |
+
this._renderShapeFrame();
|
10674 |
+
|
10675 |
+
if(!this.hidden && (this._isFirstFrame || this._mdf)) {
|
10676 |
+
var tempBoundingBox = this.tempBoundingBox;
|
10677 |
+
var max = 999999;
|
10678 |
+
tempBoundingBox.x = max;
|
10679 |
+
tempBoundingBox.xMax = -max;
|
10680 |
+
tempBoundingBox.y = max;
|
10681 |
+
tempBoundingBox.yMax = -max;
|
10682 |
+
this.calculateBoundingBox(this.itemsData, tempBoundingBox);
|
10683 |
+
tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
|
10684 |
+
tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
|
10685 |
+
//var tempBoundingBox = this.shapeCont.getBBox();
|
10686 |
+
if(this.currentBoxContains(tempBoundingBox)) {
|
10687 |
+
return;
|
10688 |
+
}
|
10689 |
+
var changed = false;
|
10690 |
+
if(this.currentBBox.w !== tempBoundingBox.width){
|
10691 |
+
this.currentBBox.w = tempBoundingBox.width;
|
10692 |
+
this.shapeCont.setAttribute('width',tempBoundingBox.width);
|
10693 |
+
changed = true;
|
10694 |
+
}
|
10695 |
+
if(this.currentBBox.h !== tempBoundingBox.height){
|
10696 |
+
this.currentBBox.h = tempBoundingBox.height;
|
10697 |
+
this.shapeCont.setAttribute('height',tempBoundingBox.height);
|
10698 |
+
changed = true;
|
10699 |
+
}
|
10700 |
+
if(changed || this.currentBBox.x !== tempBoundingBox.x || this.currentBBox.y !== tempBoundingBox.y){
|
10701 |
+
this.currentBBox.w = tempBoundingBox.width;
|
10702 |
+
this.currentBBox.h = tempBoundingBox.height;
|
10703 |
+
this.currentBBox.x = tempBoundingBox.x;
|
10704 |
+
this.currentBBox.y = tempBoundingBox.y;
|
10705 |
+
|
10706 |
+
this.shapeCont.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
|
10707 |
+
this.shapeCont.style.transform = this.shapeCont.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
|
10708 |
+
}
|
10709 |
+
}
|
10710 |
+
|
10711 |
+
};
|
10712 |
+
function HTextElement(data,globalData,comp){
|
10713 |
+
this.textSpans = [];
|
10714 |
+
this.textPaths = [];
|
10715 |
+
this.currentBBox = {
|
10716 |
+
x:999999,
|
10717 |
+
y: -999999,
|
10718 |
+
h: 0,
|
10719 |
+
w: 0
|
10720 |
+
};
|
10721 |
+
this.renderType = 'svg';
|
10722 |
+
this.isMasked = false;
|
10723 |
+
this.initElement(data,globalData,comp);
|
10724 |
+
|
10725 |
+
}
|
10726 |
+
extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], HTextElement);
|
10727 |
+
|
10728 |
+
HTextElement.prototype.createContent = function(){
|
10729 |
+
this.isMasked = this.checkMasks();
|
10730 |
+
if(this.isMasked){
|
10731 |
+
this.renderType = 'svg';
|
10732 |
+
this.compW = this.comp.data.w;
|
10733 |
+
this.compH = this.comp.data.h;
|
10734 |
+
this.svgElement.setAttribute('width',this.compW);
|
10735 |
+
this.svgElement.setAttribute('height',this.compH);
|
10736 |
+
var g = createNS('g');
|
10737 |
+
this.maskedElement.appendChild(g);
|
10738 |
+
this.innerElem = g;
|
10739 |
+
} else {
|
10740 |
+
this.renderType = 'html';
|
10741 |
+
this.innerElem = this.layerElement;
|
10742 |
+
}
|
10743 |
+
|
10744 |
+
this.checkParenting();
|
10745 |
+
|
10746 |
+
};
|
10747 |
+
|
10748 |
+
HTextElement.prototype.buildNewText = function(){
|
10749 |
+
var documentData = this.textProperty.currentData;
|
10750 |
+
this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
|
10751 |
+
var innerElemStyle = this.innerElem.style;
|
10752 |
+
innerElemStyle.color = innerElemStyle.fill = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
|
10753 |
+
if(documentData.sc){
|
10754 |
+
innerElemStyle.stroke = this.buildColor(documentData.sc);
|
10755 |
+
innerElemStyle.strokeWidth = documentData.sw+'px';
|
10756 |
+
}
|
10757 |
+
var fontData = this.globalData.fontManager.getFontByName(documentData.f);
|
10758 |
+
if(!this.globalData.fontManager.chars){
|
10759 |
+
innerElemStyle.fontSize = documentData.finalSize+'px';
|
10760 |
+
innerElemStyle.lineHeight = documentData.finalSize+'px';
|
10761 |
+
if(fontData.fClass){
|
10762 |
+
this.innerElem.className = fontData.fClass;
|
10763 |
+
} else {
|
10764 |
+
innerElemStyle.fontFamily = fontData.fFamily;
|
10765 |
+
var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
|
10766 |
+
innerElemStyle.fontStyle = fStyle;
|
10767 |
+
innerElemStyle.fontWeight = fWeight;
|
10768 |
+
}
|
10769 |
+
}
|
10770 |
+
var i, len;
|
10771 |
+
|
10772 |
+
var letters = documentData.l;
|
10773 |
+
len = letters.length;
|
10774 |
+
var tSpan,tParent,tCont;
|
10775 |
+
var matrixHelper = this.mHelper;
|
10776 |
+
var shapes, shapeStr = '';
|
10777 |
+
var cnt = 0;
|
10778 |
+
for (i = 0;i < len ;i += 1) {
|
10779 |
+
if(this.globalData.fontManager.chars){
|
10780 |
+
if(!this.textPaths[cnt]){
|
10781 |
+
tSpan = createNS('path');
|
10782 |
+
tSpan.setAttribute('stroke-linecap', 'butt');
|
10783 |
+
tSpan.setAttribute('stroke-linejoin','round');
|
10784 |
+
tSpan.setAttribute('stroke-miterlimit','4');
|
10785 |
+
} else {
|
10786 |
+
tSpan = this.textPaths[cnt];
|
10787 |
+
}
|
10788 |
+
if(!this.isMasked){
|
10789 |
+
if(this.textSpans[cnt]){
|
10790 |
+
tParent = this.textSpans[cnt];
|
10791 |
+
tCont = tParent.children[0];
|
10792 |
+
} else {
|
10793 |
+
|
10794 |
+
tParent = createTag('div');
|
10795 |
+
tParent.style.lineHeight = 0;
|
10796 |
+
tCont = createNS('svg');
|
10797 |
+
tCont.appendChild(tSpan);
|
10798 |
+
styleDiv(tParent);
|
10799 |
+
}
|
10800 |
+
}
|
10801 |
+
}else{
|
10802 |
+
if(!this.isMasked){
|
10803 |
+
if(this.textSpans[cnt]){
|
10804 |
+
tParent = this.textSpans[cnt];
|
10805 |
+
tSpan = this.textPaths[cnt];
|
10806 |
+
} else {
|
10807 |
+
tParent = createTag('span');
|
10808 |
+
styleDiv(tParent);
|
10809 |
+
tSpan = createTag('span');
|
10810 |
+
styleDiv(tSpan);
|
10811 |
+
tParent.appendChild(tSpan);
|
10812 |
+
}
|
10813 |
+
} else {
|
10814 |
+
tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
|
10815 |
+
}
|
10816 |
+
}
|
10817 |
+
//tSpan.setAttribute('visibility', 'hidden');
|
10818 |
+
if(this.globalData.fontManager.chars){
|
10819 |
+
var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
|
10820 |
+
var shapeData;
|
10821 |
+
if(charData){
|
10822 |
+
shapeData = charData.data;
|
10823 |
+
} else {
|
10824 |
+
shapeData = null;
|
10825 |
+
}
|
10826 |
+
matrixHelper.reset();
|
10827 |
+
if(shapeData && shapeData.shapes){
|
10828 |
+
shapes = shapeData.shapes[0].it;
|
10829 |
+
matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
|
10830 |
+
shapeStr = this.createPathShape(matrixHelper,shapes);
|
10831 |
+
tSpan.setAttribute('d',shapeStr);
|
10832 |
+
}
|
10833 |
+
if(!this.isMasked){
|
10834 |
+
this.innerElem.appendChild(tParent);
|
10835 |
+
if(shapeData && shapeData.shapes){
|
10836 |
+
|
10837 |
+
//document.body.appendChild is needed to get exact measure of shape
|
10838 |
+
document.body.appendChild(tCont);
|
10839 |
+
var boundingBox = tCont.getBBox();
|
10840 |
+
tCont.setAttribute('width',boundingBox.width + 2);
|
10841 |
+
tCont.setAttribute('height',boundingBox.height + 2);
|
10842 |
+
tCont.setAttribute('viewBox',(boundingBox.x-1)+' '+ (boundingBox.y-1)+' '+ (boundingBox.width+2)+' '+ (boundingBox.height+2));
|
10843 |
+
tCont.style.transform = tCont.style.webkitTransform = 'translate(' + (boundingBox.x-1) + 'px,' + (boundingBox.y-1) + 'px)';
|
10844 |
+
|
10845 |
+
letters[i].yOffset = boundingBox.y-1;
|
10846 |
+
|
10847 |
+
} else{
|
10848 |
+
tCont.setAttribute('width',1);
|
10849 |
+
tCont.setAttribute('height',1);
|
10850 |
+
}
|
10851 |
+
tParent.appendChild(tCont);
|
10852 |
+
}else{
|
10853 |
+
this.innerElem.appendChild(tSpan);
|
10854 |
+
}
|
10855 |
+
}else{
|
10856 |
+
tSpan.textContent = letters[i].val;
|
10857 |
+
tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
|
10858 |
+
if(!this.isMasked){
|
10859 |
+
this.innerElem.appendChild(tParent);
|
10860 |
+
//
|
10861 |
+
tSpan.style.transform = tSpan.style.webkitTransform = 'translate3d(0,'+ -documentData.finalSize/1.2+'px,0)';
|
10862 |
+
} else {
|
10863 |
+
this.innerElem.appendChild(tSpan);
|
10864 |
+
}
|
10865 |
+
}
|
10866 |
+
//
|
10867 |
+
if(!this.isMasked){
|
10868 |
+
this.textSpans[cnt] = tParent;
|
10869 |
+
}else{
|
10870 |
+
this.textSpans[cnt] = tSpan;
|
10871 |
+
}
|
10872 |
+
this.textSpans[cnt].style.display = 'block';
|
10873 |
+
this.textPaths[cnt] = tSpan;
|
10874 |
+
cnt += 1;
|
10875 |
+
}
|
10876 |
+
while(cnt < this.textSpans.length){
|
10877 |
+
this.textSpans[cnt].style.display = 'none';
|
10878 |
+
cnt += 1;
|
10879 |
+
}
|
10880 |
+
};
|
10881 |
+
|
10882 |
+
HTextElement.prototype.renderInnerContent = function() {
|
10883 |
+
|
10884 |
+
if(this.data.singleShape){
|
10885 |
+
if(!this._isFirstFrame && !this.lettersChangedFlag){
|
10886 |
+
return;
|
10887 |
+
} else {
|
10888 |
+
// Todo Benchmark if using this is better than getBBox
|
10889 |
+
if(this.isMasked && this.finalTransform._matMdf){
|
10890 |
+
this.svgElement.setAttribute('viewBox',-this.finalTransform.mProp.p.v[0]+' '+ -this.finalTransform.mProp.p.v[1]+' '+this.compW+' '+this.compH);
|
10891 |
+
this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
|
10892 |
+
}
|
10893 |
+
}
|
10894 |
+
}
|
10895 |
+
|
10896 |
+
this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
|
10897 |
+
if(!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag){
|
10898 |
+
return;
|
10899 |
+
}
|
10900 |
+
var i,len, count = 0;
|
10901 |
+
var renderedLetters = this.textAnimator.renderedLetters;
|
10902 |
+
|
10903 |
+
var letters = this.textProperty.currentData.l;
|
10904 |
+
|
10905 |
+
len = letters.length;
|
10906 |
+
var renderedLetter, textSpan, textPath;
|
10907 |
+
for(i=0;i<len;i+=1){
|
10908 |
+
if(letters[i].n){
|
10909 |
+
count += 1;
|
10910 |
+
continue;
|
10911 |
+
}
|
10912 |
+
textSpan = this.textSpans[i];
|
10913 |
+
textPath = this.textPaths[i];
|
10914 |
+
renderedLetter = renderedLetters[count];
|
10915 |
+
count += 1;
|
10916 |
+
if(renderedLetter._mdf.m) {
|
10917 |
+
if(!this.isMasked){
|
10918 |
+
textSpan.style.transform = textSpan.style.webkitTransform = renderedLetter.m;
|
10919 |
+
}else{
|
10920 |
+
textSpan.setAttribute('transform',renderedLetter.m);
|
10921 |
+
}
|
10922 |
+
}
|
10923 |
+
////textSpan.setAttribute('opacity',renderedLetter.o);
|
10924 |
+
textSpan.style.opacity = renderedLetter.o;
|
10925 |
+
if(renderedLetter.sw && renderedLetter._mdf.sw){
|
10926 |
+
textPath.setAttribute('stroke-width',renderedLetter.sw);
|
10927 |
+
}
|
10928 |
+
if(renderedLetter.sc && renderedLetter._mdf.sc){
|
10929 |
+
textPath.setAttribute('stroke',renderedLetter.sc);
|
10930 |
+
}
|
10931 |
+
if(renderedLetter.fc && renderedLetter._mdf.fc){
|
10932 |
+
textPath.setAttribute('fill',renderedLetter.fc);
|
10933 |
+
textPath.style.color = renderedLetter.fc;
|
10934 |
+
}
|
10935 |
+
}
|
10936 |
+
|
10937 |
+
if(this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)){
|
10938 |
+
var boundingBox = this.innerElem.getBBox();
|
10939 |
+
|
10940 |
+
if(this.currentBBox.w !== boundingBox.width){
|
10941 |
+
this.currentBBox.w = boundingBox.width;
|
10942 |
+
this.svgElement.setAttribute('width',boundingBox.width);
|
10943 |
+
}
|
10944 |
+
if(this.currentBBox.h !== boundingBox.height){
|
10945 |
+
this.currentBBox.h = boundingBox.height;
|
10946 |
+
this.svgElement.setAttribute('height',boundingBox.height);
|
10947 |
+
}
|
10948 |
+
|
10949 |
+
var margin = 1;
|
10950 |
+
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)){
|
10951 |
+
this.currentBBox.w = boundingBox.width + margin*2;
|
10952 |
+
this.currentBBox.h = boundingBox.height + margin*2;
|
10953 |
+
this.currentBBox.x = boundingBox.x - margin;
|
10954 |
+
this.currentBBox.y = boundingBox.y - margin;
|
10955 |
+
|
10956 |
+
this.svgElement.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
|
10957 |
+
this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
|
10958 |
+
}
|
10959 |
+
}
|
10960 |
+
};
|
10961 |
+
function HImageElement(data,globalData,comp){
|
10962 |
+
this.assetData = globalData.getAssetData(data.refId);
|
10963 |
+
this.initElement(data,globalData,comp);
|
10964 |
+
}
|
10965 |
+
|
10966 |
+
extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement], HImageElement);
|
10967 |
+
|
10968 |
+
|
10969 |
+
HImageElement.prototype.createContent = function(){
|
10970 |
+
var assetPath = this.globalData.getAssetsPath(this.assetData);
|
10971 |
+
var img = new Image();
|
10972 |
+
|
10973 |
+
if(this.data.hasMask){
|
10974 |
+
this.imageElem = createNS('image');
|
10975 |
+
this.imageElem.setAttribute('width',this.assetData.w+"px");
|
10976 |
+
this.imageElem.setAttribute('height',this.assetData.h+"px");
|
10977 |
+
this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
|
10978 |
+
this.layerElement.appendChild(this.imageElem);
|
10979 |
+
this.baseElement.setAttribute('width',this.assetData.w);
|
10980 |
+
this.baseElement.setAttribute('height',this.assetData.h);
|
10981 |
+
} else {
|
10982 |
+
this.layerElement.appendChild(img);
|
10983 |
+
}
|
10984 |
+
img.src = assetPath;
|
10985 |
+
if(this.data.ln){
|
10986 |
+
this.baseElement.setAttribute('id',this.data.ln);
|
10987 |
+
}
|
10988 |
+
};
|
10989 |
+
function HCameraElement(data,globalData,comp){
|
10990 |
+
this.initFrame();
|
10991 |
+
this.initBaseData(data,globalData,comp);
|
10992 |
+
this.initHierarchy();
|
10993 |
+
var getProp = PropertyFactory.getProp;
|
10994 |
+
this.pe = getProp(this,data.pe,0,0,this);
|
10995 |
+
if(data.ks.p.s){
|
10996 |
+
this.px = getProp(this,data.ks.p.x,1,0,this);
|
10997 |
+
this.py = getProp(this,data.ks.p.y,1,0,this);
|
10998 |
+
this.pz = getProp(this,data.ks.p.z,1,0,this);
|
10999 |
+
}else{
|
11000 |
+
this.p = getProp(this,data.ks.p,1,0,this);
|
11001 |
+
}
|
11002 |
+
if(data.ks.a){
|
11003 |
+
this.a = getProp(this,data.ks.a,1,0,this);
|
11004 |
+
}
|
11005 |
+
if(data.ks.or.k.length && data.ks.or.k[0].to){
|
11006 |
+
var i,len = data.ks.or.k.length;
|
11007 |
+
for(i=0;i<len;i+=1){
|
11008 |
+
data.ks.or.k[i].to = null;
|
11009 |
+
data.ks.or.k[i].ti = null;
|
11010 |
+
}
|
11011 |
+
}
|
11012 |
+
this.or = getProp(this,data.ks.or,1,degToRads,this);
|
11013 |
+
this.or.sh = true;
|
11014 |
+
this.rx = getProp(this,data.ks.rx,0,degToRads,this);
|
11015 |
+
this.ry = getProp(this,data.ks.ry,0,degToRads,this);
|
11016 |
+
this.rz = getProp(this,data.ks.rz,0,degToRads,this);
|
11017 |
+
this.mat = new Matrix();
|
11018 |
+
this._prevMat = new Matrix();
|
11019 |
+
this._isFirstFrame = true;
|
11020 |
+
|
11021 |
+
// TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
|
11022 |
+
this.finalTransform = {
|
11023 |
+
mProp: this
|
11024 |
+
};
|
11025 |
+
}
|
11026 |
+
extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement);
|
11027 |
+
|
11028 |
+
HCameraElement.prototype.setup = function() {
|
11029 |
+
var i, len = this.comp.threeDElements.length, comp;
|
11030 |
+
for(i=0;i<len;i+=1){
|
11031 |
+
//[perspectiveElem,container]
|
11032 |
+
comp = this.comp.threeDElements[i];
|
11033 |
+
if(comp.type === '3d') {
|
11034 |
+
comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
|
11035 |
+
comp.container.style.transformOrigin = comp.container.style.mozTransformOrigin = comp.container.style.webkitTransformOrigin = "0px 0px 0px";
|
11036 |
+
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)';
|
11037 |
+
}
|
11038 |
+
}
|
11039 |
+
};
|
11040 |
+
|
11041 |
+
HCameraElement.prototype.createElements = function(){
|
11042 |
+
};
|
11043 |
+
|
11044 |
+
HCameraElement.prototype.hide = function(){
|
11045 |
+
};
|
11046 |
+
|
11047 |
+
HCameraElement.prototype.renderFrame = function(){
|
11048 |
+
var _mdf = this._isFirstFrame;
|
11049 |
+
var i, len;
|
11050 |
+
if(this.hierarchy){
|
11051 |
+
len = this.hierarchy.length;
|
11052 |
+
for(i=0;i<len;i+=1){
|
11053 |
+
_mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
|
11054 |
+
}
|
11055 |
+
}
|
11056 |
+
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)) {
|
11057 |
+
this.mat.reset();
|
11058 |
+
|
11059 |
+
if(this.hierarchy){
|
11060 |
+
var mat;
|
11061 |
+
len = this.hierarchy.length - 1;
|
11062 |
+
for (i = len; i >= 0; i -= 1) {
|
11063 |
+
var mTransf = this.hierarchy[i].finalTransform.mProp;
|
11064 |
+
this.mat.translate(-mTransf.p.v[0],-mTransf.p.v[1],mTransf.p.v[2]);
|
11065 |
+
this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
|
11066 |
+
this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
|
11067 |
+
this.mat.scale(1/mTransf.s.v[0],1/mTransf.s.v[1],1/mTransf.s.v[2]);
|
11068 |
+
this.mat.translate(mTransf.a.v[0],mTransf.a.v[1],mTransf.a.v[2]);
|
11069 |
+
}
|
11070 |
+
}
|
11071 |
+
if (this.p) {
|
11072 |
+
this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]);
|
11073 |
+
} else {
|
11074 |
+
this.mat.translate(-this.px.v,-this.py.v,this.pz.v);
|
11075 |
+
}
|
11076 |
+
if (this.a) {
|
11077 |
+
var diffVector
|
11078 |
+
if (this.p) {
|
11079 |
+
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]];
|
11080 |
+
} else {
|
11081 |
+
diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
|
11082 |
+
}
|
11083 |
+
var mag = Math.sqrt(Math.pow(diffVector[0],2)+Math.pow(diffVector[1],2)+Math.pow(diffVector[2],2));
|
11084 |
+
//var lookDir = getNormalizedPoint(getDiffVector(this.a.v,this.p.v));
|
11085 |
+
var lookDir = [diffVector[0]/mag,diffVector[1]/mag,diffVector[2]/mag];
|
11086 |
+
var lookLengthOnXZ = Math.sqrt( lookDir[2]*lookDir[2] + lookDir[0]*lookDir[0] );
|
11087 |
+
var m_rotationX = (Math.atan2( lookDir[1], lookLengthOnXZ ));
|
11088 |
+
var m_rotationY = (Math.atan2( lookDir[0], -lookDir[2]));
|
11089 |
+
this.mat.rotateY(m_rotationY).rotateX(-m_rotationX);
|
11090 |
+
|
11091 |
+
}
|
11092 |
+
this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
|
11093 |
+
this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
|
11094 |
+
this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0);
|
11095 |
+
this.mat.translate(0,0,this.pe.v);
|
11096 |
+
|
11097 |
+
|
11098 |
+
|
11099 |
+
|
11100 |
+
var hasMatrixChanged = !this._prevMat.equals(this.mat);
|
11101 |
+
if((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
|
11102 |
+
len = this.comp.threeDElements.length;
|
11103 |
+
var comp;
|
11104 |
+
for(i=0;i<len;i+=1){
|
11105 |
+
comp = this.comp.threeDElements[i];
|
11106 |
+
if(comp.type === '3d') {
|
11107 |
+
if(hasMatrixChanged) {
|
11108 |
+
comp.container.style.transform = comp.container.style.webkitTransform = this.mat.toCSS();
|
11109 |
+
}
|
11110 |
+
if(this.pe._mdf) {
|
11111 |
+
comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
|
11112 |
+
}
|
11113 |
+
}
|
11114 |
+
}
|
11115 |
+
this.mat.clone(this._prevMat);
|
11116 |
+
}
|
11117 |
+
}
|
11118 |
+
this._isFirstFrame = false;
|
11119 |
+
};
|
11120 |
+
|
11121 |
+
HCameraElement.prototype.prepareFrame = function(num) {
|
11122 |
+
this.prepareProperties(num, true);
|
11123 |
+
};
|
11124 |
+
|
11125 |
+
HCameraElement.prototype.destroy = function(){
|
11126 |
+
};
|
11127 |
+
HCameraElement.prototype.getBaseElement = function(){return null;};
|
11128 |
+
function HEffects() {
|
11129 |
+
}
|
11130 |
+
HEffects.prototype.renderFrame = function(){};
|
11131 |
+
var animationManager = (function(){
|
11132 |
+
var moduleOb = {};
|
11133 |
+
var registeredAnimations = [];
|
11134 |
+
var initTime = 0;
|
11135 |
+
var len = 0;
|
11136 |
+
var playingAnimationsNum = 0;
|
11137 |
+
var _stopped = true;
|
11138 |
+
var _isFrozen = false;
|
11139 |
+
|
11140 |
+
function removeElement(ev){
|
11141 |
+
var i = 0;
|
11142 |
+
var animItem = ev.target;
|
11143 |
+
while(i<len) {
|
11144 |
+
if (registeredAnimations[i].animation === animItem) {
|
11145 |
+
registeredAnimations.splice(i, 1);
|
11146 |
+
i -= 1;
|
11147 |
+
len -= 1;
|
11148 |
+
if(!animItem.isPaused){
|
11149 |
+
subtractPlayingCount();
|
11150 |
+
}
|
11151 |
+
}
|
11152 |
+
i += 1;
|
11153 |
+
}
|
11154 |
+
}
|
11155 |
+
|
11156 |
+
function registerAnimation(element, animationData){
|
11157 |
+
if(!element){
|
11158 |
+
return null;
|
11159 |
+
}
|
11160 |
+
var i=0;
|
11161 |
+
while(i<len){
|
11162 |
+
if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
|
11163 |
+
return registeredAnimations[i].animation;
|
11164 |
+
}
|
11165 |
+
i+=1;
|
11166 |
+
}
|
11167 |
+
var animItem = new AnimationItem();
|
11168 |
+
setupAnimation(animItem, element);
|
11169 |
+
animItem.setData(element, animationData);
|
11170 |
+
return animItem;
|
11171 |
+
}
|
11172 |
+
|
11173 |
+
function getRegisteredAnimations() {
|
11174 |
+
var i, len = registeredAnimations.length;
|
11175 |
+
var animations = [];
|
11176 |
+
for(i = 0; i < len; i += 1) {
|
11177 |
+
animations.push(registeredAnimations[i].animation);
|
11178 |
+
}
|
11179 |
+
return animations;
|
11180 |
+
}
|
11181 |
+
|
11182 |
+
function addPlayingCount(){
|
11183 |
+
playingAnimationsNum += 1;
|
11184 |
+
activate();
|
11185 |
+
}
|
11186 |
+
|
11187 |
+
function subtractPlayingCount(){
|
11188 |
+
playingAnimationsNum -= 1;
|
11189 |
+
}
|
11190 |
+
|
11191 |
+
function setupAnimation(animItem, element){
|
11192 |
+
animItem.addEventListener('destroy',removeElement);
|
11193 |
+
animItem.addEventListener('_active',addPlayingCount);
|
11194 |
+
animItem.addEventListener('_idle',subtractPlayingCount);
|
11195 |
+
registeredAnimations.push({elem: element,animation:animItem});
|
11196 |
+
len += 1;
|
11197 |
+
}
|
11198 |
+
|
11199 |
+
function loadAnimation(params){
|
11200 |
+
var animItem = new AnimationItem();
|
11201 |
+
setupAnimation(animItem, null);
|
11202 |
+
animItem.setParams(params);
|
11203 |
+
return animItem;
|
11204 |
+
}
|
11205 |
+
|
11206 |
+
|
11207 |
+
function setSpeed(val,animation){
|
11208 |
+
var i;
|
11209 |
+
for(i=0;i<len;i+=1){
|
11210 |
+
registeredAnimations[i].animation.setSpeed(val, animation);
|
11211 |
+
}
|
11212 |
+
}
|
11213 |
+
|
11214 |
+
function setDirection(val, animation){
|
11215 |
+
var i;
|
11216 |
+
for(i=0;i<len;i+=1){
|
11217 |
+
registeredAnimations[i].animation.setDirection(val, animation);
|
11218 |
+
}
|
11219 |
+
}
|
11220 |
+
|
11221 |
+
function play(animation){
|
11222 |
+
var i;
|
11223 |
+
for(i=0;i<len;i+=1){
|
11224 |
+
registeredAnimations[i].animation.play(animation);
|
11225 |
+
}
|
11226 |
+
}
|
11227 |
+
function resume(nowTime) {
|
11228 |
+
var elapsedTime = nowTime - initTime;
|
11229 |
+
var i;
|
11230 |
+
for(i=0;i<len;i+=1){
|
11231 |
+
registeredAnimations[i].animation.advanceTime(elapsedTime);
|
11232 |
+
}
|
11233 |
+
initTime = nowTime;
|
11234 |
+
if(playingAnimationsNum && !_isFrozen) {
|
11235 |
+
window.requestAnimationFrame(resume);
|
11236 |
+
} else {
|
11237 |
+
_stopped = true;
|
11238 |
+
}
|
11239 |
+
}
|
11240 |
+
|
11241 |
+
function first(nowTime){
|
11242 |
+
initTime = nowTime;
|
11243 |
+
window.requestAnimationFrame(resume);
|
11244 |
+
}
|
11245 |
+
|
11246 |
+
function pause(animation) {
|
11247 |
+
var i;
|
11248 |
+
for(i=0;i<len;i+=1){
|
11249 |
+
registeredAnimations[i].animation.pause(animation);
|
11250 |
+
}
|
11251 |
+
}
|
11252 |
+
|
11253 |
+
function goToAndStop(value,isFrame,animation) {
|
11254 |
+
var i;
|
11255 |
+
for(i=0;i<len;i+=1){
|
11256 |
+
registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
|
11257 |
+
}
|
11258 |
+
}
|
11259 |
+
|
11260 |
+
function stop(animation) {
|
11261 |
+
var i;
|
11262 |
+
for(i=0;i<len;i+=1){
|
11263 |
+
registeredAnimations[i].animation.stop(animation);
|
11264 |
+
}
|
11265 |
+
}
|
11266 |
+
|
11267 |
+
function togglePause(animation) {
|
11268 |
+
var i;
|
11269 |
+
for(i=0;i<len;i+=1){
|
11270 |
+
registeredAnimations[i].animation.togglePause(animation);
|
11271 |
+
}
|
11272 |
+
}
|
11273 |
+
|
11274 |
+
function destroy(animation) {
|
11275 |
+
var i;
|
11276 |
+
for(i=(len-1);i>=0;i-=1){
|
11277 |
+
registeredAnimations[i].animation.destroy(animation);
|
11278 |
+
}
|
11279 |
+
}
|
11280 |
+
|
11281 |
+
function searchAnimations(animationData, standalone, renderer){
|
11282 |
+
var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
|
11283 |
+
[].slice.call(document.getElementsByClassName('bodymovin')));
|
11284 |
+
var i, len = animElements.length;
|
11285 |
+
for(i=0;i<len;i+=1){
|
11286 |
+
if(renderer){
|
11287 |
+
animElements[i].setAttribute('data-bm-type',renderer);
|
11288 |
+
}
|
11289 |
+
registerAnimation(animElements[i], animationData);
|
11290 |
+
}
|
11291 |
+
if(standalone && len === 0){
|
11292 |
+
if(!renderer){
|
11293 |
+
renderer = 'svg';
|
11294 |
+
}
|
11295 |
+
var body = document.getElementsByTagName('body')[0];
|
11296 |
+
body.innerHTML = '';
|
11297 |
+
var div = createTag('div');
|
11298 |
+
div.style.width = '100%';
|
11299 |
+
div.style.height = '100%';
|
11300 |
+
div.setAttribute('data-bm-type',renderer);
|
11301 |
+
body.appendChild(div);
|
11302 |
+
registerAnimation(div, animationData);
|
11303 |
+
}
|
11304 |
+
}
|
11305 |
+
|
11306 |
+
function resize(){
|
11307 |
+
var i;
|
11308 |
+
for(i=0;i<len;i+=1){
|
11309 |
+
registeredAnimations[i].animation.resize();
|
11310 |
+
}
|
11311 |
+
}
|
11312 |
+
|
11313 |
+
function activate(){
|
11314 |
+
if(!_isFrozen && playingAnimationsNum){
|
11315 |
+
if(_stopped) {
|
11316 |
+
window.requestAnimationFrame(first);
|
11317 |
+
_stopped = false;
|
11318 |
+
}
|
11319 |
+
}
|
11320 |
+
}
|
11321 |
+
|
11322 |
+
function freeze() {
|
11323 |
+
_isFrozen = true;
|
11324 |
+
}
|
11325 |
+
|
11326 |
+
function unfreeze() {
|
11327 |
+
_isFrozen = false;
|
11328 |
+
activate();
|
11329 |
+
}
|
11330 |
+
|
11331 |
+
moduleOb.registerAnimation = registerAnimation;
|
11332 |
+
moduleOb.loadAnimation = loadAnimation;
|
11333 |
+
moduleOb.setSpeed = setSpeed;
|
11334 |
+
moduleOb.setDirection = setDirection;
|
11335 |
+
moduleOb.play = play;
|
11336 |
+
moduleOb.pause = pause;
|
11337 |
+
moduleOb.stop = stop;
|
11338 |
+
moduleOb.togglePause = togglePause;
|
11339 |
+
moduleOb.searchAnimations = searchAnimations;
|
11340 |
+
moduleOb.resize = resize;
|
11341 |
+
//moduleOb.start = start;
|
11342 |
+
moduleOb.goToAndStop = goToAndStop;
|
11343 |
+
moduleOb.destroy = destroy;
|
11344 |
+
moduleOb.freeze = freeze;
|
11345 |
+
moduleOb.unfreeze = unfreeze;
|
11346 |
+
moduleOb.getRegisteredAnimations = getRegisteredAnimations;
|
11347 |
+
return moduleOb;
|
11348 |
+
}());
|
11349 |
+
|
11350 |
+
var AnimationItem = function () {
|
11351 |
+
this._cbs = [];
|
11352 |
+
this.name = '';
|
11353 |
+
this.path = '';
|
11354 |
+
this.isLoaded = false;
|
11355 |
+
this.currentFrame = 0;
|
11356 |
+
this.currentRawFrame = 0;
|
11357 |
+
this.firstFrame = 0;
|
11358 |
+
this.totalFrames = 0;
|
11359 |
+
this.frameRate = 0;
|
11360 |
+
this.frameMult = 0;
|
11361 |
+
this.playSpeed = 1;
|
11362 |
+
this.playDirection = 1;
|
11363 |
+
this.playCount = 0;
|
11364 |
+
this.animationData = {};
|
11365 |
+
this.assets = [];
|
11366 |
+
this.isPaused = true;
|
11367 |
+
this.autoplay = false;
|
11368 |
+
this.loop = true;
|
11369 |
+
this.renderer = null;
|
11370 |
+
this.animationID = createElementID();
|
11371 |
+
this.assetsPath = '';
|
11372 |
+
this.timeCompleted = 0;
|
11373 |
+
this.segmentPos = 0;
|
11374 |
+
this.subframeEnabled = subframeEnabled;
|
11375 |
+
this.segments = [];
|
11376 |
+
this._idle = true;
|
11377 |
+
this._completedLoop = false;
|
11378 |
+
this.projectInterface = ProjectInterface();
|
11379 |
+
this.imagePreloader = new ImagePreloader();
|
11380 |
+
};
|
11381 |
+
|
11382 |
+
extendPrototype([BaseEvent], AnimationItem);
|
11383 |
+
|
11384 |
+
AnimationItem.prototype.setParams = function(params) {
|
11385 |
+
if(params.context){
|
11386 |
+
this.context = params.context;
|
11387 |
+
}
|
11388 |
+
if(params.wrapper || params.container){
|
11389 |
+
this.wrapper = params.wrapper || params.container;
|
11390 |
+
}
|
11391 |
+
var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
|
11392 |
+
switch(animType){
|
11393 |
+
case 'canvas':
|
11394 |
+
this.renderer = new CanvasRenderer(this, params.rendererSettings);
|
11395 |
+
break;
|
11396 |
+
case 'svg':
|
11397 |
+
this.renderer = new SVGRenderer(this, params.rendererSettings);
|
11398 |
+
break;
|
11399 |
+
default:
|
11400 |
+
this.renderer = new HybridRenderer(this, params.rendererSettings);
|
11401 |
+
break;
|
11402 |
+
}
|
11403 |
+
this.renderer.setProjectInterface(this.projectInterface);
|
11404 |
+
this.animType = animType;
|
11405 |
+
|
11406 |
+
if(params.loop === '' || params.loop === null){
|
11407 |
+
}else if(params.loop === false){
|
11408 |
+
this.loop = false;
|
11409 |
+
}else if(params.loop === true){
|
11410 |
+
this.loop = true;
|
11411 |
+
}else{
|
11412 |
+
this.loop = parseInt(params.loop);
|
11413 |
+
}
|
11414 |
+
this.autoplay = 'autoplay' in params ? params.autoplay : true;
|
11415 |
+
this.name = params.name ? params.name : '';
|
11416 |
+
this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments : true;
|
11417 |
+
this.assetsPath = params.assetsPath;
|
11418 |
+
this.initialSegment = params.initialSegment;
|
11419 |
+
if (params.animationData) {
|
11420 |
+
this.configAnimation(params.animationData);
|
11421 |
+
} else if(params.path){
|
11422 |
+
|
11423 |
+
if( params.path.lastIndexOf('\\') !== -1){
|
11424 |
+
this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
|
11425 |
+
} else {
|
11426 |
+
this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
|
11427 |
+
}
|
11428 |
+
this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
|
11429 |
+
this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
|
11430 |
+
|
11431 |
+
assetLoader.load(params.path, this.configAnimation.bind(this), function() {
|
11432 |
+
this.trigger('data_failed');
|
11433 |
+
}.bind(this));
|
11434 |
+
}
|
11435 |
+
|
11436 |
+
};
|
11437 |
+
|
11438 |
+
AnimationItem.prototype.setData = function (wrapper, animationData) {
|
11439 |
+
var params = {
|
11440 |
+
wrapper: wrapper,
|
11441 |
+
animationData: animationData ? (typeof animationData === "object") ? animationData : JSON.parse(animationData) : null
|
11442 |
+
};
|
11443 |
+
var wrapperAttributes = wrapper.attributes;
|
11444 |
+
|
11445 |
+
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 : '';
|
11446 |
+
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';
|
11447 |
+
|
11448 |
+
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 : '';
|
11449 |
+
if(loop === ''){
|
11450 |
+
}else if(loop === 'false'){
|
11451 |
+
params.loop = false;
|
11452 |
+
}else if(loop === 'true'){
|
11453 |
+
params.loop = true;
|
11454 |
+
}else{
|
11455 |
+
params.loop = parseInt(loop);
|
11456 |
+
}
|
11457 |
+
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;
|
11458 |
+
params.autoplay = autoplay !== "false";
|
11459 |
+
|
11460 |
+
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 : '';
|
11461 |
+
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 : '';
|
11462 |
+
|
11463 |
+
if(prerender === 'false'){
|
11464 |
+
params.prerender = false;
|
11465 |
+
}
|
11466 |
+
this.setParams(params);
|
11467 |
+
};
|
11468 |
+
|
11469 |
+
AnimationItem.prototype.includeLayers = function(data) {
|
11470 |
+
if(data.op > this.animationData.op){
|
11471 |
+
this.animationData.op = data.op;
|
11472 |
+
this.totalFrames = Math.floor(data.op - this.animationData.ip);
|
11473 |
+
}
|
11474 |
+
var layers = this.animationData.layers;
|
11475 |
+
var i, len = layers.length;
|
11476 |
+
var newLayers = data.layers;
|
11477 |
+
var j, jLen = newLayers.length;
|
11478 |
+
for(j=0;j<jLen;j+=1){
|
11479 |
+
i = 0;
|
11480 |
+
while(i<len){
|
11481 |
+
if(layers[i].id == newLayers[j].id){
|
11482 |
+
layers[i] = newLayers[j];
|
11483 |
+
break;
|
11484 |
+
}
|
11485 |
+
i += 1;
|
11486 |
+
}
|
11487 |
+
}
|
11488 |
+
if(data.chars || data.fonts){
|
11489 |
+
this.renderer.globalData.fontManager.addChars(data.chars);
|
11490 |
+
this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
|
11491 |
+
}
|
11492 |
+
if(data.assets){
|
11493 |
+
len = data.assets.length;
|
11494 |
+
for(i = 0; i < len; i += 1){
|
11495 |
+
this.animationData.assets.push(data.assets[i]);
|
11496 |
+
}
|
11497 |
+
}
|
11498 |
+
this.animationData.__complete = false;
|
11499 |
+
dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
|
11500 |
+
this.renderer.includeLayers(data.layers);
|
11501 |
+
if(expressionsPlugin){
|
11502 |
+
expressionsPlugin.initExpressions(this);
|
11503 |
+
}
|
11504 |
+
this.loadNextSegment();
|
11505 |
+
};
|
11506 |
+
|
11507 |
+
AnimationItem.prototype.loadNextSegment = function() {
|
11508 |
+
var segments = this.animationData.segments;
|
11509 |
+
if(!segments || segments.length === 0 || !this.autoloadSegments){
|
11510 |
+
this.trigger('data_ready');
|
11511 |
+
this.timeCompleted = this.totalFrames;
|
11512 |
+
return;
|
11513 |
+
}
|
11514 |
+
var segment = segments.shift();
|
11515 |
+
this.timeCompleted = segment.time * this.frameRate;
|
11516 |
+
var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
|
11517 |
+
this.segmentPos += 1;
|
11518 |
+
assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
|
11519 |
+
this.trigger('data_failed');
|
11520 |
+
}.bind(this));
|
11521 |
+
};
|
11522 |
+
|
11523 |
+
AnimationItem.prototype.loadSegments = function() {
|
11524 |
+
var segments = this.animationData.segments;
|
11525 |
+
if(!segments) {
|
11526 |
+
this.timeCompleted = this.totalFrames;
|
11527 |
+
}
|
11528 |
+
this.loadNextSegment();
|
11529 |
+
};
|
11530 |
+
|
11531 |
+
AnimationItem.prototype.imagesLoaded = function() {
|
11532 |
+
this.trigger('loaded_images');
|
11533 |
+
this.checkLoaded()
|
11534 |
+
}
|
11535 |
+
|
11536 |
+
AnimationItem.prototype.preloadImages = function() {
|
11537 |
+
this.imagePreloader.setAssetsPath(this.assetsPath);
|
11538 |
+
this.imagePreloader.setPath(this.path);
|
11539 |
+
this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
|
11540 |
+
}
|
11541 |
+
|
11542 |
+
AnimationItem.prototype.configAnimation = function (animData) {
|
11543 |
+
if(!this.renderer){
|
11544 |
+
return;
|
11545 |
+
}
|
11546 |
+
try {
|
11547 |
+
this.animationData = animData;
|
11548 |
+
|
11549 |
+
if (this.initialSegment) {
|
11550 |
+
this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
|
11551 |
+
this.firstFrame = Math.round(this.initialSegment[0]);
|
11552 |
+
} else {
|
11553 |
+
this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
|
11554 |
+
this.firstFrame = Math.round(this.animationData.ip);
|
11555 |
+
}
|
11556 |
+
this.renderer.configAnimation(animData);
|
11557 |
+
if(!animData.assets){
|
11558 |
+
animData.assets = [];
|
11559 |
+
}
|
11560 |
+
|
11561 |
+
this.assets = this.animationData.assets;
|
11562 |
+
this.frameRate = this.animationData.fr;
|
11563 |
+
this.frameMult = this.animationData.fr / 1000;
|
11564 |
+
this.renderer.searchExtraCompositions(animData.assets);
|
11565 |
+
this.trigger('config_ready');
|
11566 |
+
this.preloadImages();
|
11567 |
+
this.loadSegments();
|
11568 |
+
this.updaFrameModifier();
|
11569 |
+
this.waitForFontsLoaded();
|
11570 |
+
} catch(error) {
|
11571 |
+
this.triggerConfigError(error);
|
11572 |
+
}
|
11573 |
+
};
|
11574 |
+
|
11575 |
+
AnimationItem.prototype.waitForFontsLoaded = function(){
|
11576 |
+
if(!this.renderer) {
|
11577 |
+
return;
|
11578 |
+
}
|
11579 |
+
if(this.renderer.globalData.fontManager.loaded()){
|
11580 |
+
this.checkLoaded();
|
11581 |
+
}else{
|
11582 |
+
setTimeout(this.waitForFontsLoaded.bind(this),20);
|
11583 |
+
}
|
11584 |
+
}
|
11585 |
+
|
11586 |
+
AnimationItem.prototype.checkLoaded = function () {
|
11587 |
+
if (!this.isLoaded && this.renderer.globalData.fontManager.loaded() && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')) {
|
11588 |
+
this.isLoaded = true;
|
11589 |
+
dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
|
11590 |
+
if(expressionsPlugin){
|
11591 |
+
expressionsPlugin.initExpressions(this);
|
11592 |
+
}
|
11593 |
+
this.renderer.initItems();
|
11594 |
+
setTimeout(function() {
|
11595 |
+
this.trigger('DOMLoaded');
|
11596 |
+
}.bind(this), 0);
|
11597 |
+
this.gotoFrame();
|
11598 |
+
if(this.autoplay){
|
11599 |
+
this.play();
|
11600 |
+
}
|
11601 |
+
}
|
11602 |
+
};
|
11603 |
+
|
11604 |
+
AnimationItem.prototype.resize = function () {
|
11605 |
+
this.renderer.updateContainerSize();
|
11606 |
+
};
|
11607 |
+
|
11608 |
+
AnimationItem.prototype.setSubframe = function(flag){
|
11609 |
+
this.subframeEnabled = flag ? true : false;
|
11610 |
+
};
|
11611 |
+
|
11612 |
+
AnimationItem.prototype.gotoFrame = function () {
|
11613 |
+
this.currentFrame = this.subframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
|
11614 |
+
|
11615 |
+
if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
|
11616 |
+
this.currentFrame = this.timeCompleted;
|
11617 |
+
}
|
11618 |
+
this.trigger('enterFrame');
|
11619 |
+
this.renderFrame();
|
11620 |
+
};
|
11621 |
+
|
11622 |
+
AnimationItem.prototype.renderFrame = function () {
|
11623 |
+
if(this.isLoaded === false){
|
11624 |
+
return;
|
11625 |
+
}
|
11626 |
+
try {
|
11627 |
+
this.renderer.renderFrame(this.currentFrame + this.firstFrame);
|
11628 |
+
} catch(error) {
|
11629 |
+
this.triggerRenderFrameError(error);
|
11630 |
+
}
|
11631 |
+
};
|
11632 |
+
|
11633 |
+
AnimationItem.prototype.play = function (name) {
|
11634 |
+
if(name && this.name != name){
|
11635 |
+
return;
|
11636 |
+
}
|
11637 |
+
if(this.isPaused === true){
|
11638 |
+
this.isPaused = false;
|
11639 |
+
if(this._idle){
|
11640 |
+
this._idle = false;
|
11641 |
+
this.trigger('_active');
|
11642 |
+
}
|
11643 |
+
}
|
11644 |
+
};
|
11645 |
+
|
11646 |
+
AnimationItem.prototype.pause = function (name) {
|
11647 |
+
if(name && this.name != name){
|
11648 |
+
return;
|
11649 |
+
}
|
11650 |
+
if(this.isPaused === false){
|
11651 |
+
this.isPaused = true;
|
11652 |
+
this._idle = true;
|
11653 |
+
this.trigger('_idle');
|
11654 |
+
}
|
11655 |
+
};
|
11656 |
+
|
11657 |
+
AnimationItem.prototype.togglePause = function (name) {
|
11658 |
+
if(name && this.name != name){
|
11659 |
+
return;
|
11660 |
+
}
|
11661 |
+
if(this.isPaused === true){
|
11662 |
+
this.play();
|
11663 |
+
}else{
|
11664 |
+
this.pause();
|
11665 |
+
}
|
11666 |
+
};
|
11667 |
+
|
11668 |
+
AnimationItem.prototype.stop = function (name) {
|
11669 |
+
if(name && this.name != name){
|
11670 |
+
return;
|
11671 |
+
}
|
11672 |
+
this.pause();
|
11673 |
+
this.playCount = 0;
|
11674 |
+
this._completedLoop = false;
|
11675 |
+
this.setCurrentRawFrameValue(0);
|
11676 |
+
};
|
11677 |
+
|
11678 |
+
AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
|
11679 |
+
if(name && this.name != name){
|
11680 |
+
return;
|
11681 |
+
}
|
11682 |
+
if(isFrame){
|
11683 |
+
this.setCurrentRawFrameValue(value);
|
11684 |
+
}else{
|
11685 |
+
this.setCurrentRawFrameValue(value * this.frameModifier);
|
11686 |
+
}
|
11687 |
+
this.pause();
|
11688 |
+
};
|
11689 |
+
|
11690 |
+
AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
|
11691 |
+
this.goToAndStop(value, isFrame, name);
|
11692 |
+
this.play();
|
11693 |
+
};
|
11694 |
+
|
11695 |
+
AnimationItem.prototype.advanceTime = function (value) {
|
11696 |
+
if (this.isPaused === true || this.isLoaded === false) {
|
11697 |
+
return;
|
11698 |
+
}
|
11699 |
+
var nextValue = this.currentRawFrame + value * this.frameModifier;
|
11700 |
+
var _isComplete = false;
|
11701 |
+
// Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
|
11702 |
+
// If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
|
11703 |
+
if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
|
11704 |
+
if (!this.loop || this.playCount === this.loop) {
|
11705 |
+
if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
|
11706 |
+
_isComplete = true;
|
11707 |
+
nextValue = this.totalFrames - 1;
|
11708 |
+
}
|
11709 |
+
} else if (nextValue >= this.totalFrames) {
|
11710 |
+
this.playCount += 1;
|
11711 |
+
if (!this.checkSegments(nextValue % this.totalFrames)) {
|
11712 |
+
this.setCurrentRawFrameValue(nextValue % this.totalFrames);
|
11713 |
+
this._completedLoop = true;
|
11714 |
+
this.trigger('loopComplete');
|
11715 |
+
}
|
11716 |
+
} else {
|
11717 |
+
this.setCurrentRawFrameValue(nextValue);
|
11718 |
+
}
|
11719 |
+
} else if(nextValue < 0) {
|
11720 |
+
if (!this.checkSegments(nextValue % this.totalFrames)) {
|
11721 |
+
if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
|
11722 |
+
this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
|
11723 |
+
if(!this._completedLoop) {
|
11724 |
+
this._completedLoop = true;
|
11725 |
+
} else {
|
11726 |
+
this.trigger('loopComplete');
|
11727 |
+
}
|
11728 |
+
} else {
|
11729 |
+
_isComplete = true;
|
11730 |
+
nextValue = 0;
|
11731 |
+
}
|
11732 |
+
}
|
11733 |
+
} else {
|
11734 |
+
this.setCurrentRawFrameValue(nextValue);
|
11735 |
+
}
|
11736 |
+
if (_isComplete) {
|
11737 |
+
this.setCurrentRawFrameValue(nextValue);
|
11738 |
+
this.pause();
|
11739 |
+
this.trigger('complete');
|
11740 |
+
}
|
11741 |
+
};
|
11742 |
+
|
11743 |
+
AnimationItem.prototype.adjustSegment = function(arr, offset){
|
11744 |
+
this.playCount = 0;
|
11745 |
+
if(arr[1] < arr[0]){
|
11746 |
+
if(this.frameModifier > 0){
|
11747 |
+
if(this.playSpeed < 0){
|
11748 |
+
this.setSpeed(-this.playSpeed);
|
11749 |
+
} else {
|
11750 |
+
this.setDirection(-1);
|
11751 |
+
}
|
11752 |
+
}
|
11753 |
+
this.timeCompleted = this.totalFrames = arr[0] - arr[1];
|
11754 |
+
this.firstFrame = arr[1];
|
11755 |
+
this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
|
11756 |
+
} else if(arr[1] > arr[0]){
|
11757 |
+
if(this.frameModifier < 0){
|
11758 |
+
if(this.playSpeed < 0){
|
11759 |
+
this.setSpeed(-this.playSpeed);
|
11760 |
+
} else {
|
11761 |
+
this.setDirection(1);
|
11762 |
+
}
|
11763 |
+
}
|
11764 |
+
this.timeCompleted = this.totalFrames = arr[1] - arr[0];
|
11765 |
+
this.firstFrame = arr[0];
|
11766 |
+
this.setCurrentRawFrameValue(0.001 + offset);
|
11767 |
+
}
|
11768 |
+
this.trigger('segmentStart');
|
11769 |
+
};
|
11770 |
+
AnimationItem.prototype.setSegment = function (init,end) {
|
11771 |
+
var pendingFrame = -1;
|
11772 |
+
if(this.isPaused) {
|
11773 |
+
if (this.currentRawFrame + this.firstFrame < init) {
|
11774 |
+
pendingFrame = init;
|
11775 |
+
} else if (this.currentRawFrame + this.firstFrame > end) {
|
11776 |
+
pendingFrame = end - init;
|
11777 |
+
}
|
11778 |
+
}
|
11779 |
+
|
11780 |
+
this.firstFrame = init;
|
11781 |
+
this.timeCompleted = this.totalFrames = end - init;
|
11782 |
+
if(pendingFrame !== -1) {
|
11783 |
+
this.goToAndStop(pendingFrame,true);
|
11784 |
+
}
|
11785 |
+
};
|
11786 |
+
|
11787 |
+
AnimationItem.prototype.playSegments = function (arr, forceFlag) {
|
11788 |
+
if (forceFlag) {
|
11789 |
+
this.segments.length = 0;
|
11790 |
+
}
|
11791 |
+
if (typeof arr[0] === 'object') {
|
11792 |
+
var i, len = arr.length;
|
11793 |
+
for (i = 0; i < len; i += 1) {
|
11794 |
+
this.segments.push(arr[i]);
|
11795 |
+
}
|
11796 |
+
} else {
|
11797 |
+
this.segments.push(arr);
|
11798 |
+
}
|
11799 |
+
if (this.segments.length && forceFlag) {
|
11800 |
+
this.adjustSegment(this.segments.shift(), 0);
|
11801 |
+
}
|
11802 |
+
if (this.isPaused) {
|
11803 |
+
this.play();
|
11804 |
+
}
|
11805 |
+
};
|
11806 |
+
|
11807 |
+
AnimationItem.prototype.resetSegments = function (forceFlag) {
|
11808 |
+
this.segments.length = 0;
|
11809 |
+
this.segments.push([this.animationData.ip,this.animationData.op]);
|
11810 |
+
//this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
|
11811 |
+
if (forceFlag) {
|
11812 |
+
this.checkSegments(0);
|
11813 |
+
}
|
11814 |
+
};
|
11815 |
+
AnimationItem.prototype.checkSegments = function(offset) {
|
11816 |
+
if (this.segments.length) {
|
11817 |
+
this.adjustSegment(this.segments.shift(), offset);
|
11818 |
+
return true;
|
11819 |
+
}
|
11820 |
+
return false;
|
11821 |
+
};
|
11822 |
+
|
11823 |
+
AnimationItem.prototype.destroy = function (name) {
|
11824 |
+
if ((name && this.name != name) || !this.renderer) {
|
11825 |
+
return;
|
11826 |
+
}
|
11827 |
+
this.renderer.destroy();
|
11828 |
+
this.imagePreloader.destroy();
|
11829 |
+
this.trigger('destroy');
|
11830 |
+
this._cbs = null;
|
11831 |
+
this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
|
11832 |
+
this.renderer = null;
|
11833 |
+
};
|
11834 |
+
|
11835 |
+
AnimationItem.prototype.setCurrentRawFrameValue = function(value){
|
11836 |
+
this.currentRawFrame = value;
|
11837 |
+
this.gotoFrame();
|
11838 |
+
};
|
11839 |
+
|
11840 |
+
AnimationItem.prototype.setSpeed = function (val) {
|
11841 |
+
this.playSpeed = val;
|
11842 |
+
this.updaFrameModifier();
|
11843 |
+
};
|
11844 |
+
|
11845 |
+
AnimationItem.prototype.setDirection = function (val) {
|
11846 |
+
this.playDirection = val < 0 ? -1 : 1;
|
11847 |
+
this.updaFrameModifier();
|
11848 |
+
};
|
11849 |
+
|
11850 |
+
AnimationItem.prototype.updaFrameModifier = function () {
|
11851 |
+
this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
|
11852 |
+
};
|
11853 |
+
|
11854 |
+
AnimationItem.prototype.getPath = function () {
|
11855 |
+
return this.path;
|
11856 |
+
};
|
11857 |
+
|
11858 |
+
AnimationItem.prototype.getAssetsPath = function (assetData) {
|
11859 |
+
var path = '';
|
11860 |
+
if(assetData.e) {
|
11861 |
+
path = assetData.p;
|
11862 |
+
} else if(this.assetsPath){
|
11863 |
+
var imagePath = assetData.p;
|
11864 |
+
if(imagePath.indexOf('images/') !== -1){
|
11865 |
+
imagePath = imagePath.split('/')[1];
|
11866 |
+
}
|
11867 |
+
path = this.assetsPath + imagePath;
|
11868 |
+
} else {
|
11869 |
+
path = this.path;
|
11870 |
+
path += assetData.u ? assetData.u : '';
|
11871 |
+
path += assetData.p;
|
11872 |
+
}
|
11873 |
+
return path;
|
11874 |
+
};
|
11875 |
+
|
11876 |
+
AnimationItem.prototype.getAssetData = function (id) {
|
11877 |
+
var i = 0, len = this.assets.length;
|
11878 |
+
while (i < len) {
|
11879 |
+
if(id == this.assets[i].id){
|
11880 |
+
return this.assets[i];
|
11881 |
+
}
|
11882 |
+
i += 1;
|
11883 |
+
}
|
11884 |
+
};
|
11885 |
+
|
11886 |
+
AnimationItem.prototype.hide = function () {
|
11887 |
+
this.renderer.hide();
|
11888 |
+
};
|
11889 |
+
|
11890 |
+
AnimationItem.prototype.show = function () {
|
11891 |
+
this.renderer.show();
|
11892 |
+
};
|
11893 |
+
|
11894 |
+
AnimationItem.prototype.getDuration = function (isFrame) {
|
11895 |
+
return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
|
11896 |
+
};
|
11897 |
+
|
11898 |
+
AnimationItem.prototype.trigger = function(name){
|
11899 |
+
if(this._cbs && this._cbs[name]){
|
11900 |
+
switch(name){
|
11901 |
+
case 'enterFrame':
|
11902 |
+
this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
|
11903 |
+
break;
|
11904 |
+
case 'loopComplete':
|
11905 |
+
this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
|
11906 |
+
break;
|
11907 |
+
case 'complete':
|
11908 |
+
this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
|
11909 |
+
break;
|
11910 |
+
case 'segmentStart':
|
11911 |
+
this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
|
11912 |
+
break;
|
11913 |
+
case 'destroy':
|
11914 |
+
this.triggerEvent(name,new BMDestroyEvent(name,this));
|
11915 |
+
break;
|
11916 |
+
default:
|
11917 |
+
this.triggerEvent(name);
|
11918 |
+
}
|
11919 |
+
}
|
11920 |
+
if(name === 'enterFrame' && this.onEnterFrame){
|
11921 |
+
this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
|
11922 |
+
}
|
11923 |
+
if(name === 'loopComplete' && this.onLoopComplete){
|
11924 |
+
this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
|
11925 |
+
}
|
11926 |
+
if(name === 'complete' && this.onComplete){
|
11927 |
+
this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
|
11928 |
+
}
|
11929 |
+
if(name === 'segmentStart' && this.onSegmentStart){
|
11930 |
+
this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
|
11931 |
+
}
|
11932 |
+
if(name === 'destroy' && this.onDestroy){
|
11933 |
+
this.onDestroy.call(this,new BMDestroyEvent(name,this));
|
11934 |
+
}
|
11935 |
+
};
|
11936 |
+
|
11937 |
+
AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
|
11938 |
+
|
11939 |
+
var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
|
11940 |
+
this.triggerEvent('error', error);
|
11941 |
+
|
11942 |
+
if (this.onError) {
|
11943 |
+
this.onError.call(this, error);
|
11944 |
+
}
|
11945 |
+
}
|
11946 |
+
|
11947 |
+
AnimationItem.prototype.triggerConfigError = function(nativeError) {
|
11948 |
+
|
11949 |
+
var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
|
11950 |
+
this.triggerEvent('error', error);
|
11951 |
+
|
11952 |
+
if (this.onError) {
|
11953 |
+
this.onError.call(this, error);
|
11954 |
+
}
|
11955 |
+
}
|
11956 |
+
var Expressions = (function(){
|
11957 |
+
var ob = {};
|
11958 |
+
ob.initExpressions = initExpressions;
|
11959 |
+
|
11960 |
+
|
11961 |
+
function initExpressions(animation){
|
11962 |
+
|
11963 |
+
var stackCount = 0;
|
11964 |
+
var registers = [];
|
11965 |
+
|
11966 |
+
function pushExpression() {
|
11967 |
+
stackCount += 1;
|
11968 |
+
}
|
11969 |
+
|
11970 |
+
function popExpression() {
|
11971 |
+
stackCount -= 1;
|
11972 |
+
if (stackCount === 0) {
|
11973 |
+
releaseInstances();
|
11974 |
+
}
|
11975 |
+
}
|
11976 |
+
|
11977 |
+
function registerExpressionProperty(expression) {
|
11978 |
+
if (registers.indexOf(expression) === -1) {
|
11979 |
+
registers.push(expression)
|
11980 |
+
}
|
11981 |
+
}
|
11982 |
+
|
11983 |
+
function releaseInstances() {
|
11984 |
+
var i, len = registers.length;
|
11985 |
+
for (i = 0; i < len; i += 1) {
|
11986 |
+
registers[i].release();
|
11987 |
+
}
|
11988 |
+
registers.length = 0;
|
11989 |
+
}
|
11990 |
+
|
11991 |
+
animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
|
11992 |
+
animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
|
11993 |
+
animation.renderer.globalData.pushExpression = pushExpression;
|
11994 |
+
animation.renderer.globalData.popExpression = popExpression;
|
11995 |
+
animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
|
11996 |
+
}
|
11997 |
+
return ob;
|
11998 |
+
}());
|
11999 |
+
|
12000 |
+
expressionsPlugin = Expressions;
|
12001 |
+
|
12002 |
+
var ExpressionManager = (function(){
|
12003 |
+
'use strict';
|
12004 |
+
var ob = {};
|
12005 |
+
var Math = BMMath;
|
12006 |
+
var window = null;
|
12007 |
+
var document = null;
|
12008 |
+
|
12009 |
+
function $bm_isInstanceOfArray(arr) {
|
12010 |
+
return arr.constructor === Array || arr.constructor === Float32Array;
|
12011 |
+
}
|
12012 |
+
|
12013 |
+
function isNumerable(tOfV, v) {
|
12014 |
+
return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
|
12015 |
+
}
|
12016 |
+
|
12017 |
+
function $bm_neg(a){
|
12018 |
+
var tOfA = typeof a;
|
12019 |
+
if(tOfA === 'number' || tOfA === 'boolean' || a instanceof Number ){
|
12020 |
+
return -a;
|
12021 |
+
}
|
12022 |
+
if($bm_isInstanceOfArray(a)){
|
12023 |
+
var i, lenA = a.length;
|
12024 |
+
var retArr = [];
|
12025 |
+
for(i=0;i<lenA;i+=1){
|
12026 |
+
retArr[i] = -a[i];
|
12027 |
+
}
|
12028 |
+
return retArr;
|
12029 |
+
}
|
12030 |
+
if (a.propType) {
|
12031 |
+
return a.v;
|
12032 |
+
}
|
12033 |
+
}
|
12034 |
+
|
12035 |
+
var easeInBez = BezierFactory.getBezierEasing(0.333,0,.833,.833, 'easeIn').get;
|
12036 |
+
var easeOutBez = BezierFactory.getBezierEasing(0.167,0.167,.667,1, 'easeOut').get;
|
12037 |
+
var easeInOutBez = BezierFactory.getBezierEasing(.33,0,.667,1, 'easeInOut').get;
|
12038 |
+
|
12039 |
+
function sum(a,b) {
|
12040 |
+
var tOfA = typeof a;
|
12041 |
+
var tOfB = typeof b;
|
12042 |
+
if(tOfA === 'string' || tOfB === 'string'){
|
12043 |
+
return a + b;
|
12044 |
+
}
|
12045 |
+
if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
|
12046 |
+
return a + b;
|
12047 |
+
}
|
12048 |
+
if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
|
12049 |
+
a = a.slice(0);
|
12050 |
+
a[0] = a[0] + b;
|
12051 |
+
return a;
|
12052 |
+
}
|
12053 |
+
if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
|
12054 |
+
b = b.slice(0);
|
12055 |
+
b[0] = a + b[0];
|
12056 |
+
return b;
|
12057 |
+
}
|
12058 |
+
if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
|
12059 |
+
|
12060 |
+
var i = 0, lenA = a.length, lenB = b.length;
|
12061 |
+
var retArr = [];
|
12062 |
+
while(i<lenA || i < lenB){
|
12063 |
+
if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
|
12064 |
+
retArr[i] = a[i] + b[i];
|
12065 |
+
}else{
|
12066 |
+
retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
|
12067 |
+
}
|
12068 |
+
i += 1;
|
12069 |
+
}
|
12070 |
+
return retArr;
|
12071 |
+
}
|
12072 |
+
return 0;
|
12073 |
+
}
|
12074 |
+
var add = sum;
|
12075 |
+
|
12076 |
+
function sub(a,b) {
|
12077 |
+
var tOfA = typeof a;
|
12078 |
+
var tOfB = typeof b;
|
12079 |
+
if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
|
12080 |
+
if(tOfA === 'string') {
|
12081 |
+
a = parseInt(a);
|
12082 |
+
}
|
12083 |
+
if(tOfB === 'string') {
|
12084 |
+
b = parseInt(b);
|
12085 |
+
}
|
12086 |
+
return a - b;
|
12087 |
+
}
|
12088 |
+
if( $bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
|
12089 |
+
a = a.slice(0);
|
12090 |
+
a[0] = a[0] - b;
|
12091 |
+
return a;
|
12092 |
+
}
|
12093 |
+
if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
|
12094 |
+
b = b.slice(0);
|
12095 |
+
b[0] = a - b[0];
|
12096 |
+
return b;
|
12097 |
+
}
|
12098 |
+
if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
|
12099 |
+
var i = 0, lenA = a.length, lenB = b.length;
|
12100 |
+
var retArr = [];
|
12101 |
+
while(i<lenA || i < lenB){
|
12102 |
+
if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
|
12103 |
+
retArr[i] = a[i] - b[i];
|
12104 |
+
}else{
|
12105 |
+
retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
|
12106 |
+
}
|
12107 |
+
i += 1;
|
12108 |
+
}
|
12109 |
+
return retArr;
|
12110 |
+
}
|
12111 |
+
return 0;
|
12112 |
+
}
|
12113 |
+
|
12114 |
+
function mul(a,b) {
|
12115 |
+
var tOfA = typeof a;
|
12116 |
+
var tOfB = typeof b;
|
12117 |
+
var arr;
|
12118 |
+
if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
|
12119 |
+
return a * b;
|
12120 |
+
}
|
12121 |
+
|
12122 |
+
var i, len;
|
12123 |
+
if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
|
12124 |
+
len = a.length;
|
12125 |
+
arr = createTypedArray('float32', len);
|
12126 |
+
for(i=0;i<len;i+=1){
|
12127 |
+
arr[i] = a[i] * b;
|
12128 |
+
}
|
12129 |
+
return arr;
|
12130 |
+
}
|
12131 |
+
if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
|
12132 |
+
len = b.length;
|
12133 |
+
arr = createTypedArray('float32', len);
|
12134 |
+
for(i=0;i<len;i+=1){
|
12135 |
+
arr[i] = a * b[i];
|
12136 |
+
}
|
12137 |
+
return arr;
|
12138 |
+
}
|
12139 |
+
return 0;
|
12140 |
+
}
|
12141 |
+
|
12142 |
+
function div(a,b) {
|
12143 |
+
var tOfA = typeof a;
|
12144 |
+
var tOfB = typeof b;
|
12145 |
+
var arr;
|
12146 |
+
if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
|
12147 |
+
return a / b;
|
12148 |
+
}
|
12149 |
+
var i, len;
|
12150 |
+
if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
|
12151 |
+
len = a.length;
|
12152 |
+
arr = createTypedArray('float32', len);
|
12153 |
+
for(i=0;i<len;i+=1){
|
12154 |
+
arr[i] = a[i] / b;
|
12155 |
+
}
|
12156 |
+
return arr;
|
12157 |
+
}
|
12158 |
+
if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
|
12159 |
+
len = b.length;
|
12160 |
+
arr = createTypedArray('float32', len);
|
12161 |
+
for(i=0;i<len;i+=1){
|
12162 |
+
arr[i] = a / b[i];
|
12163 |
+
}
|
12164 |
+
return arr;
|
12165 |
+
}
|
12166 |
+
return 0;
|
12167 |
+
}
|
12168 |
+
function mod(a,b) {
|
12169 |
+
if(typeof a === 'string') {
|
12170 |
+
a = parseInt(a);
|
12171 |
+
}
|
12172 |
+
if(typeof b === 'string') {
|
12173 |
+
b = parseInt(b);
|
12174 |
+
}
|
12175 |
+
return a % b;
|
12176 |
+
}
|
12177 |
+
var $bm_sum = sum;
|
12178 |
+
var $bm_sub = sub;
|
12179 |
+
var $bm_mul = mul;
|
12180 |
+
var $bm_div = div;
|
12181 |
+
var $bm_mod = mod;
|
12182 |
+
|
12183 |
+
function clamp(num, min, max) {
|
12184 |
+
if(min > max){
|
12185 |
+
var mm = max;
|
12186 |
+
max = min;
|
12187 |
+
min = mm;
|
12188 |
+
}
|
12189 |
+
return Math.min(Math.max(num, min), max);
|
12190 |
+
}
|
12191 |
+
|
12192 |
+
function radiansToDegrees(val) {
|
12193 |
+
return val/degToRads;
|
12194 |
+
}
|
12195 |
+
var radians_to_degrees = radiansToDegrees;
|
12196 |
+
|
12197 |
+
function degreesToRadians(val) {
|
12198 |
+
return val*degToRads;
|
12199 |
+
}
|
12200 |
+
var degrees_to_radians = radiansToDegrees;
|
12201 |
+
|
12202 |
+
var helperLengthArray = [0,0,0,0,0,0];
|
12203 |
+
|
12204 |
+
function length(arr1, arr2) {
|
12205 |
+
if (typeof arr1 === 'number' || arr1 instanceof Number) {
|
12206 |
+
arr2 = arr2 || 0;
|
12207 |
+
return Math.abs(arr1 - arr2);
|
12208 |
+
}
|
12209 |
+
if(!arr2) {
|
12210 |
+
arr2 = helperLengthArray;
|
12211 |
+
}
|
12212 |
+
var i, len = Math.min(arr1.length, arr2.length);
|
12213 |
+
var addedLength = 0;
|
12214 |
+
for (i = 0; i < len; i += 1) {
|
12215 |
+
addedLength += Math.pow(arr2[i] - arr1[i], 2);
|
12216 |
+
}
|
12217 |
+
return Math.sqrt(addedLength);
|
12218 |
+
}
|
12219 |
+
|
12220 |
+
function normalize(vec) {
|
12221 |
+
return div(vec, length(vec));
|
12222 |
+
}
|
12223 |
+
|
12224 |
+
function rgbToHsl(val) {
|
12225 |
+
var r = val[0]; var g = val[1]; var b = val[2];
|
12226 |
+
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
12227 |
+
var h, s, l = (max + min) / 2;
|
12228 |
+
|
12229 |
+
if(max == min){
|
12230 |
+
h = s = 0; // achromatic
|
12231 |
+
}else{
|
12232 |
+
var d = max - min;
|
12233 |
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
12234 |
+
switch(max){
|
12235 |
+
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
12236 |
+
case g: h = (b - r) / d + 2; break;
|
12237 |
+
case b: h = (r - g) / d + 4; break;
|
12238 |
+
}
|
12239 |
+
h /= 6;
|
12240 |
+
}
|
12241 |
+
|
12242 |
+
return [h, s, l,val[3]];
|
12243 |
+
}
|
12244 |
+
|
12245 |
+
function hue2rgb(p, q, t){
|
12246 |
+
if(t < 0) t += 1;
|
12247 |
+
if(t > 1) t -= 1;
|
12248 |
+
if(t < 1/6) return p + (q - p) * 6 * t;
|
12249 |
+
if(t < 1/2) return q;
|
12250 |
+
if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
|
12251 |
+
return p;
|
12252 |
+
}
|
12253 |
+
|
12254 |
+
function hslToRgb(val){
|
12255 |
+
var h = val[0];
|
12256 |
+
var s = val[1];
|
12257 |
+
var l = val[2];
|
12258 |
+
|
12259 |
+
var r, g, b;
|
12260 |
+
|
12261 |
+
if(s === 0){
|
12262 |
+
r = g = b = l; // achromatic
|
12263 |
+
}else{
|
12264 |
+
|
12265 |
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
12266 |
+
var p = 2 * l - q;
|
12267 |
+
r = hue2rgb(p, q, h + 1/3);
|
12268 |
+
g = hue2rgb(p, q, h);
|
12269 |
+
b = hue2rgb(p, q, h - 1/3);
|
12270 |
+
}
|
12271 |
+
|
12272 |
+
return [r, g , b, val[3]];
|
12273 |
+
}
|
12274 |
+
|
12275 |
+
function linear(t, tMin, tMax, value1, value2){
|
12276 |
+
if(value1 === undefined || value2 === undefined){
|
12277 |
+
value1 = tMin;
|
12278 |
+
value2 = tMax;
|
12279 |
+
tMin = 0;
|
12280 |
+
tMax = 1;
|
12281 |
+
}
|
12282 |
+
if(tMax < tMin) {
|
12283 |
+
var _tMin = tMax;
|
12284 |
+
tMax = tMin;
|
12285 |
+
tMin = _tMin;
|
12286 |
+
}
|
12287 |
+
if(t <= tMin) {
|
12288 |
+
return value1;
|
12289 |
+
}else if(t >= tMax){
|
12290 |
+
return value2;
|
12291 |
+
}
|
12292 |
+
var perc = tMax === tMin ? 0 : (t-tMin)/(tMax-tMin);
|
12293 |
+
if(!value1.length){
|
12294 |
+
return value1 + (value2-value1)*perc;
|
12295 |
+
}
|
12296 |
+
var i, len = value1.length;
|
12297 |
+
var arr = createTypedArray('float32', len);
|
12298 |
+
for(i=0;i<len;i+=1){
|
12299 |
+
arr[i] = value1[i] + (value2[i]-value1[i])*perc;
|
12300 |
+
}
|
12301 |
+
return arr;
|
12302 |
+
}
|
12303 |
+
function random(min,max){
|
12304 |
+
if(max === undefined){
|
12305 |
+
if(min === undefined){
|
12306 |
+
min = 0;
|
12307 |
+
max = 1;
|
12308 |
+
} else {
|
12309 |
+
max = min;
|
12310 |
+
min = undefined;
|
12311 |
+
}
|
12312 |
+
}
|
12313 |
+
if(max.length){
|
12314 |
+
var i, len = max.length;
|
12315 |
+
if(!min){
|
12316 |
+
min = createTypedArray('float32', len);
|
12317 |
+
}
|
12318 |
+
var arr = createTypedArray('float32', len);
|
12319 |
+
var rnd = BMMath.random();
|
12320 |
+
for(i=0;i<len;i+=1){
|
12321 |
+
arr[i] = min[i] + rnd*(max[i]-min[i]);
|
12322 |
+
}
|
12323 |
+
return arr;
|
12324 |
+
}
|
12325 |
+
if(min === undefined){
|
12326 |
+
min = 0;
|
12327 |
+
}
|
12328 |
+
var rndm = BMMath.random();
|
12329 |
+
return min + rndm*(max-min);
|
12330 |
+
}
|
12331 |
+
|
12332 |
+
function createPath(points, inTangents, outTangents, closed) {
|
12333 |
+
var i, len = points.length;
|
12334 |
+
var path = shape_pool.newElement();
|
12335 |
+
path.setPathData(!!closed, len);
|
12336 |
+
var arrPlaceholder = [0,0], inVertexPoint, outVertexPoint;
|
12337 |
+
for(i = 0; i < len; i += 1) {
|
12338 |
+
inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
|
12339 |
+
outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
|
12340 |
+
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);
|
12341 |
+
}
|
12342 |
+
return path;
|
12343 |
+
}
|
12344 |
+
|
12345 |
+
function initiateExpression(elem,data,property){
|
12346 |
+
var val = data.x;
|
12347 |
+
var needsVelocity = /velocity(?![\w\d])/.test(val);
|
12348 |
+
var _needsRandom = val.indexOf('random') !== -1;
|
12349 |
+
var elemType = elem.data.ty;
|
12350 |
+
var transform,$bm_transform,content,effect;
|
12351 |
+
var thisProperty = property;
|
12352 |
+
thisProperty.valueAtTime = thisProperty.getValueAtTime;
|
12353 |
+
Object.defineProperty(thisProperty, 'value', {
|
12354 |
+
get: function() {
|
12355 |
+
return thisProperty.v
|
12356 |
+
}
|
12357 |
+
})
|
12358 |
+
elem.comp.frameDuration = 1/elem.comp.globalData.frameRate;
|
12359 |
+
elem.comp.displayStartTime = 0;
|
12360 |
+
var inPoint = elem.data.ip/elem.comp.globalData.frameRate;
|
12361 |
+
var outPoint = elem.data.op/elem.comp.globalData.frameRate;
|
12362 |
+
var width = elem.data.sw ? elem.data.sw : 0;
|
12363 |
+
var height = elem.data.sh ? elem.data.sh : 0;
|
12364 |
+
var name = elem.data.nm;
|
12365 |
+
var loopIn, loop_in, loopOut, loop_out, smooth;
|
12366 |
+
var toWorld,fromWorld,fromComp,toComp,fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp,mask,valueAtTime,velocityAtTime;
|
12367 |
+
var __expression_functions = [];
|
12368 |
+
if(data.xf) {
|
12369 |
+
var i, len = data.xf.length;
|
12370 |
+
for(i = 0; i < len; i += 1) {
|
12371 |
+
__expression_functions[i] = eval('(function(){ return ' + data.xf[i] + '}())');
|
12372 |
+
}
|
12373 |
+
}
|
12374 |
+
|
12375 |
+
var scoped_bm_rt;
|
12376 |
+
var expression_function = eval('[function _expression_function(){' + val+';scoped_bm_rt=$bm_rt}' + ']')[0];
|
12377 |
+
var numKeys = property.kf ? data.k.length : 0;
|
12378 |
+
|
12379 |
+
var active = !this.data || this.data.hd !== true;
|
12380 |
+
|
12381 |
+
var wiggle = function wiggle(freq,amp){
|
12382 |
+
var i,j, len = this.pv.length ? this.pv.length : 1;
|
12383 |
+
var addedAmps = createTypedArray('float32', len);
|
12384 |
+
freq = 5;
|
12385 |
+
var iterations = Math.floor(time*freq);
|
12386 |
+
i = 0;
|
12387 |
+
j = 0;
|
12388 |
+
while(i<iterations){
|
12389 |
+
//var rnd = BMMath.random();
|
12390 |
+
for(j=0;j<len;j+=1){
|
12391 |
+
addedAmps[j] += -amp + amp*2*BMMath.random();
|
12392 |
+
//addedAmps[j] += -amp + amp*2*rnd;
|
12393 |
+
}
|
12394 |
+
i += 1;
|
12395 |
+
}
|
12396 |
+
//var rnd2 = BMMath.random();
|
12397 |
+
var periods = time*freq;
|
12398 |
+
var perc = periods - Math.floor(periods);
|
12399 |
+
var arr = createTypedArray('float32', len);
|
12400 |
+
if(len>1){
|
12401 |
+
for(j=0;j<len;j+=1){
|
12402 |
+
arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp*2*BMMath.random())*perc;
|
12403 |
+
//arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp*2*rnd)*perc;
|
12404 |
+
//arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
|
12405 |
+
}
|
12406 |
+
return arr;
|
12407 |
+
} else {
|
12408 |
+
return this.pv + addedAmps[0] + (-amp + amp*2*BMMath.random())*perc;
|
12409 |
+
}
|
12410 |
+
}.bind(this);
|
12411 |
+
|
12412 |
+
if(thisProperty.loopIn) {
|
12413 |
+
loopIn = thisProperty.loopIn.bind(thisProperty);
|
12414 |
+
loop_in = loopIn;
|
12415 |
+
}
|
12416 |
+
|
12417 |
+
if(thisProperty.loopOut) {
|
12418 |
+
loopOut = thisProperty.loopOut.bind(thisProperty);
|
12419 |
+
loop_out = loopOut;
|
12420 |
+
}
|
12421 |
+
|
12422 |
+
if(thisProperty.smooth) {
|
12423 |
+
smooth = thisProperty.smooth.bind(thisProperty);
|
12424 |
+
}
|
12425 |
+
|
12426 |
+
function loopInDuration(type,duration){
|
12427 |
+
return loopIn(type,duration,true);
|
12428 |
+
}
|
12429 |
+
|
12430 |
+
function loopOutDuration(type,duration){
|
12431 |
+
return loopOut(type,duration,true);
|
12432 |
+
}
|
12433 |
+
|
12434 |
+
if(this.getValueAtTime) {
|
12435 |
+
valueAtTime = this.getValueAtTime.bind(this);
|
12436 |
+
}
|
12437 |
+
|
12438 |
+
if(this.getVelocityAtTime) {
|
12439 |
+
velocityAtTime = this.getVelocityAtTime.bind(this);
|
12440 |
+
}
|
12441 |
+
|
12442 |
+
var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
|
12443 |
+
|
12444 |
+
function lookAt(elem1,elem2){
|
12445 |
+
var fVec = [elem2[0]-elem1[0],elem2[1]-elem1[1],elem2[2]-elem1[2]];
|
12446 |
+
var pitch = Math.atan2(fVec[0],Math.sqrt(fVec[1]*fVec[1]+fVec[2]*fVec[2]))/degToRads;
|
12447 |
+
var yaw = -Math.atan2(fVec[1],fVec[2])/degToRads;
|
12448 |
+
return [yaw,pitch,0];
|
12449 |
+
}
|
12450 |
+
|
12451 |
+
function easeOut(t, tMin, tMax, val1, val2){
|
12452 |
+
return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
|
12453 |
+
}
|
12454 |
+
|
12455 |
+
function easeIn(t, tMin, tMax, val1, val2){
|
12456 |
+
return applyEase(easeInBez, t, tMin, tMax, val1, val2);
|
12457 |
+
}
|
12458 |
+
|
12459 |
+
function ease(t, tMin, tMax, val1, val2){
|
12460 |
+
return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
|
12461 |
+
}
|
12462 |
+
|
12463 |
+
function applyEase(fn, t, tMin, tMax, val1, val2) {
|
12464 |
+
if(val1 === undefined){
|
12465 |
+
val1 = tMin;
|
12466 |
+
val2 = tMax;
|
12467 |
+
} else {
|
12468 |
+
t = (t - tMin) / (tMax - tMin);
|
12469 |
+
}
|
12470 |
+
t = t > 1 ? 1 : t < 0 ? 0 : t;
|
12471 |
+
var mult = fn(t);
|
12472 |
+
if($bm_isInstanceOfArray(val1)) {
|
12473 |
+
var i, len = val1.length;
|
12474 |
+
var arr = createTypedArray('float32', len);
|
12475 |
+
for (i = 0; i < len; i += 1) {
|
12476 |
+
arr[i] = (val2[i] - val1[i]) * mult + val1[i];
|
12477 |
+
}
|
12478 |
+
return arr;
|
12479 |
+
} else {
|
12480 |
+
return (val2 - val1) * mult + val1;
|
12481 |
+
}
|
12482 |
+
}
|
12483 |
+
|
12484 |
+
function nearestKey(time){
|
12485 |
+
var i, len = data.k.length,index,keyTime;
|
12486 |
+
if(!data.k.length || typeof(data.k[0]) === 'number'){
|
12487 |
+
index = 0;
|
12488 |
+
keyTime = 0;
|
12489 |
+
} else {
|
12490 |
+
index = -1;
|
12491 |
+
time *= elem.comp.globalData.frameRate;
|
12492 |
+
if (time < data.k[0].t) {
|
12493 |
+
index = 1;
|
12494 |
+
keyTime = data.k[0].t;
|
12495 |
+
} else {
|
12496 |
+
for(i=0;i<len-1;i+=1){
|
12497 |
+
if(time === data.k[i].t){
|
12498 |
+
index = i + 1;
|
12499 |
+
keyTime = data.k[i].t;
|
12500 |
+
break;
|
12501 |
+
}else if(time>data.k[i].t && time<data.k[i+1].t){
|
12502 |
+
if(time-data.k[i].t > data.k[i+1].t - time){
|
12503 |
+
index = i + 2;
|
12504 |
+
keyTime = data.k[i+1].t;
|
12505 |
+
} else {
|
12506 |
+
index = i + 1;
|
12507 |
+
keyTime = data.k[i].t;
|
12508 |
+
}
|
12509 |
+
break;
|
12510 |
+
}
|
12511 |
+
}
|
12512 |
+
if(index === -1){
|
12513 |
+
index = i + 1;
|
12514 |
+
keyTime = data.k[i].t;
|
12515 |
+
}
|
12516 |
+
}
|
12517 |
+
|
12518 |
+
}
|
12519 |
+
var ob = {};
|
12520 |
+
ob.index = index;
|
12521 |
+
ob.time = keyTime/elem.comp.globalData.frameRate;
|
12522 |
+
return ob;
|
12523 |
+
}
|
12524 |
+
|
12525 |
+
function key(ind){
|
12526 |
+
var ob, i, len;
|
12527 |
+
if(!data.k.length || typeof(data.k[0]) === 'number'){
|
12528 |
+
throw new Error('The property has no keyframe at index ' + ind);
|
12529 |
+
}
|
12530 |
+
ind -= 1;
|
12531 |
+
ob = {
|
12532 |
+
time: data.k[ind].t/elem.comp.globalData.frameRate,
|
12533 |
+
value: []
|
12534 |
+
};
|
12535 |
+
var arr = data.k[ind].hasOwnProperty('s') ? data.k[ind].s : data.k[ind - 1].e;
|
12536 |
+
|
12537 |
+
len = arr.length;
|
12538 |
+
for(i=0;i<len;i+=1){
|
12539 |
+
ob[i] = arr[i];
|
12540 |
+
ob.value[i] = arr[i]
|
12541 |
+
}
|
12542 |
+
return ob;
|
12543 |
+
}
|
12544 |
+
|
12545 |
+
function framesToTime(frames, fps) {
|
12546 |
+
if (!fps) {
|
12547 |
+
fps = elem.comp.globalData.frameRate;
|
12548 |
+
}
|
12549 |
+
return frames / fps;
|
12550 |
+
}
|
12551 |
+
|
12552 |
+
function timeToFrames(t, fps) {
|
12553 |
+
if (!t && t !== 0) {
|
12554 |
+
t = time;
|
12555 |
+
}
|
12556 |
+
if (!fps) {
|
12557 |
+
fps = elem.comp.globalData.frameRate;
|
12558 |
+
}
|
12559 |
+
return t * fps;
|
12560 |
+
}
|
12561 |
+
|
12562 |
+
function seedRandom(seed){
|
12563 |
+
BMMath.seedrandom(randSeed + seed);
|
12564 |
+
}
|
12565 |
+
|
12566 |
+
function sourceRectAtTime() {
|
12567 |
+
return elem.sourceRectAtTime();
|
12568 |
+
}
|
12569 |
+
|
12570 |
+
function substring(init, end) {
|
12571 |
+
if(typeof value === 'string') {
|
12572 |
+
if(end === undefined) {
|
12573 |
+
return value.substring(init)
|
12574 |
+
}
|
12575 |
+
return value.substring(init, end)
|
12576 |
+
}
|
12577 |
+
return '';
|
12578 |
+
}
|
12579 |
+
|
12580 |
+
function substr(init, end) {
|
12581 |
+
if(typeof value === 'string') {
|
12582 |
+
if(end === undefined) {
|
12583 |
+
return value.substr(init)
|
12584 |
+
}
|
12585 |
+
return value.substr(init, end)
|
12586 |
+
}
|
12587 |
+
return '';
|
12588 |
+
}
|
12589 |
+
|
12590 |
+
function posterizeTime(framesPerSecond) {
|
12591 |
+
time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond
|
12592 |
+
value = valueAtTime(time)
|
12593 |
+
}
|
12594 |
+
|
12595 |
+
var time, velocity, value, text, textIndex, textTotal, selectorValue;
|
12596 |
+
var index = elem.data.ind;
|
12597 |
+
var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
|
12598 |
+
var parent;
|
12599 |
+
var randSeed = Math.floor(Math.random()*1000000);
|
12600 |
+
var globalData = elem.globalData;
|
12601 |
+
function executeExpression(_value) {
|
12602 |
+
// globalData.pushExpression();
|
12603 |
+
value = _value;
|
12604 |
+
if (_needsRandom) {
|
12605 |
+
seedRandom(randSeed);
|
12606 |
+
}
|
12607 |
+
if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
|
12608 |
+
return value;
|
12609 |
+
}
|
12610 |
+
if(this.propType === 'textSelector'){
|
12611 |
+
textIndex = this.textIndex;
|
12612 |
+
textTotal = this.textTotal;
|
12613 |
+
selectorValue = this.selectorValue;
|
12614 |
+
}
|
12615 |
+
if (!thisLayer) {
|
12616 |
+
text = elem.layerInterface.text;
|
12617 |
+
thisLayer = elem.layerInterface;
|
12618 |
+
thisComp = elem.comp.compInterface;
|
12619 |
+
toWorld = thisLayer.toWorld.bind(thisLayer);
|
12620 |
+
fromWorld = thisLayer.fromWorld.bind(thisLayer);
|
12621 |
+
fromComp = thisLayer.fromComp.bind(thisLayer);
|
12622 |
+
toComp = thisLayer.toComp.bind(thisLayer);
|
12623 |
+
mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
|
12624 |
+
fromCompToSurface = fromComp;
|
12625 |
+
}
|
12626 |
+
if (!transform) {
|
12627 |
+
transform = elem.layerInterface("ADBE Transform Group");
|
12628 |
+
$bm_transform = transform;
|
12629 |
+
if(transform) {
|
12630 |
+
anchorPoint = transform.anchorPoint;
|
12631 |
+
/*position = transform.position;
|
12632 |
+
rotation = transform.rotation;
|
12633 |
+
scale = transform.scale;*/
|
12634 |
+
}
|
12635 |
+
}
|
12636 |
+
|
12637 |
+
if (elemType === 4 && !content) {
|
12638 |
+
content = thisLayer("ADBE Root Vectors Group");
|
12639 |
+
}
|
12640 |
+
if (!effect) {
|
12641 |
+
effect = thisLayer(4);
|
12642 |
+
}
|
12643 |
+
hasParent = !!(elem.hierarchy && elem.hierarchy.length);
|
12644 |
+
if (hasParent && !parent) {
|
12645 |
+
parent = elem.hierarchy[0].layerInterface;
|
12646 |
+
}
|
12647 |
+
time = this.comp.renderedFrame/this.comp.globalData.frameRate;
|
12648 |
+
if (needsVelocity) {
|
12649 |
+
velocity = velocityAtTime(time);
|
12650 |
+
}
|
12651 |
+
expression_function();
|
12652 |
+
this.frameExpressionId = elem.globalData.frameId;
|
12653 |
+
|
12654 |
+
|
12655 |
+
//TODO: Check if it's possible to return on ShapeInterface the .v value
|
12656 |
+
if (scoped_bm_rt.propType === "shape") {
|
12657 |
+
scoped_bm_rt = scoped_bm_rt.v;
|
12658 |
+
}
|
12659 |
+
// globalData.popExpression();
|
12660 |
+
return scoped_bm_rt;
|
12661 |
+
}
|
12662 |
+
return executeExpression;
|
12663 |
+
}
|
12664 |
+
|
12665 |
+
ob.initiateExpression = initiateExpression;
|
12666 |
+
return ob;
|
12667 |
+
}());
|
12668 |
+
var expressionHelpers = (function(){
|
12669 |
+
|
12670 |
+
function searchExpressions(elem,data,prop){
|
12671 |
+
if(data.x){
|
12672 |
+
prop.k = true;
|
12673 |
+
prop.x = true;
|
12674 |
+
prop.initiateExpression = ExpressionManager.initiateExpression;
|
12675 |
+
prop.effectsSequence.push(prop.initiateExpression(elem,data,prop).bind(prop));
|
12676 |
+
}
|
12677 |
+
}
|
12678 |
+
|
12679 |
+
function getValueAtTime(frameNum) {
|
12680 |
+
frameNum *= this.elem.globalData.frameRate;
|
12681 |
+
frameNum -= this.offsetTime;
|
12682 |
+
if(frameNum !== this._cachingAtTime.lastFrame) {
|
12683 |
+
this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
|
12684 |
+
this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
|
12685 |
+
this._cachingAtTime.lastFrame = frameNum;
|
12686 |
+
}
|
12687 |
+
return this._cachingAtTime.value;
|
12688 |
+
|
12689 |
+
}
|
12690 |
+
|
12691 |
+
function getSpeedAtTime(frameNum) {
|
12692 |
+
var delta = -0.01;
|
12693 |
+
var v1 = this.getValueAtTime(frameNum);
|
12694 |
+
var v2 = this.getValueAtTime(frameNum + delta);
|
12695 |
+
var speed = 0;
|
12696 |
+
if(v1.length){
|
12697 |
+
var i;
|
12698 |
+
for(i=0;i<v1.length;i+=1){
|
12699 |
+
speed += Math.pow(v2[i] - v1[i], 2);
|
12700 |
+
}
|
12701 |
+
speed = Math.sqrt(speed) * 100;
|
12702 |
+
} else {
|
12703 |
+
speed = 0;
|
12704 |
+
}
|
12705 |
+
return speed;
|
12706 |
+
}
|
12707 |
+
|
12708 |
+
function getVelocityAtTime(frameNum) {
|
12709 |
+
if(this.vel !== undefined){
|
12710 |
+
return this.vel;
|
12711 |
+
}
|
12712 |
+
var delta = -0.001;
|
12713 |
+
//frameNum += this.elem.data.st;
|
12714 |
+
var v1 = this.getValueAtTime(frameNum);
|
12715 |
+
var v2 = this.getValueAtTime(frameNum + delta);
|
12716 |
+
var velocity;
|
12717 |
+
if(v1.length){
|
12718 |
+
velocity = createTypedArray('float32', v1.length);
|
12719 |
+
var i;
|
12720 |
+
for(i=0;i<v1.length;i+=1){
|
12721 |
+
//removing frameRate
|
12722 |
+
//if needed, don't add it here
|
12723 |
+
//velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
|
12724 |
+
velocity[i] = (v2[i] - v1[i])/delta;
|
12725 |
+
}
|
12726 |
+
} else {
|
12727 |
+
velocity = (v2 - v1)/delta;
|
12728 |
+
}
|
12729 |
+
return velocity;
|
12730 |
+
}
|
12731 |
+
|
12732 |
+
function getStaticValueAtTime() {
|
12733 |
+
return this.pv;
|
12734 |
+
}
|
12735 |
+
|
12736 |
+
function setGroupProperty(propertyGroup){
|
12737 |
+
this.propertyGroup = propertyGroup;
|
12738 |
+
}
|
12739 |
+
|
12740 |
+
return {
|
12741 |
+
searchExpressions: searchExpressions,
|
12742 |
+
getSpeedAtTime: getSpeedAtTime,
|
12743 |
+
getVelocityAtTime: getVelocityAtTime,
|
12744 |
+
getValueAtTime: getValueAtTime,
|
12745 |
+
getStaticValueAtTime: getStaticValueAtTime,
|
12746 |
+
setGroupProperty: setGroupProperty,
|
12747 |
+
}
|
12748 |
+
}());
|
12749 |
+
(function addPropertyDecorator() {
|
12750 |
+
|
12751 |
+
function loopOut(type,duration,durationFlag){
|
12752 |
+
if(!this.k || !this.keyframes){
|
12753 |
+
return this.pv;
|
12754 |
+
}
|
12755 |
+
type = type ? type.toLowerCase() : '';
|
12756 |
+
var currentFrame = this.comp.renderedFrame;
|
12757 |
+
var keyframes = this.keyframes;
|
12758 |
+
var lastKeyFrame = keyframes[keyframes.length - 1].t;
|
12759 |
+
if(currentFrame<=lastKeyFrame){
|
12760 |
+
return this.pv;
|
12761 |
+
}else{
|
12762 |
+
var cycleDuration, firstKeyFrame;
|
12763 |
+
if(!durationFlag){
|
12764 |
+
if(!duration || duration > keyframes.length - 1){
|
12765 |
+
duration = keyframes.length - 1;
|
12766 |
+
}
|
12767 |
+
firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
|
12768 |
+
cycleDuration = lastKeyFrame - firstKeyFrame;
|
12769 |
+
} else {
|
12770 |
+
if(!duration){
|
12771 |
+
cycleDuration = Math.max(0,lastKeyFrame - this.elem.data.ip);
|
12772 |
+
} else {
|
12773 |
+
cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate*duration);
|
12774 |
+
}
|
12775 |
+
firstKeyFrame = lastKeyFrame - cycleDuration;
|
12776 |
+
}
|
12777 |
+
var i, len, ret;
|
12778 |
+
if(type === 'pingpong') {
|
12779 |
+
var iterations = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
|
12780 |
+
if(iterations % 2 !== 0){
|
12781 |
+
return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0);
|
12782 |
+
}
|
12783 |
+
} else if(type === 'offset'){
|
12784 |
+
var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
|
12785 |
+
var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
|
12786 |
+
var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0);
|
12787 |
+
var repeats = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
|
12788 |
+
if(this.pv.length){
|
12789 |
+
ret = new Array(initV.length);
|
12790 |
+
len = ret.length;
|
12791 |
+
for(i=0;i<len;i+=1){
|
12792 |
+
ret[i] = (endV[i]-initV[i])*repeats + current[i];
|
12793 |
+
}
|
12794 |
+
return ret;
|
12795 |
+
}
|
12796 |
+
return (endV-initV)*repeats + current;
|
12797 |
+
} else if(type === 'continue'){
|
12798 |
+
var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
|
12799 |
+
var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
|
12800 |
+
if(this.pv.length){
|
12801 |
+
ret = new Array(lastValue.length);
|
12802 |
+
len = ret.length;
|
12803 |
+
for(i=0;i<len;i+=1){
|
12804 |
+
ret[i] = lastValue[i] + (lastValue[i]-nextLastValue[i])*((currentFrame - lastKeyFrame)/ this.comp.globalData.frameRate)/0.0005;
|
12805 |
+
}
|
12806 |
+
return ret;
|
12807 |
+
}
|
12808 |
+
return lastValue + (lastValue-nextLastValue)*(((currentFrame - lastKeyFrame))/0.001);
|
12809 |
+
}
|
12810 |
+
return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0);
|
12811 |
+
}
|
12812 |
+
}
|
12813 |
+
|
12814 |
+
function loopIn(type,duration, durationFlag) {
|
12815 |
+
if(!this.k){
|
12816 |
+
return this.pv;
|
12817 |
+
}
|
12818 |
+
type = type ? type.toLowerCase() : '';
|
12819 |
+
var currentFrame = this.comp.renderedFrame;
|
12820 |
+
var keyframes = this.keyframes;
|
12821 |
+
var firstKeyFrame = keyframes[0].t;
|
12822 |
+
if(currentFrame>=firstKeyFrame){
|
12823 |
+
return this.pv;
|
12824 |
+
}else{
|
12825 |
+
var cycleDuration, lastKeyFrame;
|
12826 |
+
if(!durationFlag){
|
12827 |
+
if(!duration || duration > keyframes.length - 1){
|
12828 |
+
duration = keyframes.length - 1;
|
12829 |
+
}
|
12830 |
+
lastKeyFrame = keyframes[duration].t;
|
12831 |
+
cycleDuration = lastKeyFrame - firstKeyFrame;
|
12832 |
+
} else {
|
12833 |
+
if(!duration){
|
12834 |
+
cycleDuration = Math.max(0,this.elem.data.op - firstKeyFrame);
|
12835 |
+
} else {
|
12836 |
+
cycleDuration = Math.abs(elem.comp.globalData.frameRate*duration);
|
12837 |
+
}
|
12838 |
+
lastKeyFrame = firstKeyFrame + cycleDuration;
|
12839 |
+
}
|
12840 |
+
var i, len, ret;
|
12841 |
+
if(type === 'pingpong') {
|
12842 |
+
var iterations = Math.floor((firstKeyFrame - currentFrame)/cycleDuration);
|
12843 |
+
if(iterations % 2 === 0){
|
12844 |
+
return this.getValueAtTime((((firstKeyFrame - currentFrame)%cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0);
|
12845 |
+
}
|
12846 |
+
} else if(type === 'offset'){
|
12847 |
+
var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
|
12848 |
+
var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
|
12849 |
+
var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame)%cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0);
|
12850 |
+
var repeats = Math.floor((firstKeyFrame - currentFrame)/cycleDuration)+1;
|
12851 |
+
if(this.pv.length){
|
12852 |
+
ret = new Array(initV.length);
|
12853 |
+
len = ret.length;
|
12854 |
+
for(i=0;i<len;i+=1){
|
12855 |
+
ret[i] = current[i]-(endV[i]-initV[i])*repeats;
|
12856 |
+
}
|
12857 |
+
return ret;
|
12858 |
+
}
|
12859 |
+
return current-(endV-initV)*repeats;
|
12860 |
+
} else if(type === 'continue'){
|
12861 |
+
var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
|
12862 |
+
var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
|
12863 |
+
if(this.pv.length){
|
12864 |
+
ret = new Array(firstValue.length);
|
12865 |
+
len = ret.length;
|
12866 |
+
for(i=0;i<len;i+=1){
|
12867 |
+
ret[i] = firstValue[i] + (firstValue[i]-nextFirstValue[i])*(firstKeyFrame - currentFrame)/0.001;
|
12868 |
+
}
|
12869 |
+
return ret;
|
12870 |
+
}
|
12871 |
+
return firstValue + (firstValue-nextFirstValue)*(firstKeyFrame - currentFrame)/0.001;
|
12872 |
+
}
|
12873 |
+
return this.getValueAtTime(((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0);
|
12874 |
+
}
|
12875 |
+
}
|
12876 |
+
|
12877 |
+
function smooth(width, samples) {
|
12878 |
+
if (!this.k){
|
12879 |
+
return this.pv;
|
12880 |
+
}
|
12881 |
+
width = (width || 0.4) * 0.5;
|
12882 |
+
samples = Math.floor(samples || 5);
|
12883 |
+
if (samples <= 1) {
|
12884 |
+
return this.pv;
|
12885 |
+
}
|
12886 |
+
var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
|
12887 |
+
var initFrame = currentTime - width;
|
12888 |
+
var endFrame = currentTime + width;
|
12889 |
+
var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
|
12890 |
+
var i = 0, j = 0;
|
12891 |
+
var value;
|
12892 |
+
if (this.pv.length) {
|
12893 |
+
value = createTypedArray('float32', this.pv.length);
|
12894 |
+
} else {
|
12895 |
+
value = 0;
|
12896 |
+
}
|
12897 |
+
var sampleValue;
|
12898 |
+
while (i < samples) {
|
12899 |
+
sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
|
12900 |
+
if(this.pv.length) {
|
12901 |
+
for (j = 0; j < this.pv.length; j += 1) {
|
12902 |
+
value[j] += sampleValue[j];
|
12903 |
+
}
|
12904 |
+
} else {
|
12905 |
+
value += sampleValue;
|
12906 |
+
}
|
12907 |
+
i += 1;
|
12908 |
+
}
|
12909 |
+
if(this.pv.length) {
|
12910 |
+
for (j = 0; j < this.pv.length; j += 1) {
|
12911 |
+
value[j] /= samples;
|
12912 |
+
}
|
12913 |
+
} else {
|
12914 |
+
value /= samples;
|
12915 |
+
}
|
12916 |
+
return value;
|
12917 |
+
}
|
12918 |
+
|
12919 |
+
function getValueAtTime(frameNum) {
|
12920 |
+
frameNum *= this.elem.globalData.frameRate;
|
12921 |
+
frameNum -= this.offsetTime;
|
12922 |
+
if(frameNum !== this._cachingAtTime.lastFrame) {
|
12923 |
+
this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
|
12924 |
+
this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
|
12925 |
+
this._cachingAtTime.lastFrame = frameNum;
|
12926 |
+
}
|
12927 |
+
return this._cachingAtTime.value;
|
12928 |
+
|
12929 |
+
}
|
12930 |
+
|
12931 |
+
function getTransformValueAtTime(time) {
|
12932 |
+
console.warn('Transform at time not supported');
|
12933 |
+
}
|
12934 |
+
|
12935 |
+
function getTransformStaticValueAtTime(time) {
|
12936 |
+
|
12937 |
+
}
|
12938 |
+
|
12939 |
+
var getTransformProperty = TransformPropertyFactory.getTransformProperty;
|
12940 |
+
TransformPropertyFactory.getTransformProperty = function(elem, data, container) {
|
12941 |
+
var prop = getTransformProperty(elem, data, container);
|
12942 |
+
if(prop.dynamicProperties.length) {
|
12943 |
+
prop.getValueAtTime = getTransformValueAtTime.bind(prop);
|
12944 |
+
} else {
|
12945 |
+
prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
|
12946 |
+
}
|
12947 |
+
prop.setGroupProperty = expressionHelpers.setGroupProperty;
|
12948 |
+
return prop;
|
12949 |
+
};
|
12950 |
+
|
12951 |
+
var propertyGetProp = PropertyFactory.getProp;
|
12952 |
+
PropertyFactory.getProp = function(elem,data,type, mult, container){
|
12953 |
+
var prop = propertyGetProp(elem,data,type, mult, container);
|
12954 |
+
//prop.getVelocityAtTime = getVelocityAtTime;
|
12955 |
+
//prop.loopOut = loopOut;
|
12956 |
+
//prop.loopIn = loopIn;
|
12957 |
+
if(prop.kf){
|
12958 |
+
prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
|
12959 |
+
} else {
|
12960 |
+
prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
|
12961 |
+
}
|
12962 |
+
prop.setGroupProperty = expressionHelpers.setGroupProperty;
|
12963 |
+
prop.loopOut = loopOut;
|
12964 |
+
prop.loopIn = loopIn;
|
12965 |
+
prop.smooth = smooth;
|
12966 |
+
prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
|
12967 |
+
prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
|
12968 |
+
prop.numKeys = data.a === 1 ? data.k.length : 0;
|
12969 |
+
prop.propertyIndex = data.ix;
|
12970 |
+
var value = 0;
|
12971 |
+
if(type !== 0) {
|
12972 |
+
value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);
|
12973 |
+
}
|
12974 |
+
prop._cachingAtTime = {
|
12975 |
+
lastFrame: initialDefaultFrame,
|
12976 |
+
lastIndex: 0,
|
12977 |
+
value: value
|
12978 |
+
};
|
12979 |
+
expressionHelpers.searchExpressions(elem,data,prop);
|
12980 |
+
if(prop.k){
|
12981 |
+
container.addDynamicProperty(prop);
|
12982 |
+
}
|
12983 |
+
|
12984 |
+
return prop;
|
12985 |
+
};
|
12986 |
+
|
12987 |
+
function getShapeValueAtTime(frameNum) {
|
12988 |
+
//For now this caching object is created only when needed instead of creating it when the shape is initialized.
|
12989 |
+
if (!this._cachingAtTime) {
|
12990 |
+
this._cachingAtTime = {
|
12991 |
+
shapeValue: shape_pool.clone(this.pv),
|
12992 |
+
lastIndex: 0,
|
12993 |
+
lastTime: initialDefaultFrame
|
12994 |
+
};
|
12995 |
+
}
|
12996 |
+
|
12997 |
+
frameNum *= this.elem.globalData.frameRate;
|
12998 |
+
frameNum -= this.offsetTime;
|
12999 |
+
if(frameNum !== this._cachingAtTime.lastTime) {
|
13000 |
+
this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
|
13001 |
+
this._cachingAtTime.lastTime = frameNum;
|
13002 |
+
this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
|
13003 |
+
}
|
13004 |
+
return this._cachingAtTime.shapeValue;
|
13005 |
+
}
|
13006 |
+
|
13007 |
+
var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
|
13008 |
+
var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
|
13009 |
+
|
13010 |
+
function ShapeExpressions(){}
|
13011 |
+
ShapeExpressions.prototype = {
|
13012 |
+
vertices: function(prop, time){
|
13013 |
+
if (this.k) {
|
13014 |
+
this.getValue();
|
13015 |
+
}
|
13016 |
+
var shapePath = this.v;
|
13017 |
+
if(time !== undefined) {
|
13018 |
+
shapePath = this.getValueAtTime(time, 0);
|
13019 |
+
}
|
13020 |
+
var i, len = shapePath._length;
|
13021 |
+
var vertices = shapePath[prop];
|
13022 |
+
var points = shapePath.v;
|
13023 |
+
var arr = createSizedArray(len);
|
13024 |
+
for(i = 0; i < len; i += 1) {
|
13025 |
+
if(prop === 'i' || prop === 'o') {
|
13026 |
+
arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
|
13027 |
+
} else {
|
13028 |
+
arr[i] = [vertices[i][0], vertices[i][1]];
|
13029 |
+
}
|
13030 |
+
|
13031 |
+
}
|
13032 |
+
return arr;
|
13033 |
+
},
|
13034 |
+
points: function(time){
|
13035 |
+
return this.vertices('v', time);
|
13036 |
+
},
|
13037 |
+
inTangents: function(time){
|
13038 |
+
return this.vertices('i', time);
|
13039 |
+
},
|
13040 |
+
outTangents: function(time){
|
13041 |
+
return this.vertices('o', time);
|
13042 |
+
},
|
13043 |
+
isClosed: function(){
|
13044 |
+
return this.v.c;
|
13045 |
+
},
|
13046 |
+
pointOnPath: function(perc, time){
|
13047 |
+
var shapePath = this.v;
|
13048 |
+
if(time !== undefined) {
|
13049 |
+
shapePath = this.getValueAtTime(time, 0);
|
13050 |
+
}
|
13051 |
+
if(!this._segmentsLength) {
|
13052 |
+
this._segmentsLength = bez.getSegmentsLength(shapePath);
|
13053 |
+
}
|
13054 |
+
|
13055 |
+
var segmentsLength = this._segmentsLength;
|
13056 |
+
var lengths = segmentsLength.lengths;
|
13057 |
+
var lengthPos = segmentsLength.totalLength * perc;
|
13058 |
+
var i = 0, len = lengths.length;
|
13059 |
+
var j = 0, jLen;
|
13060 |
+
var accumulatedLength = 0, pt;
|
13061 |
+
while(i < len) {
|
13062 |
+
if(accumulatedLength + lengths[i].addedLength > lengthPos) {
|
13063 |
+
var initIndex = i;
|
13064 |
+
var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
|
13065 |
+
var segmentPerc = (lengthPos - accumulatedLength)/lengths[i].addedLength;
|
13066 |
+
pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
|
13067 |
+
break;
|
13068 |
+
} else {
|
13069 |
+
accumulatedLength += lengths[i].addedLength;
|
13070 |
+
}
|
13071 |
+
i += 1;
|
13072 |
+
}
|
13073 |
+
if(!pt){
|
13074 |
+
pt = shapePath.c ? [shapePath.v[0][0],shapePath.v[0][1]]:[shapePath.v[shapePath._length-1][0],shapePath.v[shapePath._length-1][1]];
|
13075 |
+
}
|
13076 |
+
return pt;
|
13077 |
+
},
|
13078 |
+
vectorOnPath: function(perc, time, vectorType){
|
13079 |
+
//perc doesn't use triple equality because it can be a Number object as well as a primitive.
|
13080 |
+
perc = perc == 1 ? this.v.c ? 0 : 0.999 : perc;
|
13081 |
+
var pt1 = this.pointOnPath(perc, time);
|
13082 |
+
var pt2 = this.pointOnPath(perc + 0.001, time);
|
13083 |
+
var xLength = pt2[0] - pt1[0];
|
13084 |
+
var yLength = pt2[1] - pt1[1];
|
13085 |
+
var magnitude = Math.sqrt(Math.pow(xLength,2) + Math.pow(yLength,2));
|
13086 |
+
if (magnitude === 0) {
|
13087 |
+
return [0,0];
|
13088 |
+
}
|
13089 |
+
var unitVector = vectorType === 'tangent' ? [xLength/magnitude, yLength/magnitude] : [-yLength/magnitude, xLength/magnitude];
|
13090 |
+
return unitVector;
|
13091 |
+
},
|
13092 |
+
tangentOnPath: function(perc, time){
|
13093 |
+
return this.vectorOnPath(perc, time, 'tangent');
|
13094 |
+
},
|
13095 |
+
normalOnPath: function(perc, time){
|
13096 |
+
return this.vectorOnPath(perc, time, 'normal');
|
13097 |
+
},
|
13098 |
+
setGroupProperty: expressionHelpers.setGroupProperty,
|
13099 |
+
getValueAtTime: expressionHelpers.getStaticValueAtTime
|
13100 |
+
};
|
13101 |
+
extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
|
13102 |
+
extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
|
13103 |
+
KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
|
13104 |
+
KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
|
13105 |
+
|
13106 |
+
var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
|
13107 |
+
ShapePropertyFactory.getShapeProp = function(elem,data,type, arr, trims){
|
13108 |
+
var prop = propertyGetShapeProp(elem,data,type, arr, trims);
|
13109 |
+
prop.propertyIndex = data.ix;
|
13110 |
+
prop.lock = false;
|
13111 |
+
if(type === 3){
|
13112 |
+
expressionHelpers.searchExpressions(elem,data.pt,prop);
|
13113 |
+
} else if(type === 4){
|
13114 |
+
expressionHelpers.searchExpressions(elem,data.ks,prop);
|
13115 |
+
}
|
13116 |
+
if(prop.k){
|
13117 |
+
elem.addDynamicProperty(prop);
|
13118 |
+
}
|
13119 |
+
return prop;
|
13120 |
+
};
|
13121 |
+
}());
|
13122 |
+
(function addDecorator() {
|
13123 |
+
|
13124 |
+
function searchExpressions(){
|
13125 |
+
if(this.data.d.x){
|
13126 |
+
this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this);
|
13127 |
+
this.addEffect(this.getExpressionValue.bind(this));
|
13128 |
+
return true;
|
13129 |
+
}
|
13130 |
+
}
|
13131 |
+
|
13132 |
+
TextProperty.prototype.getExpressionValue = function(currentValue, text) {
|
13133 |
+
var newValue = this.calculateExpression(text);
|
13134 |
+
if(currentValue.t !== newValue) {
|
13135 |
+
var newData = {};
|
13136 |
+
this.copyData(newData, currentValue);
|
13137 |
+
newData.t = newValue.toString();
|
13138 |
+
newData.__complete = false;
|
13139 |
+
return newData;
|
13140 |
+
}
|
13141 |
+
return currentValue;
|
13142 |
+
}
|
13143 |
+
|
13144 |
+
TextProperty.prototype.searchProperty = function(){
|
13145 |
+
|
13146 |
+
var isKeyframed = this.searchKeyframes();
|
13147 |
+
var hasExpressions = this.searchExpressions();
|
13148 |
+
this.kf = isKeyframed || hasExpressions;
|
13149 |
+
return this.kf;
|
13150 |
+
};
|
13151 |
+
|
13152 |
+
TextProperty.prototype.searchExpressions = searchExpressions;
|
13153 |
+
|
13154 |
+
}());
|
13155 |
+
var ShapeExpressionInterface = (function(){
|
13156 |
+
|
13157 |
+
function iterateElements(shapes,view, propertyGroup){
|
13158 |
+
var arr = [];
|
13159 |
+
var i, len = shapes ? shapes.length : 0;
|
13160 |
+
for(i=0;i<len;i+=1){
|
13161 |
+
if(shapes[i].ty == 'gr'){
|
13162 |
+
arr.push(groupInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13163 |
+
}else if(shapes[i].ty == 'fl'){
|
13164 |
+
arr.push(fillInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13165 |
+
}else if(shapes[i].ty == 'st'){
|
13166 |
+
arr.push(strokeInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13167 |
+
}else if(shapes[i].ty == 'tm'){
|
13168 |
+
arr.push(trimInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13169 |
+
}else if(shapes[i].ty == 'tr'){
|
13170 |
+
//arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13171 |
+
}else if(shapes[i].ty == 'el'){
|
13172 |
+
arr.push(ellipseInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13173 |
+
}else if(shapes[i].ty == 'sr'){
|
13174 |
+
arr.push(starInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13175 |
+
} else if(shapes[i].ty == 'sh'){
|
13176 |
+
arr.push(pathInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13177 |
+
} else if(shapes[i].ty == 'rc'){
|
13178 |
+
arr.push(rectInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13179 |
+
} else if(shapes[i].ty == 'rd'){
|
13180 |
+
arr.push(roundedInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13181 |
+
} else if(shapes[i].ty == 'rp'){
|
13182 |
+
arr.push(repeaterInterfaceFactory(shapes[i],view[i],propertyGroup));
|
13183 |
+
}
|
13184 |
+
}
|
13185 |
+
return arr;
|
13186 |
+
}
|
13187 |
+
|
13188 |
+
function contentsInterfaceFactory(shape,view, propertyGroup){
|
13189 |
+
var interfaces;
|
13190 |
+
var interfaceFunction = function _interfaceFunction(value){
|
13191 |
+
var i = 0, len = interfaces.length;
|
13192 |
+
while(i<len){
|
13193 |
+
if(interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value){
|
13194 |
+
return interfaces[i];
|
13195 |
+
}
|
13196 |
+
i+=1;
|
13197 |
+
}
|
13198 |
+
if(typeof value === 'number'){
|
13199 |
+
return interfaces[value-1];
|
13200 |
+
}
|
13201 |
+
};
|
13202 |
+
interfaceFunction.propertyGroup = function(val){
|
13203 |
+
if(val === 1){
|
13204 |
+
return interfaceFunction;
|
13205 |
+
} else{
|
13206 |
+
return propertyGroup(val-1);
|
13207 |
+
}
|
13208 |
+
};
|
13209 |
+
interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
|
13210 |
+
interfaceFunction.numProperties = interfaces.length;
|
13211 |
+
interfaceFunction.propertyIndex = shape.cix;
|
13212 |
+
interfaceFunction._name = shape.nm;
|
13213 |
+
|
13214 |
+
return interfaceFunction;
|
13215 |
+
}
|
13216 |
+
|
13217 |
+
function groupInterfaceFactory(shape,view, propertyGroup){
|
13218 |
+
var interfaceFunction = function _interfaceFunction(value){
|
13219 |
+
switch(value){
|
13220 |
+
case 'ADBE Vectors Group':
|
13221 |
+
case 'Contents':
|
13222 |
+
case 2:
|
13223 |
+
return interfaceFunction.content;
|
13224 |
+
//Not necessary for now. Keeping them here in case a new case appears
|
13225 |
+
//case 'ADBE Vector Transform Group':
|
13226 |
+
//case 3:
|
13227 |
+
default:
|
13228 |
+
return interfaceFunction.transform;
|
13229 |
+
}
|
13230 |
+
};
|
13231 |
+
interfaceFunction.propertyGroup = function(val){
|
13232 |
+
if(val === 1){
|
13233 |
+
return interfaceFunction;
|
13234 |
+
} else{
|
13235 |
+
return propertyGroup(val-1);
|
13236 |
+
}
|
13237 |
+
};
|
13238 |
+
var content = contentsInterfaceFactory(shape,view,interfaceFunction.propertyGroup);
|
13239 |
+
var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
|
13240 |
+
interfaceFunction.content = content;
|
13241 |
+
interfaceFunction.transform = transformInterface;
|
13242 |
+
Object.defineProperty(interfaceFunction, '_name', {
|
13243 |
+
get: function(){
|
13244 |
+
return shape.nm;
|
13245 |
+
}
|
13246 |
+
});
|
13247 |
+
//interfaceFunction.content = interfaceFunction;
|
13248 |
+
interfaceFunction.numProperties = shape.np;
|
13249 |
+
interfaceFunction.propertyIndex = shape.ix;
|
13250 |
+
interfaceFunction.nm = shape.nm;
|
13251 |
+
interfaceFunction.mn = shape.mn;
|
13252 |
+
return interfaceFunction;
|
13253 |
+
}
|
13254 |
+
|
13255 |
+
function fillInterfaceFactory(shape,view,propertyGroup){
|
13256 |
+
function interfaceFunction(val){
|
13257 |
+
if(val === 'Color' || val === 'color'){
|
13258 |
+
return interfaceFunction.color;
|
13259 |
+
} else if(val === 'Opacity' || val === 'opacity'){
|
13260 |
+
return interfaceFunction.opacity;
|
13261 |
+
}
|
13262 |
+
}
|
13263 |
+
Object.defineProperties(interfaceFunction, {
|
13264 |
+
'color': {
|
13265 |
+
get: ExpressionPropertyInterface(view.c)
|
13266 |
+
},
|
13267 |
+
'opacity': {
|
13268 |
+
get: ExpressionPropertyInterface(view.o)
|
13269 |
+
},
|
13270 |
+
'_name': { value: shape.nm },
|
13271 |
+
'mn': { value: shape.mn }
|
13272 |
+
});
|
13273 |
+
|
13274 |
+
view.c.setGroupProperty(propertyGroup);
|
13275 |
+
view.o.setGroupProperty(propertyGroup);
|
13276 |
+
return interfaceFunction;
|
13277 |
+
}
|
13278 |
+
|
13279 |
+
function strokeInterfaceFactory(shape,view,propertyGroup){
|
13280 |
+
function _propertyGroup(val){
|
13281 |
+
if(val === 1){
|
13282 |
+
return ob;
|
13283 |
+
} else{
|
13284 |
+
return propertyGroup(val-1);
|
13285 |
+
}
|
13286 |
+
}
|
13287 |
+
function _dashPropertyGroup(val){
|
13288 |
+
if(val === 1){
|
13289 |
+
return dashOb;
|
13290 |
+
} else{
|
13291 |
+
return _propertyGroup(val-1);
|
13292 |
+
}
|
13293 |
+
}
|
13294 |
+
function addPropertyToDashOb(i) {
|
13295 |
+
Object.defineProperty(dashOb, shape.d[i].nm, {
|
13296 |
+
get: ExpressionPropertyInterface(view.d.dataProps[i].p)
|
13297 |
+
});
|
13298 |
+
}
|
13299 |
+
var i, len = shape.d ? shape.d.length : 0;
|
13300 |
+
var dashOb = {};
|
13301 |
+
for (i = 0; i < len; i += 1) {
|
13302 |
+
addPropertyToDashOb(i);
|
13303 |
+
view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
|
13304 |
+
}
|
13305 |
+
|
13306 |
+
function interfaceFunction(val){
|
13307 |
+
if(val === 'Color' || val === 'color'){
|
13308 |
+
return interfaceFunction.color;
|
13309 |
+
} else if(val === 'Opacity' || val === 'opacity'){
|
13310 |
+
return interfaceFunction.opacity;
|
13311 |
+
} else if(val === 'Stroke Width' || val === 'stroke width'){
|
13312 |
+
return interfaceFunction.strokeWidth;
|
13313 |
+
}
|
13314 |
+
}
|
13315 |
+
Object.defineProperties(interfaceFunction, {
|
13316 |
+
'color': {
|
13317 |
+
get: ExpressionPropertyInterface(view.c)
|
13318 |
+
},
|
13319 |
+
'opacity': {
|
13320 |
+
get: ExpressionPropertyInterface(view.o)
|
13321 |
+
},
|
13322 |
+
'strokeWidth': {
|
13323 |
+
get: ExpressionPropertyInterface(view.w)
|
13324 |
+
},
|
13325 |
+
'dash': {
|
13326 |
+
get: function() {
|
13327 |
+
return dashOb;
|
13328 |
+
}
|
13329 |
+
},
|
13330 |
+
'_name': { value: shape.nm },
|
13331 |
+
'mn': { value: shape.mn }
|
13332 |
+
});
|
13333 |
+
|
13334 |
+
view.c.setGroupProperty(_propertyGroup);
|
13335 |
+
view.o.setGroupProperty(_propertyGroup);
|
13336 |
+
view.w.setGroupProperty(_propertyGroup);
|
13337 |
+
return interfaceFunction;
|
13338 |
+
}
|
13339 |
+
|
13340 |
+
function trimInterfaceFactory(shape,view,propertyGroup){
|
13341 |
+
function _propertyGroup(val){
|
13342 |
+
if(val == 1){
|
13343 |
+
return interfaceFunction;
|
13344 |
+
} else {
|
13345 |
+
return propertyGroup(--val);
|
13346 |
+
}
|
13347 |
+
}
|
13348 |
+
interfaceFunction.propertyIndex = shape.ix;
|
13349 |
+
|
13350 |
+
view.s.setGroupProperty(_propertyGroup);
|
13351 |
+
view.e.setGroupProperty(_propertyGroup);
|
13352 |
+
view.o.setGroupProperty(_propertyGroup);
|
13353 |
+
|
13354 |
+
function interfaceFunction(val){
|
13355 |
+
if(val === shape.e.ix || val === 'End' || val === 'end'){
|
13356 |
+
return interfaceFunction.end;
|
13357 |
+
}
|
13358 |
+
if(val === shape.s.ix){
|
13359 |
+
return interfaceFunction.start;
|
13360 |
+
}
|
13361 |
+
if(val === shape.o.ix){
|
13362 |
+
return interfaceFunction.offset;
|
13363 |
+
}
|
13364 |
+
}
|
13365 |
+
interfaceFunction.propertyIndex = shape.ix;
|
13366 |
+
interfaceFunction.propertyGroup = propertyGroup;
|
13367 |
+
|
13368 |
+
Object.defineProperties(interfaceFunction, {
|
13369 |
+
'start': {
|
13370 |
+
get: ExpressionPropertyInterface(view.s)
|
13371 |
+
},
|
13372 |
+
'end': {
|
13373 |
+
get: ExpressionPropertyInterface(view.e)
|
13374 |
+
},
|
13375 |
+
'offset': {
|
13376 |
+
get: ExpressionPropertyInterface(view.o)
|
13377 |
+
},
|
13378 |
+
'_name': { value: shape.nm }
|
13379 |
+
});
|
13380 |
+
interfaceFunction.mn = shape.mn;
|
13381 |
+
return interfaceFunction;
|
13382 |
+
}
|
13383 |
+
|
13384 |
+
function transformInterfaceFactory(shape,view,propertyGroup){
|
13385 |
+
function _propertyGroup(val){
|
13386 |
+
if(val == 1){
|
13387 |
+
return interfaceFunction;
|
13388 |
+
} else {
|
13389 |
+
return propertyGroup(--val);
|
13390 |
+
}
|
13391 |
+
}
|
13392 |
+
view.transform.mProps.o.setGroupProperty(_propertyGroup);
|
13393 |
+
view.transform.mProps.p.setGroupProperty(_propertyGroup);
|
13394 |
+
view.transform.mProps.a.setGroupProperty(_propertyGroup);
|
13395 |
+
view.transform.mProps.s.setGroupProperty(_propertyGroup);
|
13396 |
+
view.transform.mProps.r.setGroupProperty(_propertyGroup);
|
13397 |
+
if(view.transform.mProps.sk){
|
13398 |
+
view.transform.mProps.sk.setGroupProperty(_propertyGroup);
|
13399 |
+
view.transform.mProps.sa.setGroupProperty(_propertyGroup);
|
13400 |
+
}
|
13401 |
+
view.transform.op.setGroupProperty(_propertyGroup);
|
13402 |
+
|
13403 |
+
function interfaceFunction(value){
|
13404 |
+
if(shape.a.ix === value || value === 'Anchor Point'){
|
13405 |
+
return interfaceFunction.anchorPoint;
|
13406 |
+
}
|
13407 |
+
if(shape.o.ix === value || value === 'Opacity'){
|
13408 |
+
return interfaceFunction.opacity;
|
13409 |
+
}
|
13410 |
+
if(shape.p.ix === value || value === 'Position'){
|
13411 |
+
return interfaceFunction.position;
|
13412 |
+
}
|
13413 |
+
if(shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation'){
|
13414 |
+
return interfaceFunction.rotation;
|
13415 |
+
}
|
13416 |
+
if(shape.s.ix === value || value === 'Scale'){
|
13417 |
+
return interfaceFunction.scale;
|
13418 |
+
}
|
13419 |
+
if(shape.sk && shape.sk.ix === value || value === 'Skew'){
|
13420 |
+
return interfaceFunction.skew;
|
13421 |
+
}
|
13422 |
+
if(shape.sa && shape.sa.ix === value || value === 'Skew Axis'){
|
13423 |
+
return interfaceFunction.skewAxis;
|
13424 |
+
}
|
13425 |
+
|
13426 |
+
}
|
13427 |
+
Object.defineProperties(interfaceFunction, {
|
13428 |
+
'opacity': {
|
13429 |
+
get: ExpressionPropertyInterface(view.transform.mProps.o)
|
13430 |
+
},
|
13431 |
+
'position': {
|
13432 |
+
get: ExpressionPropertyInterface(view.transform.mProps.p)
|
13433 |
+
},
|
13434 |
+
'anchorPoint': {
|
13435 |
+
get: ExpressionPropertyInterface(view.transform.mProps.a)
|
13436 |
+
},
|
13437 |
+
'scale': {
|
13438 |
+
get: ExpressionPropertyInterface(view.transform.mProps.s)
|
13439 |
+
},
|
13440 |
+
'rotation': {
|
13441 |
+
get: ExpressionPropertyInterface(view.transform.mProps.r)
|
13442 |
+
},
|
13443 |
+
'skew': {
|
13444 |
+
get: ExpressionPropertyInterface(view.transform.mProps.sk)
|
13445 |
+
},
|
13446 |
+
'skewAxis': {
|
13447 |
+
get: ExpressionPropertyInterface(view.transform.mProps.sa)
|
13448 |
+
},
|
13449 |
+
'_name': { value: shape.nm }
|
13450 |
+
});
|
13451 |
+
interfaceFunction.ty = 'tr';
|
13452 |
+
interfaceFunction.mn = shape.mn;
|
13453 |
+
interfaceFunction.propertyGroup = propertyGroup;
|
13454 |
+
return interfaceFunction;
|
13455 |
+
}
|
13456 |
+
|
13457 |
+
function ellipseInterfaceFactory(shape,view,propertyGroup){
|
13458 |
+
function _propertyGroup(val){
|
13459 |
+
if(val == 1){
|
13460 |
+
return interfaceFunction;
|
13461 |
+
} else {
|
13462 |
+
return propertyGroup(--val);
|
13463 |
+
}
|
13464 |
+
}
|
13465 |
+
interfaceFunction.propertyIndex = shape.ix;
|
13466 |
+
var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
|
13467 |
+
prop.s.setGroupProperty(_propertyGroup);
|
13468 |
+
prop.p.setGroupProperty(_propertyGroup);
|
13469 |
+
function interfaceFunction(value){
|
13470 |
+
if(shape.p.ix === value){
|
13471 |
+
return interfaceFunction.position;
|
13472 |
+
}
|
13473 |
+
if(shape.s.ix === value){
|
13474 |
+
return interfaceFunction.size;
|
13475 |
+
}
|
13476 |
+
}
|
13477 |
+
|
13478 |
+
Object.defineProperties(interfaceFunction, {
|
13479 |
+
'size': {
|
13480 |
+
get: ExpressionPropertyInterface(prop.s)
|
13481 |
+
},
|
13482 |
+
'position': {
|
13483 |
+
get: ExpressionPropertyInterface(prop.p)
|
13484 |
+
},
|
13485 |
+
'_name': { value: shape.nm }
|
13486 |
+
});
|
13487 |
+
interfaceFunction.mn = shape.mn;
|
13488 |
+
return interfaceFunction;
|
13489 |
+
}
|
13490 |
+
|
13491 |
+
function starInterfaceFactory(shape,view,propertyGroup){
|
13492 |
+
function _propertyGroup(val){
|
13493 |
+
if(val == 1){
|
13494 |
+
return interfaceFunction;
|
13495 |
+
} else {
|
13496 |
+
return propertyGroup(--val);
|
13497 |
+
}
|
13498 |
+
}
|
13499 |
+
var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
|
13500 |
+
interfaceFunction.propertyIndex = shape.ix;
|
13501 |
+
prop.or.setGroupProperty(_propertyGroup);
|
13502 |
+
prop.os.setGroupProperty(_propertyGroup);
|
13503 |
+
prop.pt.setGroupProperty(_propertyGroup);
|
13504 |
+
prop.p.setGroupProperty(_propertyGroup);
|
13505 |
+
prop.r.setGroupProperty(_propertyGroup);
|
13506 |
+
if(shape.ir){
|
13507 |
+
prop.ir.setGroupProperty(_propertyGroup);
|
13508 |
+
prop.is.setGroupProperty(_propertyGroup);
|
13509 |
+
}
|
13510 |
+
|
13511 |
+
function interfaceFunction(value){
|
13512 |
+
if(shape.p.ix === value){
|
13513 |
+
return interfaceFunction.position;
|
13514 |
+
}
|
13515 |
+
if(shape.r.ix === value){
|
13516 |
+
return interfaceFunction.rotation;
|
13517 |
+
}
|
13518 |
+
if(shape.pt.ix === value){
|
13519 |
+
return interfaceFunction.points;
|
13520 |
+
}
|
13521 |
+
if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
|
13522 |
+
return interfaceFunction.outerRadius;
|
13523 |
+
}
|
13524 |
+
if(shape.os.ix === value){
|
13525 |
+
return interfaceFunction.outerRoundness;
|
13526 |
+
}
|
13527 |
+
if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
|
13528 |
+
return interfaceFunction.innerRadius;
|
13529 |
+
}
|
13530 |
+
if(shape.is && shape.is.ix === value){
|
13531 |
+
return interfaceFunction.innerRoundness;
|
13532 |
+
}
|
13533 |
+
|
13534 |
+
}
|
13535 |
+
|
13536 |
+
Object.defineProperties(interfaceFunction, {
|
13537 |
+
'position': {
|
13538 |
+
get: ExpressionPropertyInterface(prop.p)
|
13539 |
+
},
|
13540 |
+
'rotation': {
|
13541 |
+
get: ExpressionPropertyInterface(prop.r)
|
13542 |
+
},
|
13543 |
+
'points': {
|
13544 |
+
get: ExpressionPropertyInterface(prop.pt)
|
13545 |
+
},
|
13546 |
+
'outerRadius': {
|
13547 |
+
get: ExpressionPropertyInterface(prop.or)
|
13548 |
+
},
|
13549 |
+
'outerRoundness': {
|
13550 |
+
get: ExpressionPropertyInterface(prop.os)
|
13551 |
+
},
|
13552 |
+
'innerRadius': {
|
13553 |
+
get: ExpressionPropertyInterface(prop.ir)
|
13554 |
+
},
|
13555 |
+
'innerRoundness': {
|
13556 |
+
get: ExpressionPropertyInterface(prop.is)
|
13557 |
+
},
|
13558 |
+
'_name': { value: shape.nm }
|
13559 |
+
});
|
13560 |
+
interfaceFunction.mn = shape.mn;
|
13561 |
+
return interfaceFunction;
|
13562 |
+
}
|
13563 |
+
|
13564 |
+
function rectInterfaceFactory(shape,view,propertyGroup){
|
13565 |
+
function _propertyGroup(val){
|
13566 |
+
if(val == 1){
|
13567 |
+
return interfaceFunction;
|
13568 |
+
} else {
|
13569 |
+
return propertyGroup(--val);
|
13570 |
+
}
|
13571 |
+
}
|
13572 |
+
var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
|
13573 |
+
interfaceFunction.propertyIndex = shape.ix;
|
13574 |
+
prop.p.setGroupProperty(_propertyGroup);
|
13575 |
+
prop.s.setGroupProperty(_propertyGroup);
|
13576 |
+
prop.r.setGroupProperty(_propertyGroup);
|
13577 |
+
|
13578 |
+
function interfaceFunction(value){
|
13579 |
+
if(shape.p.ix === value){
|
13580 |
+
return interfaceFunction.position;
|
13581 |
+
}
|
13582 |
+
if(shape.r.ix === value){
|
13583 |
+
return interfaceFunction.roundness;
|
13584 |
+
}
|
13585 |
+
if(shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size'){
|
13586 |
+
return interfaceFunction.size;
|
13587 |
+
}
|
13588 |
+
|
13589 |
+
}
|
13590 |
+
Object.defineProperties(interfaceFunction, {
|
13591 |
+
'position': {
|
13592 |
+
get: ExpressionPropertyInterface(prop.p)
|
13593 |
+
},
|
13594 |
+
'roundness': {
|
13595 |
+
get: ExpressionPropertyInterface(prop.r)
|
13596 |
+
},
|
13597 |
+
'size': {
|
13598 |
+
get: ExpressionPropertyInterface(prop.s)
|
13599 |
+
},
|
13600 |
+
'_name': { value: shape.nm }
|
13601 |
+
});
|
13602 |
+
interfaceFunction.mn = shape.mn;
|
13603 |
+
return interfaceFunction;
|
13604 |
+
}
|
13605 |
+
|
13606 |
+
function roundedInterfaceFactory(shape,view,propertyGroup){
|
13607 |
+
function _propertyGroup(val){
|
13608 |
+
if(val == 1){
|
13609 |
+
return interfaceFunction;
|
13610 |
+
} else {
|
13611 |
+
return propertyGroup(--val);
|
13612 |
+
}
|
13613 |
+
}
|
13614 |
+
var prop = view;
|
13615 |
+
interfaceFunction.propertyIndex = shape.ix;
|
13616 |
+
prop.rd.setGroupProperty(_propertyGroup);
|
13617 |
+
|
13618 |
+
function interfaceFunction(value){
|
13619 |
+
if(shape.r.ix === value || 'Round Corners 1' === value){
|
13620 |
+
return interfaceFunction.radius;
|
13621 |
+
}
|
13622 |
+
|
13623 |
+
}
|
13624 |
+
Object.defineProperties(interfaceFunction, {
|
13625 |
+
'radius': {
|
13626 |
+
get: ExpressionPropertyInterface(prop.rd)
|
13627 |
+
},
|
13628 |
+
'_name': { value: shape.nm }
|
13629 |
+
});
|
13630 |
+
interfaceFunction.mn = shape.mn;
|
13631 |
+
return interfaceFunction;
|
13632 |
+
}
|
13633 |
+
|
13634 |
+
function repeaterInterfaceFactory(shape,view,propertyGroup){
|
13635 |
+
function _propertyGroup(val){
|
13636 |
+
if(val == 1){
|
13637 |
+
return interfaceFunction;
|
13638 |
+
} else {
|
13639 |
+
return propertyGroup(--val);
|
13640 |
+
}
|
13641 |
+
}
|
13642 |
+
var prop = view;
|
13643 |
+
interfaceFunction.propertyIndex = shape.ix;
|
13644 |
+
prop.c.setGroupProperty(_propertyGroup);
|
13645 |
+
prop.o.setGroupProperty(_propertyGroup);
|
13646 |
+
|
13647 |
+
function interfaceFunction(value){
|
13648 |
+
if(shape.c.ix === value || 'Copies' === value){
|
13649 |
+
return interfaceFunction.copies;
|
13650 |
+
} else if(shape.o.ix === value || 'Offset' === value){
|
13651 |
+
return interfaceFunction.offset;
|
13652 |
+
}
|
13653 |
+
|
13654 |
+
}
|
13655 |
+
Object.defineProperties(interfaceFunction, {
|
13656 |
+
'copies': {
|
13657 |
+
get: ExpressionPropertyInterface(prop.c)
|
13658 |
+
},
|
13659 |
+
'offset': {
|
13660 |
+
get: ExpressionPropertyInterface(prop.o)
|
13661 |
+
},
|
13662 |
+
'_name': { value: shape.nm }
|
13663 |
+
});
|
13664 |
+
interfaceFunction.mn = shape.mn;
|
13665 |
+
return interfaceFunction;
|
13666 |
+
}
|
13667 |
+
|
13668 |
+
function pathInterfaceFactory(shape,view,propertyGroup){
|
13669 |
+
var prop = view.sh;
|
13670 |
+
function _propertyGroup(val){
|
13671 |
+
if(val == 1){
|
13672 |
+
return interfaceFunction;
|
13673 |
+
} else {
|
13674 |
+
return propertyGroup(--val);
|
13675 |
+
}
|
13676 |
+
}
|
13677 |
+
prop.setGroupProperty(_propertyGroup);
|
13678 |
+
|
13679 |
+
function interfaceFunction(val){
|
13680 |
+
if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2){
|
13681 |
+
return interfaceFunction.path;
|
13682 |
+
}
|
13683 |
+
}
|
13684 |
+
Object.defineProperties(interfaceFunction, {
|
13685 |
+
'path': {
|
13686 |
+
get: function(){
|
13687 |
+
if(prop.k){
|
13688 |
+
prop.getValue();
|
13689 |
+
}
|
13690 |
+
return prop;
|
13691 |
+
}
|
13692 |
+
},
|
13693 |
+
'shape': {
|
13694 |
+
get: function(){
|
13695 |
+
if(prop.k){
|
13696 |
+
prop.getValue();
|
13697 |
+
}
|
13698 |
+
return prop;
|
13699 |
+
}
|
13700 |
+
},
|
13701 |
+
'_name': { value: shape.nm },
|
13702 |
+
'ix': { value: shape.ix },
|
13703 |
+
'propertyIndex': { value: shape.ix },
|
13704 |
+
'mn': { value: shape.mn }
|
13705 |
+
});
|
13706 |
+
return interfaceFunction;
|
13707 |
+
}
|
13708 |
+
|
13709 |
+
return function(shapes,view,propertyGroup) {
|
13710 |
+
var interfaces;
|
13711 |
+
function _interfaceFunction(value){
|
13712 |
+
if(typeof value === 'number'){
|
13713 |
+
return interfaces[value-1];
|
13714 |
+
} else {
|
13715 |
+
var i = 0, len = interfaces.length;
|
13716 |
+
while(i<len){
|
13717 |
+
if(interfaces[i]._name === value){
|
13718 |
+
return interfaces[i];
|
13719 |
+
}
|
13720 |
+
i+=1;
|
13721 |
+
}
|
13722 |
+
}
|
13723 |
+
}
|
13724 |
+
_interfaceFunction.propertyGroup = propertyGroup;
|
13725 |
+
interfaces = iterateElements(shapes, view, _interfaceFunction);
|
13726 |
+
_interfaceFunction.numProperties = interfaces.length;
|
13727 |
+
return _interfaceFunction;
|
13728 |
+
};
|
13729 |
+
}());
|
13730 |
+
|
13731 |
+
var TextExpressionInterface = (function(){
|
13732 |
+
return function(elem){
|
13733 |
+
var _prevValue, _sourceText;
|
13734 |
+
function _thisLayerFunction(){
|
13735 |
+
}
|
13736 |
+
Object.defineProperty(_thisLayerFunction, "sourceText", {
|
13737 |
+
get: function(){
|
13738 |
+
elem.textProperty.getValue()
|
13739 |
+
var stringValue = elem.textProperty.currentData.t;
|
13740 |
+
if(stringValue !== _prevValue) {
|
13741 |
+
elem.textProperty.currentData.t = _prevValue;
|
13742 |
+
_sourceText = new String(stringValue);
|
13743 |
+
//If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
|
13744 |
+
_sourceText.value = stringValue ? stringValue : new String(stringValue);
|
13745 |
+
}
|
13746 |
+
return _sourceText;
|
13747 |
+
}
|
13748 |
+
});
|
13749 |
+
return _thisLayerFunction;
|
13750 |
+
};
|
13751 |
+
}());
|
13752 |
+
var LayerExpressionInterface = (function (){
|
13753 |
+
function toWorld(arr, time){
|
13754 |
+
var toWorldMat = new Matrix();
|
13755 |
+
toWorldMat.reset();
|
13756 |
+
var transformMat;
|
13757 |
+
if(time) {
|
13758 |
+
//Todo implement value at time on transform properties
|
13759 |
+
//transformMat = this._elem.finalTransform.mProp.getValueAtTime(time);
|
13760 |
+
transformMat = this._elem.finalTransform.mProp;
|
13761 |
+
} else {
|
13762 |
+
transformMat = this._elem.finalTransform.mProp;
|
13763 |
+
}
|
13764 |
+
transformMat.applyToMatrix(toWorldMat);
|
13765 |
+
if(this._elem.hierarchy && this._elem.hierarchy.length){
|
13766 |
+
var i, len = this._elem.hierarchy.length;
|
13767 |
+
for(i=0;i<len;i+=1){
|
13768 |
+
this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
|
13769 |
+
}
|
13770 |
+
return toWorldMat.applyToPointArray(arr[0],arr[1],arr[2]||0);
|
13771 |
+
}
|
13772 |
+
return toWorldMat.applyToPointArray(arr[0],arr[1],arr[2]||0);
|
13773 |
+
}
|
13774 |
+
function fromWorld(arr, time){
|
13775 |
+
var toWorldMat = new Matrix();
|
13776 |
+
toWorldMat.reset();
|
13777 |
+
var transformMat;
|
13778 |
+
if(time) {
|
13779 |
+
//Todo implement value at time on transform properties
|
13780 |
+
//transformMat = this._elem.finalTransform.mProp.getValueAtTime(time);
|
13781 |
+
transformMat = this._elem.finalTransform.mProp;
|
13782 |
+
} else {
|
13783 |
+
transformMat = this._elem.finalTransform.mProp;
|
13784 |
+
}
|
13785 |
+
transformMat.applyToMatrix(toWorldMat);
|
13786 |
+
if(this._elem.hierarchy && this._elem.hierarchy.length){
|
13787 |
+
var i, len = this._elem.hierarchy.length;
|
13788 |
+
for(i=0;i<len;i+=1){
|
13789 |
+
this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
|
13790 |
+
}
|
13791 |
+
return toWorldMat.inversePoint(arr);
|
13792 |
+
}
|
13793 |
+
return toWorldMat.inversePoint(arr);
|
13794 |
+
}
|
13795 |
+
function fromComp(arr){
|
13796 |
+
var toWorldMat = new Matrix();
|
13797 |
+
toWorldMat.reset();
|
13798 |
+
this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
|
13799 |
+
if(this._elem.hierarchy && this._elem.hierarchy.length){
|
13800 |
+
var i, len = this._elem.hierarchy.length;
|
13801 |
+
for(i=0;i<len;i+=1){
|
13802 |
+
this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
|
13803 |
+
}
|
13804 |
+
return toWorldMat.inversePoint(arr);
|
13805 |
+
}
|
13806 |
+
return toWorldMat.inversePoint(arr);
|
13807 |
+
}
|
13808 |
+
|
13809 |
+
function sampleImage() {
|
13810 |
+
return [1,1,1,1];
|
13811 |
+
}
|
13812 |
+
|
13813 |
+
|
13814 |
+
return function(elem){
|
13815 |
+
|
13816 |
+
var transformInterface;
|
13817 |
+
|
13818 |
+
function _registerMaskInterface(maskManager){
|
13819 |
+
_thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
|
13820 |
+
}
|
13821 |
+
function _registerEffectsInterface(effects){
|
13822 |
+
_thisLayerFunction.effect = effects;
|
13823 |
+
}
|
13824 |
+
|
13825 |
+
function _thisLayerFunction(name){
|
13826 |
+
switch(name){
|
13827 |
+
case "ADBE Root Vectors Group":
|
13828 |
+
case "Contents":
|
13829 |
+
case 2:
|
13830 |
+
return _thisLayerFunction.shapeInterface;
|
13831 |
+
case 1:
|
13832 |
+
case 6:
|
13833 |
+
case "Transform":
|
13834 |
+
case "transform":
|
13835 |
+
case "ADBE Transform Group":
|
13836 |
+
return transformInterface;
|
13837 |
+
case 4:
|
13838 |
+
case "ADBE Effect Parade":
|
13839 |
+
case "effects":
|
13840 |
+
case "Effects":
|
13841 |
+
return _thisLayerFunction.effect;
|
13842 |
+
}
|
13843 |
+
}
|
13844 |
+
_thisLayerFunction.toWorld = toWorld;
|
13845 |
+
_thisLayerFunction.fromWorld = fromWorld;
|
13846 |
+
_thisLayerFunction.toComp = toWorld;
|
13847 |
+
_thisLayerFunction.fromComp = fromComp;
|
13848 |
+
_thisLayerFunction.sampleImage = sampleImage;
|
13849 |
+
_thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
|
13850 |
+
_thisLayerFunction._elem = elem;
|
13851 |
+
transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
|
13852 |
+
var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
|
13853 |
+
Object.defineProperties(_thisLayerFunction,{
|
13854 |
+
hasParent: {
|
13855 |
+
get: function(){
|
13856 |
+
return elem.hierarchy.length;
|
13857 |
+
}
|
13858 |
+
},
|
13859 |
+
parent: {
|
13860 |
+
get: function(){
|
13861 |
+
return elem.hierarchy[0].layerInterface;
|
13862 |
+
}
|
13863 |
+
},
|
13864 |
+
rotation: getDescriptor(transformInterface, 'rotation'),
|
13865 |
+
scale: getDescriptor(transformInterface, 'scale'),
|
13866 |
+
position: getDescriptor(transformInterface, 'position'),
|
13867 |
+
opacity: getDescriptor(transformInterface, 'opacity'),
|
13868 |
+
anchorPoint: anchorPointDescriptor,
|
13869 |
+
anchor_point: anchorPointDescriptor,
|
13870 |
+
transform: {
|
13871 |
+
get: function () {
|
13872 |
+
return transformInterface;
|
13873 |
+
}
|
13874 |
+
},
|
13875 |
+
active: {
|
13876 |
+
get: function(){
|
13877 |
+
return elem.isInRange;
|
13878 |
+
}
|
13879 |
+
}
|
13880 |
+
});
|
13881 |
+
|
13882 |
+
_thisLayerFunction.startTime = elem.data.st;
|
13883 |
+
_thisLayerFunction.index = elem.data.ind;
|
13884 |
+
_thisLayerFunction.source = elem.data.refId;
|
13885 |
+
_thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
|
13886 |
+
_thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
|
13887 |
+
_thisLayerFunction.inPoint = elem.data.ip/elem.comp.globalData.frameRate;
|
13888 |
+
_thisLayerFunction.outPoint = elem.data.op/elem.comp.globalData.frameRate;
|
13889 |
+
_thisLayerFunction._name = elem.data.nm;
|
13890 |
+
|
13891 |
+
_thisLayerFunction.registerMaskInterface = _registerMaskInterface;
|
13892 |
+
_thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
|
13893 |
+
return _thisLayerFunction;
|
13894 |
+
};
|
13895 |
+
}());
|
13896 |
+
|
13897 |
+
var CompExpressionInterface = (function () {
|
13898 |
+
return function(comp) {
|
13899 |
+
function _thisLayerFunction(name) {
|
13900 |
+
var i = 0, len = comp.layers.length;
|
13901 |
+
while ( i < len) {
|
13902 |
+
if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
|
13903 |
+
return comp.elements[i].layerInterface;
|
13904 |
+
}
|
13905 |
+
i += 1;
|
13906 |
+
}
|
13907 |
+
return null;
|
13908 |
+
//return {active:false};
|
13909 |
+
}
|
13910 |
+
Object.defineProperty(_thisLayerFunction, "_name", { value: comp.data.nm });
|
13911 |
+
_thisLayerFunction.layer = _thisLayerFunction;
|
13912 |
+
_thisLayerFunction.pixelAspect = 1;
|
13913 |
+
_thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
|
13914 |
+
_thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
|
13915 |
+
_thisLayerFunction.pixelAspect = 1;
|
13916 |
+
_thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
|
13917 |
+
_thisLayerFunction.displayStartTime = 0;
|
13918 |
+
_thisLayerFunction.numLayers = comp.layers.length;
|
13919 |
+
return _thisLayerFunction;
|
13920 |
+
};
|
13921 |
+
}());
|
13922 |
+
var TransformExpressionInterface = (function (){
|
13923 |
+
return function(transform){
|
13924 |
+
function _thisFunction(name){
|
13925 |
+
switch(name){
|
13926 |
+
case "scale":
|
13927 |
+
case "Scale":
|
13928 |
+
case "ADBE Scale":
|
13929 |
+
case 6:
|
13930 |
+
return _thisFunction.scale;
|
13931 |
+
case "rotation":
|
13932 |
+
case "Rotation":
|
13933 |
+
case "ADBE Rotation":
|
13934 |
+
case "ADBE Rotate Z":
|
13935 |
+
case 10:
|
13936 |
+
return _thisFunction.rotation;
|
13937 |
+
case "ADBE Rotate X":
|
13938 |
+
return _thisFunction.xRotation;
|
13939 |
+
case "ADBE Rotate Y":
|
13940 |
+
return _thisFunction.yRotation;
|
13941 |
+
case "position":
|
13942 |
+
case "Position":
|
13943 |
+
case "ADBE Position":
|
13944 |
+
case 2:
|
13945 |
+
return _thisFunction.position;
|
13946 |
+
case 'ADBE Position_0':
|
13947 |
+
return _thisFunction.xPosition;
|
13948 |
+
case 'ADBE Position_1':
|
13949 |
+
return _thisFunction.yPosition;
|
13950 |
+
case 'ADBE Position_2':
|
13951 |
+
return _thisFunction.zPosition;
|
13952 |
+
case "anchorPoint":
|
13953 |
+
case "AnchorPoint":
|
13954 |
+
case "Anchor Point":
|
13955 |
+
case "ADBE AnchorPoint":
|
13956 |
+
case 1:
|
13957 |
+
return _thisFunction.anchorPoint;
|
13958 |
+
case "opacity":
|
13959 |
+
case "Opacity":
|
13960 |
+
case 11:
|
13961 |
+
return _thisFunction.opacity;
|
13962 |
+
}
|
13963 |
+
}
|
13964 |
+
|
13965 |
+
Object.defineProperty(_thisFunction, "rotation", {
|
13966 |
+
get: ExpressionPropertyInterface(transform.r || transform.rz)
|
13967 |
+
});
|
13968 |
+
|
13969 |
+
Object.defineProperty(_thisFunction, "zRotation", {
|
13970 |
+
get: ExpressionPropertyInterface(transform.rz || transform.r)
|
13971 |
+
});
|
13972 |
+
|
13973 |
+
Object.defineProperty(_thisFunction, "xRotation", {
|
13974 |
+
get: ExpressionPropertyInterface(transform.rx)
|
13975 |
+
});
|
13976 |
+
|
13977 |
+
Object.defineProperty(_thisFunction, "yRotation", {
|
13978 |
+
get: ExpressionPropertyInterface(transform.ry)
|
13979 |
+
});
|
13980 |
+
Object.defineProperty(_thisFunction, "scale", {
|
13981 |
+
get: ExpressionPropertyInterface(transform.s)
|
13982 |
+
});
|
13983 |
+
|
13984 |
+
if(transform.p) {
|
13985 |
+
var _transformFactory = ExpressionPropertyInterface(transform.p);
|
13986 |
+
}
|
13987 |
+
Object.defineProperty(_thisFunction, "position", {
|
13988 |
+
get: function () {
|
13989 |
+
if(transform.p) {
|
13990 |
+
return _transformFactory();
|
13991 |
+
} else {
|
13992 |
+
return [transform.px.v, transform.py.v, transform.pz ? transform.pz.v : 0];
|
13993 |
+
}
|
13994 |
+
}
|
13995 |
+
});
|
13996 |
+
|
13997 |
+
Object.defineProperty(_thisFunction, "xPosition", {
|
13998 |
+
get: ExpressionPropertyInterface(transform.px)
|
13999 |
+
});
|
14000 |
+
|
14001 |
+
Object.defineProperty(_thisFunction, "yPosition", {
|
14002 |
+
get: ExpressionPropertyInterface(transform.py)
|
14003 |
+
});
|
14004 |
+
|
14005 |
+
Object.defineProperty(_thisFunction, "zPosition", {
|
14006 |
+
get: ExpressionPropertyInterface(transform.pz)
|
14007 |
+
});
|
14008 |
+
|
14009 |
+
Object.defineProperty(_thisFunction, "anchorPoint", {
|
14010 |
+
get: ExpressionPropertyInterface(transform.a)
|
14011 |
+
});
|
14012 |
+
|
14013 |
+
Object.defineProperty(_thisFunction, "opacity", {
|
14014 |
+
get: ExpressionPropertyInterface(transform.o)
|
14015 |
+
});
|
14016 |
+
|
14017 |
+
Object.defineProperty(_thisFunction, "skew", {
|
14018 |
+
get: ExpressionPropertyInterface(transform.sk)
|
14019 |
+
});
|
14020 |
+
|
14021 |
+
Object.defineProperty(_thisFunction, "skewAxis", {
|
14022 |
+
get: ExpressionPropertyInterface(transform.sa)
|
14023 |
+
});
|
14024 |
+
|
14025 |
+
Object.defineProperty(_thisFunction, "orientation", {
|
14026 |
+
get: ExpressionPropertyInterface(transform.or)
|
14027 |
+
});
|
14028 |
+
|
14029 |
+
return _thisFunction;
|
14030 |
+
};
|
14031 |
+
}());
|
14032 |
+
var ProjectInterface = (function (){
|
14033 |
+
|
14034 |
+
function registerComposition(comp){
|
14035 |
+
this.compositions.push(comp);
|
14036 |
+
}
|
14037 |
+
|
14038 |
+
return function(){
|
14039 |
+
function _thisProjectFunction(name){
|
14040 |
+
var i = 0, len = this.compositions.length;
|
14041 |
+
while(i<len){
|
14042 |
+
if(this.compositions[i].data && this.compositions[i].data.nm === name){
|
14043 |
+
if(this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
|
14044 |
+
this.compositions[i].prepareFrame(this.currentFrame);
|
14045 |
+
}
|
14046 |
+
return this.compositions[i].compInterface;
|
14047 |
+
}
|
14048 |
+
i+=1;
|
14049 |
+
}
|
14050 |
+
}
|
14051 |
+
|
14052 |
+
_thisProjectFunction.compositions = [];
|
14053 |
+
_thisProjectFunction.currentFrame = 0;
|
14054 |
+
|
14055 |
+
_thisProjectFunction.registerComposition = registerComposition;
|
14056 |
+
|
14057 |
+
|
14058 |
+
|
14059 |
+
return _thisProjectFunction;
|
14060 |
+
};
|
14061 |
+
}());
|
14062 |
+
var EffectsExpressionInterface = (function (){
|
14063 |
+
var ob = {
|
14064 |
+
createEffectsInterface: createEffectsInterface
|
14065 |
+
};
|
14066 |
+
|
14067 |
+
function createEffectsInterface(elem, propertyGroup){
|
14068 |
+
if(elem.effectsManager){
|
14069 |
+
|
14070 |
+
var effectElements = [];
|
14071 |
+
var effectsData = elem.data.ef;
|
14072 |
+
var i, len = elem.effectsManager.effectElements.length;
|
14073 |
+
for(i=0;i<len;i+=1){
|
14074 |
+
effectElements.push(createGroupInterface(effectsData[i],elem.effectsManager.effectElements[i],propertyGroup,elem));
|
14075 |
+
}
|
14076 |
+
|
14077 |
+
return function(name){
|
14078 |
+
var effects = elem.data.ef || [], i = 0, len = effects.length;
|
14079 |
+
while(i<len) {
|
14080 |
+
if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
|
14081 |
+
return effectElements[i];
|
14082 |
+
}
|
14083 |
+
i += 1;
|
14084 |
+
}
|
14085 |
+
};
|
14086 |
+
}
|
14087 |
+
}
|
14088 |
+
|
14089 |
+
function createGroupInterface(data,elements, propertyGroup, elem){
|
14090 |
+
var effectElements = [];
|
14091 |
+
var i, len = data.ef.length;
|
14092 |
+
for(i=0;i<len;i+=1){
|
14093 |
+
if(data.ef[i].ty === 5){
|
14094 |
+
effectElements.push(createGroupInterface(data.ef[i],elements.effectElements[i],elements.effectElements[i].propertyGroup, elem));
|
14095 |
+
} else {
|
14096 |
+
effectElements.push(createValueInterface(elements.effectElements[i],data.ef[i].ty, elem, _propertyGroup));
|
14097 |
+
}
|
14098 |
+
}
|
14099 |
+
|
14100 |
+
function _propertyGroup(val) {
|
14101 |
+
if(val === 1){
|
14102 |
+
return groupInterface;
|
14103 |
+
} else{
|
14104 |
+
return propertyGroup(val-1);
|
14105 |
+
}
|
14106 |
+
}
|
14107 |
+
|
14108 |
+
var groupInterface = function(name){
|
14109 |
+
var effects = data.ef, i = 0, len = effects.length;
|
14110 |
+
while(i<len) {
|
14111 |
+
if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
|
14112 |
+
if(effects[i].ty === 5){
|
14113 |
+
return effectElements[i];
|
14114 |
+
} else {
|
14115 |
+
return effectElements[i]();
|
14116 |
+
}
|
14117 |
+
}
|
14118 |
+
i += 1;
|
14119 |
+
}
|
14120 |
+
return effectElements[0]();
|
14121 |
+
};
|
14122 |
+
|
14123 |
+
groupInterface.propertyGroup = _propertyGroup;
|
14124 |
+
|
14125 |
+
if(data.mn === 'ADBE Color Control'){
|
14126 |
+
Object.defineProperty(groupInterface, 'color', {
|
14127 |
+
get: function(){
|
14128 |
+
return effectElements[0]();
|
14129 |
+
}
|
14130 |
+
});
|
14131 |
+
}
|
14132 |
+
Object.defineProperty(groupInterface, 'numProperties', {
|
14133 |
+
get: function(){
|
14134 |
+
return data.np;
|
14135 |
+
}
|
14136 |
+
});
|
14137 |
+
groupInterface.active = groupInterface.enabled = data.en !== 0;
|
14138 |
+
return groupInterface;
|
14139 |
+
}
|
14140 |
+
|
14141 |
+
function createValueInterface(element, type, elem, propertyGroup){
|
14142 |
+
var expressionProperty = ExpressionPropertyInterface(element.p);
|
14143 |
+
function interfaceFunction(){
|
14144 |
+
if(type === 10){
|
14145 |
+
return elem.comp.compInterface(element.p.v);
|
14146 |
+
}
|
14147 |
+
return expressionProperty();
|
14148 |
+
}
|
14149 |
+
|
14150 |
+
if(element.p.setGroupProperty) {
|
14151 |
+
element.p.setGroupProperty(propertyGroup);
|
14152 |
+
}
|
14153 |
+
|
14154 |
+
return interfaceFunction;
|
14155 |
+
}
|
14156 |
+
|
14157 |
+
return ob;
|
14158 |
+
|
14159 |
+
}());
|
14160 |
+
var MaskManagerInterface = (function(){
|
14161 |
+
|
14162 |
+
function MaskInterface(mask, data){
|
14163 |
+
this._mask = mask;
|
14164 |
+
this._data = data;
|
14165 |
+
}
|
14166 |
+
Object.defineProperty(MaskInterface.prototype, 'maskPath', {
|
14167 |
+
get: function(){
|
14168 |
+
if(this._mask.prop.k){
|
14169 |
+
this._mask.prop.getValue();
|
14170 |
+
}
|
14171 |
+
return this._mask.prop;
|
14172 |
+
}
|
14173 |
+
});
|
14174 |
+
Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
|
14175 |
+
get: function(){
|
14176 |
+
if(this._mask.op.k){
|
14177 |
+
this._mask.op.getValue();
|
14178 |
+
}
|
14179 |
+
return this._mask.op.v * 100;
|
14180 |
+
}
|
14181 |
+
});
|
14182 |
+
|
14183 |
+
var MaskManager = function(maskManager, elem){
|
14184 |
+
var _maskManager = maskManager;
|
14185 |
+
var _elem = elem;
|
14186 |
+
var _masksInterfaces = createSizedArray(maskManager.viewData.length);
|
14187 |
+
var i, len = maskManager.viewData.length;
|
14188 |
+
for(i = 0; i < len; i += 1) {
|
14189 |
+
_masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
|
14190 |
+
}
|
14191 |
+
|
14192 |
+
var maskFunction = function(name){
|
14193 |
+
i = 0;
|
14194 |
+
while(i<len){
|
14195 |
+
if(maskManager.masksProperties[i].nm === name){
|
14196 |
+
return _masksInterfaces[i];
|
14197 |
+
}
|
14198 |
+
i += 1;
|
14199 |
+
}
|
14200 |
+
};
|
14201 |
+
return maskFunction;
|
14202 |
+
};
|
14203 |
+
return MaskManager;
|
14204 |
+
}());
|
14205 |
+
|
14206 |
+
var ExpressionPropertyInterface = (function() {
|
14207 |
+
|
14208 |
+
var defaultUnidimensionalValue = {pv:0, v:0, mult: 1}
|
14209 |
+
var defaultMultidimensionalValue = {pv:[0,0,0], v:[0,0,0], mult: 1}
|
14210 |
+
|
14211 |
+
function completeProperty(expressionValue, property, type) {
|
14212 |
+
Object.defineProperty(expressionValue, 'velocity', {
|
14213 |
+
get: function(){
|
14214 |
+
return property.getVelocityAtTime(property.comp.currentFrame);
|
14215 |
+
}
|
14216 |
+
});
|
14217 |
+
expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
|
14218 |
+
expressionValue.key = function(pos) {
|
14219 |
+
if (!expressionValue.numKeys) {
|
14220 |
+
return 0;
|
14221 |
+
} else {
|
14222 |
+
var value = '';
|
14223 |
+
if ('s' in property.keyframes[pos-1]) {
|
14224 |
+
value = property.keyframes[pos-1].s;
|
14225 |
+
} else if ('e' in property.keyframes[pos-2]) {
|
14226 |
+
value = property.keyframes[pos-2].e;
|
14227 |
+
} else {
|
14228 |
+
value = property.keyframes[pos-2].s;
|
14229 |
+
}
|
14230 |
+
var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value);
|
14231 |
+
valueProp.time = property.keyframes[pos-1].t / property.elem.comp.globalData.frameRate;
|
14232 |
+
return valueProp;
|
14233 |
+
}
|
14234 |
+
};
|
14235 |
+
expressionValue.valueAtTime = property.getValueAtTime;
|
14236 |
+
expressionValue.speedAtTime = property.getSpeedAtTime;
|
14237 |
+
expressionValue.velocityAtTime = property.getVelocityAtTime;
|
14238 |
+
expressionValue.propertyGroup = property.propertyGroup;
|
14239 |
+
}
|
14240 |
+
|
14241 |
+
function UnidimensionalPropertyInterface(property) {
|
14242 |
+
if(!property || !('pv' in property)) {
|
14243 |
+
property = defaultUnidimensionalValue;
|
14244 |
+
}
|
14245 |
+
var mult = 1 / property.mult;
|
14246 |
+
var val = property.pv * mult;
|
14247 |
+
var expressionValue = new Number(val);
|
14248 |
+
expressionValue.value = val;
|
14249 |
+
completeProperty(expressionValue, property, 'unidimensional');
|
14250 |
+
|
14251 |
+
return function() {
|
14252 |
+
if (property.k) {
|
14253 |
+
property.getValue();
|
14254 |
+
}
|
14255 |
+
val = property.v * mult;
|
14256 |
+
if(expressionValue.value !== val) {
|
14257 |
+
expressionValue = new Number(val);
|
14258 |
+
expressionValue.value = val;
|
14259 |
+
completeProperty(expressionValue, property, 'unidimensional');
|
14260 |
+
}
|
14261 |
+
return expressionValue;
|
14262 |
+
}
|
14263 |
+
}
|
14264 |
+
|
14265 |
+
function MultidimensionalPropertyInterface(property) {
|
14266 |
+
if(!property || !('pv' in property)) {
|
14267 |
+
property = defaultMultidimensionalValue;
|
14268 |
+
}
|
14269 |
+
var mult = 1 / property.mult;
|
14270 |
+
var len = property.pv.length;
|
14271 |
+
var expressionValue = createTypedArray('float32', len);
|
14272 |
+
var arrValue = createTypedArray('float32', len);
|
14273 |
+
expressionValue.value = arrValue;
|
14274 |
+
completeProperty(expressionValue, property, 'multidimensional');
|
14275 |
+
|
14276 |
+
return function() {
|
14277 |
+
if (property.k) {
|
14278 |
+
property.getValue();
|
14279 |
+
}
|
14280 |
+
for (var i = 0; i < len; i += 1) {
|
14281 |
+
expressionValue[i] = arrValue[i] = property.v[i] * mult;
|
14282 |
+
}
|
14283 |
+
return expressionValue;
|
14284 |
+
}
|
14285 |
+
}
|
14286 |
+
|
14287 |
+
//TODO: try to avoid using this getter
|
14288 |
+
function defaultGetter() {
|
14289 |
+
return defaultUnidimensionalValue;
|
14290 |
+
}
|
14291 |
+
|
14292 |
+
return function(property) {
|
14293 |
+
if(!property) {
|
14294 |
+
return defaultGetter;
|
14295 |
+
} else if (property.propType === 'unidimensional') {
|
14296 |
+
return UnidimensionalPropertyInterface(property);
|
14297 |
+
} else {
|
14298 |
+
return MultidimensionalPropertyInterface(property);
|
14299 |
+
}
|
14300 |
+
}
|
14301 |
+
}());
|
14302 |
+
|
14303 |
+
(function(){
|
14304 |
+
|
14305 |
+
var TextExpressionSelectorProp = (function(){
|
14306 |
+
|
14307 |
+
function getValueProxy(index,total){
|
14308 |
+
this.textIndex = index+1;
|
14309 |
+
this.textTotal = total;
|
14310 |
+
this.v = this.getValue() * this.mult;
|
14311 |
+
return this.v;
|
14312 |
+
}
|
14313 |
+
|
14314 |
+
return function TextExpressionSelectorProp(elem,data){
|
14315 |
+
this.pv = 1;
|
14316 |
+
this.comp = elem.comp;
|
14317 |
+
this.elem = elem;
|
14318 |
+
this.mult = 0.01;
|
14319 |
+
this.propType = 'textSelector';
|
14320 |
+
this.textTotal = data.totalChars;
|
14321 |
+
this.selectorValue = 100;
|
14322 |
+
this.lastValue = [1,1,1];
|
14323 |
+
this.k = true;
|
14324 |
+
this.x = true;
|
14325 |
+
this.getValue = ExpressionManager.initiateExpression.bind(this)(elem,data,this);
|
14326 |
+
this.getMult = getValueProxy;
|
14327 |
+
this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
|
14328 |
+
if(this.kf){
|
14329 |
+
this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
|
14330 |
+
} else {
|
14331 |
+
this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
|
14332 |
+
}
|
14333 |
+
this.setGroupProperty = expressionHelpers.setGroupProperty;
|
14334 |
+
};
|
14335 |
+
}());
|
14336 |
+
|
14337 |
+
var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
|
14338 |
+
TextSelectorProp.getTextSelectorProp = function(elem, data,arr){
|
14339 |
+
if(data.t === 1){
|
14340 |
+
return new TextExpressionSelectorProp(elem, data,arr);
|
14341 |
+
} else {
|
14342 |
+
return propertyGetTextProp(elem,data,arr);
|
14343 |
+
}
|
14344 |
+
};
|
14345 |
+
}());
|
14346 |
+
function SliderEffect(data,elem, container){
|
14347 |
+
this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
|
14348 |
+
}
|
14349 |
+
function AngleEffect(data,elem, container){
|
14350 |
+
this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
|
14351 |
+
}
|
14352 |
+
function ColorEffect(data,elem, container){
|
14353 |
+
this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
|
14354 |
+
}
|
14355 |
+
function PointEffect(data,elem, container){
|
14356 |
+
this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
|
14357 |
+
}
|
14358 |
+
function LayerIndexEffect(data,elem, container){
|
14359 |
+
this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
|
14360 |
+
}
|
14361 |
+
function MaskIndexEffect(data,elem, container){
|
14362 |
+
this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
|
14363 |
+
}
|
14364 |
+
function CheckboxEffect(data,elem, container){
|
14365 |
+
this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
|
14366 |
+
}
|
14367 |
+
function NoValueEffect(){
|
14368 |
+
this.p = {};
|
14369 |
+
}
|
14370 |
+
function EffectsManager(){}
|
14371 |
+
function EffectsManager(data,element){
|
14372 |
+
var effects = data.ef || [];
|
14373 |
+
this.effectElements = [];
|
14374 |
+
var i,len = effects.length;
|
14375 |
+
var effectItem;
|
14376 |
+
for(i=0;i<len;i++) {
|
14377 |
+
effectItem = new GroupEffect(effects[i],element);
|
14378 |
+
this.effectElements.push(effectItem);
|
14379 |
+
}
|
14380 |
+
}
|
14381 |
+
|
14382 |
+
function GroupEffect(data,element){
|
14383 |
+
this.init(data,element);
|
14384 |
+
}
|
14385 |
+
|
14386 |
+
extendPrototype([DynamicPropertyContainer], GroupEffect);
|
14387 |
+
|
14388 |
+
GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
|
14389 |
+
|
14390 |
+
GroupEffect.prototype.init = function(data,element){
|
14391 |
+
this.data = data;
|
14392 |
+
this.effectElements = [];
|
14393 |
+
this.initDynamicPropertyContainer(element);
|
14394 |
+
var i, len = this.data.ef.length;
|
14395 |
+
var eff, effects = this.data.ef;
|
14396 |
+
for(i=0;i<len;i+=1){
|
14397 |
+
eff = null;
|
14398 |
+
switch(effects[i].ty){
|
14399 |
+
case 0:
|
14400 |
+
eff = new SliderEffect(effects[i],element,this);
|
14401 |
+
break;
|
14402 |
+
case 1:
|
14403 |
+
eff = new AngleEffect(effects[i],element,this);
|
14404 |
+
break;
|
14405 |
+
case 2:
|
14406 |
+
eff = new ColorEffect(effects[i],element,this);
|
14407 |
+
break;
|
14408 |
+
case 3:
|
14409 |
+
eff = new PointEffect(effects[i],element,this);
|
14410 |
+
break;
|
14411 |
+
case 4:
|
14412 |
+
case 7:
|
14413 |
+
eff = new CheckboxEffect(effects[i],element,this);
|
14414 |
+
break;
|
14415 |
+
case 10:
|
14416 |
+
eff = new LayerIndexEffect(effects[i],element,this);
|
14417 |
+
break;
|
14418 |
+
case 11:
|
14419 |
+
eff = new MaskIndexEffect(effects[i],element,this);
|
14420 |
+
break;
|
14421 |
+
case 5:
|
14422 |
+
eff = new EffectsManager(effects[i],element,this);
|
14423 |
+
break;
|
14424 |
+
//case 6:
|
14425 |
+
default:
|
14426 |
+
eff = new NoValueEffect(effects[i],element,this);
|
14427 |
+
break;
|
14428 |
+
}
|
14429 |
+
if(eff) {
|
14430 |
+
this.effectElements.push(eff);
|
14431 |
+
}
|
14432 |
+
}
|
14433 |
+
};
|
14434 |
+
|
14435 |
+
var lottie = {};
|
14436 |
+
|
14437 |
+
var _isFrozen = false;
|
14438 |
+
|
14439 |
+
function setLocationHref (href) {
|
14440 |
+
locationHref = href;
|
14441 |
+
}
|
14442 |
+
|
14443 |
+
function searchAnimations() {
|
14444 |
+
if (standalone === true) {
|
14445 |
+
animationManager.searchAnimations(animationData, standalone, renderer);
|
14446 |
+
} else {
|
14447 |
+
animationManager.searchAnimations();
|
14448 |
+
}
|
14449 |
+
}
|
14450 |
+
|
14451 |
+
function setSubframeRendering(flag) {
|
14452 |
+
subframeEnabled = flag;
|
14453 |
+
}
|
14454 |
+
|
14455 |
+
function loadAnimation(params) {
|
14456 |
+
if (standalone === true) {
|
14457 |
+
params.animationData = JSON.parse(animationData);
|
14458 |
+
}
|
14459 |
+
return animationManager.loadAnimation(params);
|
14460 |
+
}
|
14461 |
+
|
14462 |
+
function setQuality(value) {
|
14463 |
+
if (typeof value === 'string') {
|
14464 |
+
switch (value) {
|
14465 |
+
case 'high':
|
14466 |
+
defaultCurveSegments = 200;
|
14467 |
+
break;
|
14468 |
+
case 'medium':
|
14469 |
+
defaultCurveSegments = 50;
|
14470 |
+
break;
|
14471 |
+
case 'low':
|
14472 |
+
defaultCurveSegments = 10;
|
14473 |
+
break;
|
14474 |
+
}
|
14475 |
+
} else if (!isNaN(value) && value > 1) {
|
14476 |
+
defaultCurveSegments = value;
|
14477 |
+
}
|
14478 |
+
if (defaultCurveSegments >= 50) {
|
14479 |
+
roundValues(false);
|
14480 |
+
} else {
|
14481 |
+
roundValues(true);
|
14482 |
+
}
|
14483 |
+
}
|
14484 |
+
|
14485 |
+
function inBrowser() {
|
14486 |
+
return typeof navigator !== 'undefined';
|
14487 |
+
}
|
14488 |
+
|
14489 |
+
function installPlugin(type, plugin) {
|
14490 |
+
if (type === 'expressions') {
|
14491 |
+
expressionsPlugin = plugin;
|
14492 |
+
}
|
14493 |
+
}
|
14494 |
+
|
14495 |
+
function getFactory(name) {
|
14496 |
+
switch (name) {
|
14497 |
+
case "propertyFactory":
|
14498 |
+
return PropertyFactory;
|
14499 |
+
case "shapePropertyFactory":
|
14500 |
+
return ShapePropertyFactory;
|
14501 |
+
case "matrix":
|
14502 |
+
return Matrix;
|
14503 |
+
}
|
14504 |
+
}
|
14505 |
+
|
14506 |
+
lottie.play = animationManager.play;
|
14507 |
+
lottie.pause = animationManager.pause;
|
14508 |
+
lottie.setLocationHref = setLocationHref;
|
14509 |
+
lottie.togglePause = animationManager.togglePause;
|
14510 |
+
lottie.setSpeed = animationManager.setSpeed;
|
14511 |
+
lottie.setDirection = animationManager.setDirection;
|
14512 |
+
lottie.stop = animationManager.stop;
|
14513 |
+
lottie.searchAnimations = searchAnimations;
|
14514 |
+
lottie.registerAnimation = animationManager.registerAnimation;
|
14515 |
+
lottie.loadAnimation = loadAnimation;
|
14516 |
+
lottie.setSubframeRendering = setSubframeRendering;
|
14517 |
+
lottie.resize = animationManager.resize;
|
14518 |
+
//lottie.start = start;
|
14519 |
+
lottie.goToAndStop = animationManager.goToAndStop;
|
14520 |
+
lottie.destroy = animationManager.destroy;
|
14521 |
+
lottie.setQuality = setQuality;
|
14522 |
+
lottie.inBrowser = inBrowser;
|
14523 |
+
lottie.installPlugin = installPlugin;
|
14524 |
+
lottie.freeze = animationManager.freeze;
|
14525 |
+
lottie.unfreeze = animationManager.unfreeze;
|
14526 |
+
lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
|
14527 |
+
lottie.__getFactory = getFactory;
|
14528 |
+
lottie.version = '5.6.8';
|
14529 |
+
|
14530 |
+
function checkReady() {
|
14531 |
+
if (document.readyState === "complete") {
|
14532 |
+
clearInterval(readyStateCheckInterval);
|
14533 |
+
searchAnimations();
|
14534 |
+
}
|
14535 |
+
}
|
14536 |
+
|
14537 |
+
function getQueryVariable(variable) {
|
14538 |
+
var vars = queryString.split('&');
|
14539 |
+
for (var i = 0; i < vars.length; i++) {
|
14540 |
+
var pair = vars[i].split('=');
|
14541 |
+
if (decodeURIComponent(pair[0]) == variable) {
|
14542 |
+
return decodeURIComponent(pair[1]);
|
14543 |
+
}
|
14544 |
+
}
|
14545 |
+
}
|
14546 |
+
var standalone = '__[STANDALONE]__';
|
14547 |
+
var animationData = '__[ANIMATIONDATA]__';
|
14548 |
+
var renderer = '';
|
14549 |
+
if (standalone) {
|
14550 |
+
var scripts = document.getElementsByTagName('script');
|
14551 |
+
var index = scripts.length - 1;
|
14552 |
+
var myScript = scripts[index] || {
|
14553 |
+
src: ''
|
14554 |
+
};
|
14555 |
+
var queryString = myScript.src.replace(/^[^\?]+\??/, '');
|
14556 |
+
renderer = getQueryVariable('renderer');
|
14557 |
+
}
|
14558 |
+
var readyStateCheckInterval = setInterval(checkReady, 100);
|
14559 |
+
|
14560 |
+
return lottie;
|
14561 |
+
}));
|
assets/lib/lottie/lottie.min.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Version: 5.6.8
|
3 |
+
License: MIT
|
4 |
+
*/
|
5 |
+
(typeof navigator !== "undefined") && (function(root, factory) {
|
6 |
+
if (typeof define === "function" && define.amd) {
|
7 |
+
define(function() {
|
8 |
+
return factory(root);
|
9 |
+
});
|
10 |
+
} else if (typeof module === "object" && module.exports) {
|
11 |
+
module.exports = factory(root);
|
12 |
+
} else {
|
13 |
+
root.lottie = factory(root);
|
14 |
+
root.bodymovin = root.lottie;
|
15 |
+
}
|
16 |
+
}((window || {}), function(window) {
|
17 |
+
"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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"],r=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e,this.currentTime=currentTime}roundValues(!1);var createElementID=(G=0,function(){return"__lottie_element_"+ ++G}),G;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,l,p;switch(h=r*(1-e),l=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=r*(1-(1-o)*e),n%6){case 0:i=r,s=p,a=h;break;case 1:i=l,s=r,a=h;break;case 2:i=h,s=r,a=p;break;case 3:i=h,s=l,a=r;break;case 4:i=p,s=h,a=r;break;case 5:i=r,s=h,a=l}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1==e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i++)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s};function createSizedArray(t){return Array.apply(null,{length:t})}function createNS(t){return document.createElementNS(svgNS,t)}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Pa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Pa[t]||""}),Pa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function m(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function f(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,l,p,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function u(t,e,r,i,s,a,n,o,h,l,p,m,f,c,d,u){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return y[12]=y[12]*t+y[15]*f,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*p+y[15]*d,y[15]=y[15]*u,this._identityCalculated=!1,this;var g=y[0],v=y[1],b=y[2],E=y[3],x=y[4],S=y[5],P=y[6],_=y[7],A=y[8],C=y[9],T=y[10],k=y[11],M=y[12],D=y[13],w=y[14],F=y[15];return y[0]=g*t+v*s+b*h+E*f,y[1]=g*e+v*a+b*l+E*c,y[2]=g*r+v*n+b*p+E*d,y[3]=g*i+v*o+b*m+E*u,y[4]=x*t+S*s+P*h+_*f,y[5]=x*e+S*a+P*l+_*c,y[6]=x*r+S*n+P*p+_*d,y[7]=x*i+S*o+P*m+_*u,y[8]=A*t+C*s+T*h+k*f,y[9]=A*e+C*a+T*l+k*c,y[10]=A*r+C*n+T*p+k*d,y[11]=A*i+C*o+T*m+k*u,y[12]=M*t+D*s+w*h+F*f,y[13]=M*e+D*a+w*l+F*c,y[14]=M*r+D*n+w*p+F*d,y[15]=M*i+D*o+w*m+F*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e]}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function E(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function x(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function S(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function P(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function _(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function A(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function C(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=A(t[e]);return i}function T(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+l,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+l,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+l}return i}function k(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function M(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function D(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function w(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function F(){var t=this.props;return"matrix("+w(t[0])+","+w(t[1])+","+w(t[4])+","+w(t[5])+","+w(t[12])+","+w(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=m,this.shear=l,this.scale=f,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=E,this.applyToX=x,this.applyToY=S,this.applyToZ=P,this.applyToPointArray=k,this.applyToTriplePoints=T,this.applyToPointStringified=M,this.toCSS=D,this.to2dCSS=F,this.clone=v,this.cloneFromProps=b,this.equals=g,this.inversePoints=C,this.inversePoint=A,this.getInverseMatrix=_,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var l,p=this,m=256,f=6,c="random",d=h.pow(m,f),u=h.pow(2,52),y=2*u,g=m-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<m;)a[i]=i++;for(i=0;i<m;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*m+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function E(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=E(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,x(o)]:null===t?function(){try{if(l)return x(l.randomBytes(m));var t=new Uint8Array(m);return(p.crypto||p.msCrypto).getRandomValues(t),x(t)}catch(t){var e=p.navigator,r=e&&e.plugins;return[+new Date,p,r,p.screen,x(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(f),e=d,r=0;t<u;)t=(t+r)*m,e*=m,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,E(x(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&b(i,a),t.state=function(){return b(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},E(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function m(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function f(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:m(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<l;++r)this._mSampleValues[r]=m(r*p,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=l-1;a!==n&&i[a]<=t;++a)s+=p;var o=s+(t-i[--a])/(i[a+1]-i[a])*p,h=f(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=f(e,r,i);if(0===a)return e;e-=(m(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=m(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+p,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)i.hasOwnProperty(a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var p=function(t,e,r,i){var s,a,n,o,h,l,p=defaultCurveSegments,m=0,f=[],c=[],d=bezier_length_pool.newElement();for(n=r.length,s=0;s<p;s+=1){for(h=s/(p-1),a=l=0;a<n;a+=1)o=bm_pow(1-h,3)*t[a]+3*bm_pow(1-h,2)*h*r[a]+3*(1-h)*bm_pow(h,2)*i[a]+bm_pow(h,3)*e[a],f[a]=o,null!==c[a]&&(l+=bm_pow(f[a]-c[a],2)),c[a]=f[a];l&&(m+=l=bm_sqrt(l)),d.percents[s]=h,d.lengths[s]=m}return d.addedLength=m,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!b[s]){var a,n,o,h,l,p,m,f=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(f=2);var u=new g(f);for(o=r.length,a=0;a<f;a+=1){for(m=createSizedArray(o),l=a/(f-1),n=p=0;n<o;n+=1)h=bm_pow(1-l,3)*t[n]+3*bm_pow(1-l,2)*l*(t[n]+r[n])+3*(1-l)*bm_pow(l,2)*(e[n]+i[n])+bm_pow(l,3)*e[n],m[n]=h,null!==d&&(p+=bm_pow(m[n]-d[n],2));c+=p=bm_sqrt(p),u.points[a]=new v(p,m),d=m}u.segmentLength=c,b[s]=u}return b[s]});function M(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bm_floor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,l=!0;l;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),l=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];l=!1}return r[a]+(r[a+1]-r[a])*o}var D=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segments_length_pool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,l=0;for(e=0;e<o-1;e+=1)h[e]=p(s[e],s[e+1],a[e],n[e+1]),l+=h[e].addedLength;return i&&o&&(h[e]=p(s[e],s[0],a[e],n[0]),l+=h[e].addedLength),r.totalLength=l,r},getNewSegment:function(t,e,r,i,s,a,n){var o,h=M(s=s<0?0:1<s?1:s,n),l=M(a=1<a?1:a,n),p=t.length,m=1-h,f=1-l,c=m*m*m,d=h*m*m*3,u=h*h*m*3,y=h*h*h,g=m*m*f,v=h*m*f+m*h*f+m*m*l,b=h*h*f+m*h*l+h*m*l,E=h*h*l,x=m*f*f,S=h*f*f+m*l*f+m*f*l,P=h*l*f+m*l*l+h*f*l,_=h*l*l,A=f*f*f,C=l*f*f+f*l*f+f*f*l,T=l*l*f+f*l*l+l*f*l,k=l*l*l;for(o=0;o<p;o+=1)D[4*o]=Math.round(1e3*(c*t[o]+d*r[o]+u*i[o]+y*e[o]))/1e3,D[4*o+1]=Math.round(1e3*(g*t[o]+v*r[o]+b*i[o]+E*e[o]))/1e3,D[4*o+2]=Math.round(1e3*(x*t[o]+S*r[o]+P*i[o]+_*e[o]))/1e3,D[4*o+3]=Math.round(1e3*(A*t[o]+C*r[o]+T*i[o]+k*e[o]))/1e3;return D},getPointInSegment:function(t,e,r,i,s,a){var n=M(s,a),o=1-n;return[Math.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var l,p=Math.sqrt(Math.pow(i-t,2)+Math.pow(s-e,2)+Math.pow(a-r,2)),m=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-r,2)),f=Math.sqrt(Math.pow(n-i,2)+Math.pow(o-s,2)+Math.pow(h-a,2));return-1e-4<(l=m<p?f<p?p-m-f:f-m-p:m<f?f-m-p:m-p-f)&&l<1e-4}}}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var r=(new Date).getTime(),i=Math.max(0,16-(r-a)),s=setTimeout(function(){t(r+i)},i);return a=r+i,s}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function m(t,e,r){var i,s,a,n,o,h,l=t.length;for(s=0;s<l;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),[],-1,i.hasMask){var p=i.masksProperties;for(n=p.length,a=0;a<n;a+=1)if(p[a].pt.k.i)d(p[a].pt.k);else for(h=p[a].pt.k.length,o=0;o<h;o+=1)p[a].pt.k[o].s&&d(p[a].pt.k[o].s[0]),p[a].pt.k[o].e&&d(p[a].pt.k[o].e[0])}0===i.ty?(i.layers=f(i.refId,e),m(i.layers,e,r)):4===i.ty?c(i.shapes):5==i.ty&&u(i,r)}}function f(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)d(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&d(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&d(t[e].ks.k[r].e[0]);!0}else"gr"==t[e].ty&&c(t[e].it)}function d(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&void 0))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(d(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function l(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);!0}else"gr"==t[e].ty&&l(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t,e){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=m,t}var dataManager=dataFunctionManager(),FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function u(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerHTML="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=t+", "+e,{node:i,w:s,parent:r}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this.initTime=Date.now()};return e.getCombinedCharacterCodes=function(){return t},e.prototype.addChars=function(t){if(t){this.chars||(this.chars=[]);var e,r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},e.prototype.addFonts=function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i,s,a,n=t.list,o=n.length,h=o;for(r=0;r<o;r+=1){var l,p,m=!0;if(n[r].loaded=!1,n[r].monoCase=u(n[r].fFamily,"monospace"),n[r].sansCase=u(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){if(0<(l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[r].fFamily+'"], style[f-origin="3"][f-family="'+n[r].fFamily+'"]')).length&&(m=!1),m){var f=createTag("style");f.setAttribute("f-forigin",n[r].fOrigin),f.setAttribute("f-origin",n[r].origin),f.setAttribute("f-family",n[r].fFamily),f.type="text/css",f.innerHTML="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",e.appendChild(f)}}else if("g"===n[r].fOrigin||1===n[r].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),p=0;p<l.length;p++)-1!==l[p].href.indexOf(n[r].fPath)&&(m=!1);if(m){var c=createTag("link");c.setAttribute("f-forigin",n[r].fOrigin),c.setAttribute("f-origin",n[r].origin),c.type="text/css",c.rel="stylesheet",c.href=n[r].fPath,document.body.appendChild(c)}}else if("t"===n[r].fOrigin||2===n[r].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),p=0;p<l.length;p++)n[r].fPath===l[p].src&&(m=!1);if(m){var d=createTag("link");d.setAttribute("f-forigin",n[r].fOrigin),d.setAttribute("f-origin",n[r].origin),d.setAttribute("rel","stylesheet"),d.setAttribute("href",n[r].fPath),e.appendChild(d)}}}else n[r].loaded=!0,h-=1;n[r].helper=(i=e,s=n[r],a=void 0,(a=createNS("text")).style.fontSize="100px",a.setAttribute("font-family",s.fFamily),a.setAttribute("font-style",s.fStyle),a.setAttribute("font-weight",s.fWeight),a.textContent="1",s.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",s.fClass)):a.style.fontFamily=s.fFamily,i.appendChild(a),createTag("canvas").getContext("2d").font=s.fWeight+" "+s.fStyle+" 100px "+s.fFamily,a),n[r].cache={},this.fonts.push(n[r])}0===h?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},e.prototype.getCharData=function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&console.warn("Missing character from exported characters list: ",t,e,r),a},e.prototype.getFontByName=function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},e.prototype.measureText=function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},e.prototype.checkLoadedFonts=function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFonts.bind(this),20):setTimeout(function(){this.isLoaded=!0}.bind(this),0)},e.prototype.loaded=function(){return this.isLoaded},e}(),PropertyFactory=function(){var m=initialDefaultFrame,s=Math.abs;function f(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,l,p,m,f=e.lastIndex,c=f,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>t){f=c;break}c<d-1?c+=1:(f=0,u=!1)}var y,g,v,b,E,x,S,P,_,A,C=a.t-i,T=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var k=s.bezierData;if(C<=t||t<T){var M=C<=t?k.points.length-1:0;for(o=k.points[M].point.length,n=0;n<o;n+=1)r[n]=k.points[M].point[n]}else{s.__fnct?m=s.__fnct:(m=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=m),h=m((t-T)/(C-T));var D,w=k.segmentLength*h,F=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,l=k.points.length;u;){if(F+=k.points[p].partialLength,0===w||0===h||p===k.points.length-1){for(o=k.points[p].point.length,n=0;n<o;n+=1)r[n]=k.points[p].point[n];break}if(F<=w&&w<F+k.points[p+1].partialLength){for(D=(w-F)/k.points[p+1].partialLength,o=k.points[p].point.length,n=0;n<o;n+=1)r[n]=k.points[p].point[n]+(k.points[p+1].point[n]-k.points[p].point[n])*D;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=F-k.points[p].partialLength,e._lastKeyframeIndex=c}}else{var I,V,R,B,L;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(C<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=T)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var G=N(s.s),z=N(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],l=t[0],p=t[1],m=t[2],f=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=l*c+p*d+m*u+f*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*l+o*c,h[1]=n*p+o*d,h[2]=n*m+o*u,h[3]=n*f+o*y,h}(G,z,(t-T)/(C-T)),b=v[0],E=v[1],x=v[2],S=v[3],P=Math.atan2(2*E*S-2*b*x,1-2*E*E-2*x*x),_=Math.asin(2*b*E+2*x*S),A=Math.atan2(2*b*S-2*E*x,1-2*b*b-2*x*x),g[0]=P/degToRads,g[1]=_/degToRads,g[2]=A/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=C<=t?1:t<T?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?m=s.__fnct[c]:(I=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],V=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],R=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],B=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],m=BezierFactory.getBezierEasing(I,V,R,B).get,s.__fnct[c]=m)):s.__fnct?m=s.__fnct:(I=s.o.x,V=s.o.y,R=s.i.x,B=s.i.y,m=BezierFactory.getBezierEasing(I,V,R,B).get,s.__fnct=m),m((t-T)/(C-T)))),y=a.s||s.e,L=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=L:r=L}return e.lastIndex=f,r}function N(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),l=Math.sin(i/2);return[o*h*n+s*a*l,o*a*n+s*h*l,s*h*n-o*a*l,s*a*n-o*h*l]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==m&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,r,i){this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,a=e.k.length;this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a);createTypedArray("float32",a);for(this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:m,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=m,this.pv=m,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.effectsSequence=[c.bind(this)],this.addEffect=y}function l(t,e,r,i){this.propType="multidimensional";var s,a,n,o,h,l=e.k.length;for(s=0;s<l-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.frameId=-1;var p=e.k[0].s.length;for(this.v=createTypedArray("float32",p),this.pv=createTypedArray("float32",p),s=0;s<p;s+=1)this.v[s]=m,this.pv[s]=m;this._caching={lastFrame:m,lastIndex:0,value:createTypedArray("float32",p)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new l(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,r,i=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)r=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],r=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(e[0]=s.getValueAtTime((s.keyframes[0].t+.01)/i,0),e[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=s.getValueAtTime(s.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(e[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/i,0),e[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(e=[s.pv,a.pv],r[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/i,s.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else e=r=n;this.v.rotate(-Math.atan2(e[1]-r[1],e[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=point_pool.newElement(),this.o[r]=point_pool.newElement(),this.i[r]=point_pool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}(!a[i]||a[i]&&!s)&&(a[i]=point_pool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,l,p,m,f=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,f=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(f=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<d.t-this.offsetTime)p=0;else{var b;d.__fnct?b=d.__fnct:(b=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=b),p=b((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}i=d.s[0]}for(h=e._length,l=i.i[0].length,r.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<l;o+=1)m=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*p,e.i[n][o]=m,m=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*p,e.o[n][o]=m,m=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*p,e.v[n][o]=m}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shape_pool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,r=this.effectsSequence.length;for(t=0;t<r;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shape_pool.clone(i),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=shape_pool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,m=2*Math.PI*o/(2*s),f=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?l:p,i=n?m:f;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*i*r*d,y-v*i*r*d,u+g*i*r*d,y+v*i*r*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),l=i*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),m=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*s*o,l-m*a*s*o,h+p*a*s*o,l+m*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bm_min(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var m={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new p(t,e):6===r?i=new h(t,e):7===r&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return m}(),ShapeModifiers=($r={},_r={},$r.registerModifier=function(t,e){_r[t]||(_r[t]=e)},$r.getModifier=function(t,e,r){return new _r[t](e,r)},$r),$r,_r;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var s,a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollection_pool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;n<l;n+=1){var p,m;if((o=a[n]).e*s<i||o.s*s>i+r);else p=o.s*s<=i?0:(o.s*s-i)/r,m=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([p,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segments_length_pool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i;if(this._mdf||t){var s=this.o.v%360/360;if(s<0&&(s+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+s,(r=(1<this.e.v?1:this.e.v<0?0:this.e.v)+s)<e){var a=e;e=r,r=a}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var n,o,h,l,p,m,f=this.shapes.length,c=0;if(r===e)for(n=0;n<f;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection;else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(n=0;n<f;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var d,u,y=[];for(n=0;n<f;n+=1)if((d=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=d.shape.paths)._length,m=0,!d.shape._mdf&&d.pathsData.length)m=d.totalShapeLength;else{for(l=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)p=bez.getSegmentsLength(i.shapes[o]),l.push(p),m+=p.totalLength;d.totalShapeLength=m,d.pathsData=l}c+=m,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,b=r,E=0;for(n=f-1;0<=n;n-=1)if((d=this.shapes[n]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<f?(g=this.calculateShapeEdges(e,r,d.totalShapeLength,E,c),E+=d.totalShapeLength):g=[[v,b]],h=g.length,o=0;o<h;o+=1){v=g[o][0],b=g[o][1],y.length=0,b<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*b}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(b-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(b-1)}));var x=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,u),x=this.addShapes(d,y[1],S)}else this.addPaths(x,u),x=this.addShapes(d,y[1]);this.addPaths(x,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,l,p,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(p=r?(o=r._length,r._length):(r=shape_pool.newElement(),o=0),u.push(r),i=0;i<c;i+=1){for(h=m[i].lengths,r.c=f[i].c,a=f[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,r.c=!1;else{if(d>e.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[s],f[i].v[s],r,o,y),y=!1):(l=bez.getNewSegment(f[i].v[s-1],f[i].v[s],f[i].o[s-1],f[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[i].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[0],f[i].v[0],r,o,y),y=!1):(l=bez.getNewSegment(f[i].v[s-1],f[i].v[0],f[i].o[s-1],f[i].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[p][0],r.v[p][1],"i",p),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;i<c-1&&(r=shape_pool.newElement(),y=!0,u.push(r),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r=shape_pool.newElement();r.c=t.c;var i,s,a,n,o,h,l,p,m,f,c,d,u,y=t._length,g=0;for(i=0;i<y;i+=1)s=t.v[i],n=t.o[i],a=t.i[i],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==i&&i!==y-1||t.c?(o=0===i?t.v[y-1]:t.v[i-1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=d=s[0]+(o[0]-s[0])*l,m=u=s[1]-(s[1]-o[1])*l,f=p-(p-s[0])*roundCorner,c=m-(m-s[1])*roundCorner,r.setTripleAt(p,m,f,c,d,u,g),g+=1,o=i===y-1?t.v[0]:t.v[i+1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=f=s[0]+(o[0]-s[0])*l,m=c=s[1]+(o[1]-s[1])*l,d=p-(p-s[0])*roundCorner,u=m-(m-s[1])*roundCorner,r.setTripleAt(p,m,f,c,d,u,g)):r.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):r.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],g),g+=1;return r},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if((a=this.shapes[r]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);for(;0<r;)r-=1,this._elements.unshift(e[r]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var l=this.o.v,p=l%1,m=0<l?Math.floor(l):Math.ceil(l),f=(this.tr.v.props,this.pMatrix.props),c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<l){for(;g<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),g+=p)}else if(l<0){for(;m<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),g-=p)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),u=0;u<y;u+=1)r[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)r[u]=this.matrix.props[u];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shape_pool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function e(t){var e=function(t,e,r){var i="";if(t.e)i=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),i=e+s}else i=r,i+=t.u?t.u:"",i+=t.p;return i}(t,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded.bind(this),!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.src=e;var i={img:r,assetData:t};return i}function r(t,e){this.imagesLoadedCb=e;var r,i=t.length;for(r=0;r<i;r+=1)t[r].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[r])))}function i(t){this.path=t||""}function a(t){this.assetsPath=t||""}function n(t){for(var e=0,r=this.images.length;e<r;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}}function o(){this.imagesLoadedCb=null,this.images.length=0}function h(){return this.totalImages===this.loadedAssets}return function(){this.loadAssets=r,this.setAssetsPath=a,this.setPath=i,this.loaded=h,this.destroy=o,this.getImage=n,this._createImageData=e,this._imageLoaded=t,this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}}(),featureSupport=(sw={maskType:!0},(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(sw.maskType=!1),sw),sw,filtersFactory=(tw={},tw.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},tw.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t},tw),tw,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}();function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,l,p,m,f,c,d,u,y,g,v,b,E,x=this._moreOptions.alignment.v,S=this._animatorsData,P=this._textData,_=this.mHelper,A=this._renderType,C=this.renderedLetters.length,T=(this.data,t.l);if(this._hasMaskedPath){if(E=this._pathData.m,!this._pathData.n||this._pathData._mdf){var k,M=E.v;for(this._pathData.r&&(M=M.reverse()),n={tLength:0,segments:[]},a=M._length-1,s=g=0;s<a;s+=1)k=bez.buildBezierData(M.v[s],M.v[s+1],[M.o[s][0]-M.v[s][0],M.o[s][1]-M.v[s][1]],[M.i[s+1][0]-M.v[s+1][0],M.i[s+1][1]-M.v[s+1][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength;s=a,E.v.c&&(k=bez.buildBezierData(M.v[s],M.v[0],[M.o[s][0]-M.v[s][0],M.o[s][1]-M.v[s][1]],[M.i[0][0]-M.v[0][0],M.i[0][1]-M.v[0][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,m=1,p=!(l=f=0),u=n.segments,o<0&&E.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),m=(d=u[f=u.length-1].points).length-1;o<0;)o+=d[m].partialLength,(m-=1)<0&&(m=(d=u[f-=1].points).length-1);c=(d=u[f].points)[m-1],y=(h=d[m]).partialLength}a=T.length,i=r=0;var D,w,F,I,V=1.2*t.finalSize*.714,R=!0;F=S.length;var B,L,G,z,N,O,H,j,q,W,Y,X,$,K=-1,U=o,J=f,Z=m,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(T[s].n){for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(w=0;w<F;w+=1)(D=S[w].a).t.propType&&(nt&&2===t.j&&(it+=D.t.v*st),(B=S[w].s.getMult(T[s].anIndexes[w],P.a[w].s.totalChars)).length?rt+=D.t.v*B[0]*st:rt+=D.t.v*B*st);nt=!1}for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(_.reset(),N=1,T[s].n)r=0,i+=t.yOffset,i+=R?1:0,o=U,R=!1,0,this._hasMaskedPath&&(m=Z,c=(d=u[f=J].points)[m-1],y=(h=d[m]).partialLength,l=0),$=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==T[s].line){switch(t.j){case 1:o+=g-t.lineWidths[T[s].line];break;case 2:o+=(g-t.lineWidths[T[s].line])/2}Q=T[s].line}K!==T[s].ind&&(T[K]&&(o+=T[K].extra),o+=T[s].an/2,K=T[s].ind),o+=x[0]*T[s].an/200;var ot=0;for(w=0;w<F;w+=1)(D=S[w].a).p.propType&&((B=S[w].s.getMult(T[s].anIndexes[w],P.a[w].s.totalChars)).length?ot+=D.p.v[0]*B[0]:ot+=D.p.v[0]*B),D.a.propType&&((B=S[w].s.getMult(T[s].anIndexes[w],P.a[w].s.totalChars)).length?ot+=D.a.v[0]*B[0]:ot+=D.a.v[0]*B);for(p=!0;p;)o+ot<=l+y||!d?(v=(o+ot-l)/h.partialLength,G=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,_.translate(-x[0]*T[s].an/200,-x[1]*V/100),p=!1):d&&(l+=h.partialLength,(m+=1)>=d.length&&(m=0,d=u[f+=1]?u[f].points:E.v.c?u[f=m=0].points:(l-=h.partialLength,null)),d&&(c=h,y=(h=d[m]).partialLength));L=T[s].an/2-T[s].add,_.translate(-L,0,0)}else L=T[s].an/2-T[s].add,_.translate(-L,0,0),_.translate(-x[0]*T[s].an/200,-x[1]*V/100,0);for(T[s].l/2,w=0;w<F;w+=1)(D=S[w].a).t.propType&&(B=S[w].s.getMult(T[s].anIndexes[w],P.a[w].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?B.length?o+=D.t.v*B[0]:o+=D.t.v*B:B.length?r+=D.t.v*B[0]:r+=D.t.v*B));for(T[s].l/2,t.strokeWidthAnim&&(H=t.sw||0),t.strokeColorAnim&&(O=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(j=[t.fc[0],t.fc[1],t.fc[2]]),w=0;w<F;w+=1)(D=S[w].a).a.propType&&((B=S[w].s.getMult(T[s].anIndexes[w],P.a[w].s.totalChars)).length?_.translate(-D.a.v[0]*B[0],-D.a.v[1]*B[1],D.a.v[2]*B[2]):_.translate(-D.a.v[0]*B,-D.a.v[1]*B,D.a.v[2]*B));for(w=0;w<F;w+=1)(D=S[w].a).s.propType&&((B=S[w].s.getMult(T[s].anIndexes[w],P.a[w].s.totalChars)).length?_.scale(1+(D.s.v[0]-1)*B[0],1+(D.s.v[1]-1)*B[1],1):_.scale(1+(D.s.v[0]-1)*B,1+(D.s.v[1]-1)*B,1));for(w=0;w<F;w+=1){if(D=S[w].a,B=S[w].s.getMult(T[s].anIndexes[w],P.a[w].s.totalChars),D.sk.propType&&(B.length?_.skewFromAxis(-D.sk.v*B[0],D.sa.v*B[1]):_.skewFromAxis(-D.sk.v*B,D.sa.v*B)),D.r.propType&&(B.length?_.rotateZ(-D.r.v*B[2]):_.rotateZ(-D.r.v*B)),D.ry.propType&&(B.length?_.rotateY(D.ry.v*B[1]):_.rotateY(D.ry.v*B)),D.rx.propType&&(B.length?_.rotateX(D.rx.v*B[0]):_.rotateX(D.rx.v*B)),D.o.propType&&(B.length?N+=(D.o.v*B[0]-N)*B[0]:N+=(D.o.v*B-N)*B),t.strokeWidthAnim&&D.sw.propType&&(B.length?H+=D.sw.v*B[0]:H+=D.sw.v*B),t.strokeColorAnim&&D.sc.propType)for(q=0;q<3;q+=1)B.length?O[q]=O[q]+(D.sc.v[q]-O[q])*B[0]:O[q]=O[q]+(D.sc.v[q]-O[q])*B;if(t.fillColorAnim&&t.fc){if(D.fc.propType)for(q=0;q<3;q+=1)B.length?j[q]=j[q]+(D.fc.v[q]-j[q])*B[0]:j[q]=j[q]+(D.fc.v[q]-j[q])*B;D.fh.propType&&(j=B.length?addHueToRGB(j,D.fh.v*B[0]):addHueToRGB(j,D.fh.v*B)),D.fs.propType&&(j=B.length?addSaturationToRGB(j,D.fs.v*B[0]):addSaturationToRGB(j,D.fs.v*B)),D.fb.propType&&(j=B.length?addBrightnessToRGB(j,D.fb.v*B[0]):addBrightnessToRGB(j,D.fb.v*B))}}for(w=0;w<F;w+=1)(D=S[w].a).p.propType&&(B=S[w].s.getMult(T[s].anIndexes[w],P.a[w].s.totalChars),this._hasMaskedPath?B.length?_.translate(0,D.p.v[1]*B[0],-D.p.v[2]*B[1]):_.translate(0,D.p.v[1]*B,-D.p.v[2]*B):B.length?_.translate(D.p.v[0]*B[0],D.p.v[1]*B[1],-D.p.v[2]*B[2]):_.translate(D.p.v[0]*B,D.p.v[1]*B,-D.p.v[2]*B));if(t.strokeWidthAnim&&(W=H<0?0:H),t.strokeColorAnim&&(Y="rgb("+Math.round(255*O[0])+","+Math.round(255*O[1])+","+Math.round(255*O[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),this._hasMaskedPath){if(_.translate(0,-t.ls),_.translate(0,x[1]*V/100+i,0),P.p.p){b=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(b)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),_.rotate(-ht*Math.PI/180)}_.translate(G,z,0),o-=x[0]*T[s].an/200,T[s+1]&&K!==T[s+1].ind&&(o+=T[s].an/2,o+=t.tr/1e3*t.finalSize)}else{switch(_.translate(r,i,0),t.ps&&_.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:_.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line]),0,0);break;case 2:_.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line])/2,0,0)}_.translate(0,-t.ls),_.translate(L,0,0),_.translate(x[0]*T[s].an/200,x[1]*V/100,0),r+=T[s].l+t.tr/1e3*t.finalSize}"html"===A?tt=_.toCSS():"svg"===A?tt=_.to2dCSS():et=[_.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]],$=N}this.lettersChangedFlag=C<=s?(I=new LetterProps($,W,Y,X,tt,et),this.renderedLetters.push(I),C+=1,!0):(I=this.renderedLetters[s]).update($,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var i,s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&(t[r].s,!(r===i-1||t[r+1].t>e));)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),++s):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],m=0,f=l.m.g,c=0,d=0,u=0,y=[],g=0,v=0,b=h.getFontByName(t.f),E=0,x=b.fStyle?b.fStyle.split(" "):[],S="normal",P="normal";for(r=x.length,e=0;e<r;e+=1)switch(x[e].toLowerCase()){case"italic":P="italic";break;case"bold":S="700";break;case"black":S="900";break;case"medium":S="500";break;case"regular":case"normal":S="400";break;case"light":case"thin":S="200"}t.fWeight=b.fWeight||S,t.fStyle=P,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var _,A=t.tr/1e3*t.finalSize;if(t.sz)for(var C,T,k=!0,M=t.sz[0],D=t.sz[1];k;){g=C=0,r=(T=this.buildFinalText(t.t)).length,A=t.tr/1e3*t.finalSize;var w=-1;for(e=0;e<r;e+=1)_=T[e].charCodeAt(0),i=!1," "===T[e]?w=e:13!==_&&3!==_||(i=!(g=0),C+=t.finalLineHeight||1.2*t.finalSize),M<g+(E=h.chars?(o=h.getCharData(T[e],b.fStyle,b.fFamily),i?0:o.w*t.finalSize/100):h.measureText(T[e],t.f,t.finalSize))&&" "!==T[e]?(-1===w?r+=1:e=w,C+=t.finalLineHeight||1.2*t.finalSize,T.splice(e,w===e?1:0,"\r"),w=-1,g=0):(g+=E,g+=A);C+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&D<C?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=T,r=t.finalText.length,k=!1)}g=-A;var F,I=E=0;for(e=0;e<r;e+=1)if(i=!1,13===(_=(F=t.finalText[e]).charCodeAt(0))||3===_?(I=0,y.push(g),v=v<g?g:v,g=-2*A,i=!(s=""),u+=1):s=F,E=h.chars?(o=h.getCharData(F,b.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===F?I+=E+A:(g+=E+A+I,I=0),p.push({l:E,an:E,add:c,n:i,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==f){if(c+=E,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=E);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=E,d+=1;m+=1,c=0}}else if(3==f){if(c+=E,""===s||e===r-1){for(""===s&&(c-=E);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=E,d+=1;c=0,m+=1}}else p[m].ind=m,p[m].extra=0,m+=1;if(t.l=p,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var V,R,B=l.a;n=B.length;var L,G,z=[];for(a=0;a<n;a+=1){for((V=B[a]).a.sc&&(t.strokeColorAnim=!0),V.a.sw&&(t.strokeWidthAnim=!0),(V.a.fc||V.a.fh||V.a.fs||V.a.fb)&&(t.fillColorAnim=!0),G=0,L=V.s.b,e=0;e<r;e+=1)(R=p[e]).anIndexes[a]=G,(1==L&&""!==R.val||2==L&&""!==R.val&&" "!==R.val||3==L&&(R.n||" "==R.val||e==r-1)||4==L&&(R.n||e==r-1))&&(1===V.s.rn&&z.push(G),G+=1);l.a[a].s.totalChars=G;var N,O=-1;if(1===V.s.rn)for(e=0;e<r;e+=1)O!=(R=p[e]).anIndexes[a]&&(O=R.anIndexes[a],N=z.splice(Math.floor(Math.random()*z.length),1)[0]),R.anIndexes[a]=N}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,l=this.data.sh;if(2===l)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===l)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===l)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===l){if(h===o)n=0;else{var p=h-o,m=-p/2+(t=d(c(0,t+.5-o),h-o)),f=p/2;n=Math.sqrt(1-m*m/(f*f))}n=a(n)}else n=6===l?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),pool_factory=function(t,e,r,i){var s=0,a=t,n=createSizedArray(a);function o(){return s?n[s-=1]:e()}return{newElement:o,release:function(t){s===a&&(n=pooling.double(n),a*=2),r&&r(t),n[s]=t,s+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},point_pool=pool_factory(8,function(){return createTypedArray("float32",2)}),shape_pool=(KA=pool_factory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)point_pool.release(t.v[e]),point_pool.release(t.i[e]),point_pool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),KA.clone=function(t){var e,r=KA.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},KA),KA,shapeCollection_pool=(TA={newShapeCollection:function(){var t;t=UA?WA[UA-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shape_pool.release(t.shapes[e]);t._length=0,UA===VA&&(WA=pooling.double(WA),VA*=2);WA[UA]=t,UA+=1}},UA=0,VA=4,WA=createSizedArray(VA),TA),TA,UA,VA,WA,segments_length_pool=pool_factory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezier_length_pool.release(t.lengths[e]);t.lengths.length=0}),bezier_length_pool=pool_factory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function HybridRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!e||!1!==e.hideOnTransparent,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var n,o,h,l,p,m,f,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<a;i++)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!=c[i].mode&&"i"!=c[i].mode||0!==d?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),n=createNS("path"),"n"!=c[i].mode){var b;if(d+=1,n.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",f=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),b=createElementID(),(p=createNS("filter")).setAttribute("id",b),(m=createNS("feMorphology")).setAttribute("operator","erode"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),p.appendChild(m),s.appendChild(p),n.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):f=m=null,this.storedData[i]={elem:n,x:f,expan:m,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==c[i].mode){h=u.length;var E=createNS("g");for(o=0;o<h;o+=1)E.appendChild(u[o]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",y+"_"+d),x.appendChild(n),s.appendChild(x),E.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(E)}else u.push(n);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:n,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:n,lastPath:""},s.appendChild(n);for(this.maskElement=createNS(g),a=u.length,i=0;i<a;i+=1)this.maskElement.appendChild(u[i]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function SVGTransformData(t,e,r){this.transform={mProps:t,op:e,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function SVGStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r}function SVGGradientFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,r)}function SVGGradientStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e--)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 13:return this.createCamera(t)}return this.createNull(t)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){this.completeLayers=!1;var e,r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id==t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],CanvasRenderer),CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRenderer.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var r=this.contextData.cTr.props;this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},CanvasRenderer.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},CanvasRenderer.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var r,i=this.contextData.saved[this.contextData.cArrPos];for(r=0;r<16;r+=1)i[r]=e[r];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},CanvasRenderer.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,r=this.contextData.saved[this.contextData.cArrPos],i=this.contextData.cTr.props;for(e=0;e<16;e+=1)i[e]=r[e];this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),r=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=r,this.globalData.currentGlobalAlpha!==r&&(this.canvasContext.globalAlpha=r,this.globalData.currentGlobalAlpha=r)}else this.canvasContext.restore()},CanvasRenderer.prototype.configAnimation=function(t){this.animationItem.wrapper?(this.animationItem.container=createTag("canvas"),this.animationItem.container.style.width="100%",this.animationItem.container.style.height="100%",this.animationItem.container.style.transformOrigin=this.animationItem.container.style.mozTransformOrigin=this.animationItem.container.style.webkitTransformOrigin=this.animationItem.container.style["-webkit-transform"]="0px 0px 0px",this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)):this.canvasContext=this.renderConfig.context,this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){var t,e,r,i;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var s=this.renderConfig.preserveAspectRatio.split(" "),a=s[1]||"meet",n=s[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);r=t/e,i=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=r<i&&"meet"===a||i<r&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"==this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRenderer.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&(this.animationItem.wrapper.innerHTML=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var r,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),r=0;r<i;r++)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(t-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){var r=this.createItem(this.layers[t],this,this.globalData);(e[t]=r).initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([BaseRenderer],HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},HybridRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){var i=this.layers[e];if(i.ddd&&this.supports3d)this.addTo3dContainer(r,e);else if(this.threeDElements)this.addTo3dContainer(r,e);else{for(var s,a,n=0;n<e;)this.elements[n]&&!0!==this.elements[n]&&this.elements[n].getBaseElement&&(a=this.elements[n],s=(this.layers[n].ddd?this.getThreeDContainerByPos(n):a.getBaseElement())||s),n+=1;s?i.ddd&&this.supports3d||this.layerElement.insertBefore(r,s):i.ddd&&this.supports3d||this.layerElement.appendChild(r)}}},HybridRenderer.prototype.createShape=function(t){return this.supports3d?new HShapeElement(t,this.globalData,this):new SVGShapeElement(t,this.globalData,this)},HybridRenderer.prototype.createText=function(t){return this.supports3d?new HTextElement(t,this.globalData,this):new SVGTextElement(t,this.globalData,this)},HybridRenderer.prototype.createCamera=function(t){return this.camera=new HCameraElement(t,this.globalData,this),this.camera},HybridRenderer.prototype.createImage=function(t){return this.supports3d?new HImageElement(t,this.globalData,this):new IImageElement(t,this.globalData,this)},HybridRenderer.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.globalData,this):new SVGCompElement(t,this.globalData,this)},HybridRenderer.prototype.createSolid=function(t){return this.supports3d?new HSolidElement(t,this.globalData,this):new ISolidElement(t,this.globalData,this)},HybridRenderer.prototype.createNull=SVGRenderer.prototype.createNull,HybridRenderer.prototype.getThreeDContainerByPos=function(t){for(var e=0,r=this.threeDElements.length;e<r;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}},HybridRenderer.prototype.createThreeDContainer=function(t,e){var r=createTag("div");styleDiv(r);var i=createTag("div");styleDiv(i),"3d"===e&&(r.style.width=this.globalData.compSize.w+"px",r.style.height=this.globalData.compSize.h+"px",r.style.transformOrigin=r.style.mozTransformOrigin=r.style.webkitTransformOrigin="50% 50%",i.style.transform=i.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"),r.appendChild(i);var s={container:i,perspectiveElem:r,startPos:t,endPos:t,type:e};return this.threeDElements.push(s),s},HybridRenderer.prototype.build3dContainers=function(){var t,e,r=this.layers.length,i="";for(t=0;t<r;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?"3d"!==i&&(i="3d",e=this.createThreeDContainer(t,"3d")):"2d"!==i&&(i="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t);for(t=(r=this.threeDElements.length)-1;0<=t;t--)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRenderer.prototype.addTo3dContainer=function(t,e){for(var r=0,i=this.threeDElements.length;r<i;){if(e<=this.threeDElements[r].endPos){for(var s,a=this.threeDElements[r].startPos;a<e;)this.elements[a]&&this.elements[a].getBaseElement&&(s=this.elements[a].getBaseElement()),a+=1;s?this.threeDElements[r].container.insertBefore(t,s):this.threeDElements[r].container.appendChild(t);break}r+=1}},HybridRenderer.prototype.configAnimation=function(t){var e=createTag("div"),r=this.animationItem.wrapper;e.style.width=t.w+"px",e.style.height=t.h+"px",styleDiv(this.resizerElem=e),e.style.transformStyle=e.style.webkitTransformStyle=e.style.mozTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),r.appendChild(e),e.style.overflow="hidden";var i=createNS("svg");i.setAttribute("width","1"),i.setAttribute("height","1"),styleDiv(i),this.resizerElem.appendChild(i);var s=createNS("defs");i.appendChild(s),this.data=t,this.setupGlobalData(t,i),this.globalData.defs=s,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRenderer.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.animationItem.container=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRenderer.prototype.updateContainerSize=function(){var t,e,r,i,s=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight;i=s/a<this.globalData.compSize.w/this.globalData.compSize.h?(t=s/this.globalData.compSize.w,e=s/this.globalData.compSize.w,r=0,(a-this.globalData.compSize.h*(s/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,r=(s-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,0),this.resizerElem.style.transform=this.resizerElem.style.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+r+","+i+",0,1)"},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,r=this.globalData.compSize.h,i=this.threeDElements.length;for(t=0;t<i;t+=1)this.threeDElements[t].perspectiveElem.style.perspective=this.threeDElements[t].perspectiveElem.style.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(r,2))+"px"}},HybridRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length,i=createTag("div");for(e=0;e<r;e+=1)if(t[e].xt){var s=this.createComp(t[e],i,this.globalData.comp,null);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r=!0,i=this.comp;r;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):r=!1;var s,a,n=e.length;for(s=0;s<n;s+=1)a=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,r){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,e),this.setGradientOpacity(e,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var r=createElementID(),i=createNS(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",r),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var s,a,n,o=[];for(n=4*e.g.p,a=0;a<n;a+=4)s=createNS("stop"),i.appendChild(s),o.push(s);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+locationHref+"#"+r+")"),this.gf=i,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var r,i,s,a=createNS("mask"),n=createNS("path");a.appendChild(n);var o=createElementID(),h=createElementID();a.setAttribute("id",h);var l=createNS(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",o),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),s=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(i=4*t.g.p;i<s;i+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(r),p.push(r);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+locationHref+"#"+o+")"),this.of=l,this.ms=a,this.ost=p,this.maskId=h,e.msElem=n}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var SVGElementsRenderer=function(){var y=new Matrix,g=new Matrix;function e(t,e,r){(r||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(r||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function r(t,e,r){var i,s,a,n,o,h,l,p,m,f,c,d=e.styles.length,u=e.lvl;for(h=0;h<d;h+=1){if(n=e.sh._mdf||r,e.styles[h].lvl<u){for(p=g.reset(),f=u-e.styles[h].lvl,c=e.transformers.length-1;!n&&0<f;)n=e.transformers[c].mProps._mdf||n,f--,c--;if(n)for(f=u-e.styles[h].lvl,c=e.transformers.length-1;0<f;)m=e.transformers[c].mProps.v.props,p.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),f--,c--}else p=y;if(s=(l=e.sh.paths)._length,n){for(a="",i=0;i<s;i+=1)(o=l.shapes[i])&&o._length&&(a+=buildShapeString(o,o._length,o.c,p));e.caches[h]=a}else a=e.caches[h];e.styles[h].d+=!0===t.hd?"":a,e.styles[h]._mdf=n||e.styles[h]._mdf}}function i(t,e,r){var i=e.style;(e.c._mdf||r)&&i.pElem.setAttribute("fill","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function s(t,e,r){a(t,e,r),n(t,e,r)}function a(t,e,r){var i,s,a,n,o,h=e.gf,l=e.g._hasOpacity,p=e.s.v,m=e.e.v;if(e.o._mdf||r){var f="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(f,e.o.v)}if(e.s._mdf||r){var c=1===t.t?"x1":"cx",d="x1"===c?"y1":"cy";h.setAttribute(c,p[0]),h.setAttribute(d,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(c,p[0]),e.of.setAttribute(d,p[1]))}if(e.g._cmdf||r){i=e.cst;var u=e.g.c;for(a=i.length,s=0;s<a;s+=1)(n=i[s]).setAttribute("offset",u[4*s]+"%"),n.setAttribute("stop-color","rgb("+u[4*s+1]+","+u[4*s+2]+","+u[4*s+3]+")")}if(l&&(e.g._omdf||r)){var y=e.g.o;for(a=(i=e.g._collapsable?e.cst:e.ost).length,s=0;s<a;s+=1)n=i[s],e.g._collapsable||n.setAttribute("offset",y[2*s]+"%"),n.setAttribute("stop-opacity",y[2*s+1])}if(1===t.t)(e.e._mdf||r)&&(h.setAttribute("x2",m[0]),h.setAttribute("y2",m[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",m[0]),e.of.setAttribute("y2",m[1])));else if((e.s._mdf||e.e._mdf||r)&&(o=Math.sqrt(Math.pow(p[0]-m[0],2)+Math.pow(p[1]-m[1],2)),h.setAttribute("r",o),l&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.e._mdf||e.h._mdf||e.a._mdf||r){o||(o=Math.sqrt(Math.pow(p[0]-m[0],2)+Math.pow(p[1]-m[1],2)));var g=Math.atan2(m[1]-p[1],m[0]-p[0]),v=o*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),b=Math.cos(g+e.a.v)*v+p[0],E=Math.sin(g+e.a.v)*v+p[1];h.setAttribute("fx",b),h.setAttribute("fy",E),l&&!e.g._collapsable&&(e.of.setAttribute("fx",b),e.of.setAttribute("fy",E))}}function n(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||r)&&s.dashStr&&(i.pElem.setAttribute("stroke-dasharray",s.dashStr),i.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||r)&&i.pElem.setAttribute("stroke","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||r)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){t.ty;switch(t.ty){case"fl":return i;case"gf":return a;case"gs":return s;case"st":return n;case"sh":case"el":case"rc":case"sr":return r;case"tr":return e}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(t,e,r,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var s=4;"rc"==e.ty?s=5:"el"==e.ty?s=6:"sr"==e.ty&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,s,t);var a,n,o=r.length;for(a=0;a<o;a+=1)r[a].closed||(n={transforms:i.addTransformSequence(r[a].transforms),trNodes:[]},this.styledShapes.push(n),r[a].elements.push(n))}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function SVGCompElement(t,e,r){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGTextElement(t,e,r){this.textSpans=[],this.renderType="svg",this.initElement(t,e,r)}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function SVGTintFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");if(r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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"),r.setAttribute("result","f1"),t.appendChild(r),(r=createNS("feColorMatrix")).setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result","f2"),t.appendChild(r),this.matrixFilter=r,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var i,s=createNS("feMerge");t.appendChild(s),(i=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),s.appendChild(i),(i=createNS("feMergeNode")).setAttribute("in","f2"),s.appendChild(i)}}function SVGFillFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(r),this.matrixFilter=r}function SVGGaussianBlurEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var r=createNS("feGaussianBlur");t.appendChild(r),this.feGaussianBlur=r}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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"),r.setAttribute("result","f1"),t.appendChild(r);var i=createNS("feComponentTransfer");i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.matrixFilter=i;var s=createNS("feFuncR");s.setAttribute("type","table"),i.appendChild(s),this.feFuncR=s;var a=createNS("feFuncG");a.setAttribute("type","table"),i.appendChild(a),this.feFuncG=a;var n=createNS("feFuncB");n.setAttribute("type","table"),i.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var r=this.filterManager.effectElements,i=createNS("feComponentTransfer");(r[10].p.k||0!==r[10].p.v||r[11].p.k||1!==r[11].p.v||r[12].p.k||1!==r[12].p.v||r[13].p.k||0!==r[13].p.v||r[14].p.k||1!==r[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",i)),(r[17].p.k||0!==r[17].p.v||r[18].p.k||1!==r[18].p.v||r[19].p.k||1!==r[19].p.v||r[20].p.k||0!==r[20].p.v||r[21].p.k||1!==r[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",i)),(r[24].p.k||0!==r[24].p.v||r[25].p.k||1!==r[25].p.v||r[26].p.k||1!==r[26].p.v||r[27].p.k||0!==r[27].p.v||r[28].p.k||1!==r[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",i)),(r[31].p.k||0!==r[31].p.v||r[32].p.k||1!==r[32].p.v||r[33].p.k||1!==r[33].p.v||r[34].p.k||0!==r[34].p.v||r[35].p.k||1!==r[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",i)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),i=createNS("feComponentTransfer")),(r[3].p.k||0!==r[3].p.v||r[4].p.k||1!==r[4].p.v||r[5].p.k||1!==r[5].p.v||r[6].p.k||0!==r[6].p.v||r[7].p.k||1!==r[7].p.v)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.feFuncRComposed=this.createFeFunc("feFuncR",i),this.feFuncGComposed=this.createFeFunc("feFuncG",i),this.feFuncBComposed=this.createFeFunc("feFuncB",i))}function SVGDropShadowEffect(t,e){var r=e.container.globalData.renderConfig.filterSize;t.setAttribute("x",r.x),t.setAttribute("y",r.y),t.setAttribute("width",r.width),t.setAttribute("height",r.height),this.filterManager=e;var i=createNS("feGaussianBlur");i.setAttribute("in","SourceAlpha"),i.setAttribute("result","drop_shadow_1"),i.setAttribute("stdDeviation","0"),this.feGaussianBlur=i,t.appendChild(i);var s=createNS("feOffset");s.setAttribute("dx","25"),s.setAttribute("dy","0"),s.setAttribute("in","drop_shadow_1"),s.setAttribute("result","drop_shadow_2"),this.feOffset=s,t.appendChild(s);var a=createNS("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var n=createNS("feComposite");n.setAttribute("in","drop_shadow_3"),n.setAttribute("in2","drop_shadow_2"),n.setAttribute("operator","in"),n.setAttribute("result","drop_shadow_4"),t.appendChild(n);var o,h=createNS("feMerge");t.appendChild(h),o=createNS("feMergeNode"),h.appendChild(o),(o=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=h,this.originalNodeAdded=!1,h.appendChild(o)}ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return"_"+this.transform_key_count++}},CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(l),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),m=createNS("path");m.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var f=createElementID();if(p.setAttribute("id",f),p.appendChild(m),this.globalData.defs.appendChild(p),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+f+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+f+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextElement),SVGTextElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextElement.prototype.buildTextContents=function(t){for(var e=0,r=t.length,i=[],s="";e<r;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(s),s=""):s+=t[e],e+=1;return i.push(s),i},SVGTextElement.prototype.buildNewText=function(){var t,e,r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var i=this.globalData.fontManager.getFontByName(r.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var s=r.fWeight,a=r.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",s)}this.layerElement.setAttribute("aria-label",r.t);var n,o=r.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var l,p=this.mHelper,m="",f=this.data.singleShape,c=0,d=0,u=!0,y=r.tr/1e3*r.finalSize;if(!f||h||r.sz){var g,v,b=this.textSpans.length;for(t=0;t<e;t+=1)h&&f&&0!==t||(n=t<b?this.textSpans[t]:createNS(h?"path":"text"),b<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(r.finalSize/100,r.finalSize/100),f&&(o[t].n&&(c=-y,d+=r.yOffset,d+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(r,p,o[t].line,c,d),c+=o[t].l||0,c+=y),h?(l=(g=(v=this.globalData.fontManager.getCharData(r.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily))&&v.data||{}).shapes?g.shapes[0].it:[],f?m+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(f&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));f&&n&&n.setAttribute("d",m)}else{var E=this.textContainer,x="start";switch(r.j){case 1:x="end";break;case 2:x="middle"}E.setAttribute("text-anchor",x),E.setAttribute("letter-spacing",y);var S=this.buildTextContents(r.finalText);for(e=S.length,d=r.ps?r.ps[1]+r.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||createNS("tspan")).textContent=S[t],n.setAttribute("x",0),n.setAttribute("y",d),n.style.display="inherit",E.appendChild(n),this.textSpans[t]=n,d+=r.finalLineHeight;this.layerElement.appendChild(E)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},SVGTextElement.prototype.sourceRectAtTime=function(t){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextElement.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var r,i,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(r=s[t],i=this.textSpans[t],r._mdf.m&&i.setAttribute("transform",r.m),r._mdf.o&&i.setAttribute("opacity",r.o),r._mdf.sw&&i.setAttribute("stroke-width",r.sw),r._mdf.sc&&i.setAttribute("stroke",r.sc),r._mdf.fc&&i.setAttribute("fill",r.fc))}},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,l,p,m,f,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((f=this.searchProcessedElement(t[o]))?e[o]=r[f-1]:t[o]._render=n,"fl"==t[o].ty||"st"==t[o].ty||"gf"==t[o].ty||"gs"==t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"==t[o].ty){if(f)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"==t[o].ty?(f||(e[o]=this.createTransformElement(t[o],i)),p=e[o].transform,c.push(p)):"sh"==t[o].ty||"rc"==t[o].ty||"el"==t[o].ty||"sr"==t[o].ty?(f||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"==t[o].ty||"rd"==t[o].ty||"ms"==t[o].ty?(f?(m=e[o]).closed=!1:((m=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=m,this.shapeModifiers.push(m)),y.push(m)):"rp"==t[o].ty&&(f?(m=e[o]).closed=!0:(m=ShapeModifiers.getModifier(t[o].ty),(e[o]=m).init(this,t,o,e),this.shapeModifiers.push(m),n=!1),y.push(m));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",r[0]-e[0]+" 0 0 0 "+e[0]+" "+(r[1]-e[1])+" 0 0 0 "+e[1]+" "+(r[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGGaussianBlurEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=3==r?0:e,s=2==r?0:e;this.feGaussianBlur.setAttribute("stdDeviation",i+" "+s);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},SVGStrokeEffect.prototype.initialize=function(){var t,e,r,i,s=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(i=this.elem.maskManager.masksProperties.length,r=0):i=(r=this.filterManager.effectElements[0].p.v-1)+1,(e=createNS("g")).setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1);r<i;r+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:r});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),n=createElementID();a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+locationHref+"#"+n+")");s[0];)o.appendChild(s[0]);this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(s=this.elem.layerElement.children||this.elem.layerElement.childNodes;s.length;)this.elem.layerElement.removeChild(s[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){this.initialized||this.initialize();var e,r,i,s=this.paths.length;for(e=0;e<s;e+=1)if(-1!==this.paths[e].m&&(r=this.elem.maskManager.viewData[this.paths[e].m],i=this.paths[e].p,(t||this.filterManager._mdf||r.prop._mdf)&&i.setAttribute("d",r.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,o=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,h=i.getTotalLength();a="0 0 0 "+h*n+" ";var l,p=h*(o-n),m=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100,f=Math.floor(p/m);for(l=0;l<f;l+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100;i.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bm_floor(255*c[0])+","+bm_floor(255*c[1])+","+bm_floor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v,s=i[0]+" "+r[0]+" "+e[0],a=i[1]+" "+r[1]+" "+e[1],n=i[2]+" "+r[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",s),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var r=createNS(t);return r.setAttribute("type","table"),e.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(t,e,r,i,s){for(var a,n,o=0,h=Math.min(t,e),l=Math.max(t,e),p=Array.call(null,{length:256}),m=0,f=s-i,c=e-t;o<=256;)n=(a=o/256)<=h?c<0?s:i:l<=a?c<0?i:s:i+f*Math.pow((a-t)/c,1/r),p[m++]=n,o+=256/255;return p.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(t||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(e=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(e=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(e=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(e=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(e=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=r*Math.cos(i),a=r*Math.sin(i);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,r){this.initialized=!1,this.filterManager=e,this.filterElem=t,(this.elem=r).matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGEffects(t){var e,r,i=t.data.ef?t.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s),n=0;for(this.filters=[],e=0;e<i;e+=1)r=null,20===t.data.ef[e].ty?(n+=1,r=new SVGTintFilter(a,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(n+=1,r=new SVGFillFilter(a,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?r=new SVGStrokeEffect(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(n+=1,r=new SVGTritoneFilter(a,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(n+=1,r=new SVGProLevelsFilter(a,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(n+=1,r=new SVGDropShadowEffect(a,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty?r=new SVGMatte3Effect(a,t.effectsManager.effectElements[e],t):29===t.data.ef[e].ty&&(n+=1,r=new SVGGaussianBlurEffect(a,t.effectsManager.effectElements[e])),r&&this.filters.push(r);n&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+locationHref+"#"+s+")")),this.filters.length&&t.addRenderableComponent(this)}function CVContextData(){this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;var t;for(this.savedOp=createTypedArray("float32",15),t=0;t<15;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=15}function CVBaseElement(){}function CVImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.img=e.imageLoader.getImage(this.assetData),this.initElement(t,e,r)}function CVCompElement(t,e,r){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CVMaskElement(t,e){this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var r,i=this.masksProperties.length,s=!1;for(r=0;r<i;r++)"n"!==this.masksProperties[r].mode&&(s=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);(this.hasMasks=s)&&this.element.addRenderableComponent(this)}function CVShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(t,e,r)}function CVSolidElement(t,e,r){this.initElement(t,e,r)}function CVTextElement(t,e,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,r)}function CVEffects(){}function HBaseElement(t,e,r){}function HSolidElement(t,e,r){this.initElement(t,e,r)}function HCompElement(t,e,r){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function HShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(t,e,r){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,r)}function HImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r)}function HCameraElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initHierarchy();var i=PropertyFactory.getProp;if(this.pe=i(this,t.pe,0,0,this),t.ks.p.s?(this.px=i(this,t.ks.p.x,1,0,this),this.py=i(this,t.ks.p.y,1,0,this),this.pz=i(this,t.ks.p.z,1,0,this)):this.p=i(this,t.ks.p,1,0,this),t.ks.a&&(this.a=i(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var s,a=t.ks.or.k.length;for(s=0;s<a;s+=1)t.ks.or.k[s].to=null,t.ks.or.k[s].ti=null}this.or=i(this,t.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=i(this,t.ks.rx,0,degToRads,this),this.ry=i(this,t.ks.ry,0,degToRads,this),this.rz=i(this,t.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HEffects(){}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,r=_svgMatteSymbols.length;e<r;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var r=t.layerElement.parentNode;if(r){for(var i,s=r.children,a=0,n=s.length;a<n&&s[a]!==t.layerElement;)a+=1;a<=n-2&&(i=s[a+1]);var o=createNS("use");o.setAttribute("href","#"+e),i?r.insertBefore(o,i):r.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var r=createElementID(),i=createNS("mask");i.setAttribute("id",e.layerId),i.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var s=t.globalData.defs;s.appendChild(i);var a=createNS("symbol");a.setAttribute("id",r),this.replaceInParent(e,r),a.appendChild(e.layerElement),s.appendChild(a);var n=createNS("use");n.setAttribute("href","#"+r),i.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,r=0,i=e.length;r<i;)e[r]&&e[r].data.ind===t&&this.setElementAsMask(this.elem,e[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGEffects.prototype.renderFrame=function(t){var e,r=this.filters.length;for(e=0;e<r;e+=1)this.filters[e].renderFrame(t)},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var r=0;for(r=this._length;r<t;r+=1)this.saved[r]=createTypedArray("float32",16);this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var t=createTag("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,r,i=t.getContext("2d"),s=this.img.width,a=this.img.height,n=s/a,o=this.assetData.w/this.assetData.h,h=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;o<n&&"xMidYMid slice"===h||n<o&&"xMidYMid slice"!==h?e=(r=a)*o:r=(e=s)/o,i.drawImage(this.img,(s-e)/2,(a-r)/2,e,r,0,0,this.assetData.w,this.assetData.h),this.img=t}},CVImageElement.prototype.renderInnerContent=function(t){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([CanvasRenderer,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,r,i,s=this.element.finalTransform.mat,a=this.element.canvasContext,n=this.masksProperties.length;for(a.beginPath(),t=0;t<n;t++)if("n"!==this.masksProperties[t].mode){this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),i=this.viewData[t].v,e=s.applyToPointArray(i.v[0][0],i.v[0][1],0),a.moveTo(e[0],e[1]);var o,h=i._length;for(o=1;o<h;o++)r=s.applyToTriplePoints(i.o[o-1],i.i[o],i.v[o]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=s.applyToTriplePoints(i.o[o-1],i.i[0],i.v[0]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var r={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"==t.ty||"st"==t.ty?(i.c=PropertyFactory.getProp(this,t.c,1,255,this),i.c.k||(r.co="rgb("+bm_floor(i.c.v[0])+","+bm_floor(i.c.v[1])+","+bm_floor(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=PropertyFactory.getProp(this,t.s,1,null,this),i.e=PropertyFactory.getProp(this,t.e,1,null,this),i.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),i.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),i.g=new GradientProperty(this,t.g,this)),i.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"==t.ty||"gs"==t.ty){if(r.lc=this.lcEnum[t.lc]||"round",r.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(r.ml=t.ml),i.w=PropertyFactory.getProp(this,t.w,0,null,this),i.w.k||(r.wi=i.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);i.d=s,i.d.k||(r.da=i.d.dashArray,r.do=i.d.dashoffset[0])}}else r.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(r),i.style=r,i},CVShapeElement.prototype.createGroupElement=function(t){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(t){var e,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},CVShapeElement.prototype.closeStyles=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].closed=!0},CVShapeElement.prototype.searchShapes=function(t,e,r,i,s){var a,n,o,h,l,p,m=t.length-1,f=[],c=[],d=[].concat(s);for(a=m;0<=a;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=r[h-1]:t[a]._shouldRender=i,"fl"==t[a].ty||"st"==t[a].ty||"gf"==t[a].ty||"gs"==t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),f.push(e[a].style);else if("gr"==t[a].ty){if(h)for(o=e[a].it.length,n=0;n<o;n+=1)e[a].prevViewData[n]=e[a].it[n];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,i,d)}else"tr"==t[a].ty?(h||(p=this.createTransformElement(t[a]),e[a]=p),d.push(e[a]),this.addTransformToStyleList(e[a])):"sh"==t[a].ty||"rc"==t[a].ty||"el"==t[a].ty||"sr"==t[a].ty?h||(e[a]=this.createShapeElement(t[a])):"tm"==t[a].ty||"rd"==t[a].ty?(h?(l=e[a]).closed=!1:((l=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=l,this.shapeModifiers.push(l)),c.push(l)):"rp"==t[a].ty&&(h?(l=e[a]).closed=!0:(l=ShapeModifiers.getModifier(t[a].ty),(e[a]=l).init(this,t,a,e),this.shapeModifiers.push(l),i=!1),c.push(l));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(f),m=c.length,a=0;a<m;a+=1)c[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var t,e,r,i,s,a,n,o,h,l=this.stylesList.length,p=this.globalData.renderer,m=this.globalData.canvasContext;for(t=0;t<l;t+=1)if(("st"!==(o=(h=this.stylesList[t]).type)&&"gs"!==o||0!==h.wi)&&h.data._shouldRender&&0!==h.coOp&&0!==this.globalData.currentGlobalAlpha){for(p.save(),a=h.elements,"st"===o||"gs"===o?(m.strokeStyle="st"===o?h.co:h.grd,m.lineWidth=h.wi,m.lineCap=h.lc,m.lineJoin=h.lj,m.miterLimit=h.ml||0):m.fillStyle="fl"===o?h.co:h.grd,p.ctxOpacity(h.coOp),"st"!==o&&"gs"!==o&&m.beginPath(),p.ctxTransform(h.preTransforms.finalTransform.props),r=a.length,e=0;e<r;e+=1){for("st"!==o&&"gs"!==o||(m.beginPath(),h.da&&(m.setLineDash(h.da),m.lineDashOffset=h.do)),s=(n=a[e].trNodes).length,i=0;i<s;i+=1)"m"==n[i].t?m.moveTo(n[i].p[0],n[i].p[1]):"c"==n[i].t?m.bezierCurveTo(n[i].pts[0],n[i].pts[1],n[i].pts[2],n[i].pts[3],n[i].pts[4],n[i].pts[5]):m.closePath();"st"!==o&&"gs"!==o||(m.stroke(),h.da&&m.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&m.fill(h.r),p.restore()}},CVShapeElement.prototype.renderShape=function(t,e,r,i){var s,a;for(a=t,s=e.length-1;0<=s;s-=1)"tr"==e[s].ty?(a=r[s].transform,this.renderShapeTransform(t,a)):"sh"==e[s].ty||"el"==e[s].ty||"rc"==e[s].ty||"sr"==e[s].ty?this.renderPath(e[s],r[s]):"fl"==e[s].ty?this.renderFill(e[s],r[s],a):"st"==e[s].ty?this.renderStroke(e[s],r[s],a):"gf"==e[s].ty||"gs"==e[s].ty?this.renderGradientFill(e[s],r[s],a):"gr"==e[s].ty?this.renderShape(a,e[s].it,r[s].it):e[s].ty;i&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var r,i,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(s=0;s<o;s+=1){var l=n.shapes[s];if(l&&l.v){for(i=l._length,r=1;r<i;r+=1)1===r&&a.push({t:"m",p:h.applyToPointArray(l.v[0][0],l.v[0][1],0)}),a.push({t:"c",pts:h.applyToTriplePoints(l.o[r-1],l.i[r],l.v[r])});1===i&&a.push({t:"m",p:h.applyToPointArray(l.v[0][0],l.v[0][1],0)}),l.c&&i&&(a.push({t:"c",pts:h.applyToTriplePoints(l.o[r-1],l.i[0],l.v[0])}),a.push({t:"z"}))}}t.trNodes=a}},CVShapeElement.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var r,i=e.styledShapes.length;for(r=0;r<i;r+=1)this.renderStyledShape(e.styledShapes[r],e.sh)}},CVShapeElement.prototype.renderFill=function(t,e,r){var i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(t,e,r){var i=e.style;if(!i.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var s=this.globalData.canvasContext,a=e.s.v,n=e.e.v;if(1===t.t)f=s.createLinearGradient(a[0],a[1],n[0],n[1]);else var o=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)),h=Math.atan2(n[1]-a[1],n[0]-a[0]),l=o*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),p=Math.cos(h+e.a.v)*l+a[0],m=Math.sin(h+e.a.v)*l+a[1],f=s.createRadialGradient(p,m,0,a[0],a[1],o);var c,d=t.g.p,u=e.g.c,y=1;for(c=0;c<d;c+=1)e.g._hasOpacity&&e.g._collapsable&&(y=e.g.o[2*c+1]),f.addColorStop(u[4*c]/100,"rgba("+u[4*c+1]+","+u[4*c+2]+","+u[4*c+3]+","+y+")");i.grd=f}i.coOp=e.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||this._isFirstFrame)&&(i.da=s.dashArray,i.do=s.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity),(e.w._mdf||this._isFirstFrame)&&(i.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var r=!1;t.sc&&(r=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var i,s,a=this.globalData.fontManager.getFontByName(t.f),n=t.l,o=this.mHelper;this.stroke=r,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,s=t.finalText.length;var h,l,p,m,f,c,d,u,y,g,v=this.data.singleShape,b=t.tr/1e3*t.finalSize,E=0,x=0,S=!0,P=0;for(i=0;i<s;i+=1){for(l=(h=this.globalData.fontManager.getCharData(t.finalText[i],a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&h.data||{},o.reset(),v&&n[i].n&&(E=-b,x+=t.yOffset,x+=S?1:0,S=!1),d=(f=l.shapes?l.shapes[0].it:[]).length,o.scale(t.finalSize/100,t.finalSize/100),v&&this.applyTextPropertiesToMatrix(t,o,n[i].line,E,x),y=createSizedArray(d),c=0;c<d;c+=1){for(m=f[c].ks.k.i.length,u=f[c].ks.k,g=[],p=1;p<m;p+=1)1==p&&g.push(o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),g.push(o.applyToX(u.o[p-1][0],u.o[p-1][1],0),o.applyToY(u.o[p-1][0],u.o[p-1][1],0),o.applyToX(u.i[p][0],u.i[p][1],0),o.applyToY(u.i[p][0],u.i[p][1],0),o.applyToX(u.v[p][0],u.v[p][1],0),o.applyToY(u.v[p][0],u.v[p][1],0));g.push(o.applyToX(u.o[p-1][0],u.o[p-1][1],0),o.applyToY(u.o[p-1][0],u.o[p-1][1],0),o.applyToX(u.i[0][0],u.i[0][1],0),o.applyToY(u.i[0][0],u.i[0][1],0),o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),y[c]=g}v&&(E+=n[i].l,E+=b),this.textSpans[P]?this.textSpans[P].elem=y:this.textSpans[P]={elem:y},P+=1}},CVTextElement.prototype.renderInnerContent=function(){var t,e,r,i,s,a,n=this.canvasContext;this.finalTransform.mat.props;n.font=this.values.fValue,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,h=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;e=l.length;var p,m,f=null,c=null,d=null;for(t=0;t<e;t+=1)if(!l[t].n){if((o=h[t])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(o.p),this.globalData.renderer.ctxOpacity(o.o)),this.fill){for(o&&o.fc?f!==o.fc&&(f=o.fc,n.fillStyle=o.fc):f!==this.values.fill&&(f=this.values.fill,n.fillStyle=this.values.fill),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<i;r+=1)for(a=(m=p[r]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(o&&o.sw?d!==o.sw&&(d=o.sw,n.lineWidth=o.sw):d!==this.values.sWidth&&(d=this.values.sWidth,n.lineWidth=this.values.sWidth),o&&o.sc?c!==o.sc&&(c=o.sc,n.strokeStyle=o.sc):c!==this.values.stroke&&(c=this.values.stroke,n.strokeStyle=this.values.stroke),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<i;r+=1)for(a=(m=p[r]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}o&&this.globalData.renderer.restore()}},CVEffects.prototype.renderFrame=function(){},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&(this.transformedElement.style.transform=this.transformedElement.style.webkitTransform=this.finalTransform.mat.toCSS()),this.finalTransform._opMdf&&(this.transformedElement.style.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=HybridRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([HybridRenderer,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(t,e){for(var r,i=0;i<e;)this.elements[i]&&this.elements[i].getBaseElement&&(r=this.elements[i].getBaseElement()),i+=1;r?this.layerElement.insertBefore(t,r):this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e=t[r].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(t,e){var r,i,s,a,n,o=t.sh.v,h=t.transformers,l=o._length;if(!(l<=1)){for(r=0;r<l-1;r+=1)i=this.getTransformedPoint(h,o.v[r]),s=this.getTransformedPoint(h,o.o[r]),a=this.getTransformedPoint(h,o.i[r+1]),n=this.getTransformedPoint(h,o.v[r+1]),this.checkBounds(i,s,a,n,e);o.c&&(i=this.getTransformedPoint(h,o.v[r]),s=this.getTransformedPoint(h,o.o[r]),a=this.getTransformedPoint(h,o.i[0]),n=this.getTransformedPoint(h,o.v[0]),this.checkBounds(i,s,a,n,e))}},HShapeElement.prototype.checkBounds=function(t,e,r,i,s){this.getBoundsOfCurve(t,e,r,i);var a=this.shapeBoundingBox;s.x=bm_min(a.left,s.x),s.xMax=bm_max(a.right,s.xMax),s.y=bm_min(a.top,s.y),s.yMax=bm_max(a.bottom,s.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(t,e,r,i){for(var s,a,n,o,h,l,p,m=[[t[0],i[0]],[t[1],i[1]]],f=0;f<2;++f)if(a=6*t[f]-12*e[f]+6*r[f],s=-3*t[f]+9*e[f]-9*r[f]+3*i[f],n=3*e[f]-3*t[f],a|=0,n|=0,0!==(s|=0))(h=a*a-4*n*s)<0||(0<(l=(-a+bm_sqrt(h))/(2*s))&&l<1&&m[f].push(this.calculateF(l,t,e,r,i,f)),0<(p=(-a-bm_sqrt(h))/(2*s))&&p<1&&m[f].push(this.calculateF(p,t,e,r,i,f)));else{if(0===a)continue;0<(o=-n/a)&&o<1&&m[f].push(this.calculateF(o,t,e,r,i,f))}this.shapeBoundingBox.left=bm_min.apply(null,m[0]),this.shapeBoundingBox.top=bm_min.apply(null,m[1]),this.shapeBoundingBox.right=bm_max.apply(null,m[0]),this.shapeBoundingBox.bottom=bm_max.apply(null,m[1])},HShapeElement.prototype.calculateF=function(t,e,r,i,s,a){return bm_pow(1-t,3)*e[a]+3*bm_pow(1-t,2)*t*r[a]+3*(1-t)*bm_pow(t,2)*i[a]+bm_pow(t,3)*s[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]&&t[r].sh?this.calculateShapeBoundingBox(t[r],e):t[r]&&t[r].it&&this.calculateBoundingBox(t[r].it,e)},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var r=!1;this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),r=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),r=!0),(r||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y)&&(this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.shapeCont.style.transform=this.shapeCont.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=createNS("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=this.innerElem.style;e.color=e.fill=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)",t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var r,i,s=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",s.fClass)this.innerElem.className=s.fClass;else{e.fontFamily=s.fFamily;var a=t.fWeight,n=t.fStyle;e.fontStyle=n,e.fontWeight=a}var o,h,l,p=t.l;i=p.length;var m,f=this.mHelper,c="",d=0;for(r=0;r<i;r+=1){if(this.globalData.fontManager.chars?(this.textPaths[d]?o=this.textPaths[d]:((o=createNS("path")).setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[d]?l=(h=this.textSpans[d]).children[0]:((h=createTag("div")).style.lineHeight=0,(l=createNS("svg")).appendChild(o),styleDiv(h)))):this.isMasked?o=this.textPaths[d]?this.textPaths[d]:createNS("text"):this.textSpans[d]?(h=this.textSpans[d],o=this.textPaths[d]):(styleDiv(h=createTag("span")),styleDiv(o=createTag("span")),h.appendChild(o)),this.globalData.fontManager.chars){var u,y=this.globalData.fontManager.getCharData(t.finalText[r],s.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(u=y?y.data:null,f.reset(),u&&u.shapes&&(m=u.shapes[0].it,f.scale(t.finalSize/100,t.finalSize/100),c=this.createPathShape(f,m),o.setAttribute("d",c)),this.isMasked)this.innerElem.appendChild(o);else{if(this.innerElem.appendChild(h),u&&u.shapes){document.body.appendChild(l);var g=l.getBBox();l.setAttribute("width",g.width+2),l.setAttribute("height",g.height+2),l.setAttribute("viewBox",g.x-1+" "+(g.y-1)+" "+(g.width+2)+" "+(g.height+2)),l.style.transform=l.style.webkitTransform="translate("+(g.x-1)+"px,"+(g.y-1)+"px)",p[r].yOffset=g.y-1}else l.setAttribute("width",1),l.setAttribute("height",1);h.appendChild(l)}}else o.textContent=p[r].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked?this.innerElem.appendChild(o):(this.innerElem.appendChild(h),o.style.transform=o.style.webkitTransform="translate3d(0,"+-t.finalSize/1.2+"px,0)");this.isMasked?this.textSpans[d]=o:this.textSpans[d]=h,this.textSpans[d].style.display="block",this.textPaths[d]=o,d+=1}for(;d<this.textSpans.length;)this.textSpans[d].style.display="none",d+=1},HTextElement.prototype.renderInnerContent=function(){if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;this.isMasked&&this.finalTransform._matMdf&&(this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)")}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var t,e,r,i,s,a=0,n=this.textAnimator.renderedLetters,o=this.textProperty.currentData.l;for(e=o.length,t=0;t<e;t+=1)o[t].n?a+=1:(i=this.textSpans[t],s=this.textPaths[t],r=n[a],a+=1,r._mdf.m&&(this.isMasked?i.setAttribute("transform",r.m):i.style.transform=i.style.webkitTransform=r.m),i.style.opacity=r.o,r.sw&&r._mdf.sw&&s.setAttribute("stroke-width",r.sw),r.sc&&r._mdf.sc&&s.setAttribute("stroke",r.sc),r.fc&&r._mdf.fc&&(s.setAttribute("fill",r.fc),s.style.color=r.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var h=this.innerElem.getBBox();this.currentBBox.w!==h.width&&(this.currentBBox.w=h.width,this.svgElement.setAttribute("width",h.width)),this.currentBBox.h!==h.height&&(this.currentBBox.h=h.height,this.svgElement.setAttribute("height",h.height));this.currentBBox.w===h.width+2&&this.currentBBox.h===h.height+2&&this.currentBBox.x===h.x-1&&this.currentBBox.y===h.y-1||(this.currentBBox.w=h.width+2,this.currentBBox.h=h.height+2,this.currentBBox.x=h.x-1,this.currentBBox.y=h.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var t,e,r=this.comp.threeDElements.length;for(t=0;t<r;t+=1)"3d"===(e=this.comp.threeDElements[t]).type&&(e.perspectiveElem.style.perspective=e.perspectiveElem.style.webkitPerspective=this.pe.v+"px",e.container.style.transformOrigin=e.container.style.mozTransformOrigin=e.container.style.webkitTransformOrigin="0px 0px 0px",e.perspectiveElem.style.transform=e.perspectiveElem.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)")},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var t,e,r=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)r=this.hierarchy[t].finalTransform.mProp._mdf||r;if(r||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){if(this.mat.reset(),this.hierarchy)for(t=e=this.hierarchy.length-1;0<=t;t-=1){var i=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-i.p.v[0],-i.p.v[1],i.p.v[2]),this.mat.rotateX(-i.or.v[0]).rotateY(-i.or.v[1]).rotateZ(i.or.v[2]),this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v),this.mat.scale(1/i.s.v[0],1/i.s.v[1],1/i.s.v[2]),this.mat.translate(i.a.v[0],i.a.v[1],i.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s;s=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),n=[s[0]/a,s[1]/a,s[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],o),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-h)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var m;for(e=this.comp.threeDElements.length,t=0;t<e;t+=1)"3d"===(m=this.comp.threeDElements[t]).type&&(p&&(m.container.style.transform=m.container.style.webkitTransform=this.mat.toCSS()),this.pe._mdf&&(m.perspectiveElem.style.perspective=m.perspectiveElem.style.webkitPerspective=this.pe.v+"px"));this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},HEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||m()),e+=1}function l(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem==t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return f(i,t),i.setData(t,e),i}function p(){n+=1,d()}function m(){n-=1}function f(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",p),t.addEventListener("_idle",m),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new AnimationItem;return f(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),l(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerHTML="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),l(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.subframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){t.context&&(this.context=t.context),(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||(!1===t.loop?this.loop=!1:!0===t.loop?this.loop=!0:this.loop=parseInt(t.loop)),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){var r={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===s||(r.loop="false"!==s&&("true"===s||parseInt(s)));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id==a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.loaded()?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.loaded()||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.subframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.subframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"))},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!=r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t==this.assets[e].id)return this.assets[e];e+=1}},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(IW={},IW.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},IW),IW;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:void 0}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]=t[0]+e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t)),"string"===i&&(e=parseInt(e)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]=t[0]-e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t)),"string"==typeof e&&(e=parseInt(e)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var r,i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n==o)e=r=0;else{var l=n-o;switch(r=.5<h?l/(2-n-o):l/(n+o),n){case i:e=(s-a)/l+(s<a?6:0);break;case s:e=(a-i)/l+2;break;case a:e=(i-s)/l+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)e=r=i=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*n;var o,h=i.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=i[o]+(s[o]-i[o])*n;return l}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shape_pool.newElement();n.setPathData(!!i,a);var o,h,l=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:l,h=r&&r[s]?r[s]:l,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,__expression_functions=[],scoped_bm_rt;if(data.xf){var i,len=data.xf.length;for(i=0;i<len;i+=1)__expression_functions[i]=eval("(function(){ return "+data.xf[i]+"}())")}var expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),l=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)l[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r);var n=t(e=1<e?1:e<0?0:e);if($bm_isInstanceOfArray(s)){var o,h=s.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=(a[o]-s[o])*n+s[o];return l}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=data.k[t].hasOwnProperty("s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[l.length-1].t;if(h<=p)return this.pv;if(r?s=p-(i=e?Math.abs(p-elem.comp.globalData.frameRate*e):Math.max(0,p-this.elem.data.ip)):((!e||e>l.length-1)&&(e=l.length-1),i=p-(s=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=(f[a]-m[a])*d+c[a];return o}return(f-m)*d+c}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-p)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-p)/.001*(u-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[0].t;if(p<=h)return this.pv;if(r?s=p+(i=e?Math.abs(elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>l.length-1)&&(e=l.length-1),i=(s=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/i)%2==0)return this.getValueAtTime(((p-h)%i+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(p/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(p-h)%i+p)/this.comp.globalData.frameRate,0),d=Math.floor((p-h)/i)+1;if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(f[a]-m[a])*d;return o}return c-(f-m)*d}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(p-h)/.001;return o}return u+(u-y)*(p-h)/.001}}return this.getValueAtTime((i-(p-h)%i+p)/this.comp.globalData.frameRate,0)}function l(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){console.warn("Transform at time not supported")}.bind(i):i.getValueAtTime=function(t){}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var p=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=p(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=l,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0));var i,s=r._length,a=r[t],n=r.v,o=createSizedArray(s);for(i=0;i<s;i+=1)o[i]="i"===t||"o"===t?[a[i][0]-n[i][0],a[i][1]-n[i][1]]:[a[i][0],a[i][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,l=0;o<h;){if(l+a[o].addedLength>n){var p=o,m=r.c&&o===h-1?0:o+1,f=(n-l)/a[o].addedLength;i=bez.getPointInSegment(r.v[p],r.v[m],r.o[p],r.i[m],f,a[o]);break}l+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){t=1==t?this.v.c?0:.999:t;var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){if(this.data.d.x)return this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0};var ShapeExpressionInterface=function(){function m(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"==t[i].ty?s.push(n(t[i],e[i],r)):"fl"==t[i].ty?s.push(o(t[i],e[i],r)):"st"==t[i].ty?s.push(h(t[i],e[i],r)):"tm"==t[i].ty?s.push(l(t[i],e[i],r)):"tr"==t[i].ty||("el"==t[i].ty?s.push(p(t[i],e[i],r)):"sr"==t[i].ty?s.push(f(t[i],e[i],r)):"sh"==t[i].ty?s.push(y(t[i],e[i],r)):"rc"==t[i].ty?s.push(c(t[i],e[i],r)):"rd"==t[i].ty?s.push(d(t[i],e[i],r)):"rp"==t[i].ty&&s.push(u(t[i],e[i],r)));return s}function n(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=function(t){return 1===t?i:r(t-1)};var s,a,n,o,h,l=(s=t,a=e,n=i.propertyGroup,(h=function(t){for(var e=0,r=o.length;e<r;){if(o[e]._name===t||o[e].mn===t||o[e].propertyIndex===t||o[e].ix===t||o[e].ind===t)return o[e];e+=1}if("number"==typeof t)return o[t-1]}).propertyGroup=function(t){return 1===t?h:n(t-1)},o=m(s.it,a.it,h.propertyGroup),h.numProperties=o.length,h.propertyIndex=s.cix,h._name=s.nm,h),p=function(e,t,r){function i(t){return 1==t?s:r(--t)}t.transform.mProps.o.setGroupProperty(i),t.transform.mProps.p.setGroupProperty(i),t.transform.mProps.a.setGroupProperty(i),t.transform.mProps.s.setGroupProperty(i),t.transform.mProps.r.setGroupProperty(i),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(i),t.transform.mProps.sa.setGroupProperty(i));function s(t){return e.a.ix===t||"Anchor Point"===t?s.anchorPoint:e.o.ix===t||"Opacity"===t?s.opacity:e.p.ix===t||"Position"===t?s.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?s.rotation:e.s.ix===t||"Scale"===t?s.scale:e.sk&&e.sk.ix===t||"Skew"===t?s.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?s.skewAxis:void 0}return t.transform.op.setGroupProperty(i),Object.defineProperties(s,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),s.ty="tr",s.mn=e.mn,s.propertyGroup=r,s}(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=l,i.transform=p,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function o(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:void 0}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(r),e.o.setGroupProperty(r),i}function h(t,e,r){function i(t){return 1===t?ob:r(t-1)}function s(t){return 1===t?h:i(t-1)}var a,n,o=t.d?t.d.length:0,h={};for(a=0;a<o;a+=1)n=a,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[a].p.setGroupProperty(s);function l(t){return"Color"===t||"color"===t?l.color:"Opacity"===t||"opacity"===t?l.opacity:"Stroke Width"===t||"stroke width"===t?l.strokeWidth:void 0}return Object.defineProperties(l,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(i),e.o.setGroupProperty(i),e.w.setGroupProperty(i),l}function l(e,t,r){function i(t){return 1==t?s:r(--t)}function s(t){return t===e.e.ix||"End"===t||"end"===t?s.end:t===e.s.ix?s.start:t===e.o.ix?s.offset:void 0}return s.propertyIndex=e.ix,t.s.setGroupProperty(i),t.e.setGroupProperty(i),t.o.setGroupProperty(i),s.propertyIndex=e.ix,s.propertyGroup=r,Object.defineProperties(s,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),s.mn=e.mn,s}function p(e,t,r){function i(t){return 1==t?a:r(--t)}a.propertyIndex=e.ix;var s="tm"===t.sh.ty?t.sh.prop:t.sh;function a(t){return e.p.ix===t?a.position:e.s.ix===t?a.size:void 0}return s.s.setGroupProperty(i),s.p.setGroupProperty(i),Object.defineProperties(a,{size:{get:ExpressionPropertyInterface(s.s)},position:{get:ExpressionPropertyInterface(s.p)},_name:{value:e.nm}}),a.mn=e.mn,a}function f(e,t,r){function i(t){return 1==t?a:r(--t)}var s="tm"===t.sh.ty?t.sh.prop:t.sh;function a(t){return e.p.ix===t?a.position:e.r.ix===t?a.rotation:e.pt.ix===t?a.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?a.outerRadius:e.os.ix===t?a.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?a.innerRoundness:void 0:a.innerRadius}return a.propertyIndex=e.ix,s.or.setGroupProperty(i),s.os.setGroupProperty(i),s.pt.setGroupProperty(i),s.p.setGroupProperty(i),s.r.setGroupProperty(i),e.ir&&(s.ir.setGroupProperty(i),s.is.setGroupProperty(i)),Object.defineProperties(a,{position:{get:ExpressionPropertyInterface(s.p)},rotation:{get:ExpressionPropertyInterface(s.r)},points:{get:ExpressionPropertyInterface(s.pt)},outerRadius:{get:ExpressionPropertyInterface(s.or)},outerRoundness:{get:ExpressionPropertyInterface(s.os)},innerRadius:{get:ExpressionPropertyInterface(s.ir)},innerRoundness:{get:ExpressionPropertyInterface(s.is)},_name:{value:e.nm}}),a.mn=e.mn,a}function c(e,t,r){function i(t){return 1==t?a:r(--t)}var s="tm"===t.sh.ty?t.sh.prop:t.sh;function a(t){return e.p.ix===t?a.position:e.r.ix===t?a.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?a.size:void 0}return a.propertyIndex=e.ix,s.p.setGroupProperty(i),s.s.setGroupProperty(i),s.r.setGroupProperty(i),Object.defineProperties(a,{position:{get:ExpressionPropertyInterface(s.p)},roundness:{get:ExpressionPropertyInterface(s.r)},size:{get:ExpressionPropertyInterface(s.s)},_name:{value:e.nm}}),a.mn=e.mn,a}function d(e,t,r){var i=t;function s(t){if(e.r.ix===t||"Round Corners 1"===t)return s.radius}return s.propertyIndex=e.ix,i.rd.setGroupProperty(function(t){return 1==t?s:r(--t)}),Object.defineProperties(s,{radius:{get:ExpressionPropertyInterface(i.rd)},_name:{value:e.nm}}),s.mn=e.mn,s}function u(e,t,r){function i(t){return 1==t?a:r(--t)}var s=t;function a(t){return e.c.ix===t||"Copies"===t?a.copies:e.o.ix===t||"Offset"===t?a.offset:void 0}return a.propertyIndex=e.ix,s.c.setGroupProperty(i),s.o.setGroupProperty(i),Object.defineProperties(a,{copies:{get:ExpressionPropertyInterface(s.c)},offset:{get:ExpressionPropertyInterface(s.o)},_name:{value:e.nm}}),a.mn=e.mn,a}function y(t,e,r){var i=e.sh;function s(t){if("Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t)return s.path}return i.setGroupProperty(function(t){return 1==t?s:r(--t)}),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn}}),s}return function(t,e,r){var i;function s(t){if("number"==typeof t)return i[t-1];for(var e=0,r=i.length;e<r;){if(i[e]._name===t)return i[e];e+=1}}return s.propertyGroup=r,i=m(t,e,s),s.numProperties=i.length,s}}(),TextExpressionInterface=function(e){var r;function t(){}return Object.defineProperty(t,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),t},LayerExpressionInterface=function(){function s(t,e){var r=new Matrix;if(r.reset(),this._elem.finalTransform.mProp.applyToMatrix(r),this._elem.hierarchy&&this._elem.hierarchy.length){var i,s=this._elem.hierarchy.length;for(i=0;i<s;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(r);return r.applyToPointArray(t[0],t[1],t[2]||0)}return r.applyToPointArray(t[0],t[1],t[2]||0)}function a(t,e){var r=new Matrix;if(r.reset(),this._elem.finalTransform.mProp.applyToMatrix(r),this._elem.hierarchy&&this._elem.hierarchy.length){var i,s=this._elem.hierarchy.length;for(i=0;i<s;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(r);return r.inversePoint(t)}return r.inversePoint(t)}function n(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function o(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect}}i.toWorld=s,i.fromWorld=a,i.toComp=s,i.fromComp=n,i.sampleImage=o,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity}}if(Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p)var r=ExpressionPropertyInterface(t.p);return Object.defineProperty(e,"position",{get:function(){return t.p?r():[t.px.v,t.py.v,t.pz?t.pz.v:0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function l(s,t,e,r){var i,a=[],n=s.ef.length;for(i=0;i<n;i+=1)5===s.ef[i].ty?a.push(l(s.ef[i],t.effectElements[i],t.effectElements[i].propertyGroup,r)):a.push(p(t.effectElements[i],s.ef[i].ty,r,o));function o(t){return 1===t?h:e(t-1)}var h=function(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?a[r]:a[r]();r+=1}return a[0]()};return h.propertyGroup=o,"ADBE Color Control"===s.mn&&Object.defineProperty(h,"color",{get:function(){return a[0]()}}),Object.defineProperty(h,"numProperties",{get:function(){return s.np}}),h.active=h.enabled=0!==s.en,h}function p(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(i),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(s,t){if(s.effectsManager){var e,a=[],r=s.data.ef,i=s.effectsManager.effectElements.length;for(e=0;e<i;e+=1)a.push(l(r[e],s.effectsManager.effectElements[e],t,s));return function(t){for(var e=s.data.ef||[],r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return a[r];r+=1}}}}}}(),MaskManagerInterface=function(){function a(t,e){this._mask=t,this._data=e}Object.defineProperty(a.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(a.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e,t){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new a(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(i.numKeys){var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r}return 0},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)s[t]=a[t]=e.v[t]*r;return s}}(t):e}}(),r5,s5;function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(){}function EffectsManager(t,e){var r=t.ef||[];this.effectElements=[];var i,s,a=r.length;for(i=0;i<a;i++)s=new GroupEffect(r[i],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}r5=function(){function r(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}return function(t,e){this.pv=1,this.comp=t.comp,this.elem=t,this.mult=.01,this.propType="textSelector",this.textTotal=e.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],this.k=!0,this.x=!0,this.getValue=ExpressionManager.initiateExpression.bind(this)(t,e,this),this.getMult=r,this.getVelocityAtTime=expressionHelpers.getVelocityAtTime,this.kf?this.getValueAtTime=expressionHelpers.getValueAtTime.bind(this):this.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(this),this.setGroupProperty=expressionHelpers.setGroupProperty}}(),s5=TextSelectorProp.getTextSelectorProp,TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new r5(t,e,r):s5(t,e,r)},extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var r,i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottie={},_isFrozen=!1;function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r<e.length;r++){var i=e[r].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.6.8";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""},queryString=myScript.src.replace(/^[^\?]+\??/,"");renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
|
18 |
+
return lottie;
|
19 |
+
}));
|
assets/lib/tablesorter/tablesorter.js
ADDED
@@ -0,0 +1,2916 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
|
2 |
+
/*! TableSorter (FORK) v2.31.3 *//*
|
3 |
+
* Client-side table sorting with ease!
|
4 |
+
* @requires jQuery v1.2.6+
|
5 |
+
*
|
6 |
+
* Copyright (c) 2007 Christian Bach
|
7 |
+
* fork maintained by Rob Garrison
|
8 |
+
*
|
9 |
+
* Examples and original docs at: http://tablesorter.com
|
10 |
+
* Dual licensed under the MIT and GPL licenses:
|
11 |
+
* http://www.opensource.org/licenses/mit-license.php
|
12 |
+
* http://www.gnu.org/licenses/gpl.html
|
13 |
+
*
|
14 |
+
* @type jQuery
|
15 |
+
* @name tablesorter (FORK)
|
16 |
+
* @cat Plugins/Tablesorter
|
17 |
+
* @author Christian Bach - christian.bach@polyester.se
|
18 |
+
* @contributor Rob Garrison - https://github.com/Mottie/tablesorter
|
19 |
+
* @docs (fork) - https://mottie.github.io/tablesorter/docs/
|
20 |
+
*/
|
21 |
+
/*jshint browser:true, jquery:true, unused:false, expr: true */
|
22 |
+
;( function( $ ) {
|
23 |
+
'use strict';
|
24 |
+
var ts = $.tablesorter = {
|
25 |
+
|
26 |
+
version : '2.31.3',
|
27 |
+
|
28 |
+
parsers : [],
|
29 |
+
widgets : [],
|
30 |
+
defaults : {
|
31 |
+
|
32 |
+
// *** appearance
|
33 |
+
theme : 'default', // adds tablesorter-{theme} to the table for styling
|
34 |
+
widthFixed : false, // adds colgroup to fix widths of columns
|
35 |
+
showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
|
36 |
+
|
37 |
+
headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i></i> // class from cssIcon
|
38 |
+
onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
|
39 |
+
onRenderHeader : null, // function( index ) {}, // nothing to return
|
40 |
+
|
41 |
+
// *** functionality
|
42 |
+
cancelSelection : true, // prevent text selection in the header
|
43 |
+
tabIndex : true, // add tabindex to header for keyboard accessibility
|
44 |
+
dateFormat : 'mmddyyyy', // other options: 'ddmmyyy' or 'yyyymmdd'
|
45 |
+
sortMultiSortKey : 'shiftKey', // key used to select additional columns
|
46 |
+
sortResetKey : 'ctrlKey', // key used to remove sorting on a column
|
47 |
+
usNumberFormat : true, // false for German '1.234.567,89' or French '1 234 567,89'
|
48 |
+
delayInit : false, // if false, the parsed table contents will not update until the first sort
|
49 |
+
serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
|
50 |
+
resort : true, // default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed
|
51 |
+
|
52 |
+
// *** sort options
|
53 |
+
headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc.
|
54 |
+
ignoreCase : true, // ignore case while sorting
|
55 |
+
sortForce : null, // column(s) first sorted; always applied
|
56 |
+
sortList : [], // Initial sort order; applied initially; updated when manually sorted
|
57 |
+
sortAppend : null, // column(s) sorted last; always applied
|
58 |
+
sortStable : false, // when sorting two rows with exactly the same content, the original sort order is maintained
|
59 |
+
|
60 |
+
sortInitialOrder : 'asc', // sort direction on first click
|
61 |
+
sortLocaleCompare: false, // replace equivalent character (accented characters)
|
62 |
+
sortReset : false, // third click on the header will reset column to default - unsorted
|
63 |
+
sortRestart : false, // restart sort to 'sortInitialOrder' when clicking on previously unsorted columns
|
64 |
+
|
65 |
+
emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
|
66 |
+
stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
|
67 |
+
duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
|
68 |
+
textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
|
69 |
+
textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
|
70 |
+
textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
|
71 |
+
numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
|
72 |
+
|
73 |
+
// *** widget options
|
74 |
+
initWidgets : true, // apply widgets on tablesorter initialization
|
75 |
+
widgetClass : 'widget-{name}', // table class name template to match to include a widget
|
76 |
+
widgets : [], // method to add widgets, e.g. widgets: ['zebra']
|
77 |
+
widgetOptions : {
|
78 |
+
zebra : [ 'even', 'odd' ] // zebra widget alternating row class names
|
79 |
+
},
|
80 |
+
|
81 |
+
// *** callbacks
|
82 |
+
initialized : null, // function( table ) {},
|
83 |
+
|
84 |
+
// *** extra css class names
|
85 |
+
tableClass : '',
|
86 |
+
cssAsc : '',
|
87 |
+
cssDesc : '',
|
88 |
+
cssNone : '',
|
89 |
+
cssHeader : '',
|
90 |
+
cssHeaderRow : '',
|
91 |
+
cssProcessing : '', // processing icon applied to header during sort/filter
|
92 |
+
|
93 |
+
cssChildRow : 'tablesorter-childRow', // class name indiciating that a row is to be attached to its parent
|
94 |
+
cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name (only one class name allowed here!)
|
95 |
+
cssNoSort : 'tablesorter-noSort', // class name added to element inside header; clicking on it won't cause a sort
|
96 |
+
cssIgnoreRow : 'eae-sort__ignoreRow',// header row to ignore; cells within this row will not be added to c.$headers
|
97 |
+
|
98 |
+
cssIcon : 'tablesorter-icon', // if this class does not exist, the {icon} will not be added from the headerTemplate
|
99 |
+
cssIconNone : '', // class name added to the icon when there is no column sort
|
100 |
+
cssIconAsc : '', // class name added to the icon when the column has an ascending sort
|
101 |
+
cssIconDesc : '', // class name added to the icon when the column has a descending sort
|
102 |
+
cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
|
103 |
+
|
104 |
+
// *** events
|
105 |
+
pointerClick : 'click',
|
106 |
+
pointerDown : 'mousedown',
|
107 |
+
pointerUp : 'mouseup',
|
108 |
+
|
109 |
+
// *** selectors
|
110 |
+
selectorHeaders : '> thead th, > thead td',
|
111 |
+
selectorSort : 'th, td', // jQuery selector of content within selectorHeaders that is clickable to trigger a sort
|
112 |
+
selectorRemove : '.remove-me',
|
113 |
+
|
114 |
+
// *** advanced
|
115 |
+
debug : false,
|
116 |
+
|
117 |
+
// *** Internal variables
|
118 |
+
headerList: [],
|
119 |
+
empties: {},
|
120 |
+
strings: {},
|
121 |
+
parsers: [],
|
122 |
+
|
123 |
+
// *** parser options for validator; values must be falsy!
|
124 |
+
globalize: 0,
|
125 |
+
imgAttr: 0
|
126 |
+
|
127 |
+
// removed: widgetZebra: { css: ['even', 'odd'] }
|
128 |
+
|
129 |
+
},
|
130 |
+
|
131 |
+
// internal css classes - these will ALWAYS be added to
|
132 |
+
// the table and MUST only contain one class name - fixes #381
|
133 |
+
css : {
|
134 |
+
//table : 'tablesorter',
|
135 |
+
cssHasChild: 'tablesorter-hasChildRow',
|
136 |
+
childRow : 'tablesorter-childRow',
|
137 |
+
colgroup : 'tablesorter-colgroup',
|
138 |
+
header : 'eae-table__sortable-head',
|
139 |
+
//headerRow : 'tablesorter-headerRow',
|
140 |
+
//headerIn : 'tablesorter-header-inner',
|
141 |
+
icon : 'tablesorter-icon',
|
142 |
+
processing : 'tablesorter-processing',
|
143 |
+
sortAsc : 'eae-table__sort-Asc',
|
144 |
+
sortDesc : 'eae-table__sort-Desc',
|
145 |
+
sortNone : 'eae-table_unSort'
|
146 |
+
},
|
147 |
+
|
148 |
+
// labels applied to sortable headers for accessibility (aria) support
|
149 |
+
language : {
|
150 |
+
sortAsc : 'Ascending sort applied, ',
|
151 |
+
sortDesc : 'Descending sort applied, ',
|
152 |
+
sortNone : 'No sort applied, ',
|
153 |
+
sortDisabled : 'sorting is disabled',
|
154 |
+
nextAsc : 'activate to apply an ascending sort',
|
155 |
+
nextDesc : 'activate to apply a descending sort',
|
156 |
+
nextNone : 'activate to remove the sort'
|
157 |
+
},
|
158 |
+
|
159 |
+
regex : {
|
160 |
+
templateContent : /\{content\}/g,
|
161 |
+
templateIcon : /\{icon\}/g,
|
162 |
+
templateName : /\{name\}/i,
|
163 |
+
spaces : /\s+/g,
|
164 |
+
nonWord : /\W/g,
|
165 |
+
formElements : /(input|select|button|textarea)/i,
|
166 |
+
|
167 |
+
// *** sort functions ***
|
168 |
+
// regex used in natural sort
|
169 |
+
// chunk/tokenize numbers & letters
|
170 |
+
chunk : /(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,
|
171 |
+
// replace chunks @ ends
|
172 |
+
chunks : /(^\\0|\\0$)/,
|
173 |
+
hex : /^0x[0-9a-f]+$/i,
|
174 |
+
|
175 |
+
// *** formatFloat ***
|
176 |
+
comma : /,/g,
|
177 |
+
digitNonUS : /[\s|\.]/g,
|
178 |
+
digitNegativeTest : /^\s*\([.\d]+\)/,
|
179 |
+
digitNegativeReplace : /^\s*\(([.\d]+)\)/,
|
180 |
+
|
181 |
+
// *** isDigit ***
|
182 |
+
digitTest : /^[\-+(]?\d+[)]?$/,
|
183 |
+
digitReplace : /[,.'"\s]/g
|
184 |
+
|
185 |
+
},
|
186 |
+
|
187 |
+
// digit sort, text location
|
188 |
+
string : {
|
189 |
+
max : 1,
|
190 |
+
min : -1,
|
191 |
+
emptymin : 1,
|
192 |
+
emptymax : -1,
|
193 |
+
zero : 0,
|
194 |
+
none : 0,
|
195 |
+
'null' : 0,
|
196 |
+
top : true,
|
197 |
+
bottom : false
|
198 |
+
},
|
199 |
+
|
200 |
+
keyCodes : {
|
201 |
+
enter : 13
|
202 |
+
},
|
203 |
+
|
204 |
+
// placeholder date parser data (globalize)
|
205 |
+
dates : {},
|
206 |
+
|
207 |
+
// These methods can be applied on table.config instance
|
208 |
+
instanceMethods : {},
|
209 |
+
|
210 |
+
/*
|
211 |
+
▄█████ ██████ ██████ ██ ██ █████▄
|
212 |
+
▀█▄ ██▄▄ ██ ██ ██ ██▄▄██
|
213 |
+
▀█▄ ██▀▀ ██ ██ ██ ██▀▀▀
|
214 |
+
█████▀ ██████ ██ ▀████▀ ██
|
215 |
+
*/
|
216 |
+
|
217 |
+
setup : function( table, c ) {
|
218 |
+
// if no thead or tbody, or tablesorter is already present, quit
|
219 |
+
if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
|
220 |
+
if ( ts.debug(c, 'core') ) {
|
221 |
+
if ( table.hasInitialized ) {
|
222 |
+
console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
|
223 |
+
} else {
|
224 |
+
console.error( 'Stopping initialization! No table, thead or tbody', table );
|
225 |
+
}
|
226 |
+
}
|
227 |
+
return;
|
228 |
+
}
|
229 |
+
|
230 |
+
var tmp = '',
|
231 |
+
$table = $( table ),
|
232 |
+
meta = $.metadata;
|
233 |
+
// initialization flag
|
234 |
+
table.hasInitialized = false;
|
235 |
+
// table is being processed flag
|
236 |
+
table.isProcessing = true;
|
237 |
+
// make sure to store the config object
|
238 |
+
table.config = c;
|
239 |
+
// save the settings where they read
|
240 |
+
$.data( table, 'tablesorter', c );
|
241 |
+
if ( ts.debug(c, 'core') ) {
|
242 |
+
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
|
243 |
+
$.data( table, 'startoveralltimer', new Date() );
|
244 |
+
}
|
245 |
+
|
246 |
+
// removing this in version 3 (only supports jQuery 1.7+)
|
247 |
+
c.supportsDataObject = ( function( version ) {
|
248 |
+
version[ 0 ] = parseInt( version[ 0 ], 10 );
|
249 |
+
return ( version[ 0 ] > 1 ) || ( version[ 0 ] === 1 && parseInt( version[ 1 ], 10 ) >= 4 );
|
250 |
+
})( $.fn.jquery.split( '.' ) );
|
251 |
+
// ensure case insensitivity
|
252 |
+
c.emptyTo = c.emptyTo.toLowerCase();
|
253 |
+
c.stringTo = c.stringTo.toLowerCase();
|
254 |
+
c.last = { sortList : [], clickedIndex : -1 };
|
255 |
+
// add table theme class only if there isn't already one there
|
256 |
+
if ( !/tablesorter\-/.test( $table ) ) {
|
257 |
+
tmp = ( c.theme !== '' ? ' tablesorter-' + c.theme : '' );
|
258 |
+
}
|
259 |
+
|
260 |
+
// give the table a unique id, which will be used in namespace binding
|
261 |
+
if ( !c.namespace ) {
|
262 |
+
c.namespace = '.tablesorter' + Math.random().toString( 16 ).slice( 2 );
|
263 |
+
} else {
|
264 |
+
// make sure namespace starts with a period & doesn't have weird characters
|
265 |
+
c.namespace = '.' + c.namespace.replace( ts.regex.nonWord, '' );
|
266 |
+
}
|
267 |
+
|
268 |
+
c.table = table;
|
269 |
+
c.$table = $table
|
270 |
+
// add namespace to table to allow bindings on extra elements to target
|
271 |
+
// the parent table (e.g. parser-input-select)
|
272 |
+
//.addClass( ts.css.table + ' ' + c.tableClass + tmp + ' ' + c.namespace.slice(1) )
|
273 |
+
//.attr( 'role', 'grid' );
|
274 |
+
c.$headers = $table.find( c.selectorHeaders );
|
275 |
+
|
276 |
+
c.$table.children().children( 'tr' );//.attr( 'role', 'row' );
|
277 |
+
c.$tbodies = $table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );//.attr({
|
278 |
+
// 'aria-live' : 'polite',
|
279 |
+
// 'aria-relevant' : 'all'
|
280 |
+
// });
|
281 |
+
if ( c.$table.children( 'caption' ).length ) {
|
282 |
+
tmp = c.$table.children( 'caption' )[ 0 ];
|
283 |
+
if ( !tmp.id ) { tmp.id = c.namespace.slice( 1 ) + 'caption'; }
|
284 |
+
//c.$table.attr( 'aria-labelledby', tmp.id );
|
285 |
+
}
|
286 |
+
c.widgetInit = {}; // keep a list of initialized widgets
|
287 |
+
// change textExtraction via data-attribute
|
288 |
+
c.textExtraction = c.$table.attr( 'data-text-extraction' ) || c.textExtraction || 'basic';
|
289 |
+
// build headers
|
290 |
+
ts.buildHeaders( c );
|
291 |
+
// fixate columns if the users supplies the fixedWidth option
|
292 |
+
// do this after theme has been applied
|
293 |
+
ts.fixColumnWidth( table );
|
294 |
+
// add widgets from class name
|
295 |
+
ts.addWidgetFromClass( table );
|
296 |
+
// add widget options before parsing (e.g. grouping widget has parser settings)
|
297 |
+
ts.applyWidgetOptions( table );
|
298 |
+
// try to auto detect column type, and store in tables config
|
299 |
+
ts.setupParsers( c );
|
300 |
+
// start total row count at zero
|
301 |
+
c.totalRows = 0;
|
302 |
+
// only validate options while debugging. See #1528
|
303 |
+
if (c.debug) {
|
304 |
+
ts.validateOptions( c );
|
305 |
+
}
|
306 |
+
// build the cache for the tbody cells
|
307 |
+
// delayInit will delay building the cache until the user starts a sort
|
308 |
+
if ( !c.delayInit ) { ts.buildCache( c ); }
|
309 |
+
// bind all header events and methods
|
310 |
+
ts.bindEvents( table, c.$headers, true );
|
311 |
+
ts.bindMethods( c );
|
312 |
+
// get sort list from jQuery data or metadata
|
313 |
+
// in jQuery < 1.4, an error occurs when calling $table.data()
|
314 |
+
if ( c.supportsDataObject && typeof $table.data().sortlist !== 'undefined' ) {
|
315 |
+
c.sortList = $table.data().sortlist;
|
316 |
+
} else if ( meta && ( $table.metadata() && $table.metadata().sortlist ) ) {
|
317 |
+
c.sortList = $table.metadata().sortlist;
|
318 |
+
}
|
319 |
+
// apply widget init code
|
320 |
+
ts.applyWidget( table, true );
|
321 |
+
// if user has supplied a sort list to constructor
|
322 |
+
if ( c.sortList.length > 0 ) {
|
323 |
+
// save sortList before any sortAppend is added
|
324 |
+
c.last.sortList = c.sortList;
|
325 |
+
ts.sortOn( c, c.sortList, {}, !c.initWidgets );
|
326 |
+
} else {
|
327 |
+
ts.setHeadersCss( c );
|
328 |
+
if ( c.initWidgets ) {
|
329 |
+
// apply widget format
|
330 |
+
ts.applyWidget( table, false );
|
331 |
+
}
|
332 |
+
}
|
333 |
+
|
334 |
+
// show processesing icon
|
335 |
+
if ( c.showProcessing ) {
|
336 |
+
$table
|
337 |
+
.unbind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace )
|
338 |
+
.bind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace, function( e ) {
|
339 |
+
clearTimeout( c.timerProcessing );
|
340 |
+
ts.isProcessing( table );
|
341 |
+
if ( e.type === 'sortBegin' ) {
|
342 |
+
c.timerProcessing = setTimeout( function() {
|
343 |
+
ts.isProcessing( table, true );
|
344 |
+
}, 500 );
|
345 |
+
}
|
346 |
+
});
|
347 |
+
}
|
348 |
+
|
349 |
+
// initialized
|
350 |
+
table.hasInitialized = true;
|
351 |
+
table.isProcessing = false;
|
352 |
+
if ( ts.debug(c, 'core') ) {
|
353 |
+
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
354 |
+
if ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
|
355 |
+
}
|
356 |
+
$table.triggerHandler( 'tablesorter-initialized', table );
|
357 |
+
if ( typeof c.initialized === 'function' ) {
|
358 |
+
c.initialized( table );
|
359 |
+
}
|
360 |
+
},
|
361 |
+
|
362 |
+
bindMethods : function( c ) {
|
363 |
+
var $table = c.$table,
|
364 |
+
namespace = c.namespace,
|
365 |
+
events = ( 'sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete ' +
|
366 |
+
'sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup ' +
|
367 |
+
'mouseleave ' ).split( ' ' )
|
368 |
+
.join( namespace + ' ' );
|
369 |
+
// apply easy methods that trigger bound events
|
370 |
+
$table
|
371 |
+
.unbind( events.replace( ts.regex.spaces, ' ' ) )
|
372 |
+
.bind( 'sortReset' + namespace, function( e, callback ) {
|
373 |
+
e.stopPropagation();
|
374 |
+
// using this.config to ensure functions are getting a non-cached version of the config
|
375 |
+
ts.sortReset( this.config, function( table ) {
|
376 |
+
if (table.isApplyingWidgets) {
|
377 |
+
// multiple triggers in a row... filterReset, then sortReset - see #1361
|
378 |
+
// wait to update widgets
|
379 |
+
setTimeout( function() {
|
380 |
+
ts.applyWidget( table, '', callback );
|
381 |
+
}, 100 );
|
382 |
+
} else {
|
383 |
+
ts.applyWidget( table, '', callback );
|
384 |
+
}
|
385 |
+
});
|
386 |
+
})
|
387 |
+
.bind( 'updateAll' + namespace, function( e, resort, callback ) {
|
388 |
+
e.stopPropagation();
|
389 |
+
ts.updateAll( this.config, resort, callback );
|
390 |
+
})
|
391 |
+
.bind( 'update' + namespace + ' updateRows' + namespace, function( e, resort, callback ) {
|
392 |
+
e.stopPropagation();
|
393 |
+
ts.update( this.config, resort, callback );
|
394 |
+
})
|
395 |
+
.bind( 'updateHeaders' + namespace, function( e, callback ) {
|
396 |
+
e.stopPropagation();
|
397 |
+
ts.updateHeaders( this.config, callback );
|
398 |
+
})
|
399 |
+
.bind( 'updateCell' + namespace, function( e, cell, resort, callback ) {
|
400 |
+
e.stopPropagation();
|
401 |
+
ts.updateCell( this.config, cell, resort, callback );
|
402 |
+
})
|
403 |
+
.bind( 'addRows' + namespace, function( e, $row, resort, callback ) {
|
404 |
+
e.stopPropagation();
|
405 |
+
ts.addRows( this.config, $row, resort, callback );
|
406 |
+
})
|
407 |
+
.bind( 'updateComplete' + namespace, function() {
|
408 |
+
this.isUpdating = false;
|
409 |
+
})
|
410 |
+
.bind( 'sorton' + namespace, function( e, list, callback, init ) {
|
411 |
+
e.stopPropagation();
|
412 |
+
ts.sortOn( this.config, list, callback, init );
|
413 |
+
})
|
414 |
+
.bind( 'appendCache' + namespace, function( e, callback, init ) {
|
415 |
+
e.stopPropagation();
|
416 |
+
ts.appendCache( this.config, init );
|
417 |
+
if ( $.isFunction( callback ) ) {
|
418 |
+
callback( this );
|
419 |
+
}
|
420 |
+
})
|
421 |
+
// $tbodies variable is used by the tbody sorting widget
|
422 |
+
.bind( 'updateCache' + namespace, function( e, callback, $tbodies ) {
|
423 |
+
e.stopPropagation();
|
424 |
+
ts.updateCache( this.config, callback, $tbodies );
|
425 |
+
})
|
426 |
+
.bind( 'applyWidgetId' + namespace, function( e, id ) {
|
427 |
+
e.stopPropagation();
|
428 |
+
ts.applyWidgetId( this, id );
|
429 |
+
})
|
430 |
+
.bind( 'applyWidgets' + namespace, function( e, callback ) {
|
431 |
+
e.stopPropagation();
|
432 |
+
// apply widgets (false = not initializing)
|
433 |
+
ts.applyWidget( this, false, callback );
|
434 |
+
})
|
435 |
+
.bind( 'refreshWidgets' + namespace, function( e, all, dontapply ) {
|
436 |
+
e.stopPropagation();
|
437 |
+
ts.refreshWidgets( this, all, dontapply );
|
438 |
+
})
|
439 |
+
.bind( 'removeWidget' + namespace, function( e, name, refreshing ) {
|
440 |
+
e.stopPropagation();
|
441 |
+
ts.re
|