svgcinema-player 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +6 -2
- package/cin-player.min.js +2 -2
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -36,8 +36,8 @@ at any time, at their own discretion and without prior notice:
|
|
|
36
36
|
Continuing to use the Software after a change means accepting the changed terms. No permission in
|
|
37
37
|
these terms is irrevocable, and none limits these rights.
|
|
38
38
|
|
|
39
|
-
Third-party components included with the Software (such as paper.js
|
|
40
|
-
their own licenses.
|
|
39
|
+
Third-party components included with the Software (such as paper.js, opentype.js and the image
|
|
40
|
+
encoders listed in third-party-notices.txt) remain under their own licenses.
|
|
41
41
|
|
|
42
42
|
Versions of the Software that were published earlier under the PolyForm Noncommercial License
|
|
43
43
|
1.0.0 stay under that license for those copies. This notice applies from the version that
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Once the page has loaded, the loader inside each SVG:
|
|
|
13
13
|
change:
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
|
-
https://cdn.jsdelivr.net/npm/svgcinema-player@1.
|
|
16
|
+
https://cdn.jsdelivr.net/npm/svgcinema-player@1.2.0/cin-player.min.js
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
The first SVG on the page loads it, and that one copy starts every SVG on the page.
|
|
@@ -56,7 +56,11 @@ State: `currentTime`, `duration`, `totalTime`, `state`, `isPlaying`, `isReversed
|
|
|
56
56
|
`hasEnded`, `isInfinite`, `isAlternate`, `isBackwards`, `speed`, `fps`, `direction`, `fill`,
|
|
57
57
|
`iterations`.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Start triggers: on load, on mouse over, on click, on scroll into view, linked to scroll (the
|
|
60
|
+
animation follows the page's scroll, or that of the nearest box that scrolls; added in 1.2.0, data
|
|
61
|
+
format 2) and programmatic.
|
|
62
|
+
|
|
63
|
+
`window.CinPlayer` has `version`, `f` (the data format it reads: 2 since 1.2.0), `boot(svg)` (for SVGs added to the
|
|
60
64
|
page later by script, which doesn't run their loader) and `scan(root)`.
|
|
61
65
|
|
|
62
66
|
See LICENSE for the terms.
|
package/cin-player.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! SVGcinema player 1.
|
|
2
|
-
"use strict";(()=>{function pr(d,M){var C={pos:"v",org:"v",p0:"v",p1:"v",rad:"n",ts:"n",te:"n",to:"n",rot:"n",scl:"v",op:"n",fill:"c",stk:"c",sw:"n",d:"m",skw:"v",fo:"n",so:"n",dof:"n",sz:"v",da:"a"},H={ease:[.25,.1,.25,1],in:[.42,0,1,1],out:[0,0,.58,1],inOut:[.42,0,.58,1],inSine:[.12,0,.39,0],outSine:[.61,1,.88,1],inOutSine:[.37,0,.63,1],inQuad:[.11,0,.5,0],outQuad:[.5,1,.89,1],inOutQuad:[.45,0,.55,1],inCubic:[.32,0,.67,0],outCubic:[.33,1,.68,1],inOutCubic:[.65,0,.35,1],inQuart:[.5,0,.75,0],outQuart:[.25,1,.5,1],inOutQuart:[.76,0,.24,1],inQuint:[.64,0,.78,0],outQuint:[.22,1,.36,1],inOutQuint:[.83,0,.17,1],inExpo:[.7,0,.84,0],outExpo:[.16,1,.3,1],inOutExpo:[.87,0,.13,1],inCirc:[.55,0,1,.45],outCirc:[0,.55,.45,1],inOutCirc:[.85,0,.15,1],inBack:[.36,0,.66,-.56],outBack:[.34,1.56,.64,1],inOutBack:[.68,-.6,.32,1.6]},R={},Q={},D=2*Math.PI/3,q=2*Math.PI/4.5,L={hold:function(n){return n<1?0:1},outBounce:F,inBounce:function(n){return 1-F(1-n)},inOutBounce:function(n){return n<.5?(1-F(1-2*n))/2:(1+F(2*n-1))/2},outElastic:function(n){return n===0||n===1?n:Math.pow(2,-10*n)*Math.sin((n*10-.75)*D)+1},inElastic:function(n){return n===0||n===1?n:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*D)},inOutElastic:function(n){return n===0||n===1?n:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*q))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*q)/2+1}};function K(n){var r=3*n[0],e=3*(n[2]-n[0])-r,t=1-r-e,u=3*n[1],i=3*(n[3]-n[1])-u,o=1-u-i;function a(f){return((t*f+e)*f+r)*f}function s(f){return((o*f+i)*f+u)*f}function l(f){return(3*t*f+2*e)*f+r}return function(f){var c=f,b,g,v,h=0,E=1;for(b=0;b<8;b++){if(g=a(c)-f,Math.abs(g)<1e-6)return s(c);if(v=l(c),Math.abs(v)<1e-6)break;c-=g/v}for(c=f;E-h>1e-6&&(g=a(c),!(Math.abs(g-f)<1e-6));)f>g?h=c:E=c,c=(h+E)/2;return s(c)}}function F(n){var r=7.5625,e=2.75;return n<1/e?r*n*n:n<2/e?r*(n-=1.5/e)*n+.75:n<2.5/e?r*(n-=2.25/e)*n+.9375:r*(n-=2.625/e)*n+.984375}function W(n,r){if(!n||n==="linear")return r;if(typeof n!="string"){var e=n.join(",");return(R[e]||(R[e]=K(n)))(r)}if(L[n])return L[n](r);var t=R[n]||(R[n]=K(H[n]||H.ease));return t(r)}function Z(n){if(typeof n!="string")return null;var r=n.trim();if(r[0]==="#"){var e=r.slice(1);return(e.length===3||e.length===4)&&(e=e.replace(/./g,"$&$&")),e.length===6&&(e+="ff"),e.length!==8?null:[parseInt(e.substr(0,2),16),parseInt(e.substr(2,2),16),parseInt(e.substr(4,2),16),parseInt(e.substr(6,2),16)/255]}var t=r.match(/^rgba?\(([^)]+)\)$/);if(t){var u=t[1].split(/[\s,\/]+/).filter(Boolean).map(parseFloat);return u.length===3&&u.push(1),u.length===4?u:null}return null}function nn(n){return!!n&&typeof n=="object"&&(n.g==="lin"||n.g==="rad")&&n.s&&n.s.length>0}function Fn(n,r){var e=n.s;if(r<=e[0][0])return e[0][1];for(var t=0;t<e.length-1;t++)if(r<=e[t+1][0]){var u=e[t+1][0]-e[t][0];return fn(e[t][1],e[t+1][1],u>0?(r-e[t][0])/u:0)}return e[e.length-1][1]}function Er(n,r,e){if(nn(n)||(n={g:r.g,a:r.a,cx:r.cx,cy:r.cy,r:r.r,p:r.p,ra:r.ra,rr:r.rr,s:[[0,n],[1,n]]}),nn(r)||(r={g:n.g,a:n.a,cx:n.cx,cy:n.cy,r:n.r,p:n.p,ra:n.ra,rr:n.rr,s:[[0,r],[1,r]]}),n.g!==r.g)return e<1?n:r;var t=[];n.s.concat(r.s).forEach(function(l){t.indexOf(l[0])<0&&t.push(l[0])}),t.sort(function(l,f){return l-f});var u=n.s.length===r.s.length?n.s.map(function(l,f){return[l[0]+(r.s[f][0]-l[0])*e,fn(l[1],r.s[f][1],e)]}):t.map(function(l){return[l,fn(Fn(n,l),Fn(r,l),e)]}),i=function(l,f,c){return(l==null?c:l)+((f==null?c:f)-(l==null?c:l))*e},o={g:n.g,a:i(n.a,r.a,90),cx:i(n.cx,r.cx,.5),cy:i(n.cy,r.cy,.5),r:i(n.r,r.r,.5),s:u};if(n.p||r.p){var a=yn(n),s=yn(r);o.p=a.map(function(l,f){return l+(s[f]-l)*e})}return(n.ra!=null||r.ra!=null)&&(o.ra=i(n.ra,r.ra,0)),(n.rr!=null||r.rr!=null)&&(o.rr=i(n.rr,r.rr,1)),o}function fn(n,r,e){if(nn(n)||nn(r))return Er(n,r,e);var t=Z(n),u=Z(r);if(!t||!u)return e<1?n:r;var i=[0,1,2].map(function(a){return Math.round(t[a]+(u[a]-t[a])*e)}),o=t[3]+(u[3]-t[3])*e;return o>=.999?"rgb("+i.join(",")+")":"rgba("+i.join(",")+","+Math.round(o*1e3)/1e3+")"}function xr(n,r){if(!n||!r||n.length!==r.length)return!1;for(var e=0;e<n.length;e++)if(n[e].n.length!==r[e].n.length)return!1;return!0}function Pr(n,r,e){return xr(n,r)?n.map(function(t,u){return{c:t.c,n:t.n.map(function(i,o){var a=r[u].n[o];return i.map(function(s,l){return s+(a[l]-s)*e})})}}):e<1?n:r}function Sr(n,r,e){n=n||[],r=r||[];var t=n.length,u=r.length,i=[],o;if(t!==u)if(!t)n=mn(r.map(jn),1);else if(!u)r=mn(n.map(jn),1);else{var a=t*u/Tn(t,u);n=mn(n,a/t),r=mn(r,a/u)}for(o=0;o<n.length;o++)i.push(n[o]+(r[o]-n[o])*e);return i}function jn(){return 0}function Tn(n,r){return r?Tn(r,n%r):n||1}function mn(n,r){for(var e=[],t=0;t<r;t++)e=e.concat(n);return e}function wr(n,r,e,t){return n==="c"?fn(r,e,t):n==="a"?Sr(r,e,t):n==="m"?Pr(r,e,t):n==="v"?[r[0]+(e[0]-r[0])*t,r[1]+(e[1]-r[1])*t]:r+(e-r)*t}function Cr(n,r,e,t,u){var i=u*u,o=i*u;return[0,1].map(function(a){return .5*(2*r[a]+(-n[a]+e[a])*u+(2*n[a]-5*r[a]+4*e[a]-t[a])*i+(-n[a]+3*r[a]-3*e[a]+t[a])*o)})}function zn(n,r,e,t){var u=1-t,i=u*u*u,o=3*u*u*t,a=3*u*t*t,s=t*t*t;return[i*n[0]+o*(n[0]+r[0])+a*(e[0]+r[2])+s*e[0],i*n[1]+o*(n[1]+r[1])+a*(e[1]+r[3])+s*e[1]]}var xn={},Gn=0;function kr(n,r,e,t){if(t<=0||t>=1)return t;var u=n.join()+";"+r.join()+";"+e.join(),i=xn[u],o=64,a;if(!i){++Gn>400&&(xn={},Gn=1),i=[0];var s=n;for(a=1;a<=o;a++){var l=zn(n,r,e,a/o);i.push(i[a-1]+Math.hypot(l[0]-s[0],l[1]-s[1])),s=l}xn[u]=i}var f=t*i[o];if(!(i[o]>0))return t;for(a=1;a<=o;a++)if(i[a]>=f)return(a-1+(f-i[a-1])/(i[a]-i[a-1]||1))/o;return 1}function Rr(n,r,e){var t=n.t[r],u=t.length,i,o,a,s;if(u===1||e<=t[0][0])return t[0][1];if(e>=t[u-1][0])return t[u-1][1];for(i=0;i<u-1;i++)if(o=t[i],a=t[i+1],e<a[0])return s=W(o[2],(e-o[0])/(a[0]-o[0])),r==="pos"&&o[3]?zn(o[1],o[3],a[1],n.ev?kr(o[1],o[3],a[1],s):s):r==="pos"&&n.sm&&u>2?Cr((t[i-1]||o)[1],o[1],a[1],(t[i+2]||a)[1],s):wr(C[r]||(typeof o[1]=="string"?"c":typeof o[1]=="object"?"v":"n"),o[1],a[1],s);return t[u-1][1]}var an=!1;function p(n,r,e){var t=!an&&n.t&&n.t[r];return t&&t.length?Rr(n,r,e):r==="org"?n.o||[0,0]:n.b[r]}function cn(n,r,e){var t=p(n,"org",r)||[0,0],u=p(n,"pos",r)||[0,0],i=p(n,"rot",r)||0,o=p(n,"scl",r)||[1,1],a=p(n,"skw",r)||[0,0],s=n.t&&n.t.pos,l=p(n,"op",r);if(n.or&&s&&s.length>1&&!an){var f=s[0][0],c=s[s.length-1][0],b=Math.min(.02,(c-f)/4),g=Math.max(f,Math.min(r-b,c-2*b)),v=p(n,"pos",g),h=p(n,"pos",g+2*b);(h[0]!==v[0]||h[1]!==v[1])&&(i+=Math.atan2(h[1]-v[1],h[0]-v[0])*180/Math.PI)}return e?{x:u[0]+t[0],y:u[1]+t[1],r:i,sx:o[0],sy:o[1],ox:t[0],oy:t[1],kx:a[0],ky:a[1],ba:Sn(n),cp:Qn(n,r)}:{x:u[0]+t[0],y:u[1]+t[1],r:i,sx:o[0],sy:o[1],ox:t[0],oy:t[1],op:l==null?1:l,fill:p(n,"fill",r),stk:p(n,"stk",r),sw:p(n,"sw",r),d:Or(n,r),kx:a[0],ky:a[1],fo:p(n,"fo",r),so:p(n,"so",r),dof:p(n,"dof",r),rad:n.t&&n.t.rad&&n.t.rad.length?p(n,"rad",r):null,gb:Nr(n,r),da:n.t&&n.t.da&&n.t.da.length?p(n,"da",r):null,trim:Ir(n,r),ba:Sn(n),cp:Qn(n,r)}}for(var Bn={},Pn=null,bn=0;bn<d.L.length;bn++)Bn[d.L[bn].id]=d.L[bn];function j(n){return n&&(Bn[n]||Pn&&Pn(n))||null}function Qn(n,r){var e=n.cs||n.type==="bone"&&!n.inh?j(n.parent):null;if(!e||!n.cs&&e.type!=="bone")return null;var t=p(e,"scl",r)||[1,1];if(t[0]===1&&t[1]===1)return null;var u=n.j||(n.geo?[n.geo.x,n.geo.y]:[0,0]);return[Sn(e),t[0]||1e-6,t[1]||1e-6,u[0],u[1]]}function Sn(n){return n.ba!=null?n.ba:n.type==="bone"&&n.geo&&n.geo.ang?n.geo.ang:0}function Ir(n,r){var e=n.t||{},t=["ts","te","to"].some(function(a){return e[a]&&e[a].length||n.b&&n.b[a]!=null&&n.b[a]!==(a==="te"?100:0)});if(!t)return null;var u=p(n,"ts",r),i=p(n,"te",r),o=p(n,"to",r);return[u==null?0:u,i==null?100:i,o==null?0:o]}function Xn(n){var r=Math.max(0,Math.min(100,Math.min(n[0],n[1]))),e=Math.max(0,Math.min(100,Math.max(n[0],n[1]))),t=e-r,u=r+(n[2]||0),i=(u%100+100)%100;return t<1e-6?["0 300",String(m(150-i))]:i+t<=100+1e-6?[m(t)+" "+m(200-t),String(m(-i))]:[m(t)+" "+m(100-t),String(m(-u))]}function Or(n,r){var e=Tr(n,r);return e&&n.t&&n.t.sz&&n.t.sz.length&&(e=_r(n,e,r)),e&&n.pins&&n.pins.length&&!gn?jr(n,e,r):e}function Ar(n,r,e){var t=n[2]?r[0]/n[2]:1,u=n[3]?r[1]/n[3]:1;return[e[0]-(e[0]-n[0])*t,e[1]-(e[1]-n[1])*u,Math.max(0,r[0]),Math.max(0,r[1])]}function Yn(n,r,e){return n.sa?[r[0]+n.sa[0]*r[2],r[1]+n.sa[1]*r[3]]:p(n,"org",e)||[0,0]}function Nr(n,r){var e=n.geo;if(!e||!n.t||!n.t.sz||!n.t.sz.length||n.type!=="rect"&&n.type!=="image"&&n.type!=="ellipse")return null;var t=n.type==="ellipse"?[(e.cx||0)-(e.rx||0),(e.cy||0)-(e.ry||0),2*(e.rx||0),2*(e.ry||0)]:[e.x||0,e.y||0,e.w||0,e.h||0];return Ar(t,p(n,"sz",r),Yn(n,t,r))}function _r(n,r,e){var t=Hn(n.b&&n.b.d||r),u=p(n,"sz",e),i=Yn(n,t,e),o=t[2]>1e-9?u[0]/t[2]:1,a=t[3]>1e-9?u[1]/t[3]:1;return r.map(function(s){return{c:s.c,n:s.n.map(function(l){return l.map(function(f,c){return c%2?i[1]+(f-i[1])*a:i[0]+(f-i[0])*o})})}})}function Hn(n){var r=1/0,e=1/0,t=-1/0,u=-1/0;function i(s,l){s<r&&(r=s),s>t&&(t=s),l<e&&(e=l),l>u&&(u=l)}function o(s,l,f,c){var b=-s+3*l-3*f+c,g=2*(s-2*l+f),v=l-s,h=[];if(Math.abs(b)<1e-12)Math.abs(g)>1e-12&&h.push(-v/g);else{var E=g*g-4*b*v;if(E>=0){var x=Math.sqrt(E);h.push((-g+x)/(2*b),(-g-x)/(2*b))}}return h.filter(function(T){return T>0&&T<1})}function a(s,l){var f=[s[0],s[4],l[2],l[0]],c=[s[1],s[5],l[3],l[1]];i(l[0],l[1]),o(f[0],f[1],f[2],f[3]).concat(o(c[0],c[1],c[2],c[3])).forEach(function(b){var g=1-b,v=g*g*g,h=3*g*g*b,E=3*g*b*b,x=b*b*b;i(v*f[0]+h*f[1]+E*f[2]+x*f[3],v*c[0]+h*c[1]+E*c[2]+x*c[3])})}return(n||[]).forEach(function(s){var l=s.n;if(l.length){i(l[0][0],l[0][1]);for(var f=1;f<l.length;f++)a(l[f-1],l[f]);s.c&&l.length>1&&a(l[l.length-1],l[0])}}),isFinite(r)?[r,e,t-r,u-e]:[0,0,0,0]}var gn=!1;function P(n,r){return[n[0]*r[0]+n[2]*r[1],n[1]*r[0]+n[3]*r[1],n[0]*r[2]+n[2]*r[3],n[1]*r[2]+n[3]*r[3],n[0]*r[4]+n[2]*r[5]+n[4],n[1]*r[4]+n[3]*r[5]+n[5]]}function Vr(n){var r=n[0]*n[3]-n[1]*n[2]||1e-12;return[n[3]/r,-n[1]/r,-n[2]/r,n[0]/r,(n[2]*n[5]-n[3]*n[4])/r,(n[1]*n[4]-n[0]*n[5])/r]}function $(n,r){return[1,0,0,1,n,r]}function J(n){var r=n*Math.PI/180;return[Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]}function wn(n,r){return[n,0,0,r,0,0]}function Kn(n){var r=[1,0,0,1,0,0],e=n.cp;e&&(r=P(r,$(e[3],e[4])),r=P(r,J(e[0])),r=P(r,wn(1/e[1],1/e[2])),r=P(r,J(-e[0])),r=P(r,$(-e[3],-e[4]))),r=P(r,$(n.x,n.y)),r=P(r,J(n.r)),n.kx&&(r=P(r,[1,0,Math.tan(n.kx*Math.PI/180),1,0,0])),n.ky&&(r=P(r,[1,Math.tan(n.ky*Math.PI/180),0,1,0,0]));var t=n.ba&&n.sx!==n.sy;return t&&(r=P(r,J(n.ba))),r=P(r,wn(n.sx,n.sy)),t&&(r=P(r,J(-n.ba))),P(r,$(-n.ox,-n.oy))}var Cn={};function kn(n){if(Cn[n])return Cn[n];for(var r=[1,0,0,1,0,0],e=/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g,t;t=e.exec(n);){var u=t[2].split(/[\s,]+/).filter(Boolean).map(Number),i=t[1];i==="matrix"&&u.length===6?r=P(r,u):i==="translate"?r=P(r,$(u[0]||0,u[1]||0)):i==="scale"?r=P(r,wn(u[0],u.length>1?u[1]:u[0])):i==="rotate"?r=u.length>2?P(P(P(r,$(u[1],u[2])),J(u[0])),$(-u[1],-u[2])):P(r,J(u[0]||0)):i==="skewX"?r=P(r,[1,0,Math.tan((u[0]||0)*Math.PI/180),1,0,0]):i==="skewY"&&(r=P(r,[1,Math.tan((u[0]||0)*Math.PI/180),0,1,0,0]))}return Cn[n]=r}function dn(n,r,e){for(var t=Kn(cn(n,r,!0)),u=j(n.parent),i=0;u&&u!==e&&i++<100;)u.xf&&(t=P(kn(u.xf),t)),t=P(Kn(cn(u,r,!0)),t),u=j(u.parent);return t}function Fr(n,r,e){var t=dn(n,r,e),u=n.type?n.type==="path":!n.mesh;return u&&n.xf?P(t,kn(n.xf)):t}function Wn(n,r,e,t,u){for(var i=[],o=j(r.parent),a=null,s=0;o&&s++<100;)i.push(o),o=j(o.parent);for(o=j(n.parent),s=0;o&&s++<100;o=j(o.parent))if(i.indexOf(o)>=0){a=o;break}var l=an;an=t;var f=Fr(n,e,a),c=Math.abs(f[0]*f[3]-f[1]*f[2])<1e-12?[1,0,0,1,0,0]:P(Vr(f),dn(r,e,a));an=l;var b=r.geo||{},g=(b.ang||0)*Math.PI/180,v=(b.x||0)+(u&&u[0]||0),h=(b.y||0)+(u&&u[1]||0),E=c[0]*Math.cos(g)+c[2]*Math.sin(g),x=c[1]*Math.cos(g)+c[3]*Math.sin(g);return[c[0]*v+c[2]*h+c[4],c[1]*v+c[3]*h+c[5],Math.atan2(x,E)*180/Math.PI]}function Zn(n,r,e){var t=r.bone?j(r.bone):null;if(t){var u=Wn(n,t,e,!0,r.bo),i=Wn(n,t,e,!1,r.bo);return[u[0],u[1],i[0],i[1],i[2]-u[2]]}var o=p(n,"pin"+r.n,e)||[r.x,r.y];return[r.x,r.y,o[0],o[1],p(n,"pinr"+r.n,e)||0]}function $n(n,r){var e=n.pins||[],t=Math.max(10,Math.min(1e3,n.reach||100)),u=Math.max(.5,Math.min(8,200/t));return[e.map(function(i){var o=Zn(n,i,r),a=o[4]*Math.PI/180;return[o[0],o[1],o[2],o[3],Math.cos(a),Math.sin(a)]}),u]}function Jn(n,r,e,t,u,i,o,a){var s=0,l=0,f=0,c;for(c=0;c<n.length;c++){var b=n[c],g=e-b[0],v=t-b[1],h=1/(Math.pow(g*g+v*v,r/2)+1e-6),E=u-b[0],x=i-b[1];s+=h,l+=h*(b[2]+E*b[4]-x*b[5]),f+=h*(b[3]+E*b[5]+x*b[4])}o[a]=s?l/s:u,o[a+1]=s?f/s:i}function jr(n,r,e){var t=$n(n,e),u=t[0],i=t[1];return r.map(function(o){return{c:o.c,n:o.n.map(function(a){for(var s=[0,0,0,0,0,0],l=0;l<6;l+=2)Jn(u,i,a[0],a[1],a[l],a[l+1],s,l);return s})}})}function Un(n,r){var e=n.mesh,t=[];if(!e)return t;var u=!gn&&n.pins&&n.pins.length,i=u?$n(n,r):null,o=[],a;for(a=0;a<e.v.length;a++)i?Jn(i[0],i[1],e.v[a][0],e.v[a][1],e.v[a][0],e.v[a][1],o,a*2):(o[a*2]=e.v[a][0],o[a*2+1]=e.v[a][1]);for(a=0;a<e.t.length;a++){var s=e.t[a],l=e.v[s[0]],f=e.v[s[1]],c=e.v[s[2]],b=f[0]-l[0],g=f[1]-l[1],v=c[0]-l[0],h=c[1]-l[1],E=b*h-g*v;if(!i||!E){t.push([1,0,0,1,0,0]);continue}var x=o[s[0]*2],T=o[s[0]*2+1],Y=o[s[1]*2]-x,ln=o[s[1]*2+1]-T,sr=o[s[2]*2]-x,lr=o[s[2]*2+1]-T,fr=h/E,mr=-v/E,cr=-g/E,br=b/E,gr=Y*fr+sr*cr,dr=Y*mr+sr*br,yr=ln*fr+lr*cr,hr=ln*mr+lr*br;t.push([gr,yr,dr,hr,x-gr*l[0]-dr*l[1],T-yr*l[0]-hr*l[1]])}return t}function Tr(n,r){var e=p(n,"d",r),t=n.t||{};if(n.shape&&t.rad&&t.rad.length)return Ln(n.shape,p(n,"rad",r),!0);if(e&&e[0]&&e[0].n.length===2&&(t.p0&&t.p0.length||t.p1&&t.p1.length)){var u=e[0].n.map(function(i,o){var a=t["p"+o]&&t["p"+o].length?p(n,"p"+o,r):null;if(!a)return i;var s=a[0]-i[0],l=a[1]-i[1];return[i[0]+s,i[1]+l,i[2]+s,i[3]+l,i[4]+s,i[5]+l]});return[{c:e[0].c,n:u}]}return e}function Dn(n){for(var r=[],e=n.kind==="star",t=e?n.n*2:n.n,u=0;u<t;u++){var i=(-90+n.rot+u*360/t)*Math.PI/180,o=e&&u%2?n.r*(n.ratio==null?.45:n.ratio):n.r;r.push([n.cx+o*Math.cos(i),n.cy+o*Math.sin(i)])}return r}function rn(n,r){return Math.hypot(n[0]-r[0],n[1]-r[1])}function qn(n){for(var r=n.length,e=1/0,t=0;t<r;t++){var u=n[(t+r-1)%r],i=n[t],o=n[(t+1)%r],a=Math.atan2(u[1]-i[1],u[0]-i[0]),s=Math.atan2(o[1]-i[1],o[0]-i[0]),l=Math.abs(a-s);l>Math.PI&&(l=2*Math.PI-l),e=Math.min(e,Math.min(rn(u,i),rn(o,i))/2*Math.tan(l/2))}return isFinite(e)?Math.max(0,e):0}function w(n){return Math.round(n*100)/100}function Ln(n,r,e){for(var t=Dn(n),u=t.length,i=Math.max(0,Math.min(r||0,qn(t))),o=[],a=0;a<u;a++){var s=t[a];if(i<=0&&!e){o.push([w(s[0]),w(s[1]),w(s[0]),w(s[1]),w(s[0]),w(s[1])]);continue}var l=t[(a+u-1)%u],f=t[(a+1)%u],c=[(l[0]-s[0])/rn(l,s),(l[1]-s[1])/rn(l,s)],b=[(f[0]-s[0])/rn(f,s),(f[1]-s[1])/rn(f,s)],g=Math.acos(Math.max(-1,Math.min(1,c[0]*b[0]+c[1]*b[1]))),v=i/Math.tan(g/2),h=4/3*Math.tan((Math.PI-g)/4)*i,E=[s[0]+c[0]*v,s[1]+c[1]*v],x=[s[0]+b[0]*v,s[1]+b[1]*v];o.push([w(E[0]),w(E[1]),w(E[0]),w(E[1]),w(E[0]-c[0]*h),w(E[1]-c[1]*h)]),o.push([w(x[0]),w(x[1]),w(x[0]-b[0]*h),w(x[1]-b[1]*h),w(x[0]),w(x[1])])}return[{c:!0,n:o}]}function nr(n){if(n.g==="rad"){var r=n.cx==null?.5:n.cx,e=n.cy==null?.5:n.cy,t=n.r==null?.5:n.r,u=n.ra||0,i=n.rr==null?1:n.rr,o={cx:String(m(r)),cy:String(m(e)),r:String(m(t)),fx:String(m(r)),fy:String(m(e))};return(m(u)||m(i)!==1)&&(o.gradientTransform="translate("+m(r)+","+m(e)+") rotate("+m(u)+") scale(1,"+m(i)+") translate("+m(-r)+","+m(-e)+")"),o}var a=yn(n);return{x1:String(m(a[0])),y1:String(m(a[1])),x2:String(m(a[2])),y2:String(m(a[3]))}}function yn(n){if(n.p&&n.p.length===4)return n.p.slice();var r=((n.a==null?90:n.a)-90)*Math.PI/180,e=Math.cos(r)/2,t=Math.sin(r)/2;return[.5-e,.5-t,.5+e,.5+t]}function m(n){return Math.round(n*1e3)/1e3}var zr=[.2126,.7152,.0722,.2126,.7152,.0722,.2126,.7152,.0722],Gr=[.393,.769,.189,.349,.686,.168,.272,.534,.131];function rr(n,r,e){if(!n)return String(typeof r=="number"?m(r):r);var t=Math.max(0,+r||0),u;if(n==="add")return String(m(t+Math.max(0,+e||0)));if(n==="half")return String(m(t/2));if(n==="bri")u=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0];else if(n==="con"){var i=.5-.5*t;u=[t,0,0,0,i,0,t,0,0,i,0,0,t,0,i]}else if(n==="inv"){t=Math.min(1,t);var o=1-2*t;u=[o,0,0,0,t,0,o,0,0,t,0,0,o,0,t]}else{t=Math.min(1,t);var a=n==="sep"?Gr:zr;u=[];for(var s=0;s<3;s++){for(var l=0;l<3;l++)u.push(a[s*3+l]*t+(s===l?1-t:0));u.push(0,0)}}return u.concat([0,0,0,1,0]).map(m).join(" ")}function er(n){return Math.round(n*1e6)/1e6}function Br(n){var r=n.cp;return(r?"translate("+m(r[3])+","+m(r[4])+") rotate("+m(r[0])+") scale("+m(1/r[1])+","+m(1/r[2])+") rotate("+m(-r[0])+") translate("+m(-r[3])+","+m(-r[4])+") ":"")+"translate("+m(n.x)+","+m(n.y)+") rotate("+m(n.r)+(n.kx?") skewX("+m(n.kx):"")+(n.ky?") skewY("+m(n.ky):"")+(n.ba&&n.sx!==n.sy?") rotate("+m(n.ba):"")+") scale("+m(n.sx)+","+m(n.sy)+(n.ba&&n.sx!==n.sy?") rotate("+m(-n.ba):"")+") translate("+m(-n.ox)+","+m(-n.oy)+")"}function tr(n){return n&&n.length?n.map(function(r){return String(m(Math.max(0,r)))}).join(" "):"none"}function ur(n){var r="";function e(t,u){t[4]===t[0]&&t[5]===t[1]&&u[2]===u[0]&&u[3]===u[1]?r+="L"+m(u[0])+" "+m(u[1]):r+="C"+m(t[4])+" "+m(t[5])+" "+m(u[2])+" "+m(u[3])+" "+m(u[0])+" "+m(u[1])}return(n||[]).forEach(function(t){var u=t.n,i;if(u.length){for(r+="M"+m(u[0][0])+" "+m(u[0][1]),i=1;i<u.length;i++)e(u[i-1],u[i]);t.c&&(e(u[u.length-1],u[0]),r+="Z")}}),r||"M0 0"}function en(n){return n in Q||(Q[n]=M?M.querySelector("#"+n):null),Q[n]}function ir(n,r,e){if(!nn(e))return e;var t=e.g==="rad"?"radialGradient":"linearGradient",u=en(r);if(!u||u.tagName!==t){var i=(n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg",t);i.setAttribute("id",r),u&&u.parentNode?u.parentNode.replaceChild(i,u):n.parentNode.insertBefore(i,n),u=i,Q[r]=i}var o=nr(e);for(var a in o)u.setAttribute(a,o[a]);for(var s=u.getElementsByTagName("stop");s.length>e.s.length;)u.removeChild(s[s.length-1]);for(;s.length<e.s.length;)u.appendChild((n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg","stop"));for(var l=0;l<e.s.length;l++){var f=Z(e.s[l][1])||[0,0,0,1];s[l].setAttribute("offset",String(m(e.s[l][0]))),s[l].setAttribute("stop-color","rgb("+Math.round(f[0])+","+Math.round(f[1])+","+Math.round(f[2])+")"),s[l].setAttribute("stop-opacity",String(m(f[3])))}return"url(#"+r+")"}function Rn(n){for(var r=0;r<d.L.length;r++){var e=d.L[r],t=en(d.p+e.id),u=en(d.p+e.id+"-s");if(!(!t||!u)){var i=cn(e,n);if(t.setAttribute("transform",Br(i)),t.setAttribute("opacity",String(m(i.op))),i.fill!=null&&u.setAttribute("fill",ir(u,d.p+e.id+"-gf",i.fill)),i.stk!=null&&u.setAttribute("stroke",ir(u,d.p+e.id+"-gs",i.stk)),i.sw!=null&&u.setAttribute("stroke-width",String(m(i.sw))),i.trim){var o=Xn(i.trim);u.setAttribute("pathLength","100"),u.setAttribute("stroke-dasharray",o[0]),u.setAttribute("stroke-dashoffset",o[1])}else i.dof!=null&&u.setAttribute("stroke-dashoffset",String(m(i.dof))),i.da&&u.setAttribute("stroke-dasharray",tr(i.da));if(i.fo!=null&&u.setAttribute("fill-opacity",String(m(i.fo))),i.so!=null&&u.setAttribute("stroke-opacity",String(m(i.so))),i.d&&u.setAttribute("d",ur(i.d)),i.gb){var a=i.gb,s=e.type==="ellipse"?{cx:a[0]+a[2]/2,cy:a[1]+a[3]/2,rx:a[2]/2,ry:a[3]/2}:{x:a[0],y:a[1],width:a[2],height:a[3]};for(var l in s)u.setAttribute(l,String(m(s[l])))}if(i.rad!=null&&!e.shape&&(u.setAttribute("rx",String(m(i.rad))),u.setAttribute("ry",String(m(i.rad)))),e.dw){var f=j(e.dw),c=en(d.p+e.id+"-w");f&&c&&c.setAttribute("transform","matrix("+dn(f,n,j(e.du)).map(er).join(",")+")")}if(e.mesh)for(var b=Un(e,n),g=0;g<b.length;g++){var v=en(d.p+e.id+"-m"+g);v&&v.setAttribute("transform","matrix("+b[g].map(er).join(",")+")")}if(e.fa)for(var h in e.fa){var E=p(e,h,n),x=e.fa[h];if(E!=null){typeof x[0]=="string"&&(x=[x]);for(var T=0;T<x.length;T++){var Y=x[T],ln=en(d.p+e.id+Y[0]);ln&&ln.setAttribute(Y[1],rr(Y[2],E,Y[3]?p(e,Y[3],n):0))}}}}}}var z=d.dur||1,A=d.it>0?Math.floor(d.it):0,hn=/alternate/.test(d.dir||""),G=/reverse/.test(d.dir||"")?-1:1,O=G,In=d.speed>0?d.speed:1,On=d.fps>0?Math.min(100,d.fps):100,pn=d.fill===-1||d.fill==="backwards"?-1:1,_=!1,An=0,Nn=-1e9,V=!1,N=!1,I=!1,B={},on=0;function tn(){return A?A*z:z}function U(){return G>0?0:tn()}var S=U();function _n(n){var r=Math.floor(n/z),e=n-r*z;return A&&(n<=0?(r=0,e=0):r>=A&&(r=A-1,e=z)),hn&&(r%2+2)%2===1?z-e:e}function X(n){var r=B[n];r&&r.slice().forEach(function(e){try{e.call(y,Math.round(S*1e3))}catch{}})}function un(){Rn(_n(S)),X("keyframe")}function sn(){_=!1,on&&cancelAnimationFrame(on),on=0}function ar(){sn(),N&&(N=!1,O=G),V=!0,pn<0&&(S=U()),un(),X("end")}function or(n){if(!(!_||I)){if(S+=(n-An)/1e3*In*O,An=n,O>0&&(A||N&&G<0)&&S>=tn())return S=tn(),ar();if(O<0&&(A||N&&G>0)&&S<=0)return S=0,ar();n-Nn>=1e3/On-1&&(Nn=n,un()),on=requestAnimationFrame(or)}}function vn(){_||I||(_=!0,V=!1,An=performance.now(),Nn=-1e9,on=requestAnimationFrame(or))}var y={play:function(){return I||_||(V&&(O=G,N=!1,S=U()),vn(),X("play")),y},pause:function(){return I||!_||(sn(),X("pause")),y},toggle:function(){return _?y.pause():y.play()},togglePlay:function(){return y.toggle()},restart:function(){return I||(sn(),N=!1,O=G,S=U(),V=!1,un(),vn(),X("restart")),y},reverse:function(){return I||(O=-O,N=!1,V=!1,vn(),X("reverse")),y},rollback:function(){if(I)return y;if(!A){var n=hn?2*z:z;S=(S%n+n)%n}return Math.abs(S-U())<1e-6&&!_||(O=-G,N=!0,V=!1,vn(),X("reverse")),y},stop:function(){return I||(sn(),N=!1,O=G,S=U(),V=!1,un(),X("stop")),y},seek:function(n){return I||(S=Math.max(0,Math.min(100,+n||0))/100*tn(),V=!1,un()),y},seekTo:function(n){return I||(S=(+n||0)/1e3,A&&(S=Math.max(0,Math.min(tn(),S))),V=!1,un()),y},seekBy:function(n){return y.seekTo(S*1e3+(+n||0))},set:function(n,r){return I||(n==="speed"?In=Math.max(.01,Math.min(100,+r||1)):n==="fps"?On=Math.max(1,Math.min(100,+r||100)):n==="iterations"?A=r===1/0||!(+r>0)?0:Math.floor(+r):n==="direction"?(O=+r<0?-1:1,N=!1):n==="alternate"?hn=!!r:n==="fill"&&(pn=+r<0?-1:1)),y},ready:function(n){return typeof n=="function"&&setTimeout(function(){n.call(y,y)},0),y},on:function(n,r,e){return typeof r!="function"||String(n).split(/[\s,]+/).forEach(function(t){t&&(B[t]=B[t]||[],e?B[t].unshift(r):B[t].push(r))}),y},off:function(n,r){return B[n]&&(B[n]=r?B[n].filter(function(e){return e!==r}):[]),y},destruct:function(){I||(sn(),B={},(y._cleanup||[]).forEach(function(n){try{n()}catch{}}),y._cleanup=[],Rn(_n(U())),I=!0)},onEnd:function(n){return y.on("end",n)},setRate:function(n){return y.set("speed",n)},apply:Rn,comp:cn,lookup:function(n){Pn=n},meshMats:Un,pinAt:Zn,worldOf:dn,restPins:function(n){var r=gn;return gn=!!n,r},get:p,fxv:rr,gAttrs:nr,linP:yn,trimDash:Xn,isG:nn,pc:Z,dstr:ur,dashStr:tr,pathBox:Hn,xfM:kn,poly:Ln,corners:Dn,maxRad:qn,ease:W,loc:_n,EZ:H,_cleanup:[]},k=function(n){return{get:n,enumerable:!0}};return Object.defineProperties(y,{currentTime:k(function(){return Math.round(S*1e3)}),duration:k(function(){return Math.round(z*1e3)}),totalTime:k(function(){return Math.round(tn()*1e3)}),fps:k(function(){return On}),speed:k(function(){return In}),direction:k(function(){return O}),fill:k(function(){return pn}),iterations:k(function(){return A}),hasEnded:k(function(){return V}),isAlternate:k(function(){return hn}),isBackwards:k(function(){return pn<0}),isInfinite:k(function(){return!A}),isPlaying:k(function(){return _}),isReversed:k(function(){return O<0}),isRollingBack:k(function(){return _&&N}),state:k(function(){return I?"destroyed":_?N?"rollback":"playing":V?"ended":"paused"})}),y}var Vn=1;function Qr(d,M,C){let H=C.b===-1?-1:1,R=C.o||"pause",Q=M._cleanup=[],D=(F,W,Z)=>{F.addEventListener(W,Z),Q.push(()=>F.removeEventListener(W,Z))},q=()=>{(M.direction!==H||M.isRollingBack)&&M.set("direction",H),M.play()},L=()=>{R==="pause"?M.pause():R==="reverse"?M.rollback():R==="start"?M.stop():R==="restart"&&M.restart()},K=C.t||"load";if(K==="hover")D(d,"mouseenter",q),D(d,"mouseleave",L);else if(K==="click")d.style.cursor="pointer",D(d,"click",()=>{M.isPlaying&&!M.isRollingBack?R!=="none"&&L():q()});else if(K==="scroll")if("IntersectionObserver"in window){let F=new IntersectionObserver(W=>{W[0].isIntersecting?q():R!=="none"&&(M.isPlaying||M.currentTime>0)&&L()},{threshold:.35});F.observe(d),Q.push(()=>F.disconnect())}else M.play();else K!=="api"&&M.play()}function Mn(d,M){if(!d)return null;if(d.player)return d.player;if(!M){let R=d.querySelector('script[type="application/json"][data-cin]');if(!R)return null;try{M=JSON.parse(R.textContent||"")}catch{return null}}if((M.f||1)>Vn)return null;let C=pr(M.d,d);d.player=d.cinPlayer=C,C.stop(),(M.rm==="first"||M.rm==="last")&&!!window.matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches?C.seekTo(M.rm==="first"?0:Math.max(0,Math.round((M.d.dur||1)*1e3)-1)):Qr(d,C,M);try{d.dispatchEvent(new CustomEvent("cinready",{detail:C}))}catch{}return C}function En(d=document){d.querySelectorAll('script[type="application/json"][data-cin]').forEach(M=>{let C=M.closest("svg");C&&!C.player&&Mn(C)})}var Xr="1.1.0",vr=typeof document!="undefined"?document.currentScript:null,Mr=window;Mr.CinPlayer=Mr.CinPlayer||{version:Xr,f:Vn,boot:Mn,scan:En};vr&&Mn(vr.closest("svg"));typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>En()):En());})();
|
|
1
|
+
/*! SVGcinema player 1.2.0. Proprietary, see the LICENSE file of the svgcinema-player package. */
|
|
2
|
+
"use strict";(()=>{function Ce(g,y){var w={pos:"v",org:"v",p0:"v",p1:"v",rad:"n",ts:"n",te:"n",to:"n",rot:"n",scl:"v",op:"n",fill:"c",stk:"c",sw:"n",d:"m",skw:"v",fo:"n",so:"n",dof:"n",sz:"v",da:"a"},V={ease:[.25,.1,.25,1],in:[.42,0,1,1],out:[0,0,.58,1],inOut:[.42,0,.58,1],inSine:[.12,0,.39,0],outSine:[.61,1,.88,1],inOutSine:[.37,0,.63,1],inQuad:[.11,0,.5,0],outQuad:[.5,1,.89,1],inOutQuad:[.45,0,.55,1],inCubic:[.32,0,.67,0],outCubic:[.33,1,.68,1],inOutCubic:[.65,0,.35,1],inQuart:[.5,0,.75,0],outQuart:[.25,1,.5,1],inOutQuart:[.76,0,.24,1],inQuint:[.64,0,.78,0],outQuint:[.22,1,.36,1],inOutQuint:[.83,0,.17,1],inExpo:[.7,0,.84,0],outExpo:[.16,1,.3,1],inOutExpo:[.87,0,.13,1],inCirc:[.55,0,1,.45],outCirc:[0,.55,.45,1],inOutCirc:[.85,0,.15,1],inBack:[.36,0,.66,-.56],outBack:[.34,1.56,.64,1],inOutBack:[.68,-.6,.32,1.6]},O={},W={},P=2*Math.PI/3,Z=2*Math.PI/4.5,T={hold:function(n){return n<1?0:1},outBounce:H,inBounce:function(n){return 1-H(1-n)},inOutBounce:function(n){return n<.5?(1-H(1-2*n))/2:(1+H(2*n-1))/2},outElastic:function(n){return n===0||n===1?n:Math.pow(2,-10*n)*Math.sin((n*10-.75)*P)+1},inElastic:function(n){return n===0||n===1?n:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*P)},inOutElastic:function(n){return n===0||n===1?n:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*Z))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*Z)/2+1}};function z(n){var e=3*n[0],r=3*(n[2]-n[0])-e,t=1-e-r,u=3*n[1],a=3*(n[3]-n[1])-u,i=1-u-a;function o(f){return((t*f+r)*f+e)*f}function l(f){return((i*f+a)*f+u)*f}function s(f){return(3*t*f+2*r)*f+e}return function(f){var c=f,b,d,M,E=0,v=1;for(b=0;b<8;b++){if(d=o(c)-f,Math.abs(d)<1e-6)return l(c);if(M=s(c),Math.abs(M)<1e-6)break;c-=d/M}for(c=f;v-E>1e-6&&(d=o(c),!(Math.abs(d-f)<1e-6));)f>d?E=c:v=c,c=(E+v)/2;return l(c)}}function H(n){var e=7.5625,r=2.75;return n<1/r?e*n*n:n<2/r?e*(n-=1.5/r)*n+.75:n<2.5/r?e*(n-=2.25/r)*n+.9375:e*(n-=2.625/r)*n+.984375}function k(n,e){if(!n||n==="linear")return e;if(typeof n!="string"){var r=n.join(",");return(O[r]||(O[r]=z(n)))(e)}if(T[n])return T[n](e);var t=O[n]||(O[n]=z(V[n]||V.ease));return t(e)}function Y(n){if(typeof n!="string")return null;var e=n.trim();if(e[0]==="#"){var r=e.slice(1);return(r.length===3||r.length===4)&&(r=r.replace(/./g,"$&$&")),r.length===6&&(r+="ff"),r.length!==8?null:[parseInt(r.substr(0,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(6,2),16)/255]}var t=e.match(/^rgba?\(([^)]+)\)$/);if(t){var u=t[1].split(/[\s,\/]+/).filter(Boolean).map(parseFloat);return u.length===3&&u.push(1),u.length===4?u:null}return null}function D(n){return!!n&&typeof n=="object"&&(n.g==="lin"||n.g==="rad")&&n.s&&n.s.length>0}function pn(n,e){var r=n.s;if(e<=r[0][0])return r[0][1];for(var t=0;t<r.length-1;t++)if(e<=r[t+1][0]){var u=r[t+1][0]-r[t][0];return A(r[t][1],r[t+1][1],u>0?(e-r[t][0])/u:0)}return r[r.length-1][1]}function kn(n,e,r){if(D(n)||(n={g:e.g,a:e.a,cx:e.cx,cy:e.cy,r:e.r,p:e.p,ra:e.ra,rr:e.rr,s:[[0,n],[1,n]]}),D(e)||(e={g:n.g,a:n.a,cx:n.cx,cy:n.cy,r:n.r,p:n.p,ra:n.ra,rr:n.rr,s:[[0,e],[1,e]]}),n.g!==e.g)return r<1?n:e;var t=[];n.s.concat(e.s).forEach(function(s){t.indexOf(s[0])<0&&t.push(s[0])}),t.sort(function(s,f){return s-f});var u=n.s.length===e.s.length?n.s.map(function(s,f){return[s[0]+(e.s[f][0]-s[0])*r,A(s[1],e.s[f][1],r)]}):t.map(function(s){return[s,A(pn(n,s),pn(e,s),r)]}),a=function(s,f,c){return(s==null?c:s)+((f==null?c:f)-(s==null?c:s))*r},i={g:n.g,a:a(n.a,e.a,90),cx:a(n.cx,e.cx,.5),cy:a(n.cy,e.cy,.5),r:a(n.r,e.r,.5),s:u};if(n.p||e.p){var o=_n(n),l=_n(e);i.p=o.map(function(s,f){return s+(l[f]-s)*r})}return(n.ra!=null||e.ra!=null)&&(i.ra=a(n.ra,e.ra,0)),(n.rr!=null||e.rr!=null)&&(i.rr=a(n.rr,e.rr,1)),i}function A(n,e,r){if(D(n)||D(e))return kn(n,e,r);var t=Y(n),u=Y(e);if(!t||!u)return r<1?n:e;var a=[0,1,2].map(function(o){return Math.round(t[o]+(u[o]-t[o])*r)}),i=t[3]+(u[3]-t[3])*r;return i>=.999?"rgb("+a.join(",")+")":"rgba("+a.join(",")+","+Math.round(i*1e3)/1e3+")"}function Q(n,e){if(!n||!e||n.length!==e.length)return!1;for(var r=0;r<n.length;r++)if(n[r].n.length!==e[r].n.length)return!1;return!0}function j(n,e,r){return Q(n,e)?n.map(function(t,u){return{c:t.c,n:t.n.map(function(a,i){var o=e[u].n[i];return a.map(function(l,s){return l+(o[s]-l)*r})})}}):r<1?n:e}function bn(n,e,r){n=n||[],e=e||[];var t=n.length,u=e.length,a=[],i;if(t!==u)if(!t)n=on(e.map(vn),1);else if(!u)e=on(n.map(vn),1);else{var o=t*u/En(t,u);n=on(n,o/t),e=on(e,o/u)}for(i=0;i<n.length;i++)a.push(n[i]+(e[i]-n[i])*r);return a}function vn(){return 0}function En(n,e){return e?En(e,n%e):n||1}function on(n,e){for(var r=[],t=0;t<e;t++)r=r.concat(n);return r}function rn(n,e,r,t){return n==="c"?A(e,r,t):n==="a"?bn(e,r,t):n==="m"?j(e,r,t):n==="v"?[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t]:e+(r-e)*t}function Rn(n,e,r,t,u){var a=u*u,i=a*u;return[0,1].map(function(o){return .5*(2*e[o]+(-n[o]+r[o])*u+(2*n[o]-5*e[o]+4*r[o]-t[o])*a+(-n[o]+3*e[o]-3*r[o]+t[o])*i)})}function Mn(n,e,r,t){var u=1-t,a=u*u*u,i=3*u*u*t,o=3*u*t*t,l=t*t*t;return[a*n[0]+i*(n[0]+e[0])+o*(r[0]+e[2])+l*r[0],a*n[1]+i*(n[1]+e[1])+o*(r[1]+e[3])+l*r[1]]}var R={},$=0;function sn(n,e,r,t){if(t<=0||t>=1)return t;var u=n.join()+";"+e.join()+";"+r.join(),a=R[u],i=64,o;if(!a){++$>400&&(R={},$=1),a=[0];var l=n;for(o=1;o<=i;o++){var s=Mn(n,e,r,o/i);a.push(a[o-1]+Math.hypot(s[0]-l[0],s[1]-l[1])),l=s}R[u]=a}var f=t*a[i];if(!(a[i]>0))return t;for(o=1;o<=i;o++)if(a[o]>=f)return(o-1+(f-a[o-1])/(a[o]-a[o-1]||1))/i;return 1}function In(n,e,r){var t=n.t[e],u=t.length,a,i,o,l;if(u===1||r<=t[0][0])return t[0][1];if(r>=t[u-1][0])return t[u-1][1];for(a=0;a<u-1;a++)if(i=t[a],o=t[a+1],r<o[0])return l=k(i[2],(r-i[0])/(o[0]-i[0])),e==="pos"&&i[3]?Mn(i[1],i[3],o[1],n.ev?sn(i[1],i[3],o[1],l):l):e==="pos"&&n.sm&&u>2?Rn((t[a-1]||i)[1],i[1],o[1],(t[a+2]||o)[1],l):rn(w[e]||(typeof i[1]=="string"?"c":typeof i[1]=="object"?"v":"n"),i[1],o[1],l);return t[u-1][1]}var J=!1;function p(n,e,r){var t=!J&&n.t&&n.t[e];return t&&t.length?In(n,e,r):e==="org"?n.o||[0,0]:n.b[e]}function On(n,e,r){var t=p(n,"org",e)||[0,0],u=p(n,"pos",e)||[0,0],a=p(n,"rot",e)||0,i=p(n,"scl",e)||[1,1],o=p(n,"skw",e)||[0,0],l=n.t&&n.t.pos,s=p(n,"op",e);if(n.type==="raw"&&n.geo&&n.geo.box){var f=p(n,"sz",e),c=n.geo.box;f&&c[2]>0&&c[3]>0&&(i=[i[0]*(f[0]/c[2]),i[1]*(f[1]/c[3])])}if(n.or&&l&&l.length>1&&!J){var b=l[0][0],d=l[l.length-1][0],M=Math.min(.02,(d-b)/4),E=Math.max(b,Math.min(e-M,d-2*M)),v=p(n,"pos",E),x=p(n,"pos",E+2*M);(x[0]!==v[0]||x[1]!==v[1])&&(a+=Math.atan2(x[1]-v[1],x[0]-v[0])*180/Math.PI)}return r?{x:u[0]+t[0],y:u[1]+t[1],r:a,sx:i[0],sy:i[1],ox:t[0],oy:t[1],kx:o[0],ky:o[1],ba:zn(n),cp:Ln(n,e)}:{x:u[0]+t[0],y:u[1]+t[1],r:a,sx:i[0],sy:i[1],ox:t[0],oy:t[1],op:s==null?1:s,fill:p(n,"fill",e),stk:p(n,"stk",e),sw:p(n,"sw",e),d:Ne(n,e),kx:o[0],ky:o[1],fo:p(n,"fo",e),so:p(n,"so",e),dof:p(n,"dof",e),rad:n.t&&n.t.rad&&n.t.rad.length?p(n,"rad",e):null,gb:Te(n,e),da:n.t&&n.t.da&&n.t.da.length?p(n,"da",e):null,trim:Oe(n,e),ba:zn(n),cp:Ln(n,e)}}for(var qn={},Gn=null,Nn=0;Nn<g.L.length;Nn++)qn[g.L[Nn].id]=g.L[Nn];function U(n){return n&&(qn[n]||Gn&&Gn(n))||null}function Ln(n,e){var r=n.cs||n.type==="bone"&&!n.inh?U(n.parent):null;if(!r||!n.cs&&r.type!=="bone")return null;var t=p(r,"scl",e)||[1,1];if(t[0]===1&&t[1]===1)return null;var u=n.j||(n.geo?[n.geo.x,n.geo.y]:[0,0]);return[zn(r),t[0]||1e-6,t[1]||1e-6,u[0],u[1]]}function zn(n){return n.ba!=null?n.ba:n.type==="bone"&&n.geo&&n.geo.ang?n.geo.ang:0}function Oe(n,e){var r=n.t||{},t=["ts","te","to"].some(function(o){return r[o]&&r[o].length||n.b&&n.b[o]!=null&&n.b[o]!==(o==="te"?100:0)});if(!t)return null;var u=p(n,"ts",e),a=p(n,"te",e),i=p(n,"to",e);return[u==null?0:u,a==null?100:a,i==null?0:i]}function ne(n){var e=Math.max(0,Math.min(100,Math.min(n[0],n[1]))),r=Math.max(0,Math.min(100,Math.max(n[0],n[1]))),t=r-e,u=e+(n[2]||0),a=(u%100+100)%100;return t<1e-6?["0 300",String(m(150-a))]:a+t<=100+1e-6?[m(t)+" "+m(200-t),String(m(-a))]:[m(t)+" "+m(100-t),String(m(-u))]}function Ne(n,e){var r=je(n,e);return r&&n.t&&n.t.sz&&n.t.sz.length&&(r=_e(n,r,e)),r&&n.pins&&n.pins.length&&!An?He(n,r,e):r}function Ae(n,e,r){var t=n[2]?e[0]/n[2]:1,u=n[3]?e[1]/n[3]:1;return[r[0]-(r[0]-n[0])*t,r[1]-(r[1]-n[1])*u,Math.max(0,e[0]),Math.max(0,e[1])]}function ee(n,e,r){return n.sa?[e[0]+n.sa[0]*e[2],e[1]+n.sa[1]*e[3]]:p(n,"org",r)||[0,0]}function Te(n,e){var r=n.geo;if(!r||!n.t||!n.t.sz||!n.t.sz.length||n.type!=="rect"&&n.type!=="image"&&n.type!=="ellipse")return null;var t=n.type==="ellipse"?[(r.cx||0)-(r.rx||0),(r.cy||0)-(r.ry||0),2*(r.rx||0),2*(r.ry||0)]:[r.x||0,r.y||0,r.w||0,r.h||0];return Ae(t,p(n,"sz",e),ee(n,t,e))}function _e(n,e,r){var t=re(n.b&&n.b.d||e),u=p(n,"sz",r),a=ee(n,t,r),i=t[2]>1e-9?u[0]/t[2]:1,o=t[3]>1e-9?u[1]/t[3]:1;return e.map(function(l){return{c:l.c,n:l.n.map(function(s){return s.map(function(f,c){return c%2?a[1]+(f-a[1])*o:a[0]+(f-a[0])*i})})}})}function re(n){var e=1/0,r=1/0,t=-1/0,u=-1/0;function a(l,s){l<e&&(e=l),l>t&&(t=l),s<r&&(r=s),s>u&&(u=s)}function i(l,s,f,c){var b=-l+3*s-3*f+c,d=2*(l-2*s+f),M=s-l,E=[];if(Math.abs(b)<1e-12)Math.abs(d)>1e-12&&E.push(-M/d);else{var v=d*d-4*b*M;if(v>=0){var x=Math.sqrt(v);E.push((-d+x)/(2*b),(-d-x)/(2*b))}}return E.filter(function(en){return en>0&&en<1})}function o(l,s){var f=[l[0],l[4],s[2],s[0]],c=[l[1],l[5],s[3],s[1]];a(s[0],s[1]),i(f[0],f[1],f[2],f[3]).concat(i(c[0],c[1],c[2],c[3])).forEach(function(b){var d=1-b,M=d*d*d,E=3*d*d*b,v=3*d*b*b,x=b*b*b;a(M*f[0]+E*f[1]+v*f[2]+x*f[3],M*c[0]+E*c[1]+v*c[2]+x*c[3])})}return(n||[]).forEach(function(l){var s=l.n;if(s.length){a(s[0][0],s[0][1]);for(var f=1;f<s.length;f++)o(s[f-1],s[f]);l.c&&s.length>1&&o(s[s.length-1],s[0])}}),isFinite(e)?[e,r,t-e,u-r]:[0,0,0,0]}var An=!1;function S(n,e){return[n[0]*e[0]+n[2]*e[1],n[1]*e[0]+n[3]*e[1],n[0]*e[2]+n[2]*e[3],n[1]*e[2]+n[3]*e[3],n[0]*e[4]+n[2]*e[5]+n[4],n[1]*e[4]+n[3]*e[5]+n[5]]}function Fe(n){var e=n[0]*n[3]-n[1]*n[2]||1e-12;return[n[3]/e,-n[1]/e,-n[2]/e,n[0]/e,(n[2]*n[5]-n[3]*n[4])/e,(n[1]*n[4]-n[0]*n[5])/e]}function ln(n,e){return[1,0,0,1,n,e]}function fn(n){var e=n*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}function Yn(n,e){return[n,0,0,e,0,0]}function te(n){var e=[1,0,0,1,0,0],r=n.cp;r&&(e=S(e,ln(r[3],r[4])),e=S(e,fn(r[0])),e=S(e,Yn(1/r[1],1/r[2])),e=S(e,fn(-r[0])),e=S(e,ln(-r[3],-r[4]))),e=S(e,ln(n.x,n.y)),e=S(e,fn(n.r)),n.kx&&(e=S(e,[1,0,Math.tan(n.kx*Math.PI/180),1,0,0])),n.ky&&(e=S(e,[1,Math.tan(n.ky*Math.PI/180),0,1,0,0]));var t=n.ba&&n.sx!==n.sy;return t&&(e=S(e,fn(n.ba))),e=S(e,Yn(n.sx,n.sy)),t&&(e=S(e,fn(-n.ba))),S(e,ln(-n.ox,-n.oy))}var Qn={};function Xn(n){if(Qn[n])return Qn[n];for(var e=[1,0,0,1,0,0],r=/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g,t;t=r.exec(n);){var u=t[2].split(/[\s,]+/).filter(Boolean).map(Number),a=t[1];a==="matrix"&&u.length===6?e=S(e,u):a==="translate"?e=S(e,ln(u[0]||0,u[1]||0)):a==="scale"?e=S(e,Yn(u[0],u.length>1?u[1]:u[0])):a==="rotate"?e=u.length>2?S(S(S(e,ln(u[1],u[2])),fn(u[0])),ln(-u[1],-u[2])):S(e,fn(u[0]||0)):a==="skewX"?e=S(e,[1,0,Math.tan((u[0]||0)*Math.PI/180),1,0,0]):a==="skewY"&&(e=S(e,[1,Math.tan((u[0]||0)*Math.PI/180),0,1,0,0]))}return Qn[n]=e}function Tn(n,e,r){for(var t=te(On(n,e,!0)),u=U(n.parent),a=0;u&&u!==r&&a++<100;)u.xf&&(t=S(Xn(u.xf),t)),t=S(te(On(u,e,!0)),t),u=U(u.parent);return t}function Ve(n,e,r){var t=Tn(n,e,r),u=n.type?n.type==="path":!n.mesh;return u&&n.xf?S(t,Xn(n.xf)):t}function ue(n,e,r,t,u){for(var a=[],i=U(e.parent),o=null,l=0;i&&l++<100;)a.push(i),i=U(i.parent);for(i=U(n.parent),l=0;i&&l++<100;i=U(i.parent))if(a.indexOf(i)>=0){o=i;break}var s=J;J=t;var f=Ve(n,r,o),c=Math.abs(f[0]*f[3]-f[1]*f[2])<1e-12?[1,0,0,1,0,0]:S(Fe(f),Tn(e,r,o));J=s;var b=e.geo||{},d=(b.ang||0)*Math.PI/180,M=(b.x||0)+(u&&u[0]||0),E=(b.y||0)+(u&&u[1]||0),v=c[0]*Math.cos(d)+c[2]*Math.sin(d),x=c[1]*Math.cos(d)+c[3]*Math.sin(d);return[c[0]*M+c[2]*E+c[4],c[1]*M+c[3]*E+c[5],Math.atan2(x,v)*180/Math.PI]}function ie(n,e,r){var t=e.bone?U(e.bone):null;if(t){var u=ue(n,t,r,!0,e.bo),a=ue(n,t,r,!1,e.bo);return[u[0],u[1],a[0],a[1],a[2]-u[2]]}var i=p(n,"pin"+e.n,r)||[e.x,e.y];return[e.x,e.y,i[0],i[1],p(n,"pinr"+e.n,r)||0]}function ae(n,e){var r=n.pins||[],t=Math.max(10,Math.min(1e3,n.reach||100)),u=Math.max(.5,Math.min(8,200/t));return[r.map(function(a){var i=ie(n,a,e),o=i[4]*Math.PI/180;return[i[0],i[1],i[2],i[3],Math.cos(o),Math.sin(o)]}),u]}function oe(n,e,r,t,u,a,i,o){var l=0,s=0,f=0,c;for(c=0;c<n.length;c++){var b=n[c],d=r-b[0],M=t-b[1],E=1/(Math.pow(d*d+M*M,e/2)+1e-6),v=u-b[0],x=a-b[1];l+=E,s+=E*(b[2]+v*b[4]-x*b[5]),f+=E*(b[3]+v*b[5]+x*b[4])}i[o]=l?s/l:u,i[o+1]=l?f/l:a}function He(n,e,r){var t=ae(n,r),u=t[0],a=t[1];return e.map(function(i){return{c:i.c,n:i.n.map(function(o){for(var l=[0,0,0,0,0,0],s=0;s<6;s+=2)oe(u,a,o[0],o[1],o[s],o[s+1],l,s);return l})}})}function se(n,e){var r=n.mesh,t=[];if(!r)return t;var u=!An&&n.pins&&n.pins.length,a=u?ae(n,e):null,i=[],o;for(o=0;o<r.v.length;o++)a?oe(a[0],a[1],r.v[o][0],r.v[o][1],r.v[o][0],r.v[o][1],i,o*2):(i[o*2]=r.v[o][0],i[o*2+1]=r.v[o][1]);for(o=0;o<r.t.length;o++){var l=r.t[o],s=r.v[l[0]],f=r.v[l[1]],c=r.v[l[2]],b=f[0]-s[0],d=f[1]-s[1],M=c[0]-s[0],E=c[1]-s[1],v=b*E-d*M;if(!a||!v){t.push([1,0,0,1,0,0]);continue}var x=i[l[0]*2],en=i[l[0]*2+1],un=i[l[1]*2]-x,hn=i[l[1]*2+1]-en,an=i[l[2]*2]-x,wn=i[l[2]*2+1]-en,Pn=E/v,Cn=-M/v,Ee=-d/v,Me=b/v,xe=un*Pn+an*Ee,Se=un*Cn+an*Me,we=hn*Pn+wn*Ee,Pe=hn*Cn+wn*Me;t.push([xe,we,Se,Pe,x-xe*s[0]-Se*s[1],en-we*s[0]-Pe*s[1]])}return t}function je(n,e){var r=p(n,"d",e),t=n.t||{};if(n.shape&&t.rad&&t.rad.length)return me(n.shape,p(n,"rad",e),!0);if(r&&r[0]&&r[0].n.length===2&&(t.p0&&t.p0.length||t.p1&&t.p1.length)){var u=r[0].n.map(function(a,i){var o=t["p"+i]&&t["p"+i].length?p(n,"p"+i,e):null;if(!o)return a;var l=o[0]-a[0],s=o[1]-a[1];return[a[0]+l,a[1]+s,a[2]+l,a[3]+s,a[4]+l,a[5]+s]});return[{c:r[0].c,n:u}]}return r}function le(n){for(var e=[],r=n.kind==="star",t=r?n.n*2:n.n,u=0;u<t;u++){var a=(-90+n.rot+u*360/t)*Math.PI/180,i=r&&u%2?n.r*(n.ratio==null?.45:n.ratio):n.r;e.push([n.cx+i*Math.cos(a),n.cy+i*Math.sin(a)])}return e}function gn(n,e){return Math.hypot(n[0]-e[0],n[1]-e[1])}function fe(n){for(var e=n.length,r=1/0,t=0;t<e;t++){var u=n[(t+e-1)%e],a=n[t],i=n[(t+1)%e],o=Math.atan2(u[1]-a[1],u[0]-a[0]),l=Math.atan2(i[1]-a[1],i[0]-a[0]),s=Math.abs(o-l);s>Math.PI&&(s=2*Math.PI-s),r=Math.min(r,Math.min(gn(u,a),gn(i,a))/2*Math.tan(s/2))}return isFinite(r)?Math.max(0,r):0}function I(n){return Math.round(n*100)/100}function me(n,e,r){for(var t=le(n),u=t.length,a=Math.max(0,Math.min(e||0,fe(t))),i=[],o=0;o<u;o++){var l=t[o];if(a<=0&&!r){i.push([I(l[0]),I(l[1]),I(l[0]),I(l[1]),I(l[0]),I(l[1])]);continue}var s=t[(o+u-1)%u],f=t[(o+1)%u],c=[(s[0]-l[0])/gn(s,l),(s[1]-l[1])/gn(s,l)],b=[(f[0]-l[0])/gn(f,l),(f[1]-l[1])/gn(f,l)],d=Math.acos(Math.max(-1,Math.min(1,c[0]*b[0]+c[1]*b[1]))),M=a/Math.tan(d/2),E=4/3*Math.tan((Math.PI-d)/4)*a,v=[l[0]+c[0]*M,l[1]+c[1]*M],x=[l[0]+b[0]*M,l[1]+b[1]*M];i.push([I(v[0]),I(v[1]),I(v[0]),I(v[1]),I(v[0]-c[0]*E),I(v[1]-c[1]*E)]),i.push([I(x[0]),I(x[1]),I(x[0]-b[0]*E),I(x[1]-b[1]*E),I(x[0]),I(x[1])])}return[{c:!0,n:i}]}function ce(n){if(n.g==="rad"){var e=n.cx==null?.5:n.cx,r=n.cy==null?.5:n.cy,t=n.r==null?.5:n.r,u=n.ra||0,a=n.rr==null?1:n.rr,i={cx:String(m(e)),cy:String(m(r)),r:String(m(t)),fx:String(m(e)),fy:String(m(r))};return(m(u)||m(a)!==1)&&(i.gradientTransform="translate("+m(e)+","+m(r)+") rotate("+m(u)+") scale(1,"+m(a)+") translate("+m(-e)+","+m(-r)+")"),i}var o=_n(n);return{x1:String(m(o[0])),y1:String(m(o[1])),x2:String(m(o[2])),y2:String(m(o[3]))}}function _n(n){if(n.p&&n.p.length===4)return n.p.slice();var e=((n.a==null?90:n.a)-90)*Math.PI/180,r=Math.cos(e)/2,t=Math.sin(e)/2;return[.5-r,.5-t,.5+r,.5+t]}function m(n){return Math.round(n*1e3)/1e3}var Be=[.2126,.7152,.0722,.2126,.7152,.0722,.2126,.7152,.0722],Ge=[.393,.769,.189,.349,.686,.168,.272,.534,.131];function be(n,e,r){if(!n)return String(typeof e=="number"?m(e):e);var t=Math.max(0,+e||0),u;if(n==="add")return String(m(t+Math.max(0,+r||0)));if(n==="half")return String(m(t/2));if(n==="bri")u=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0];else if(n==="con"){var a=.5-.5*t;u=[t,0,0,0,a,0,t,0,0,a,0,0,t,0,a]}else if(n==="inv"){t=Math.min(1,t);var i=1-2*t;u=[i,0,0,0,t,0,i,0,0,t,0,0,i,0,t]}else{t=Math.min(1,t);var o=n==="sep"?Ge:Be;u=[];for(var l=0;l<3;l++){for(var s=0;s<3;s++)u.push(o[l*3+s]*t+(l===s?1-t:0));u.push(0,0)}}return u.concat([0,0,0,1,0]).map(m).join(" ")}function ge(n){return Math.round(n*1e6)/1e6}function ze(n){var e=n.cp;return(e?"translate("+m(e[3])+","+m(e[4])+") rotate("+m(e[0])+") scale("+m(1/e[1])+","+m(1/e[2])+") rotate("+m(-e[0])+") translate("+m(-e[3])+","+m(-e[4])+") ":"")+"translate("+m(n.x)+","+m(n.y)+") rotate("+m(n.r)+(n.kx?") skewX("+m(n.kx):"")+(n.ky?") skewY("+m(n.ky):"")+(n.ba&&n.sx!==n.sy?") rotate("+m(n.ba):"")+") scale("+m(n.sx)+","+m(n.sy)+(n.ba&&n.sx!==n.sy?") rotate("+m(-n.ba):"")+") translate("+m(-n.ox)+","+m(-n.oy)+")"}function de(n){return n&&n.length?n.map(function(e){return String(m(Math.max(0,e)))}).join(" "):"none"}function ye(n){var e="";function r(t,u){t[4]===t[0]&&t[5]===t[1]&&u[2]===u[0]&&u[3]===u[1]?e+="L"+m(u[0])+" "+m(u[1]):e+="C"+m(t[4])+" "+m(t[5])+" "+m(u[2])+" "+m(u[3])+" "+m(u[0])+" "+m(u[1])}return(n||[]).forEach(function(t){var u=t.n,a;if(u.length){for(e+="M"+m(u[0][0])+" "+m(u[0][1]),a=1;a<u.length;a++)r(u[a-1],u[a]);t.c&&(r(u[u.length-1],u[0]),e+="Z")}}),e||"M0 0"}function mn(n){return n in W||(W[n]=y?y.querySelector("#"+n):null),W[n]}function he(n,e,r){if(!D(r))return r;var t=r.g==="rad"?"radialGradient":"linearGradient",u=mn(e);if(!u||u.tagName!==t){var a=(n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg",t);a.setAttribute("id",e),u&&u.parentNode?u.parentNode.replaceChild(a,u):n.parentNode.insertBefore(a,n),u=a,W[e]=a}var i=ce(r);for(var o in i)u.setAttribute(o,i[o]);for(var l=u.getElementsByTagName("stop");l.length>r.s.length;)u.removeChild(l[l.length-1]);for(;l.length<r.s.length;)u.appendChild((n.ownerDocument||document).createElementNS("http://www.w3.org/2000/svg","stop"));for(var s=0;s<r.s.length;s++){var f=Y(r.s[s][1])||[0,0,0,1];l[s].setAttribute("offset",String(m(r.s[s][0]))),l[s].setAttribute("stop-color","rgb("+Math.round(f[0])+","+Math.round(f[1])+","+Math.round(f[2])+")"),l[s].setAttribute("stop-opacity",String(m(f[3])))}return"url(#"+e+")"}function Kn(n){for(var e=0;e<g.L.length;e++){var r=g.L[e],t=mn(g.p+r.id),u=mn(g.p+r.id+"-s"),a=mn(g.p+r.id+"-sf");if(!(!t||!u)){var i=On(r,n),o=function(Pn,Cn){u.setAttribute(Pn,Cn),a&&a.setAttribute(Pn,Cn)};if(t.setAttribute("transform",ze(i)),t.setAttribute("opacity",String(m(i.op))),i.fill!=null&&o("fill",he(u,g.p+r.id+"-gf",i.fill)),i.stk!=null&&u.setAttribute("stroke",he(u,g.p+r.id+"-gs",i.stk)),i.sw!=null&&u.setAttribute("stroke-width",String(m(a?i.sw*2:i.sw))),i.trim){var l=ne(i.trim);u.setAttribute("pathLength","100"),u.setAttribute("stroke-dasharray",l[0]),u.setAttribute("stroke-dashoffset",l[1])}else i.dof!=null&&u.setAttribute("stroke-dashoffset",String(m(i.dof))),i.da&&u.setAttribute("stroke-dasharray",de(i.da));if(i.fo!=null&&o("fill-opacity",String(m(i.fo))),i.so!=null&&u.setAttribute("stroke-opacity",String(m(i.so))),i.d&&o("d",ye(i.d)),i.gb){var s=i.gb,f=r.type==="ellipse"?{cx:s[0]+s[2]/2,cy:s[1]+s[3]/2,rx:s[2]/2,ry:s[3]/2}:{x:s[0],y:s[1],width:s[2],height:s[3]};for(var c in f)o(c,String(m(f[c])))}if(i.rad!=null&&!r.shape&&(o("rx",String(m(i.rad))),o("ry",String(m(i.rad)))),r.dw){var b=U(r.dw),d=mn(g.p+r.id+"-w");b&&d&&d.setAttribute("transform","matrix("+Tn(b,n,U(r.du)).map(ge).join(",")+")")}if(r.mesh)for(var M=se(r,n),E=0;E<M.length;E++){var v=mn(g.p+r.id+"-m"+E);v&&v.setAttribute("transform","matrix("+M[E].map(ge).join(",")+")")}if(r.fa)for(var x in r.fa){var en=p(r,x,n),un=r.fa[x];if(en!=null){typeof un[0]=="string"&&(un=[un]);for(var hn=0;hn<un.length;hn++){var an=un[hn],wn=mn(g.p+r.id+an[0]);wn&&wn.setAttribute(an[1],be(an[2],en,an[3]?p(r,an[3],n):0))}}}}}}var q=g.dur||1,B=g.it>0?Math.floor(g.it):0,Fn=/alternate/.test(g.dir||""),L=/reverse/.test(g.dir||"")?-1:1,F=L,Wn=g.speed>0?g.speed:1,Zn=g.fps>0?Math.min(100,g.fps):100,Vn=g.fill===-1||g.fill==="backwards"?-1:1,X=!1,$n=0,Jn=-1e9,K=!1,G=!1,_=!1,nn={},xn=0;function dn(){return B?B*q:q}function cn(){return L>0?0:dn()}var C=cn();function Un(n){var e=Math.floor(n/q),r=n-e*q;return B&&(n<=0?(e=0,r=0):e>=B&&(e=B-1,r=q)),Fn&&(e%2+2)%2===1?q-r:r}function tn(n){var e=nn[n];e&&e.slice().forEach(function(r){try{r.call(h,Math.round(C*1e3))}catch{}})}function yn(){Kn(Un(C)),tn("keyframe")}function Sn(){X=!1,xn&&cancelAnimationFrame(xn),xn=0}function pe(){Sn(),G&&(G=!1,F=L),K=!0,Vn<0&&(C=cn()),yn(),tn("end")}function ve(n){if(!(!X||_)){if(C+=(n-$n)/1e3*Wn*F,$n=n,F>0&&(B||G&&L<0)&&C>=dn())return C=dn(),pe();if(F<0&&(B||G&&L>0)&&C<=0)return C=0,pe();n-Jn>=1e3/Zn-1&&(Jn=n,yn()),xn=requestAnimationFrame(ve)}}function Hn(){X||_||(X=!0,K=!1,$n=performance.now(),Jn=-1e9,xn=requestAnimationFrame(ve))}var h={play:function(){return _||X||(K&&(F=L,G=!1,C=cn()),Hn(),tn("play")),h},pause:function(){return _||!X||(Sn(),tn("pause")),h},toggle:function(){return X?h.pause():h.play()},togglePlay:function(){return h.toggle()},restart:function(){return _||(Sn(),G=!1,F=L,C=cn(),K=!1,yn(),Hn(),tn("restart")),h},reverse:function(){return _||(F=-F,G=!1,K=!1,Hn(),tn("reverse")),h},rollback:function(){if(_)return h;if(!B){var n=Fn?2*q:q;C=(C%n+n)%n}return Math.abs(C-cn())<1e-6&&!X||(F=-L,G=!0,K=!1,Hn(),tn("reverse")),h},stop:function(){return _||(Sn(),G=!1,F=L,C=cn(),K=!1,yn(),tn("stop")),h},seek:function(n){return _||(C=Math.max(0,Math.min(100,+n||0))/100*dn(),K=!1,yn()),h},seekTo:function(n){return _||(C=(+n||0)/1e3,B&&(C=Math.max(0,Math.min(dn(),C))),K=!1,yn()),h},seekBy:function(n){return h.seekTo(C*1e3+(+n||0))},set:function(n,e){return _||(n==="speed"?Wn=Math.max(.01,Math.min(100,+e||1)):n==="fps"?Zn=Math.max(1,Math.min(100,+e||100)):n==="iterations"?B=e===1/0||!(+e>0)?0:Math.floor(+e):n==="direction"?(F=+e<0?-1:1,G=!1):n==="alternate"?Fn=!!e:n==="fill"&&(Vn=+e<0?-1:1)),h},ready:function(n){return typeof n=="function"&&setTimeout(function(){n.call(h,h)},0),h},on:function(n,e,r){return typeof e!="function"||String(n).split(/[\s,]+/).forEach(function(t){t&&(nn[t]=nn[t]||[],r?nn[t].unshift(e):nn[t].push(e))}),h},off:function(n,e){return nn[n]&&(nn[n]=e?nn[n].filter(function(r){return r!==e}):[]),h},destruct:function(){_||(Sn(),nn={},(h._cleanup||[]).forEach(function(n){try{n()}catch{}}),h._cleanup=[],Kn(Un(cn())),_=!0)},onEnd:function(n){return h.on("end",n)},setRate:function(n){return h.set("speed",n)},apply:Kn,comp:On,lookup:function(n){Gn=n},meshMats:se,pinAt:ie,worldOf:Tn,restPins:function(n){var e=An;return An=!!n,e},get:p,fxv:be,gAttrs:ce,linP:_n,trimDash:ne,isG:D,pc:Y,dstr:ye,dashStr:de,pathBox:re,xfM:Xn,poly:me,corners:le,maxRad:fe,ease:k,loc:Un,EZ:V,_cleanup:[]},N=function(n){return{get:n,enumerable:!0}};return Object.defineProperties(h,{currentTime:N(function(){return Math.round(C*1e3)}),duration:N(function(){return Math.round(q*1e3)}),totalTime:N(function(){return Math.round(dn()*1e3)}),fps:N(function(){return Zn}),speed:N(function(){return Wn}),direction:N(function(){return F}),fill:N(function(){return Vn}),iterations:N(function(){return B}),hasEnded:N(function(){return K}),isAlternate:N(function(){return Fn}),isBackwards:N(function(){return Vn<0}),isInfinite:N(function(){return!B}),isPlaying:N(function(){return X}),isReversed:N(function(){return F<0}),isRollingBack:N(function(){return X&&G}),state:N(function(){return _?"destroyed":X?G?"rollback":"playing":K?"ended":"paused"})}),h}function ke(g,y,w){var V=w&&w.r||[0,100,1,0],O=Math.max(0,+(w&&w.sm)||0),W=!!w&&w.b===-1,P=window,Z=g,T=null;try{P.frameElement&&P.parent&&P.parent!==P&&(Z=P.frameElement,P=P.parent)}catch{}for(var z=P.document.documentElement,H=P.document.body,k=Z.parentNode;k&&k.nodeType===1&&k!==z&&k!==H;k=k.parentNode){var Y=P.getComputedStyle(k).overflowY;if((Y==="auto"||Y==="scroll"||Y==="overlay")&&k.scrollHeight>k.clientHeight){T=k;break}}function D(R,$,sn,In){var J=R+V[0]*$-(sn+V[1]/100*In),p=R+V[2]*$-(sn+V[3]/100*In);return p<=J?J<=0?1:0:Math.max(0,Math.min(1,-J/(p-J)))}function pn(){var R=Z.getBoundingClientRect(),$=0,sn=P.innerHeight||z.clientHeight;return T&&($=T.getBoundingClientRect().top+T.clientTop,sn=T.clientHeight),D(R.top,R.height,$,sn)}var kn=O/3,A=-1,Q=0,j=0,bn=0,vn=P.requestAnimationFrame||function(R){return setTimeout(function(){R(Date.now())},16)},En=P.cancelAnimationFrame||clearTimeout;function on(R){j=0;var $=bn?(R-bn)/1e3:1/60;bn=R,A<0||!kn?A=Q:A+=(Q-A)*(1-Math.exp(-$/kn)),Math.abs(Q-A)<.5&&(A=Q),y.seekTo(A),A!==Q?j=vn(on):bn=0}function rn(){var R=y.duration||0;Q=pn()*R,W&&(Q=R-Q),j||(j=vn(on))}var Rn=T||P,Mn={passive:!0};return Rn.addEventListener("scroll",rn,Mn),P.addEventListener("resize",rn),y._cleanup&&y._cleanup.push(function(){Rn.removeEventListener("scroll",rn,Mn),P.removeEventListener("resize",rn),j&&En(j),j=0}),rn(),j&&En(j),j=0,A=Q,y.seekTo(A),{progress:pn,at:D,update:rn,box:T}}var Dn=2;function Ye(g,y,w){let V=w.b===-1?-1:1,O=w.o||"pause",W=y._cleanup=[],P=(H,k,Y)=>{H.addEventListener(k,Y),W.push(()=>H.removeEventListener(k,Y))},Z=()=>{(y.direction!==V||y.isRollingBack)&&y.set("direction",V),y.play()},T=()=>{O==="pause"?y.pause():O==="reverse"?y.rollback():O==="start"?y.stop():O==="restart"&&y.restart()},z=w.t||"load";if(z==="hover")P(g,"mouseenter",Z),P(g,"mouseleave",T);else if(z==="click")g.style.cursor="pointer",P(g,"click",()=>{y.isPlaying&&!y.isRollingBack?O!=="none"&&T():Z()});else if(z==="scroll")if("IntersectionObserver"in window){let H=new IntersectionObserver(k=>{k[0].isIntersecting?Z():O!=="none"&&(y.isPlaying||y.currentTime>0)&&T()},{threshold:.35});H.observe(g),W.push(()=>H.disconnect())}else y.play();else z==="scrub"?ke(g,y,w.sc||{r:[0,100,1,0]}):z!=="api"&&y.play()}function jn(g,y){if(!g)return null;if(g.player)return g.player;if(!y){let O=g.querySelector('script[type="application/json"][data-cin]');if(!O)return null;try{y=JSON.parse(O.textContent||"")}catch{return null}}if((y.f||1)>Dn)return null;let w=Ce(y.d,g);g.player=g.cinPlayer=w,w.stop(),(y.rm==="first"||y.rm==="last")&&!!window.matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches?w.seekTo(y.rm==="first"?0:Math.max(0,Math.round((y.d.dur||1)*1e3)-1)):Ye(g,w,y);try{g.dispatchEvent(new CustomEvent("cinready",{detail:w}))}catch{}return w}function Bn(g=document){g.querySelectorAll('script[type="application/json"][data-cin]').forEach(y=>{let w=y.closest("svg");w&&!w.player&&jn(w)})}var Qe="1.2.0",Re=typeof document!="undefined"?document.currentScript:null,Ie=window;Ie.CinPlayer=Ie.CinPlayer||{version:Qe,f:Dn,boot:jn,scan:Bn};Re&&jn(Re.closest("svg"));typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Bn()):Bn());})();
|