//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//       LottieGen version:
//           8.1.240821.1+077322fa26
//       
//       Command:
//           LottieGen -Language CSharp -Public -WinUIVersion 3.0 -InputFile Certificate.json
//       
//       Input file:
//           Certificate.json (155831 bytes created 12:44+02:00 Nov 23 2024)
//       
//       LottieGen source:
//           http://aka.ms/Lottie
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// ____________________________________
// |       Object stats       | Count |
// |__________________________|_______|
// | All CompositionObjects   |   106 |
// |--------------------------+-------|
// | Expression animators     |     1 |
// | KeyFrame animators       |     8 |
// | Reference parameters     |     1 |
// | Expression operations    |     0 |
// |--------------------------+-------|
// | Animated brushes         |     - |
// | Animated gradient stops  |     - |
// | ExpressionAnimations     |     1 |
// | PathKeyFrameAnimations   |     1 |
// |--------------------------+-------|
// | ContainerVisuals         |     3 |
// | ShapeVisuals             |     4 |
// |--------------------------+-------|
// | ContainerShapes          |     4 |
// | CompositionSpriteShapes  |    10 |
// |--------------------------+-------|
// | Brushes                  |     9 |
// | Gradient stops           |     - |
// | CompositionVisualSurface |     2 |
// ------------------------------------
using Microsoft.Graphics;
using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using Microsoft.Graphics.Canvas.Geometry;
using Microsoft.UI.Composition;
using System;
using System.Collections.Generic;
using System.Numerics;
using Windows.UI;

namespace AnimatedVisuals
{
    // Name:        certificate
    // Frame rate:  24 fps
    // Frame count: 28
    // Duration:    1166.7 mS
    // _____________________________________________________________________________________________
    // |           Marker           |           Constant           | Frame |   mS   |   Progress   |
    // |____________________________|______________________________|_______|________|______________|
    // | NormalToPressed_Start      | M_NormalToPressed_Start      |     0 |    0.0 | 0F           |
    // | NormalToPressed_End        | M_NormalToPressed_End        |     9 |  375.0 | 0.323214293F |
    // | PointerOverToPressed_Start | M_PointerOverToPressed_Start |     9 |  375.0 | 0.323214293F |
    // | PointerOverToPressed_End   | M_PointerOverToPressed_End   |    19 |  791.7 | 0.680357158F |
    // | PressedToNormal_Start      | M_PressedToNormal_Start      |    20 |  833.3 | 0.716071427F |
    // | PressedToNormal_End        | M_PressedToNormal_End        |    28 | 1166.7 | 1F           |
    // | PressedToPointerOver_Start | M_PressedToPointerOver_Start |    28 | 1166.7 | 1F           |
    // | PressedToPointerOver_End   | M_PressedToPointerOver_End   |    28 | 1166.7 | 1F           |
    // ---------------------------------------------------------------------------------------------
    sealed partial class Certificate
        : Microsoft.UI.Xaml.Controls.IAnimatedVisualSource
        , Microsoft.UI.Xaml.Controls.IAnimatedVisualSource2
    {
        // Animation duration: 1.167 seconds.
        internal const long c_durationTicks = 11666666;

        // Marker: NormalToPressed_Start.
        internal const float M_NormalToPressed_Start = 0F;

        // Marker: NormalToPressed_End.
        internal const float M_NormalToPressed_End = 0.323214293F;

        // Marker: PointerOverToPressed_Start.
        internal const float M_PointerOverToPressed_Start = 0.323214293F;

        // Marker: PointerOverToPressed_End.
        internal const float M_PointerOverToPressed_End = 0.680357158F;

        // Marker: PressedToNormal_Start.
        internal const float M_PressedToNormal_Start = 0.716071427F;

        // Marker: PressedToNormal_End.
        internal const float M_PressedToNormal_End = 1F;

        // Marker: PressedToPointerOver_Start.
        internal const float M_PressedToPointerOver_Start = 1F;

        // Marker: PressedToPointerOver_End.
        internal const float M_PressedToPointerOver_End = 1F;

        public Microsoft.UI.Xaml.Controls.IAnimatedVisual TryCreateAnimatedVisual(Compositor compositor)
        {
            object ignored = null;
            return TryCreateAnimatedVisual(compositor, out ignored);
        }

        public Microsoft.UI.Xaml.Controls.IAnimatedVisual TryCreateAnimatedVisual(Compositor compositor, out object diagnostics)
        {
            diagnostics = null;

            var res =
                new Certificate_AnimatedVisual(
                    compositor
                    );
            res.CreateAnimations();
            return res;
        }

        /// <summary>
        /// Gets the number of frames in the animation.
        /// </summary>
        public double FrameCount => 28d;

        /// <summary>
        /// Gets the frame rate of the animation.
        /// </summary>
        public double Framerate => 24d;

        /// <summary>
        /// Gets the duration of the animation.
        /// </summary>
        public TimeSpan Duration => TimeSpan.FromTicks(11666666);

        /// <summary>
        /// Converts a zero-based frame number to the corresponding progress value denoting the
        /// start of the frame.
        /// </summary>
        public double FrameToProgress(double frameNumber)
        {
            return frameNumber / 28d;
        }

        /// <summary>
        /// Returns a map from marker names to corresponding progress values.
        /// </summary>
        public IReadOnlyDictionary<string, double> Markers =>
            new Dictionary<string, double>
            {
                { "NormalToPressed_Start", 0d },
                { "NormalToPressed_End", 0.323214285714286 },
                { "PointerOverToPressed_Start", 0.323214285714286 },
                { "PointerOverToPressed_End", 0.680357142857143 },
                { "PressedToNormal_Start", 0.716071428571429 },
                { "PressedToNormal_End", 1d },
                { "PressedToPointerOver_Start", 1d },
                { "PressedToPointerOver_End", 1d },
            };

        /// <summary>
        /// Sets the color property with the given name, or does nothing if no such property
        /// exists.
        /// </summary>
        public void SetColorProperty(string propertyName, Color value)
        {
        }

        /// <summary>
        /// Sets the scalar property with the given name, or does nothing if no such property
        /// exists.
        /// </summary>
        public void SetScalarProperty(string propertyName, double value)
        {
        }

        sealed partial class Certificate_AnimatedVisual
            : Microsoft.UI.Xaml.Controls.IAnimatedVisual
            , Microsoft.UI.Xaml.Controls.IAnimatedVisual2
        {
            const long c_durationTicks = 11666666;
            readonly Compositor _c;
            readonly ExpressionAnimation _reusableExpressionAnimation;
            AnimationController _animationController_0;
            CompositionColorBrush _colorBrush_AlmostDarkTurquoise_FF00B3D6;
            CompositionColorBrush _colorBrush_AlmostSalmon_FFF55276;
            CompositionContainerShape _containerShape_0;
            CompositionContainerShape _containerShape_1;
            CompositionContainerShape _containerShape_2;
            CompositionContainerShape _containerShape_3;
            CompositionPath _path_0;
            CompositionPath _path_1;
            CompositionPathGeometry _pathGeometry_0;
            CompositionPathGeometry _pathGeometry_4;
            CompositionPathGeometry _pathGeometry_5;
            CompositionSpriteShape _spriteShape_1;
            CompositionSpriteShape _spriteShape_6;
            CompositionSpriteShape _spriteShape_8;
            ContainerVisual _root;
            CubicBezierEasingFunction _cubicBezierEasingFunction_0;
            ScalarKeyFrameAnimation _rotationAngleInDegreesScalarAnimation_0_to_0_0;
            ScalarKeyFrameAnimation _rotationAngleInDegreesScalarAnimation_0_to_0_1;
            StepEasingFunction _holdThenStepEasingFunction;
            StepEasingFunction _stepThenHoldEasingFunction;

            void BindProperty(
                CompositionObject target,
                string animatedPropertyName,
                string expression,
                string referenceParameterName,
                CompositionObject referencedObject)
            {
                _reusableExpressionAnimation.ClearAllParameters();
                _reusableExpressionAnimation.Expression = expression;
                _reusableExpressionAnimation.SetReferenceParameter(referenceParameterName, referencedObject);
                target.StartAnimation(animatedPropertyName, _reusableExpressionAnimation);
            }

            PathKeyFrameAnimation CreatePathKeyFrameAnimation(float initialProgress, CompositionPath initialValue, CompositionEasingFunction initialEasingFunction)
            {
                var result = _c.CreatePathKeyFrameAnimation();
                result.Duration = TimeSpan.FromTicks(c_durationTicks);
                result.InsertKeyFrame(initialProgress, initialValue, initialEasingFunction);
                return result;
            }

            ScalarKeyFrameAnimation CreateScalarKeyFrameAnimation(float initialProgress, float initialValue, CompositionEasingFunction initialEasingFunction)
            {
                var result = _c.CreateScalarKeyFrameAnimation();
                result.Duration = TimeSpan.FromTicks(c_durationTicks);
                result.InsertKeyFrame(initialProgress, initialValue, initialEasingFunction);
                return result;
            }

            Vector2KeyFrameAnimation CreateVector2KeyFrameAnimation(float initialProgress, Vector2 initialValue, CompositionEasingFunction initialEasingFunction)
            {
                var result = _c.CreateVector2KeyFrameAnimation();
                result.Duration = TimeSpan.FromTicks(c_durationTicks);
                result.InsertKeyFrame(initialProgress, initialValue, initialEasingFunction);
                return result;
            }

            CompositionSpriteShape CreateSpriteShape(CompositionGeometry geometry, Matrix3x2 transformMatrix, CompositionBrush fillBrush)
            {
                var result = _c.CreateSpriteShape(geometry);
                result.TransformMatrix = transformMatrix;
                result.FillBrush = fillBrush;
                return result;
            }

            AnimationController AnimationController_0()
            {
                if (_animationController_0 != null) { return _animationController_0; }
                var result = _animationController_0 = _c.CreateAnimationController();
                result.Pause();
                BindProperty(_animationController_0, "Progress", "_.Progress", "_", _root);
                return result;
            }

            CanvasGeometry Geometry_0()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(-21F, 16F));
                    builder.AddLine(new Vector2(21F, 16F));
                    builder.AddLine(new Vector2(21F, -16F));
                    builder.AddLine(new Vector2(-21F, -16F));
                    builder.AddLine(new Vector2(-21F, 16F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            // - - - - Layer aggregator
            // - - ShapeGroup: Group 7
            CanvasGeometry Geometry_1()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(-18F, -10F));
                    builder.AddLine(new Vector2(-18F, 10F));
                    builder.AddLine(new Vector2(-15F, 13F));
                    builder.AddLine(new Vector2(15F, 13F));
                    builder.AddLine(new Vector2(18F, 10F));
                    builder.AddLine(new Vector2(18F, -10F));
                    builder.AddLine(new Vector2(15F, -13F));
                    builder.AddLine(new Vector2(-15F, -13F));
                    builder.AddLine(new Vector2(-18F, -10F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            // - - - - Layer aggregator
            // - - ShapeGroup: Group 6 Offset:<24, 16.5>
            CanvasGeometry Geometry_2()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(-8F, -1.5F));
                    builder.AddLine(new Vector2(8F, -1.5F));
                    builder.AddLine(new Vector2(8F, 1.5F));
                    builder.AddLine(new Vector2(-8F, 1.5F));
                    builder.AddLine(new Vector2(-8F, -1.5F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            // - - - - Layer aggregator
            // - - ShapeGroup: Group 5 Offset:<24, 22.5>
            CanvasGeometry Geometry_3()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(-13F, -1.5F));
                    builder.AddLine(new Vector2(13F, -1.5F));
                    builder.AddLine(new Vector2(13F, 1.5F));
                    builder.AddLine(new Vector2(-13F, 1.5F));
                    builder.AddLine(new Vector2(-13F, -1.5F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            CanvasGeometry Geometry_4()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(-2F, -1.5F));
                    builder.AddLine(new Vector2(2F, -1.5F));
                    builder.AddLine(new Vector2(2F, 1.5F));
                    builder.AddLine(new Vector2(-2F, 1.5F));
                    builder.AddLine(new Vector2(-2F, -1.5F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            CanvasGeometry Geometry_5()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(-4F, -6.5F));
                    builder.AddCubicBezier(new Vector2(-4F, -6.5F), new Vector2(4F, -6.5F), new Vector2(4F, -6.5F));
                    builder.AddCubicBezier(new Vector2(4F, -6.5F), new Vector2(4F, -2.16300011F), new Vector2(4F, 0.00600000005F));
                    builder.AddCubicBezier(new Vector2(4F, 2.171F), new Vector2(4F, 6.5F), new Vector2(4F, 6.5F));
                    builder.AddCubicBezier(new Vector2(4F, 6.5F), new Vector2(-4F, 6.5F), new Vector2(-4F, 6.5F));
                    builder.AddCubicBezier(new Vector2(-4F, 6.5F), new Vector2(-4F, 2.14299989F), new Vector2(-4F, -0.0350000001F));
                    builder.AddCubicBezier(new Vector2(-4F, -2.19000006F), new Vector2(-4F, -6.5F), new Vector2(-4F, -6.5F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            CanvasGeometry Geometry_6()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(-4F, -6.5F));
                    builder.AddCubicBezier(new Vector2(-4F, -6.5F), new Vector2(4F, -6.5F), new Vector2(4F, -6.5F));
                    builder.AddCubicBezier(new Vector2(4F, -6.5F), new Vector2(3.704F, -2.15499997F), new Vector2(3.704F, 0.0140000004F));
                    builder.AddCubicBezier(new Vector2(3.704F, 2.1789999F), new Vector2(4F, 6.5F), new Vector2(4F, 6.5F));
                    builder.AddCubicBezier(new Vector2(4F, 6.5F), new Vector2(-4F, 6.5F), new Vector2(-4F, 6.5F));
                    builder.AddCubicBezier(new Vector2(-4F, 6.5F), new Vector2(-4.35400009F, 2.23099995F), new Vector2(-4.35400009F, 0.0529999994F));
                    builder.AddCubicBezier(new Vector2(-4.35400009F, -2.102F), new Vector2(-4F, -6.5F), new Vector2(-4F, -6.5F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            // - Path
            CanvasGeometry Geometry_7()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(-4F, -6.5F));
                    builder.AddCubicBezier(new Vector2(-4F, -6.5F), new Vector2(4F, -6.5F), new Vector2(4F, -6.5F));
                    builder.AddCubicBezier(new Vector2(4F, -6.5F), new Vector2(4.47599983F, -2.02900004F), new Vector2(4.47599983F, 0.140000001F));
                    builder.AddCubicBezier(new Vector2(4.47599983F, 2.30500007F), new Vector2(4F, 6.5F), new Vector2(4F, 6.5F));
                    builder.AddCubicBezier(new Vector2(4F, 6.5F), new Vector2(-4F, 6.5F), new Vector2(-4F, 6.5F));
                    builder.AddCubicBezier(new Vector2(-4F, 6.5F), new Vector2(-3.58400011F, 2.19799995F), new Vector2(-3.58400011F, 0.0199999996F));
                    builder.AddCubicBezier(new Vector2(-3.58400011F, -2.13499999F), new Vector2(-4F, -6.5F), new Vector2(-4F, -6.5F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            // - - - - Shape tree root for layer: circle
            // - - Transforms: circle
            CanvasGeometry Geometry_8()
            {
                CanvasGeometry result;
                using (var builder = new CanvasPathBuilder(null))
                {
                    builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding);
                    builder.BeginFigure(new Vector2(0F, -5F));
                    builder.AddCubicBezier(new Vector2(2.76200008F, -5F), new Vector2(5F, -2.76200008F), new Vector2(5F, 0F));
                    builder.AddCubicBezier(new Vector2(5F, 2.76099992F), new Vector2(2.76200008F, 5F), new Vector2(0F, 5F));
                    builder.AddCubicBezier(new Vector2(-2.76099992F, 5F), new Vector2(-5F, 2.76099992F), new Vector2(-5F, 0F));
                    builder.AddCubicBezier(new Vector2(-5F, -2.76200008F), new Vector2(-2.76099992F, -5F), new Vector2(0F, -5F));
                    builder.EndFigure(CanvasFigureLoop.Closed);
                    result = CanvasGeometry.CreatePath(builder);
                }
                return result;
            }

            CompositionColorBrush ColorBrush_AlmostDarkTurquoise_FF00B3D6()
            {
                return (_colorBrush_AlmostDarkTurquoise_FF00B3D6 == null)
                    ? _colorBrush_AlmostDarkTurquoise_FF00B3D6 = _c.CreateColorBrush(Color.FromArgb(0xFF, 0x00, 0xB3, 0xD6))
                    : _colorBrush_AlmostDarkTurquoise_FF00B3D6;
            }

            // - - Layer aggregator
            // ShapeGroup: Group 7
            CompositionColorBrush ColorBrush_AlmostLightSkyBlue_FF7CEBF5()
            {
                return _c.CreateColorBrush(Color.FromArgb(0xFF, 0x7C, 0xEB, 0xF5));
            }

            // - - Shape tree root for layer: circle
            // Transforms: circle
            CompositionColorBrush ColorBrush_AlmostOrange_FFF5BB00()
            {
                return _c.CreateColorBrush(Color.FromArgb(0xFF, 0xF5, 0xBB, 0x00));
            }

            // - - Shape tree root for layer: overlay
            // ShapeGroup: Group 9 Offset:<24, 24>
            CompositionColorBrush ColorBrush_AlmostRed_FFEB0000()
            {
                return _c.CreateColorBrush(Color.FromArgb(0xFF, 0xEB, 0x00, 0x00));
            }

            CompositionColorBrush ColorBrush_AlmostSalmon_FFF55276()
            {
                return (_colorBrush_AlmostSalmon_FFF55276 == null)
                    ? _colorBrush_AlmostSalmon_FFF55276 = _c.CreateColorBrush(Color.FromArgb(0xFF, 0xF5, 0x52, 0x76))
                    : _colorBrush_AlmostSalmon_FFF55276;
            }

            // - - Layer aggregator
            // ShapeGroup: Group 9 Offset:<24, 24>
            CompositionColorBrush ColorBrush_AlmostTurquoise_FF3CD9EB()
            {
                return _c.CreateColorBrush(Color.FromArgb(0xFF, 0x3C, 0xD9, 0xEB));
            }

            // Layer aggregator
            CompositionContainerShape ContainerShape_0()
            {
                if (_containerShape_0 != null) { return _containerShape_0; }
                var result = _containerShape_0 = _c.CreateContainerShape();
                result.CenterPoint = new Vector2(24F, 24F);
                var shapes = result.Shapes;
                // ShapeGroup: Group 9 Offset:<24, 24>
                shapes.Add(SpriteShape_0());
                // ShapeGroup: Group 7
                shapes.Add(SpriteShape_1());
                // ShapeGroup: Group 6 Offset:<24, 16.5>
                shapes.Add(SpriteShape_2());
                // ShapeGroup: Group 5 Offset:<24, 22.5>
                shapes.Add(SpriteShape_3());
                // ShapeGroup: Group 4 Offset:<13, 30.5>
                shapes.Add(SpriteShape_4());
                // ShapeGroup: Group 3 Offset:<35, 30.5>
                shapes.Add(SpriteShape_5());
                // Transforms: ribbon
                shapes.Add(SpriteShape_6());
                return result;
            }

            // Shape tree root for layer: overlay
            CompositionContainerShape ContainerShape_1()
            {
                if (_containerShape_1 != null) { return _containerShape_1; }
                var result = _containerShape_1 = _c.CreateContainerShape();
                result.CenterPoint = new Vector2(24F, 24F);
                // ShapeGroup: Group 9 Offset:<24, 24>
                result.Shapes.Add(SpriteShape_7());
                return result;
            }

            // Shape tree root for layer: mask
            CompositionContainerShape ContainerShape_2()
            {
                if (_containerShape_2 != null) { return _containerShape_2; }
                var result = _containerShape_2 = _c.CreateContainerShape();
                result.CenterPoint = new Vector2(24F, 24F);
                // Transforms: mask
                result.Shapes.Add(SpriteShape_8());
                return result;
            }

            // Shape tree root for layer: circle
            CompositionContainerShape ContainerShape_3()
            {
                if (_containerShape_3 != null) { return _containerShape_3; }
                var result = _containerShape_3 = _c.CreateContainerShape();
                result.CenterPoint = new Vector2(24F, 24F);
                // Transforms: circle
                result.Shapes.Add(SpriteShape_9());
                return result;
            }

            CompositionEffectBrush EffectBrush()
            {
                var effectFactory = EffectFactory();
                var result = effectFactory.CreateBrush();
                result.SetSourceParameter("destination", SurfaceBrush_0());
                result.SetSourceParameter("source", SurfaceBrush_1());
                return result;
            }

            CompositionEffectFactory EffectFactory()
            {
                var compositeEffect = new CompositeEffect();
                compositeEffect.Mode = CanvasComposite.DestinationIn;
                compositeEffect.Sources.Add(new CompositionEffectSourceParameter("destination"));
                compositeEffect.Sources.Add(new CompositionEffectSourceParameter("source"));
                var result = _c.CreateEffectFactory(compositeEffect);
                return result;
            }

            CompositionPath Path_0()
            {
                if (_path_0 != null) { return _path_0; }
                var result = _path_0 = new CompositionPath(Geometry_5());
                return result;
            }

            CompositionPath Path_1()
            {
                if (_path_1 != null) { return _path_1; }
                var result = _path_1 = new CompositionPath(Geometry_6());
                return result;
            }

            CompositionPathGeometry PathGeometry_0()
            {
                return (_pathGeometry_0 == null)
                    ? _pathGeometry_0 = _c.CreatePathGeometry(new CompositionPath(Geometry_0()))
                    : _pathGeometry_0;
            }

            // - - Layer aggregator
            // ShapeGroup: Group 7
            CompositionPathGeometry PathGeometry_1()
            {
                return _c.CreatePathGeometry(new CompositionPath(Geometry_1()));
            }

            // - - Layer aggregator
            // ShapeGroup: Group 6 Offset:<24, 16.5>
            CompositionPathGeometry PathGeometry_2()
            {
                return _c.CreatePathGeometry(new CompositionPath(Geometry_2()));
            }

            // - - Layer aggregator
            // ShapeGroup: Group 5 Offset:<24, 22.5>
            CompositionPathGeometry PathGeometry_3()
            {
                return _c.CreatePathGeometry(new CompositionPath(Geometry_3()));
            }

            CompositionPathGeometry PathGeometry_4()
            {
                return (_pathGeometry_4 == null)
                    ? _pathGeometry_4 = _c.CreatePathGeometry(new CompositionPath(Geometry_4()))
                    : _pathGeometry_4;
            }

            CompositionPathGeometry PathGeometry_5()
            {
                if (_pathGeometry_5 != null) { return _pathGeometry_5; }
                var result = _pathGeometry_5 = _c.CreatePathGeometry();
                return result;
            }

            // - - Shape tree root for layer: circle
            // Transforms: circle
            CompositionPathGeometry PathGeometry_6()
            {
                return _c.CreatePathGeometry(new CompositionPath(Geometry_8()));
            }

            // - Layer aggregator
            // Path 1
            CompositionSpriteShape SpriteShape_0()
            {
                // Offset:<24, 24>
                var geometry = PathGeometry_0();
                var result = CreateSpriteShape(geometry, new Matrix3x2(1F, 0F, 0F, 1F, 24F, 24F), ColorBrush_AlmostTurquoise_FF3CD9EB()); ;
                return result;
            }

            // - Layer aggregator
            // Path 1
            CompositionSpriteShape SpriteShape_1()
            {
                if (_spriteShape_1 != null) { return _spriteShape_1; }
                var result = _spriteShape_1 = _c.CreateSpriteShape(PathGeometry_1());
                result.Offset = new Vector2(24F, 24F);
                result.FillBrush = ColorBrush_AlmostLightSkyBlue_FF7CEBF5();
                return result;
            }

            // - Layer aggregator
            // Path 1
            CompositionSpriteShape SpriteShape_2()
            {
                // Offset:<24, 16.5>
                var geometry = PathGeometry_2();
                var result = CreateSpriteShape(geometry, new Matrix3x2(1F, 0F, 0F, 1F, 24F, 16.5F), ColorBrush_AlmostDarkTurquoise_FF00B3D6()); ;
                return result;
            }

            // - Layer aggregator
            // Path 1
            CompositionSpriteShape SpriteShape_3()
            {
                // Offset:<24, 22.5>
                var geometry = PathGeometry_3();
                var result = CreateSpriteShape(geometry, new Matrix3x2(1F, 0F, 0F, 1F, 24F, 22.5F), ColorBrush_AlmostDarkTurquoise_FF00B3D6()); ;
                return result;
            }

            // - Layer aggregator
            // Path 1
            CompositionSpriteShape SpriteShape_4()
            {
                // Offset:<13, 30.5>
                var geometry = PathGeometry_4();
                var result = CreateSpriteShape(geometry, new Matrix3x2(1F, 0F, 0F, 1F, 13F, 30.5F), ColorBrush_AlmostDarkTurquoise_FF00B3D6()); ;
                return result;
            }

            // - Layer aggregator
            // Path 1
            CompositionSpriteShape SpriteShape_5()
            {
                // Offset:<35, 30.5>
                var geometry = PathGeometry_4();
                var result = CreateSpriteShape(geometry, new Matrix3x2(1F, 0F, 0F, 1F, 35F, 30.5F), ColorBrush_AlmostDarkTurquoise_FF00B3D6()); ;
                return result;
            }

            // - Layer aggregator
            // Path 1
            CompositionSpriteShape SpriteShape_6()
            {
                if (_spriteShape_6 != null) { return _spriteShape_6; }
                var result = _spriteShape_6 = _c.CreateSpriteShape(PathGeometry_5());
                result.CenterPoint = new Vector2(0F, -6.46899986F);
                result.Offset = new Vector2(24F, 37.5F);
                result.FillBrush = ColorBrush_AlmostSalmon_FFF55276();
                return result;
            }

            // - Shape tree root for layer: overlay
            // Path 1
            CompositionSpriteShape SpriteShape_7()
            {
                // Offset:<24, 24>
                var geometry = PathGeometry_0();
                var result = CreateSpriteShape(geometry, new Matrix3x2(1F, 0F, 0F, 1F, 24F, 24F), ColorBrush_AlmostRed_FFEB0000()); ;
                return result;
            }

            // - Shape tree root for layer: mask
            // Path 1
            CompositionSpriteShape SpriteShape_8()
            {
                if (_spriteShape_8 != null) { return _spriteShape_8; }
                var result = _spriteShape_8 = _c.CreateSpriteShape(PathGeometry_5());
                result.CenterPoint = new Vector2(0F, -6.46899986F);
                result.Offset = new Vector2(24F, 37.5F);
                result.FillBrush = ColorBrush_AlmostSalmon_FFF55276();
                return result;
            }

            // - Shape tree root for layer: circle
            // Path 1
            CompositionSpriteShape SpriteShape_9()
            {
                // Offset:<24, 32.064>
                var geometry = PathGeometry_6();
                var result = CreateSpriteShape(geometry, new Matrix3x2(1F, 0F, 0F, 1F, 24F, 32.0639992F), ColorBrush_AlmostOrange_FFF5BB00()); ;
                return result;
            }

            CompositionSurfaceBrush SurfaceBrush_0()
            {
                return _c.CreateSurfaceBrush(VisualSurface_0());
            }

            CompositionSurfaceBrush SurfaceBrush_1()
            {
                return _c.CreateSurfaceBrush(VisualSurface_1());
            }

            CompositionVisualSurface VisualSurface_0()
            {
                var result = _c.CreateVisualSurface();
                result.SourceVisual = ContainerVisual_0();
                result.SourceSize = new Vector2(48F, 48F);
                return result;
            }

            CompositionVisualSurface VisualSurface_1()
            {
                var result = _c.CreateVisualSurface();
                result.SourceVisual = ContainerVisual_1();
                result.SourceSize = new Vector2(48F, 48F);
                return result;
            }

            ContainerVisual ContainerVisual_0()
            {
                var result = _c.CreateContainerVisual();
                result.BorderMode = CompositionBorderMode.Soft;
                // Shape tree root for layer: overlay
                result.Children.InsertAtTop(ShapeVisual_1());
                return result;
            }

            ContainerVisual ContainerVisual_1()
            {
                var result = _c.CreateContainerVisual();
                result.BorderMode = CompositionBorderMode.Soft;
                // Shape tree root for layer: mask
                result.Children.InsertAtTop(ShapeVisual_2());
                return result;
            }

            // The root of the composition.
            ContainerVisual Root()
            {
                if (_root != null) { return _root; }
                var result = _root = _c.CreateContainerVisual();
                var propertySet = result.Properties;
                propertySet.InsertScalar("Progress", 0F);
                var children = result.Children;
                // Layer aggregator
                children.InsertAtTop(ShapeVisual_0());
                children.InsertAtTop(SpriteVisual_0());
                // Shape tree root for layer: circle
                children.InsertAtTop(ShapeVisual_3());
                return result;
            }

            CubicBezierEasingFunction CubicBezierEasingFunction_0()
            {
                return (_cubicBezierEasingFunction_0 == null)
                    ? _cubicBezierEasingFunction_0 = _c.CreateCubicBezierEasingFunction(new Vector2(0.333000004F, 0F), new Vector2(0.666999996F, 1F))
                    : _cubicBezierEasingFunction_0;
            }

            // Path
            PathKeyFrameAnimation PathKeyFrameAnimation_0()
            {
                // Frame 0.
                var result = CreatePathKeyFrameAnimation(0F, Path_0(), StepThenHoldEasingFunction());
                // Frame 3.
                result.InsertKeyFrame(0.107142858F, Path_0(), HoldThenStepEasingFunction());
                // Frame 7.
                result.InsertKeyFrame(0.25F, Path_1(), CubicBezierEasingFunction_0());
                // Frame 11.
                result.InsertKeyFrame(0.392857134F, new CompositionPath(Geometry_7()), CubicBezierEasingFunction_0());
                // Frame 15.
                result.InsertKeyFrame(0.535714269F, Path_1(), CubicBezierEasingFunction_0());
                // Frame 20.
                result.InsertKeyFrame(0.714285731F, Path_1(), CubicBezierEasingFunction_0());
                // Frame 25.
                result.InsertKeyFrame(0.892857134F, Path_0(), _c.CreateCubicBezierEasingFunction(new Vector2(0.514999986F, 0F), new Vector2(0.856999993F, 0.998000026F)));
                return result;
            }

            // Rotation
            ScalarKeyFrameAnimation RotationAngleInDegreesScalarAnimation_0_to_0_0()
            {
                // Frame 0.
                if (_rotationAngleInDegreesScalarAnimation_0_to_0_0 != null) { return _rotationAngleInDegreesScalarAnimation_0_to_0_0; }
                var result = _rotationAngleInDegreesScalarAnimation_0_to_0_0 = CreateScalarKeyFrameAnimation(0F, 0F, StepThenHoldEasingFunction());
                // Frame 3.
                result.InsertKeyFrame(0.107142858F, 0F, HoldThenStepEasingFunction());
                // Frame 7.
                result.InsertKeyFrame(0.25F, -10F, CubicBezierEasingFunction_0());
                // Frame 11.
                result.InsertKeyFrame(0.392857134F, 12F, CubicBezierEasingFunction_0());
                // Frame 15.
                result.InsertKeyFrame(0.535714269F, -10F, CubicBezierEasingFunction_0());
                // Frame 20.
                result.InsertKeyFrame(0.714285731F, 12F, CubicBezierEasingFunction_0());
                // Frame 25.
                result.InsertKeyFrame(0.892857134F, 0F, CubicBezierEasingFunction_0());
                return result;
            }

            // Rotation
            ScalarKeyFrameAnimation RotationAngleInDegreesScalarAnimation_0_to_0_1()
            {
                // Frame 0.
                if (_rotationAngleInDegreesScalarAnimation_0_to_0_1 != null) { return _rotationAngleInDegreesScalarAnimation_0_to_0_1; }
                var result = _rotationAngleInDegreesScalarAnimation_0_to_0_1 = CreateScalarKeyFrameAnimation(0F, 0F, StepThenHoldEasingFunction());
                // Frame 3.
                result.InsertKeyFrame(0.107142858F, 0F, HoldThenStepEasingFunction());
                // Frame 7.
                result.InsertKeyFrame(0.25F, -7F, _c.CreateCubicBezierEasingFunction(new Vector2(0.321999997F, 0F), new Vector2(0.25999999F, 1F)));
                // Frame 11.
                result.InsertKeyFrame(0.392857134F, 7F, CubicBezierEasingFunction_0());
                // Frame 15.
                result.InsertKeyFrame(0.535714269F, -4F, CubicBezierEasingFunction_0());
                // Frame 19.
                result.InsertKeyFrame(0.678571403F, 3F, CubicBezierEasingFunction_0());
                // Frame 23.
                result.InsertKeyFrame(0.821428597F, 0F, CubicBezierEasingFunction_0());
                return result;
            }

            // Layer aggregator
            ShapeVisual ShapeVisual_0()
            {
                var result = _c.CreateShapeVisual();
                result.Size = new Vector2(48F, 48F);
                result.Shapes.Add(ContainerShape_0());
                return result;
            }

            // Shape tree root for layer: overlay
            ShapeVisual ShapeVisual_1()
            {
                var result = _c.CreateShapeVisual();
                result.Size = new Vector2(48F, 48F);
                result.Shapes.Add(ContainerShape_1());
                return result;
            }

            // Shape tree root for layer: mask
            ShapeVisual ShapeVisual_2()
            {
                var result = _c.CreateShapeVisual();
                result.Size = new Vector2(48F, 48F);
                result.Shapes.Add(ContainerShape_2());
                return result;
            }

            // Shape tree root for layer: circle
            ShapeVisual ShapeVisual_3()
            {
                var result = _c.CreateShapeVisual();
                result.Size = new Vector2(48F, 48F);
                result.Shapes.Add(ContainerShape_3());
                return result;
            }

            SpriteVisual SpriteVisual_0()
            {
                var result = _c.CreateSpriteVisual();
                result.Size = new Vector2(48F, 48F);
                result.Brush = EffectBrush();
                return result;
            }

            StepEasingFunction HoldThenStepEasingFunction()
            {
                if (_holdThenStepEasingFunction != null) { return _holdThenStepEasingFunction; }
                var result = _holdThenStepEasingFunction = _c.CreateStepEasingFunction();
                result.IsFinalStepSingleFrame = true;
                return result;
            }

            StepEasingFunction StepThenHoldEasingFunction()
            {
                if (_stepThenHoldEasingFunction != null) { return _stepThenHoldEasingFunction; }
                var result = _stepThenHoldEasingFunction = _c.CreateStepEasingFunction();
                result.IsInitialStepSingleFrame = true;
                return result;
            }

            // - - Layer aggregator
            // ShapeGroup: Group 7
            // Scale
            Vector2KeyFrameAnimation ScaleVector2Animation()
            {
                // Frame 0.
                var result = CreateVector2KeyFrameAnimation(0F, new Vector2(1F, 1F), StepThenHoldEasingFunction());
                // Frame 3.
                result.InsertKeyFrame(0.107142858F, new Vector2(1F, 1F), HoldThenStepEasingFunction());
                // Frame 7.
                result.InsertKeyFrame(0.25F, new Vector2(1.02999997F, 1.02999997F), _c.CreateCubicBezierEasingFunction(new Vector2(0.333000004F, 0F), new Vector2(0.414999992F, 1F)));
                // Frame 11.
                result.InsertKeyFrame(0.392857134F, new Vector2(0.970000029F, 0.970000029F), CubicBezierEasingFunction_0());
                // Frame 15.
                result.InsertKeyFrame(0.535714269F, new Vector2(1.02999997F, 1.02999997F), CubicBezierEasingFunction_0());
                // Frame 19.
                result.InsertKeyFrame(0.678571403F, new Vector2(0.970000029F, 0.970000029F), CubicBezierEasingFunction_0());
                // Frame 23.
                result.InsertKeyFrame(0.821428597F, new Vector2(1F, 1F), CubicBezierEasingFunction_0());
                return result;
            }

            internal Certificate_AnimatedVisual(
                Compositor compositor
                )
            {
                _c = compositor;
                _reusableExpressionAnimation = compositor.CreateExpressionAnimation();
                Root();
            }

            public Visual RootVisual => _root;
            public TimeSpan Duration => TimeSpan.FromTicks(c_durationTicks);
            public Vector2 Size => new Vector2(48F, 48F);
            void IDisposable.Dispose() => _root?.Dispose();

            public void CreateAnimations()
            {
                _containerShape_0.StartAnimation("RotationAngleInDegrees", RotationAngleInDegreesScalarAnimation_0_to_0_1(), AnimationController_0());
                _containerShape_1.StartAnimation("RotationAngleInDegrees", RotationAngleInDegreesScalarAnimation_0_to_0_1(), AnimationController_0());
                _containerShape_2.StartAnimation("RotationAngleInDegrees", RotationAngleInDegreesScalarAnimation_0_to_0_1(), AnimationController_0());
                _containerShape_3.StartAnimation("RotationAngleInDegrees", RotationAngleInDegreesScalarAnimation_0_to_0_1(), AnimationController_0());
                _pathGeometry_5.StartAnimation("Path", PathKeyFrameAnimation_0(), AnimationController_0());
                _spriteShape_1.StartAnimation("Scale", ScaleVector2Animation(), AnimationController_0());
                _spriteShape_6.StartAnimation("RotationAngleInDegrees", RotationAngleInDegreesScalarAnimation_0_to_0_0(), AnimationController_0());
                _spriteShape_8.StartAnimation("RotationAngleInDegrees", RotationAngleInDegreesScalarAnimation_0_to_0_0(), AnimationController_0());
            }

            public void DestroyAnimations()
            {
                _containerShape_0.StopAnimation("RotationAngleInDegrees");
                _containerShape_1.StopAnimation("RotationAngleInDegrees");
                _containerShape_2.StopAnimation("RotationAngleInDegrees");
                _containerShape_3.StopAnimation("RotationAngleInDegrees");
                _pathGeometry_5.StopAnimation("Path");
                _spriteShape_1.StopAnimation("Scale");
                _spriteShape_6.StopAnimation("RotationAngleInDegrees");
                _spriteShape_8.StopAnimation("RotationAngleInDegrees");
            }

        }
    }
}
