form: 'scale(0)' },
            { offset: 1, opacity: '0.99', transform: 'scale(1)' },
          ]);

        return createAnimation()
          .addElement(baseEl)
          .easing('ease-out')
          .duration(500)
          .addAnimation([backdropAnimation, wrapperAnimation]);
      };

      const leaveAnimation = (baseEl) => {
        return enterAnimation(baseEl).direction('reverse');
      };

      modal.enterAnimation = enterAnimation;
      modal.leaveAnimation = leaveAnimation;
    </script>
 