You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5269 lines
146 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  3. typeof define === 'function' && define.amd ? define(['exports'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PNotify = {}));
  5. }(this, (function (exports) { 'use strict';
  6. function _typeof(obj) {
  7. "@babel/helpers - typeof";
  8. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  9. _typeof = function (obj) {
  10. return typeof obj;
  11. };
  12. } else {
  13. _typeof = function (obj) {
  14. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  15. };
  16. }
  17. return _typeof(obj);
  18. }
  19. function _classCallCheck(instance, Constructor) {
  20. if (!(instance instanceof Constructor)) {
  21. throw new TypeError("Cannot call a class as a function");
  22. }
  23. }
  24. function _defineProperties(target, props) {
  25. for (var i = 0; i < props.length; i++) {
  26. var descriptor = props[i];
  27. descriptor.enumerable = descriptor.enumerable || false;
  28. descriptor.configurable = true;
  29. if ("value" in descriptor) descriptor.writable = true;
  30. Object.defineProperty(target, descriptor.key, descriptor);
  31. }
  32. }
  33. function _createClass(Constructor, protoProps, staticProps) {
  34. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  35. if (staticProps) _defineProperties(Constructor, staticProps);
  36. return Constructor;
  37. }
  38. function _defineProperty(obj, key, value) {
  39. if (key in obj) {
  40. Object.defineProperty(obj, key, {
  41. value: value,
  42. enumerable: true,
  43. configurable: true,
  44. writable: true
  45. });
  46. } else {
  47. obj[key] = value;
  48. }
  49. return obj;
  50. }
  51. function ownKeys(object, enumerableOnly) {
  52. var keys = Object.keys(object);
  53. if (Object.getOwnPropertySymbols) {
  54. var symbols = Object.getOwnPropertySymbols(object);
  55. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  56. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  57. });
  58. keys.push.apply(keys, symbols);
  59. }
  60. return keys;
  61. }
  62. function _objectSpread2(target) {
  63. for (var i = 1; i < arguments.length; i++) {
  64. var source = arguments[i] != null ? arguments[i] : {};
  65. if (i % 2) {
  66. ownKeys(Object(source), true).forEach(function (key) {
  67. _defineProperty(target, key, source[key]);
  68. });
  69. } else if (Object.getOwnPropertyDescriptors) {
  70. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  71. } else {
  72. ownKeys(Object(source)).forEach(function (key) {
  73. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  74. });
  75. }
  76. }
  77. return target;
  78. }
  79. function _inherits(subClass, superClass) {
  80. if (typeof superClass !== "function" && superClass !== null) {
  81. throw new TypeError("Super expression must either be null or a function");
  82. }
  83. subClass.prototype = Object.create(superClass && superClass.prototype, {
  84. constructor: {
  85. value: subClass,
  86. writable: true,
  87. configurable: true
  88. }
  89. });
  90. if (superClass) _setPrototypeOf(subClass, superClass);
  91. }
  92. function _getPrototypeOf(o) {
  93. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  94. return o.__proto__ || Object.getPrototypeOf(o);
  95. };
  96. return _getPrototypeOf(o);
  97. }
  98. function _setPrototypeOf(o, p) {
  99. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  100. o.__proto__ = p;
  101. return o;
  102. };
  103. return _setPrototypeOf(o, p);
  104. }
  105. function _isNativeReflectConstruct() {
  106. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  107. if (Reflect.construct.sham) return false;
  108. if (typeof Proxy === "function") return true;
  109. try {
  110. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  111. return true;
  112. } catch (e) {
  113. return false;
  114. }
  115. }
  116. function _construct(Parent, args, Class) {
  117. if (_isNativeReflectConstruct()) {
  118. _construct = Reflect.construct;
  119. } else {
  120. _construct = function _construct(Parent, args, Class) {
  121. var a = [null];
  122. a.push.apply(a, args);
  123. var Constructor = Function.bind.apply(Parent, a);
  124. var instance = new Constructor();
  125. if (Class) _setPrototypeOf(instance, Class.prototype);
  126. return instance;
  127. };
  128. }
  129. return _construct.apply(null, arguments);
  130. }
  131. function _assertThisInitialized(self) {
  132. if (self === void 0) {
  133. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  134. }
  135. return self;
  136. }
  137. function _possibleConstructorReturn(self, call) {
  138. if (call && (typeof call === "object" || typeof call === "function")) {
  139. return call;
  140. }
  141. return _assertThisInitialized(self);
  142. }
  143. function _createSuper(Derived) {
  144. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  145. return function _createSuperInternal() {
  146. var Super = _getPrototypeOf(Derived),
  147. result;
  148. if (hasNativeReflectConstruct) {
  149. var NewTarget = _getPrototypeOf(this).constructor;
  150. result = Reflect.construct(Super, arguments, NewTarget);
  151. } else {
  152. result = Super.apply(this, arguments);
  153. }
  154. return _possibleConstructorReturn(this, result);
  155. };
  156. }
  157. function _slicedToArray(arr, i) {
  158. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  159. }
  160. function _toConsumableArray(arr) {
  161. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  162. }
  163. function _arrayWithoutHoles(arr) {
  164. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  165. }
  166. function _arrayWithHoles(arr) {
  167. if (Array.isArray(arr)) return arr;
  168. }
  169. function _iterableToArray(iter) {
  170. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  171. }
  172. function _iterableToArrayLimit(arr, i) {
  173. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  174. var _arr = [];
  175. var _n = true;
  176. var _d = false;
  177. var _e = undefined;
  178. try {
  179. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  180. _arr.push(_s.value);
  181. if (i && _arr.length === i) break;
  182. }
  183. } catch (err) {
  184. _d = true;
  185. _e = err;
  186. } finally {
  187. try {
  188. if (!_n && _i["return"] != null) _i["return"]();
  189. } finally {
  190. if (_d) throw _e;
  191. }
  192. }
  193. return _arr;
  194. }
  195. function _unsupportedIterableToArray(o, minLen) {
  196. if (!o) return;
  197. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  198. var n = Object.prototype.toString.call(o).slice(8, -1);
  199. if (n === "Object" && o.constructor) n = o.constructor.name;
  200. if (n === "Map" || n === "Set") return Array.from(o);
  201. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  202. }
  203. function _arrayLikeToArray(arr, len) {
  204. if (len == null || len > arr.length) len = arr.length;
  205. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  206. return arr2;
  207. }
  208. function _nonIterableSpread() {
  209. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  210. }
  211. function _nonIterableRest() {
  212. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  213. }
  214. function noop() {}
  215. function assign(tar, src) {
  216. // @ts-ignore
  217. for (var k in src) {
  218. tar[k] = src[k];
  219. }
  220. return tar;
  221. }
  222. function run(fn) {
  223. return fn();
  224. }
  225. function blank_object() {
  226. return Object.create(null);
  227. }
  228. function run_all(fns) {
  229. fns.forEach(run);
  230. }
  231. function is_function(thing) {
  232. return typeof thing === 'function';
  233. }
  234. function safe_not_equal(a, b) {
  235. return a != a ? b == b : a !== b || a && _typeof(a) === 'object' || typeof a === 'function';
  236. }
  237. function is_empty(obj) {
  238. return Object.keys(obj).length === 0;
  239. }
  240. function action_destroyer(action_result) {
  241. return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
  242. }
  243. function append(target, node) {
  244. target.appendChild(node);
  245. }
  246. function insert(target, node, anchor) {
  247. target.insertBefore(node, anchor || null);
  248. }
  249. function detach(node) {
  250. node.parentNode.removeChild(node);
  251. }
  252. function element(name) {
  253. return document.createElement(name);
  254. }
  255. function text(data) {
  256. return document.createTextNode(data);
  257. }
  258. function space() {
  259. return text(' ');
  260. }
  261. function empty() {
  262. return text('');
  263. }
  264. function listen(node, event, handler, options) {
  265. node.addEventListener(event, handler, options);
  266. return function () {
  267. return node.removeEventListener(event, handler, options);
  268. };
  269. }
  270. function attr(node, attribute, value) {
  271. if (value == null) node.removeAttribute(attribute);else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
  272. }
  273. function children(element) {
  274. return Array.from(element.childNodes);
  275. }
  276. function set_data(text, data) {
  277. data = '' + data;
  278. if (text.wholeText !== data) text.data = data;
  279. }
  280. function custom_event(type, detail) {
  281. var e = document.createEvent('CustomEvent');
  282. e.initCustomEvent(type, false, false, detail);
  283. return e;
  284. }
  285. var HtmlTag = /*#__PURE__*/function () {
  286. function HtmlTag() {
  287. var anchor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  288. _classCallCheck(this, HtmlTag);
  289. this.a = anchor;
  290. this.e = this.n = null;
  291. }
  292. _createClass(HtmlTag, [{
  293. key: "m",
  294. value: function m(html, target) {
  295. var anchor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  296. if (!this.e) {
  297. this.e = element(target.nodeName);
  298. this.t = target;
  299. this.h(html);
  300. }
  301. this.i(anchor);
  302. }
  303. }, {
  304. key: "h",
  305. value: function h(html) {
  306. this.e.innerHTML = html;
  307. this.n = Array.from(this.e.childNodes);
  308. }
  309. }, {
  310. key: "i",
  311. value: function i(anchor) {
  312. for (var i = 0; i < this.n.length; i += 1) {
  313. insert(this.t, this.n[i], anchor);
  314. }
  315. }
  316. }, {
  317. key: "p",
  318. value: function p(html) {
  319. this.d();
  320. this.h(html);
  321. this.i(this.a);
  322. }
  323. }, {
  324. key: "d",
  325. value: function d() {
  326. this.n.forEach(detach);
  327. }
  328. }]);
  329. return HtmlTag;
  330. }();
  331. var current_component;
  332. function set_current_component(component) {
  333. current_component = component;
  334. }
  335. function get_current_component() {
  336. if (!current_component) throw new Error('Function called outside component initialization');
  337. return current_component;
  338. }
  339. function beforeUpdate(fn) {
  340. get_current_component().$$.before_update.push(fn);
  341. }
  342. function onMount(fn) {
  343. get_current_component().$$.on_mount.push(fn);
  344. }
  345. function createEventDispatcher() {
  346. var component = get_current_component();
  347. return function (type, detail) {
  348. var callbacks = component.$$.callbacks[type];
  349. if (callbacks) {
  350. // TODO are there situations where events could be dispatched
  351. // in a server (non-DOM) environment?
  352. var event = custom_event(type, detail);
  353. callbacks.slice().forEach(function (fn) {
  354. fn.call(component, event);
  355. });
  356. }
  357. };
  358. }
  359. // shorthand events, or if we want to implement
  360. // a real bubbling mechanism
  361. function bubble(component, event) {
  362. var callbacks = component.$$.callbacks[event.type];
  363. if (callbacks) {
  364. callbacks.slice().forEach(function (fn) {
  365. return fn(event);
  366. });
  367. }
  368. }
  369. var dirty_components = [];
  370. var binding_callbacks = [];
  371. var render_callbacks = [];
  372. var flush_callbacks = [];
  373. var resolved_promise = Promise.resolve();
  374. var update_scheduled = false;
  375. function schedule_update() {
  376. if (!update_scheduled) {
  377. update_scheduled = true;
  378. resolved_promise.then(flush);
  379. }
  380. }
  381. function tick() {
  382. schedule_update();
  383. return resolved_promise;
  384. }
  385. function add_render_callback(fn) {
  386. render_callbacks.push(fn);
  387. }
  388. var flushing = false;
  389. var seen_callbacks = new Set();
  390. function flush() {
  391. if (flushing) return;
  392. flushing = true;
  393. do {
  394. // first, call beforeUpdate functions
  395. // and update components
  396. for (var i = 0; i < dirty_components.length; i += 1) {
  397. var component = dirty_components[i];
  398. set_current_component(component);
  399. update(component.$$);
  400. }
  401. set_current_component(null);
  402. dirty_components.length = 0;
  403. while (binding_callbacks.length) {
  404. binding_callbacks.pop()();
  405. } // then, once components are updated, call
  406. // afterUpdate functions. This may cause
  407. // subsequent updates...
  408. for (var _i = 0; _i < render_callbacks.length; _i += 1) {
  409. var callback = render_callbacks[_i];
  410. if (!seen_callbacks.has(callback)) {
  411. // ...so guard against infinite loops
  412. seen_callbacks.add(callback);
  413. callback();
  414. }
  415. }
  416. render_callbacks.length = 0;
  417. } while (dirty_components.length);
  418. while (flush_callbacks.length) {
  419. flush_callbacks.pop()();
  420. }
  421. update_scheduled = false;
  422. flushing = false;
  423. seen_callbacks.clear();
  424. }
  425. function update($$) {
  426. if ($$.fragment !== null) {
  427. $$.update();
  428. run_all($$.before_update);
  429. var dirty = $$.dirty;
  430. $$.dirty = [-1];
  431. $$.fragment && $$.fragment.p($$.ctx, dirty);
  432. $$.after_update.forEach(add_render_callback);
  433. }
  434. }
  435. var outroing = new Set();
  436. var outros;
  437. function group_outros() {
  438. outros = {
  439. r: 0,
  440. c: [],
  441. p: outros // parent group
  442. };
  443. }
  444. function check_outros() {
  445. if (!outros.r) {
  446. run_all(outros.c);
  447. }
  448. outros = outros.p;
  449. }
  450. function transition_in(block, local) {
  451. if (block && block.i) {
  452. outroing["delete"](block);
  453. block.i(local);
  454. }
  455. }
  456. function transition_out(block, local, detach, callback) {
  457. if (block && block.o) {
  458. if (outroing.has(block)) return;
  459. outroing.add(block);
  460. outros.c.push(function () {
  461. outroing["delete"](block);
  462. if (callback) {
  463. if (detach) block.d(1);
  464. callback();
  465. }
  466. });
  467. block.o(local);
  468. }
  469. }
  470. var globals = typeof window !== 'undefined' ? window : typeof globalThis !== 'undefined' ? globalThis : global;
  471. function outro_and_destroy_block(block, lookup) {
  472. transition_out(block, 1, 1, function () {
  473. lookup["delete"](block.key);
  474. });
  475. }
  476. function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {
  477. var o = old_blocks.length;
  478. var n = list.length;
  479. var i = o;
  480. var old_indexes = {};
  481. while (i--) {
  482. old_indexes[old_blocks[i].key] = i;
  483. }
  484. var new_blocks = [];
  485. var new_lookup = new Map();
  486. var deltas = new Map();
  487. i = n;
  488. while (i--) {
  489. var child_ctx = get_context(ctx, list, i);
  490. var key = get_key(child_ctx);
  491. var block = lookup.get(key);
  492. if (!block) {
  493. block = create_each_block(key, child_ctx);
  494. block.c();
  495. } else if (dynamic) {
  496. block.p(child_ctx, dirty);
  497. }
  498. new_lookup.set(key, new_blocks[i] = block);
  499. if (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key]));
  500. }
  501. var will_move = new Set();
  502. var did_move = new Set();
  503. function insert(block) {
  504. transition_in(block, 1);
  505. block.m(node, next);
  506. lookup.set(block.key, block);
  507. next = block.first;
  508. n--;
  509. }
  510. while (o && n) {
  511. var new_block = new_blocks[n - 1];
  512. var old_block = old_blocks[o - 1];
  513. var new_key = new_block.key;
  514. var old_key = old_block.key;
  515. if (new_block === old_block) {
  516. // do nothing
  517. next = new_block.first;
  518. o--;
  519. n--;
  520. } else if (!new_lookup.has(old_key)) {
  521. // remove old block
  522. destroy(old_block, lookup);
  523. o--;
  524. } else if (!lookup.has(new_key) || will_move.has(new_key)) {
  525. insert(new_block);
  526. } else if (did_move.has(old_key)) {
  527. o--;
  528. } else if (deltas.get(new_key) > deltas.get(old_key)) {
  529. did_move.add(new_key);
  530. insert(new_block);
  531. } else {
  532. will_move.add(old_key);
  533. o--;
  534. }
  535. }
  536. while (o--) {
  537. var _old_block = old_blocks[o];
  538. if (!new_lookup.has(_old_block.key)) destroy(_old_block, lookup);
  539. }
  540. while (n) {
  541. insert(new_blocks[n - 1]);
  542. }
  543. return new_blocks;
  544. }
  545. function get_spread_update(levels, updates) {
  546. var update = {};
  547. var to_null_out = {};
  548. var accounted_for = {
  549. $$scope: 1
  550. };
  551. var i = levels.length;
  552. while (i--) {
  553. var o = levels[i];
  554. var n = updates[i];
  555. if (n) {
  556. for (var key in o) {
  557. if (!(key in n)) to_null_out[key] = 1;
  558. }
  559. for (var _key3 in n) {
  560. if (!accounted_for[_key3]) {
  561. update[_key3] = n[_key3];
  562. accounted_for[_key3] = 1;
  563. }
  564. }
  565. levels[i] = n;
  566. } else {
  567. for (var _key4 in o) {
  568. accounted_for[_key4] = 1;
  569. }
  570. }
  571. }
  572. for (var _key5 in to_null_out) {
  573. if (!(_key5 in update)) update[_key5] = undefined;
  574. }
  575. return update;
  576. }
  577. function get_spread_object(spread_props) {
  578. return _typeof(spread_props) === 'object' && spread_props !== null ? spread_props : {};
  579. } // source: https://html.spec.whatwg.org/multipage/indices.html
  580. function create_component(block) {
  581. block && block.c();
  582. }
  583. function mount_component(component, target, anchor) {
  584. var _component$$$ = component.$$,
  585. fragment = _component$$$.fragment,
  586. on_mount = _component$$$.on_mount,
  587. on_destroy = _component$$$.on_destroy,
  588. after_update = _component$$$.after_update;
  589. fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
  590. add_render_callback(function () {
  591. var new_on_destroy = on_mount.map(run).filter(is_function);
  592. if (on_destroy) {
  593. on_destroy.push.apply(on_destroy, _toConsumableArray(new_on_destroy));
  594. } else {
  595. // Edge case - component was destroyed immediately,
  596. // most likely as a result of a binding initialising
  597. run_all(new_on_destroy);
  598. }
  599. component.$$.on_mount = [];
  600. });
  601. after_update.forEach(add_render_callback);
  602. }
  603. function destroy_component(component, detaching) {
  604. var $$ = component.$$;
  605. if ($$.fragment !== null) {
  606. run_all($$.on_destroy);
  607. $$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
  608. // preserve final state?)
  609. $$.on_destroy = $$.fragment = null;
  610. $$.ctx = [];
  611. }
  612. }
  613. function make_dirty(component, i) {
  614. if (component.$$.dirty[0] === -1) {
  615. dirty_components.push(component);
  616. schedule_update();
  617. component.$$.dirty.fill(0);
  618. }
  619. component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
  620. }
  621. function init(component, options, instance, create_fragment, not_equal, props) {
  622. var dirty = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [-1];
  623. var parent_component = current_component;
  624. set_current_component(component);
  625. var prop_values = options.props || {};
  626. var $$ = component.$$ = {
  627. fragment: null,
  628. ctx: null,
  629. // state
  630. props: props,
  631. update: noop,
  632. not_equal: not_equal,
  633. bound: blank_object(),
  634. // lifecycle
  635. on_mount: [],
  636. on_destroy: [],
  637. before_update: [],
  638. after_update: [],
  639. context: new Map(parent_component ? parent_component.$$.context : []),
  640. // everything else
  641. callbacks: blank_object(),
  642. dirty: dirty,
  643. skip_bound: false
  644. };
  645. var ready = false;
  646. $$.ctx = instance ? instance(component, prop_values, function (i, ret) {
  647. var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
  648. if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
  649. if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
  650. if (ready) make_dirty(component, i);
  651. }
  652. return ret;
  653. }) : [];
  654. $$.update();
  655. ready = true;
  656. run_all($$.before_update); // `false` as a special case of no DOM component
  657. $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
  658. if (options.target) {
  659. if (options.hydrate) {
  660. var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  661. $$.fragment && $$.fragment.l(nodes);
  662. nodes.forEach(detach);
  663. } else {
  664. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  665. $$.fragment && $$.fragment.c();
  666. }
  667. if (options.intro) transition_in(component.$$.fragment);
  668. mount_component(component, options.target, options.anchor);
  669. flush();
  670. }
  671. set_current_component(parent_component);
  672. }
  673. var SvelteComponent = /*#__PURE__*/function () {
  674. function SvelteComponent() {
  675. _classCallCheck(this, SvelteComponent);
  676. }
  677. _createClass(SvelteComponent, [{
  678. key: "$destroy",
  679. value: function $destroy() {
  680. destroy_component(this, 1);
  681. this.$destroy = noop;
  682. }
  683. }, {
  684. key: "$on",
  685. value: function $on(type, callback) {
  686. var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
  687. callbacks.push(callback);
  688. return function () {
  689. var index = callbacks.indexOf(callback);
  690. if (index !== -1) callbacks.splice(index, 1);
  691. };
  692. }
  693. }, {
  694. key: "$set",
  695. value: function $set($$props) {
  696. if (this.$$set && !is_empty($$props)) {
  697. this.$$.skip_bound = true;
  698. this.$$set($$props);
  699. this.$$.skip_bound = false;
  700. }
  701. }
  702. }]);
  703. return SvelteComponent;
  704. }();
  705. var Stack = /*#__PURE__*/function () {
  706. function Stack(options) {
  707. _classCallCheck(this, Stack);
  708. // TODO: label for close all button
  709. Object.assign(this, {
  710. dir1: null,
  711. dir2: null,
  712. firstpos1: null,
  713. firstpos2: null,
  714. spacing1: 25,
  715. spacing2: 25,
  716. push: 'bottom',
  717. maxOpen: 1,
  718. maxStrategy: 'wait',
  719. maxClosureCausesWait: true,
  720. modal: 'ish',
  721. modalishFlash: true,
  722. overlayClose: true,
  723. overlayClosesPinned: false,
  724. positioned: true,
  725. context: window && document.body || null
  726. }, options); // Validate the options.
  727. if (this.modal === 'ish' && this.maxOpen !== 1) {
  728. throw new Error('A modalish stack must have a maxOpen value of 1.');
  729. }
  730. if (this.modal === 'ish' && !this.dir1) {
  731. throw new Error('A modalish stack must have a direction.');
  732. }
  733. if (this.push === 'top' && this.modal === 'ish' && this.maxStrategy !== 'close') {
  734. throw new Error('A modalish stack that pushes to the top must use the close maxStrategy.');
  735. } // -- Private properties.
  736. // The head of the notice double linked list.
  737. this._noticeHead = {
  738. notice: null,
  739. prev: null,
  740. next: null
  741. }; // The tail of the notice double linked list.
  742. this._noticeTail = {
  743. notice: null,
  744. prev: this._noticeHead,
  745. next: null
  746. };
  747. this._noticeHead.next = this._noticeTail; // The map of notices to nodes.
  748. this._noticeMap = new WeakMap(); // The number of notices in the stack.
  749. this._length = 0; // How much space to add along the secondary axis when moving notices to the
  750. // next column/row.
  751. this._addpos2 = 0; // Whether the stack's notices should animate while moving.
  752. this._animation = true; // A timer to debounce positioning.
  753. this._posTimer = null; // The number of open notices.
  754. this._openNotices = 0; // A listener for positioning events.
  755. this._listener = null; // Whether the overlay is currently open.
  756. this._overlayOpen = false; // Whether the overlay is currently inserted into the DOM.
  757. this._overlayInserted = false; // Whether the modal state is collapsing. (Notices go back to waiting and
  758. // shouldn't resposition.)
  759. this._collapsingModalState = false; // The leader is the first open notice in a modalish stack.
  760. this._leader = null;
  761. this._leaderOff = null; // The next waiting notice that is masking.
  762. this._masking = null;
  763. this._maskingOff = null; // Swapping notices, so don't open a new one. Set to the opening notice on
  764. // swap.
  765. this._swapping = false; // Event listener callbacks.
  766. this._callbacks = {};
  767. }
  768. _createClass(Stack, [{
  769. key: "forEach",
  770. value: function forEach(callback) {
  771. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  772. _ref$start = _ref.start,
  773. start = _ref$start === void 0 ? 'oldest' : _ref$start,
  774. _ref$dir = _ref.dir,
  775. dir = _ref$dir === void 0 ? 'newer' : _ref$dir,
  776. _ref$skipModuleHandle = _ref.skipModuleHandled,
  777. skipModuleHandled = _ref$skipModuleHandle === void 0 ? false : _ref$skipModuleHandle;
  778. var node;
  779. if (start === 'head' || start === 'newest' && this.push === 'top' || start === 'oldest' && this.push === 'bottom') {
  780. node = this._noticeHead.next;
  781. } else if (start === 'tail' || start === 'newest' && this.push === 'bottom' || start === 'oldest' && this.push === 'top') {
  782. node = this._noticeTail.prev;
  783. } else if (this._noticeMap.has(start)) {
  784. node = this._noticeMap.get(start);
  785. } else {
  786. throw new Error('Invalid start param.');
  787. }
  788. while (node.notice) {
  789. var _notice = node.notice; // Get the next node first.
  790. if (dir === 'prev' || this.push === 'top' && dir === 'newer' || this.push === 'bottom' && dir === 'older') {
  791. node = node.prev;
  792. } else if (dir === 'next' || this.push === 'top' && dir === 'older' || this.push === 'bottom' && dir === 'newer') {
  793. node = node.next;
  794. } else {
  795. throw new Error('Invalid dir param.');
  796. } // Call the callback last, just in case the callback removes the notice.
  797. if ((!skipModuleHandled || !_notice.getModuleHandled()) && callback(_notice) === false) {
  798. break;
  799. }
  800. }
  801. }
  802. }, {
  803. key: "close",
  804. value: function close(immediate) {
  805. this.forEach(function (notice) {
  806. return notice.close(immediate, false, false);
  807. });
  808. }
  809. }, {
  810. key: "open",
  811. value: function open(immediate) {
  812. this.forEach(function (notice) {
  813. return notice.open(immediate);
  814. });
  815. }
  816. }, {
  817. key: "openLast",
  818. value: function openLast() {
  819. // Look up the last notice, and display it.
  820. this.forEach(function (notice) {
  821. if (['opening', 'open', 'waiting'].indexOf(notice.getState()) === -1) {
  822. notice.open();
  823. return false;
  824. }
  825. }, {
  826. start: 'newest',
  827. dir: 'older'
  828. });
  829. }
  830. }, {
  831. key: "swap",
  832. value: function swap(one, theOther) {
  833. var _this = this;
  834. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  835. var waitAfter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  836. if (['open', 'opening', 'closing'].indexOf(one.getState()) === -1) {
  837. // One is closed. Return rejected promise.
  838. return Promise.reject();
  839. }
  840. this._swapping = theOther;
  841. return one.close(immediate, false, waitAfter).then(function () {
  842. return theOther.open(immediate);
  843. })["finally"](function () {
  844. _this._swapping = false;
  845. });
  846. }
  847. }, {
  848. key: "on",
  849. value: function on(event, callback) {
  850. var _this2 = this;
  851. if (!(event in this._callbacks)) {
  852. this._callbacks[event] = [];
  853. }
  854. this._callbacks[event].push(callback);
  855. return function () {
  856. _this2._callbacks[event].splice(_this2._callbacks[event].indexOf(callback), 1);
  857. };
  858. }
  859. }, {
  860. key: "fire",
  861. value: function fire(event) {
  862. var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  863. detail.stack = this;
  864. if (event in this._callbacks) {
  865. this._callbacks[event].forEach(function (cb) {
  866. return cb(detail);
  867. });
  868. }
  869. }
  870. }, {
  871. key: "position",
  872. value: function position() {
  873. var _this3 = this;
  874. // Reset the next position data.
  875. if (this.positioned && this._length > 0) {
  876. this.fire('beforePosition');
  877. this._resetPositionData();
  878. this.forEach(function (notice) {
  879. _this3._positionNotice(notice);
  880. }, {
  881. start: 'head',
  882. dir: 'next',
  883. skipModuleHandled: true
  884. });
  885. this.fire('afterPosition');
  886. } else {
  887. delete this._nextpos1;
  888. delete this._nextpos2;
  889. }
  890. } // Queue the position so it doesn't run repeatedly and use up resources.
  891. }, {
  892. key: "queuePosition",
  893. value: function queuePosition() {
  894. var _this4 = this;
  895. var milliseconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
  896. if (this._posTimer) {
  897. clearTimeout(this._posTimer);
  898. }
  899. this._posTimer = setTimeout(function () {
  900. return _this4.position();
  901. }, milliseconds);
  902. }
  903. }, {
  904. key: "_resetPositionData",
  905. value: function _resetPositionData() {
  906. this._nextpos1 = this.firstpos1;
  907. this._nextpos2 = this.firstpos2;
  908. this._addpos2 = 0;
  909. } // Position the notice.
  910. }, {
  911. key: "_positionNotice",
  912. value: function _positionNotice(notice) {
  913. var masking = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : notice === this._masking;
  914. if (!this.positioned) {
  915. return;
  916. } // Get the notice's element.
  917. var elem = notice.refs.elem;
  918. if (!elem) {
  919. return;
  920. } // Skip this notice if it's not shown.
  921. if (!elem.classList.contains('pnotify-in') && !elem.classList.contains('pnotify-initial') && !masking) {
  922. return;
  923. } // Use local variables, since a masking notice position shouldn't update the
  924. // stack.
  925. var _ref2 = [this.firstpos1, this.firstpos2, this._nextpos1, this._nextpos2, this._addpos2],
  926. firstpos1 = _ref2[0],
  927. firstpos2 = _ref2[1],
  928. _nextpos1 = _ref2[2],
  929. _nextpos2 = _ref2[3],
  930. _addpos2 = _ref2[4]; // Read from the DOM to cause refresh.
  931. elem.getBoundingClientRect();
  932. if (this._animation && !masking && !this._collapsingModalState) {
  933. // Add animate class.
  934. notice._setMoveClass('pnotify-move');
  935. } else {
  936. notice._setMoveClass('');
  937. }
  938. var spaceY = this.context === document.body ? window.innerHeight : this.context.scrollHeight;
  939. var spaceX = this.context === document.body ? window.innerWidth : this.context.scrollWidth;
  940. var csspos1;
  941. if (this.dir1) {
  942. csspos1 = {
  943. down: 'top',
  944. up: 'bottom',
  945. left: 'right',
  946. right: 'left'
  947. }[this.dir1]; // Calculate the current pos1 value.
  948. var curpos1;
  949. switch (this.dir1) {
  950. case 'down':
  951. curpos1 = elem.offsetTop;
  952. break;
  953. case 'up':
  954. curpos1 = spaceY - elem.scrollHeight - elem.offsetTop;
  955. break;
  956. case 'left':
  957. curpos1 = spaceX - elem.scrollWidth - elem.offsetLeft;
  958. break;
  959. case 'right':
  960. curpos1 = elem.offsetLeft;
  961. break;
  962. } // Remember the first pos1, so the first notice goes there.
  963. if (firstpos1 == null) {
  964. firstpos1 = curpos1;
  965. _nextpos1 = firstpos1;
  966. }
  967. }
  968. if (this.dir1 && this.dir2) {
  969. var csspos2 = {
  970. down: 'top',
  971. up: 'bottom',
  972. left: 'right',
  973. right: 'left'
  974. }[this.dir2]; // Calculate the current pos2 value.
  975. var curpos2;
  976. switch (this.dir2) {
  977. case 'down':
  978. curpos2 = elem.offsetTop;
  979. break;
  980. case 'up':
  981. curpos2 = spaceY - elem.scrollHeight - elem.offsetTop;
  982. break;
  983. case 'left':
  984. curpos2 = spaceX - elem.scrollWidth - elem.offsetLeft;
  985. break;
  986. case 'right':
  987. curpos2 = elem.offsetLeft;
  988. break;
  989. } // Remember the first pos2, so the first notice goes there.
  990. if (firstpos2 == null) {
  991. firstpos2 = curpos2;
  992. _nextpos2 = firstpos2;
  993. } // Don't move masking notices along dir2. They should always be beside the
  994. // leader along dir1.
  995. if (!masking) {
  996. // Check that it's not beyond the viewport edge.
  997. var endY = _nextpos1 + elem.offsetHeight + this.spacing1;
  998. var endX = _nextpos1 + elem.offsetWidth + this.spacing1;
  999. if ((this.dir1 === 'down' || this.dir1 === 'up') && endY > spaceY || (this.dir1 === 'left' || this.dir1 === 'right') && endX > spaceX) {
  1000. // If it is, it needs to go back to the first pos1, and over on pos2.
  1001. _nextpos1 = firstpos1;
  1002. _nextpos2 += _addpos2 + this.spacing2;
  1003. _addpos2 = 0;
  1004. }
  1005. } // Move the notice on dir2.
  1006. if (_nextpos2 != null) {
  1007. elem.style[csspos2] = "".concat(_nextpos2, "px");
  1008. if (!this._animation) {
  1009. elem.style[csspos2]; // Read from the DOM for update.
  1010. }
  1011. } // Keep track of the widest/tallest notice in the column/row, so we can push the next column/row.
  1012. switch (this.dir2) {
  1013. case 'down':
  1014. case 'up':
  1015. if (elem.offsetHeight + (parseFloat(elem.style.marginTop, 10) || 0) + (parseFloat(elem.style.marginBottom, 10) || 0) > _addpos2) {
  1016. _addpos2 = elem.offsetHeight;
  1017. }
  1018. break;
  1019. case 'left':
  1020. case 'right':
  1021. if (elem.offsetWidth + (parseFloat(elem.style.marginLeft, 10) || 0) + (parseFloat(elem.style.marginRight, 10) || 0) > _addpos2) {
  1022. _addpos2 = elem.offsetWidth;
  1023. }
  1024. break;
  1025. }
  1026. } else if (this.dir1) {
  1027. // Center the notice along dir1 axis, because the stack has no dir2.
  1028. var cssMiddle, cssposCross;
  1029. switch (this.dir1) {
  1030. case 'down':
  1031. case 'up':
  1032. cssposCross = ['left', 'right'];
  1033. cssMiddle = this.context.scrollWidth / 2 - elem.offsetWidth / 2;
  1034. break;
  1035. case 'left':
  1036. case 'right':
  1037. cssposCross = ['top', 'bottom'];
  1038. cssMiddle = spaceY / 2 - elem.offsetHeight / 2;
  1039. break;
  1040. }
  1041. elem.style[cssposCross[0]] = "".concat(cssMiddle, "px");
  1042. elem.style[cssposCross[1]] = 'auto';
  1043. if (!this._animation) {
  1044. elem.style[cssposCross[0]]; // Read from the DOM for update.
  1045. }
  1046. }
  1047. if (this.dir1) {
  1048. // Move the notice on dir1.
  1049. if (_nextpos1 != null) {
  1050. elem.style[csspos1] = "".concat(_nextpos1, "px");
  1051. if (!this._animation) {
  1052. elem.style[csspos1]; // Read from the DOM for update.
  1053. }
  1054. } // Calculate the next dir1 position.
  1055. switch (this.dir1) {
  1056. case 'down':
  1057. case 'up':
  1058. _nextpos1 += elem.offsetHeight + this.spacing1;
  1059. break;
  1060. case 'left':
  1061. case 'right':
  1062. _nextpos1 += elem.offsetWidth + this.spacing1;
  1063. break;
  1064. }
  1065. } else {
  1066. // Center the notice on the screen, because the stack has no dir1.
  1067. var cssMiddleLeft = spaceX / 2 - elem.offsetWidth / 2;
  1068. var cssMiddleTop = spaceY / 2 - elem.offsetHeight / 2;
  1069. elem.style.left = "".concat(cssMiddleLeft, "px");
  1070. elem.style.top = "".concat(cssMiddleTop, "px");
  1071. if (!this._animation) {
  1072. elem.style.left; // Read from the DOM for update.
  1073. }
  1074. } // If we're not positioning the masking notice, update the stack properties.
  1075. if (!masking) {
  1076. this.firstpos1 = firstpos1;
  1077. this.firstpos2 = firstpos2;
  1078. this._nextpos1 = _nextpos1;
  1079. this._nextpos2 = _nextpos2;
  1080. this._addpos2 = _addpos2;
  1081. }
  1082. }
  1083. }, {
  1084. key: "_addNotice",
  1085. value: function _addNotice(notice) {
  1086. var _this5 = this;
  1087. this.fire('beforeAddNotice', {
  1088. notice: notice
  1089. });
  1090. var handleNoticeOpen = function handleNoticeOpen() {
  1091. _this5.fire('beforeOpenNotice', {
  1092. notice: notice
  1093. });
  1094. if (notice.getModuleHandled()) {
  1095. // We don't deal with notices that are handled by a module.
  1096. _this5.fire('afterOpenNotice', {
  1097. notice: notice
  1098. });
  1099. return;
  1100. }
  1101. _this5._openNotices++; // Check the max in stack.
  1102. if (!(_this5.modal === 'ish' && _this5._overlayOpen) && _this5.maxOpen !== Infinity && _this5._openNotices > _this5.maxOpen && _this5.maxStrategy === 'close') {
  1103. var toClose = _this5._openNotices - _this5.maxOpen;
  1104. _this5.forEach(function (notice) {
  1105. if (['opening', 'open'].indexOf(notice.getState()) !== -1) {
  1106. // Close oldest notices, leaving only stack.maxOpen from the stack.
  1107. notice.close(false, false, _this5.maxClosureCausesWait);
  1108. if (notice === _this5._leader) {
  1109. _this5._setLeader(null);
  1110. }
  1111. toClose--;
  1112. return !!toClose;
  1113. }
  1114. });
  1115. }
  1116. if (_this5.modal === true) {
  1117. _this5._insertOverlay();
  1118. }
  1119. if (_this5.modal === 'ish' && (!_this5._leader || ['opening', 'open', 'closing'].indexOf(_this5._leader.getState()) === -1)) {
  1120. _this5._setLeader(notice);
  1121. }
  1122. if (_this5.modal === 'ish' && _this5._overlayOpen) {
  1123. notice._preventTimerClose(true);
  1124. } // this.queuePosition(0);
  1125. _this5.fire('afterOpenNotice', {
  1126. notice: notice
  1127. });
  1128. };
  1129. var handleNoticeClosed = function handleNoticeClosed() {
  1130. _this5.fire('beforeCloseNotice', {
  1131. notice: notice
  1132. });
  1133. if (notice.getModuleHandled()) {
  1134. // We don't deal with notices that are handled by a module.
  1135. _this5.fire('afterCloseNotice', {
  1136. notice: notice
  1137. });
  1138. return;
  1139. }
  1140. _this5._openNotices--;
  1141. if (_this5.modal === 'ish' && notice === _this5._leader) {
  1142. _this5._setLeader(null);
  1143. if (_this5._masking) {
  1144. _this5._setMasking(null);
  1145. }
  1146. }
  1147. if (!_this5._swapping && _this5.maxOpen !== Infinity && _this5._openNotices < _this5.maxOpen) {
  1148. var done = false;
  1149. var open = function open(contender) {
  1150. if (contender !== notice && contender.getState() === 'waiting') {
  1151. contender.open()["catch"](function () {});
  1152. if (_this5._openNotices >= _this5.maxOpen) {
  1153. done = true;
  1154. return false;
  1155. }
  1156. }
  1157. };
  1158. if (_this5.maxStrategy === 'wait') {
  1159. // Check for the next waiting notice and open it.
  1160. _this5.forEach(open, {
  1161. start: notice,
  1162. dir: 'next'
  1163. });
  1164. if (!done) {
  1165. _this5.forEach(open, {
  1166. start: notice,
  1167. dir: 'prev'
  1168. });
  1169. }
  1170. } else if (_this5.maxStrategy === 'close' && _this5.maxClosureCausesWait) {
  1171. // Check for the last closed notice and re-open it.
  1172. _this5.forEach(open, {
  1173. start: notice,
  1174. dir: 'older'
  1175. });
  1176. if (!done) {
  1177. _this5.forEach(open, {
  1178. start: notice,
  1179. dir: 'newer'
  1180. });
  1181. }
  1182. }
  1183. }
  1184. if (_this5._openNotices <= 0) {
  1185. _this5._openNotices = 0;
  1186. _this5._resetPositionData();
  1187. if (_this5._overlayOpen && !_this5._swapping) {
  1188. _this5._removeOverlay();
  1189. }
  1190. } else if (!_this5._collapsingModalState) {
  1191. _this5.queuePosition(0);
  1192. }
  1193. _this5.fire('afterCloseNotice', {
  1194. notice: notice
  1195. });
  1196. }; // This is the linked list node.
  1197. var node = {
  1198. notice: notice,
  1199. prev: null,
  1200. next: null,
  1201. beforeOpenOff: notice.on('pnotify:beforeOpen', handleNoticeOpen),
  1202. afterCloseOff: notice.on('pnotify:afterClose', handleNoticeClosed)
  1203. }; // Push to the correct side of the linked list.
  1204. if (this.push === 'top') {
  1205. node.next = this._noticeHead.next;
  1206. node.prev = this._noticeHead;
  1207. node.next.prev = node;
  1208. node.prev.next = node;
  1209. } else {
  1210. node.prev = this._noticeTail.prev;
  1211. node.next = this._noticeTail;
  1212. node.prev.next = node;
  1213. node.next.prev = node;
  1214. } // Add to the map.
  1215. this._noticeMap.set(notice, node); // Increment the length to match.
  1216. this._length++;
  1217. if (!this._listener) {
  1218. this._listener = function () {
  1219. return _this5.position();
  1220. };
  1221. this.context.addEventListener('pnotify:position', this._listener);
  1222. }
  1223. if (['open', 'opening', 'closing'].indexOf(notice.getState()) !== -1) {
  1224. // If the notice is already open, handle it immediately.
  1225. handleNoticeOpen();
  1226. } else if (this.modal === 'ish' && this.modalishFlash && this._shouldNoticeWait(notice)) {
  1227. // If it's not open, and it's going to be a waiting notice, flash it.
  1228. var off = notice.on('pnotify:mount', function () {
  1229. off();
  1230. notice._setMasking(true, false, function () {
  1231. notice._setMasking(false);
  1232. });
  1233. _this5._resetPositionData();
  1234. _this5._positionNotice(_this5._leader);
  1235. window.requestAnimationFrame(function () {
  1236. _this5._positionNotice(notice, true);
  1237. });
  1238. });
  1239. }
  1240. this.fire('afterAddNotice', {
  1241. notice: notice
  1242. });
  1243. }
  1244. }, {
  1245. key: "_removeNotice",
  1246. value: function _removeNotice(notice) {
  1247. if (!this._noticeMap.has(notice)) {
  1248. return;
  1249. }
  1250. this.fire('beforeRemoveNotice', {
  1251. notice: notice
  1252. });
  1253. var node = this._noticeMap.get(notice);
  1254. if (this._leader === notice) {
  1255. // Clear the leader.
  1256. this._setLeader(null);
  1257. }
  1258. if (this._masking === notice) {
  1259. // Clear masking.
  1260. this._setMasking(null);
  1261. } // Remove the notice from the linked list.
  1262. node.prev.next = node.next;
  1263. node.next.prev = node.prev;
  1264. node.prev = null;
  1265. node.next = null;
  1266. node.beforeOpenOff();
  1267. node.beforeOpenOff = null;
  1268. node.afterCloseOff();
  1269. node.afterCloseOff = null; // Remove the notice from the map.
  1270. this._noticeMap["delete"](notice); // Reduce the length to match.
  1271. this._length--;
  1272. if (!this._length && this._listener) {
  1273. // Remove the listener.
  1274. this.context.removeEventListener('pnotify:position', this._listener);
  1275. this._listener = null;
  1276. }
  1277. if (!this._length && this._overlayOpen) {
  1278. this._removeOverlay();
  1279. } // If the notice is open, handle it as if it had closed.
  1280. if (['open', 'opening', 'closing'].indexOf(notice.getState()) !== -1) {
  1281. this._handleNoticeClosed(notice);
  1282. }
  1283. this.fire('afterRemoveNotice', {
  1284. notice: notice
  1285. });
  1286. }
  1287. }, {
  1288. key: "_setLeader",
  1289. value: function _setLeader(leader) {
  1290. var _this6 = this;
  1291. this.fire('beforeSetLeader', {
  1292. leader: leader
  1293. });
  1294. if (this._leaderOff) {
  1295. this._leaderOff();
  1296. this._leaderOff = null;
  1297. }
  1298. this._leader = leader;
  1299. if (!this._leader) {
  1300. this.fire('afterSetLeader', {
  1301. leader: leader
  1302. });
  1303. return;
  1304. } // If the mouse enters this notice while it's the leader, then the next
  1305. // waiting notice should start masking.
  1306. var leaderInteraction = function leaderInteraction() {
  1307. // This is a workaround for leaving the modal state.
  1308. var nextNoticeFromModalState = null; // If the leader is moused over:
  1309. if (_this6._overlayOpen) {
  1310. _this6._collapsingModalState = true;
  1311. _this6.forEach(function (notice) {
  1312. // Allow the notices to timed close.
  1313. notice._preventTimerClose(false); // Close and set to wait any open notices other than the leader.
  1314. if (notice !== _this6._leader && ['opening', 'open'].indexOf(notice.getState()) !== -1) {
  1315. if (!nextNoticeFromModalState) {
  1316. nextNoticeFromModalState = notice;
  1317. }
  1318. notice.close(notice === nextNoticeFromModalState, false, true);
  1319. }
  1320. }, {
  1321. start: _this6._leader,
  1322. dir: 'next',
  1323. skipModuleHandled: true
  1324. }); // Remove the modal state overlay.
  1325. _this6._removeOverlay();
  1326. } // Turn off any masking off timer that may still be running.
  1327. if (maskingOffTimer) {
  1328. clearTimeout(maskingOffTimer);
  1329. maskingOffTimer = null;
  1330. } // Set the next waiting notice to be masking.
  1331. _this6.forEach(function (notice) {
  1332. if (notice === _this6._leader) {
  1333. // Skip the leader, and start with the next one.
  1334. return;
  1335. } // The next notice that is "waiting" is usually fine, but if we're
  1336. // leaving the modal state, it will still be "closing" here, so we have
  1337. // to work around that. :P
  1338. // Also, when coming back from modal state, the notice should
  1339. // immediately be masking instead of fading in.
  1340. if (notice.getState() === 'waiting' || notice === nextNoticeFromModalState) {
  1341. _this6._setMasking(notice, !!nextNoticeFromModalState);
  1342. return false;
  1343. }
  1344. }, {
  1345. start: _this6._leader,
  1346. dir: 'next',
  1347. skipModuleHandled: true
  1348. });
  1349. }; // If the mouse leaves this notice while it's the leader, then the next
  1350. // waiting notice should stop masking.
  1351. var maskingOffTimer = null;
  1352. var leaderLeaveInteraction = function leaderLeaveInteraction() {
  1353. if (maskingOffTimer) {
  1354. clearTimeout(maskingOffTimer);
  1355. maskingOffTimer = null;
  1356. } // TODO: Something wrong here when you come right back from the modal state.
  1357. maskingOffTimer = setTimeout(function () {
  1358. maskingOffTimer = null;
  1359. _this6._setMasking(null);
  1360. }, 750);
  1361. };
  1362. this._leaderOff = function (offs) {
  1363. return function () {
  1364. return offs.map(function (off) {
  1365. return off();
  1366. });
  1367. };
  1368. }([this._leader.on('mouseenter', leaderInteraction), this._leader.on('focusin', leaderInteraction), this._leader.on('mouseleave', leaderLeaveInteraction), this._leader.on('focusout', leaderLeaveInteraction)]);
  1369. this.fire('afterSetLeader', {
  1370. leader: leader
  1371. });
  1372. }
  1373. }, {
  1374. key: "_setMasking",
  1375. value: function _setMasking(masking, immediate) {
  1376. var _this7 = this;
  1377. if (this._masking) {
  1378. if (this._masking === masking) {
  1379. // Nothing to do.
  1380. return;
  1381. }
  1382. this._masking._setMasking(false, immediate);
  1383. }
  1384. if (this._maskingOff) {
  1385. this._maskingOff();
  1386. this._maskingOff = null;
  1387. }
  1388. this._masking = masking;
  1389. if (!this._masking) {
  1390. return;
  1391. } // Reset the position data and position the leader.
  1392. this._resetPositionData();
  1393. if (this._leader) {
  1394. this._positionNotice(this._leader);
  1395. } // Get this notice ready for positioning.
  1396. this._masking._setMasking(true, immediate); // Wait for the DOM to update.
  1397. window.requestAnimationFrame(function () {
  1398. if (_this7._masking) {
  1399. _this7._positionNotice(_this7._masking);
  1400. }
  1401. });
  1402. var maskingInteraction = function maskingInteraction() {
  1403. // If the masked notice is moused over or focused, the stack enters the
  1404. // modal state, and the notices appear.
  1405. if (_this7.modal === 'ish') {
  1406. _this7._insertOverlay();
  1407. _this7._setMasking(null, true);
  1408. _this7.forEach(function (notice) {
  1409. // Prevent the notices from timed closing.
  1410. notice._preventTimerClose(true);
  1411. if (notice.getState() === 'waiting') {
  1412. notice.open();
  1413. }
  1414. }, {
  1415. start: _this7._leader,
  1416. dir: 'next',
  1417. skipModuleHandled: true
  1418. });
  1419. }
  1420. };
  1421. this._maskingOff = function (offs) {
  1422. return function () {
  1423. return offs.map(function (off) {
  1424. return off();
  1425. });
  1426. };
  1427. }([this._masking.on('mouseenter', maskingInteraction), this._masking.on('focusin', maskingInteraction)]);
  1428. }
  1429. }, {
  1430. key: "_shouldNoticeWait",
  1431. value: function _shouldNoticeWait(notice) {
  1432. return this._swapping !== notice && !(this.modal === 'ish' && this._overlayOpen) && this.maxOpen !== Infinity && this._openNotices >= this.maxOpen && this.maxStrategy === 'wait';
  1433. }
  1434. }, {
  1435. key: "_insertOverlay",
  1436. value: function _insertOverlay() {
  1437. var _this8 = this;
  1438. if (!this._overlay) {
  1439. this._overlay = document.createElement('div');
  1440. this._overlay.classList.add('pnotify-modal-overlay');
  1441. if (this.dir1) {
  1442. this._overlay.classList.add("pnotify-modal-overlay-".concat(this.dir1));
  1443. }
  1444. if (this.overlayClose) {
  1445. this._overlay.classList.add('pnotify-modal-overlay-closes');
  1446. }
  1447. if (this.context !== document.body) {
  1448. this._overlay.style.height = "".concat(this.context.scrollHeight, "px");
  1449. this._overlay.style.width = "".concat(this.context.scrollWidth, "px");
  1450. } // Close the notices on overlay click.
  1451. this._overlay.addEventListener('click', function (clickEvent) {
  1452. if (_this8.overlayClose) {
  1453. _this8.fire('overlayClose', {
  1454. clickEvent: clickEvent
  1455. });
  1456. if (clickEvent.defaultPrevented) {
  1457. return;
  1458. }
  1459. if (_this8._leader) {
  1460. // Clear the leader. A new one will be found while closing.
  1461. _this8._setLeader(null);
  1462. }
  1463. _this8.forEach(function (notice) {
  1464. if (['closed', 'closing', 'waiting'].indexOf(notice.getState()) !== -1) {
  1465. return;
  1466. }
  1467. if (notice.hide || _this8.overlayClosesPinned) {
  1468. notice.close();
  1469. } else if (!notice.hide && _this8.modal === 'ish') {
  1470. if (_this8._leader) {
  1471. notice.close(false, false, true);
  1472. } else {
  1473. _this8._setLeader(notice);
  1474. }
  1475. }
  1476. }, {
  1477. skipModuleHandled: true
  1478. });
  1479. if (_this8._overlayOpen) {
  1480. _this8._removeOverlay();
  1481. }
  1482. }
  1483. });
  1484. }
  1485. if (this._overlay.parentNode !== this.context) {
  1486. this.fire('beforeAddOverlay');
  1487. this._overlay.classList.remove('pnotify-modal-overlay-in');
  1488. this._overlay = this.context.insertBefore(this._overlay, this.context.firstChild);
  1489. this._overlayOpen = true;
  1490. this._overlayInserted = true;
  1491. window.requestAnimationFrame(function () {
  1492. _this8._overlay.classList.add('pnotify-modal-overlay-in');
  1493. _this8.fire('afterAddOverlay');
  1494. });
  1495. }
  1496. this._collapsingModalState = false;
  1497. }
  1498. }, {
  1499. key: "_removeOverlay",
  1500. value: function _removeOverlay() {
  1501. var _this9 = this;
  1502. if (this._overlay.parentNode) {
  1503. this.fire('beforeRemoveOverlay');
  1504. this._overlay.classList.remove('pnotify-modal-overlay-in');
  1505. this._overlayOpen = false;
  1506. setTimeout(function () {
  1507. _this9._overlayInserted = false;
  1508. if (_this9._overlay.parentNode) {
  1509. _this9._overlay.parentNode.removeChild(_this9._overlay);
  1510. _this9.fire('afterRemoveOverlay');
  1511. }
  1512. }, 250);
  1513. setTimeout(function () {
  1514. _this9._collapsingModalState = false;
  1515. }, 400);
  1516. }
  1517. }
  1518. }, {
  1519. key: "notices",
  1520. get: function get() {
  1521. var notices = [];
  1522. this.forEach(function (notice) {
  1523. return notices.push(notice);
  1524. });
  1525. return notices;
  1526. }
  1527. }, {
  1528. key: "length",
  1529. get: function get() {
  1530. return this._length;
  1531. }
  1532. }, {
  1533. key: "leader",
  1534. get: function get() {
  1535. return this._leader;
  1536. }
  1537. }]);
  1538. return Stack;
  1539. }();
  1540. var component = function component() {
  1541. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1542. args[_key] = arguments[_key];
  1543. }
  1544. return _construct(Core, args);
  1545. };
  1546. function forwardEventsBuilder(component) {
  1547. var additionalEvents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1548. // prettier-ignore
  1549. var events = ['focus', 'blur', 'fullscreenchange', 'fullscreenerror', 'scroll', 'cut', 'copy', 'paste', 'keydown', 'keypress', 'keyup', 'auxclick', 'click', 'contextmenu', 'dblclick', 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseover', 'mouseout', 'mouseup', 'pointerlockchange', 'pointerlockerror', 'select', 'wheel', 'drag', 'dragend', 'dragenter', 'dragstart', 'dragleave', 'dragover', 'drop', 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'pointerover', 'pointerenter', 'pointerdown', 'pointermove', 'pointerup', 'pointercancel', 'pointerout', 'pointerleave', 'gotpointercapture', 'lostpointercapture'].concat(_toConsumableArray(additionalEvents));
  1550. function forward(e) {
  1551. bubble(component, e);
  1552. }
  1553. return function (node) {
  1554. var destructors = [];
  1555. for (var i = 0; i < events.length; i++) {
  1556. destructors.push(listen(node, events[i], forward));
  1557. }
  1558. return {
  1559. destroy: function destroy() {
  1560. for (var _i = 0; _i < destructors.length; _i++) {
  1561. destructors[_i]();
  1562. }
  1563. }
  1564. };
  1565. };
  1566. }
  1567. var Map_1 = globals.Map;
  1568. function get_each_context(ctx, list, i) {
  1569. var child_ctx = ctx.slice();
  1570. child_ctx[109] = list[i][0];
  1571. child_ctx[110] = list[i][1];
  1572. return child_ctx;
  1573. }
  1574. function get_each_context_1(ctx, list, i) {
  1575. var child_ctx = ctx.slice();
  1576. child_ctx[109] = list[i][0];
  1577. child_ctx[110] = list[i][1];
  1578. return child_ctx;
  1579. }
  1580. function get_each_context_2(ctx, list, i) {
  1581. var child_ctx = ctx.slice();
  1582. child_ctx[109] = list[i][0];
  1583. child_ctx[110] = list[i][1];
  1584. return child_ctx;
  1585. }
  1586. function get_each_context_3(ctx, list, i) {
  1587. var child_ctx = ctx.slice();
  1588. child_ctx[109] = list[i][0];
  1589. child_ctx[110] = list[i][1];
  1590. return child_ctx;
  1591. } // (931:4) {#each modulesPrependContainer as [module, options] (module)}
  1592. function create_each_block_3(key_1, ctx) {
  1593. var first;
  1594. var switch_instance;
  1595. var switch_instance_anchor;
  1596. var current;
  1597. var switch_instance_spread_levels = [{
  1598. self:
  1599. /*self*/
  1600. ctx[42]
  1601. },
  1602. /*options*/
  1603. ctx[110]];
  1604. var switch_value =
  1605. /*module*/
  1606. ctx[109]["default"];
  1607. function switch_props(ctx) {
  1608. var switch_instance_props = {};
  1609. for (var i = 0; i < switch_instance_spread_levels.length; i += 1) {
  1610. switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
  1611. }
  1612. return {
  1613. props: switch_instance_props
  1614. };
  1615. }
  1616. if (switch_value) {
  1617. switch_instance = new switch_value(switch_props());
  1618. }
  1619. return {
  1620. key: key_1,
  1621. first: null,
  1622. c: function c() {
  1623. first = empty();
  1624. if (switch_instance) create_component(switch_instance.$$.fragment);
  1625. switch_instance_anchor = empty();
  1626. this.first = first;
  1627. },
  1628. m: function m(target, anchor) {
  1629. insert(target, first, anchor);
  1630. if (switch_instance) {
  1631. mount_component(switch_instance, target, anchor);
  1632. }
  1633. insert(target, switch_instance_anchor, anchor);
  1634. current = true;
  1635. },
  1636. p: function p(ctx, dirty) {
  1637. var switch_instance_changes = dirty[1] &
  1638. /*self, modulesPrependContainer*/
  1639. 2176 ? get_spread_update(switch_instance_spread_levels, [dirty[1] &
  1640. /*self*/
  1641. 2048 && {
  1642. self:
  1643. /*self*/
  1644. ctx[42]
  1645. }, dirty[1] &
  1646. /*modulesPrependContainer*/
  1647. 128 && get_spread_object(
  1648. /*options*/
  1649. ctx[110])]) : {};
  1650. if (switch_value !== (switch_value =
  1651. /*module*/
  1652. ctx[109]["default"])) {
  1653. if (switch_instance) {
  1654. group_outros();
  1655. var old_component = switch_instance;
  1656. transition_out(old_component.$$.fragment, 1, 0, function () {
  1657. destroy_component(old_component, 1);
  1658. });
  1659. check_outros();
  1660. }
  1661. if (switch_value) {
  1662. switch_instance = new switch_value(switch_props());
  1663. create_component(switch_instance.$$.fragment);
  1664. transition_in(switch_instance.$$.fragment, 1);
  1665. mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
  1666. } else {
  1667. switch_instance = null;
  1668. }
  1669. } else if (switch_value) {
  1670. switch_instance.$set(switch_instance_changes);
  1671. }
  1672. },
  1673. i: function i(local) {
  1674. if (current) return;
  1675. if (switch_instance) transition_in(switch_instance.$$.fragment, local);
  1676. current = true;
  1677. },
  1678. o: function o(local) {
  1679. if (switch_instance) transition_out(switch_instance.$$.fragment, local);
  1680. current = false;
  1681. },
  1682. d: function d(detaching) {
  1683. if (detaching) detach(first);
  1684. if (detaching) detach(switch_instance_anchor);
  1685. if (switch_instance) destroy_component(switch_instance, detaching);
  1686. }
  1687. };
  1688. } // (934:4) {#if closer && !_nonBlock}
  1689. function create_if_block_8(ctx) {
  1690. var div;
  1691. var span;
  1692. var span_class_value;
  1693. var div_class_value;
  1694. var div_title_value;
  1695. var mounted;
  1696. var dispose;
  1697. return {
  1698. c: function c() {
  1699. div = element("div");
  1700. span = element("span");
  1701. attr(span, "class", span_class_value =
  1702. /*getIcon*/
  1703. ctx[22]("closer"));
  1704. attr(div, "class", div_class_value = "pnotify-closer ".concat(
  1705. /*getStyle*/
  1706. ctx[21]("closer"), " ").concat((!
  1707. /*closerHover*/
  1708. ctx[17] ||
  1709. /*_interacting*/
  1710. ctx[26]) && !
  1711. /*_masking*/
  1712. ctx[28] ? "" : "pnotify-hidden"));
  1713. attr(div, "role", "button");
  1714. attr(div, "tabindex", "0");
  1715. attr(div, "title", div_title_value =
  1716. /*labels*/
  1717. ctx[20].close);
  1718. },
  1719. m: function m(target, anchor) {
  1720. insert(target, div, anchor);
  1721. append(div, span);
  1722. if (!mounted) {
  1723. dispose = listen(div, "click",
  1724. /*click_handler*/
  1725. ctx[81]);
  1726. mounted = true;
  1727. }
  1728. },
  1729. p: function p(ctx, dirty) {
  1730. if (dirty[0] &
  1731. /*closerHover, _interacting, _masking*/
  1732. 335675392 && div_class_value !== (div_class_value = "pnotify-closer ".concat(
  1733. /*getStyle*/
  1734. ctx[21]("closer"), " ").concat((!
  1735. /*closerHover*/
  1736. ctx[17] ||
  1737. /*_interacting*/
  1738. ctx[26]) && !
  1739. /*_masking*/
  1740. ctx[28] ? "" : "pnotify-hidden"))) {
  1741. attr(div, "class", div_class_value);
  1742. }
  1743. if (dirty[0] &
  1744. /*labels*/
  1745. 1048576 && div_title_value !== (div_title_value =
  1746. /*labels*/
  1747. ctx[20].close)) {
  1748. attr(div, "title", div_title_value);
  1749. }
  1750. },
  1751. d: function d(detaching) {
  1752. if (detaching) detach(div);
  1753. mounted = false;
  1754. dispose();
  1755. }
  1756. };
  1757. } // (945:4) {#if sticker && !_nonBlock}
  1758. function create_if_block_7(ctx) {
  1759. var div;
  1760. var span;
  1761. var span_class_value;
  1762. var div_class_value;
  1763. var div_aria_pressed_value;
  1764. var div_title_value;
  1765. var mounted;
  1766. var dispose;
  1767. return {
  1768. c: function c() {
  1769. div = element("div");
  1770. span = element("span");
  1771. attr(span, "class", span_class_value = "".concat(
  1772. /*getIcon*/
  1773. ctx[22]("sticker"), " ").concat(
  1774. /*hide*/
  1775. ctx[3] ?
  1776. /*getIcon*/
  1777. ctx[22]("unstuck") :
  1778. /*getIcon*/
  1779. ctx[22]("stuck")));
  1780. attr(div, "class", div_class_value = "pnotify-sticker ".concat(
  1781. /*getStyle*/
  1782. ctx[21]("sticker"), " ").concat((!
  1783. /*stickerHover*/
  1784. ctx[19] ||
  1785. /*_interacting*/
  1786. ctx[26]) && !
  1787. /*_masking*/
  1788. ctx[28] ? "" : "pnotify-hidden"));
  1789. attr(div, "role", "button");
  1790. attr(div, "aria-pressed", div_aria_pressed_value = !
  1791. /*hide*/
  1792. ctx[3]);
  1793. attr(div, "tabindex", "0");
  1794. attr(div, "title", div_title_value =
  1795. /*hide*/
  1796. ctx[3] ?
  1797. /*labels*/
  1798. ctx[20].stick :
  1799. /*labels*/
  1800. ctx[20].unstick);
  1801. },
  1802. m: function m(target, anchor) {
  1803. insert(target, div, anchor);
  1804. append(div, span);
  1805. if (!mounted) {
  1806. dispose = listen(div, "click",
  1807. /*click_handler_1*/
  1808. ctx[82]);
  1809. mounted = true;
  1810. }
  1811. },
  1812. p: function p(ctx, dirty) {
  1813. if (dirty[0] &
  1814. /*hide*/
  1815. 8 && span_class_value !== (span_class_value = "".concat(
  1816. /*getIcon*/
  1817. ctx[22]("sticker"), " ").concat(
  1818. /*hide*/
  1819. ctx[3] ?
  1820. /*getIcon*/
  1821. ctx[22]("unstuck") :
  1822. /*getIcon*/
  1823. ctx[22]("stuck")))) {
  1824. attr(span, "class", span_class_value);
  1825. }
  1826. if (dirty[0] &
  1827. /*stickerHover, _interacting, _masking*/
  1828. 336068608 && div_class_value !== (div_class_value = "pnotify-sticker ".concat(
  1829. /*getStyle*/
  1830. ctx[21]("sticker"), " ").concat((!
  1831. /*stickerHover*/
  1832. ctx[19] ||
  1833. /*_interacting*/
  1834. ctx[26]) && !
  1835. /*_masking*/
  1836. ctx[28] ? "" : "pnotify-hidden"))) {
  1837. attr(div, "class", div_class_value);
  1838. }
  1839. if (dirty[0] &
  1840. /*hide*/
  1841. 8 && div_aria_pressed_value !== (div_aria_pressed_value = !
  1842. /*hide*/
  1843. ctx[3])) {
  1844. attr(div, "aria-pressed", div_aria_pressed_value);
  1845. }
  1846. if (dirty[0] &
  1847. /*hide, labels*/
  1848. 1048584 && div_title_value !== (div_title_value =
  1849. /*hide*/
  1850. ctx[3] ?
  1851. /*labels*/
  1852. ctx[20].stick :
  1853. /*labels*/
  1854. ctx[20].unstick)) {
  1855. attr(div, "title", div_title_value);
  1856. }
  1857. },
  1858. d: function d(detaching) {
  1859. if (detaching) detach(div);
  1860. mounted = false;
  1861. dispose();
  1862. }
  1863. };
  1864. } // (959:4) {#if icon !== false}
  1865. function create_if_block_6(ctx) {
  1866. var div;
  1867. var span;
  1868. var span_class_value;
  1869. var div_class_value;
  1870. return {
  1871. c: function c() {
  1872. div = element("div");
  1873. span = element("span");
  1874. attr(span, "class", span_class_value =
  1875. /*icon*/
  1876. ctx[13] === true ?
  1877. /*getIcon*/
  1878. ctx[22](
  1879. /*type*/
  1880. ctx[4]) :
  1881. /*icon*/
  1882. ctx[13]);
  1883. attr(div, "class", div_class_value = "pnotify-icon ".concat(
  1884. /*getStyle*/
  1885. ctx[21]("icon")));
  1886. },
  1887. m: function m(target, anchor) {
  1888. insert(target, div, anchor);
  1889. append(div, span);
  1890. /*div_binding*/
  1891. ctx[83](div);
  1892. },
  1893. p: function p(ctx, dirty) {
  1894. if (dirty[0] &
  1895. /*icon, type*/
  1896. 8208 && span_class_value !== (span_class_value =
  1897. /*icon*/
  1898. ctx[13] === true ?
  1899. /*getIcon*/
  1900. ctx[22](
  1901. /*type*/
  1902. ctx[4]) :
  1903. /*icon*/
  1904. ctx[13])) {
  1905. attr(span, "class", span_class_value);
  1906. }
  1907. },
  1908. d: function d(detaching) {
  1909. if (detaching) detach(div);
  1910. /*div_binding*/
  1911. ctx[83](null);
  1912. }
  1913. };
  1914. } // (971:6) {#each modulesPrependContent as [module, options] (module)}
  1915. function create_each_block_2(key_1, ctx) {
  1916. var first;
  1917. var switch_instance;
  1918. var switch_instance_anchor;
  1919. var current;
  1920. var switch_instance_spread_levels = [{
  1921. self:
  1922. /*self*/
  1923. ctx[42]
  1924. },
  1925. /*options*/
  1926. ctx[110]];
  1927. var switch_value =
  1928. /*module*/
  1929. ctx[109]["default"];
  1930. function switch_props(ctx) {
  1931. var switch_instance_props = {};
  1932. for (var i = 0; i < switch_instance_spread_levels.length; i += 1) {
  1933. switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
  1934. }
  1935. return {
  1936. props: switch_instance_props
  1937. };
  1938. }
  1939. if (switch_value) {
  1940. switch_instance = new switch_value(switch_props());
  1941. }
  1942. return {
  1943. key: key_1,
  1944. first: null,
  1945. c: function c() {
  1946. first = empty();
  1947. if (switch_instance) create_component(switch_instance.$$.fragment);
  1948. switch_instance_anchor = empty();
  1949. this.first = first;
  1950. },
  1951. m: function m(target, anchor) {
  1952. insert(target, first, anchor);
  1953. if (switch_instance) {
  1954. mount_component(switch_instance, target, anchor);
  1955. }
  1956. insert(target, switch_instance_anchor, anchor);
  1957. current = true;
  1958. },
  1959. p: function p(ctx, dirty) {
  1960. var switch_instance_changes = dirty[1] &
  1961. /*self, modulesPrependContent*/
  1962. 2304 ? get_spread_update(switch_instance_spread_levels, [dirty[1] &
  1963. /*self*/
  1964. 2048 && {
  1965. self:
  1966. /*self*/
  1967. ctx[42]
  1968. }, dirty[1] &
  1969. /*modulesPrependContent*/
  1970. 256 && get_spread_object(
  1971. /*options*/
  1972. ctx[110])]) : {};
  1973. if (switch_value !== (switch_value =
  1974. /*module*/
  1975. ctx[109]["default"])) {
  1976. if (switch_instance) {
  1977. group_outros();
  1978. var old_component = switch_instance;
  1979. transition_out(old_component.$$.fragment, 1, 0, function () {
  1980. destroy_component(old_component, 1);
  1981. });
  1982. check_outros();
  1983. }
  1984. if (switch_value) {
  1985. switch_instance = new switch_value(switch_props());
  1986. create_component(switch_instance.$$.fragment);
  1987. transition_in(switch_instance.$$.fragment, 1);
  1988. mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
  1989. } else {
  1990. switch_instance = null;
  1991. }
  1992. } else if (switch_value) {
  1993. switch_instance.$set(switch_instance_changes);
  1994. }
  1995. },
  1996. i: function i(local) {
  1997. if (current) return;
  1998. if (switch_instance) transition_in(switch_instance.$$.fragment, local);
  1999. current = true;
  2000. },
  2001. o: function o(local) {
  2002. if (switch_instance) transition_out(switch_instance.$$.fragment, local);
  2003. current = false;
  2004. },
  2005. d: function d(detaching) {
  2006. if (detaching) detach(first);
  2007. if (detaching) detach(switch_instance_anchor);
  2008. if (switch_instance) destroy_component(switch_instance, detaching);
  2009. }
  2010. };
  2011. } // (974:6) {#if title !== false}
  2012. function create_if_block_3(ctx) {
  2013. var div;
  2014. var div_class_value;
  2015. var if_block = !
  2016. /*_titleElement*/
  2017. ctx[34] && create_if_block_4(ctx);
  2018. return {
  2019. c: function c() {
  2020. div = element("div");
  2021. if (if_block) if_block.c();
  2022. attr(div, "class", div_class_value = "pnotify-title ".concat(
  2023. /*getStyle*/
  2024. ctx[21]("title")));
  2025. },
  2026. m: function m(target, anchor) {
  2027. insert(target, div, anchor);
  2028. if (if_block) if_block.m(div, null);
  2029. /*div_binding_1*/
  2030. ctx[84](div);
  2031. },
  2032. p: function p(ctx, dirty) {
  2033. if (!
  2034. /*_titleElement*/
  2035. ctx[34]) {
  2036. if (if_block) {
  2037. if_block.p(ctx, dirty);
  2038. } else {
  2039. if_block = create_if_block_4(ctx);
  2040. if_block.c();
  2041. if_block.m(div, null);
  2042. }
  2043. } else if (if_block) {
  2044. if_block.d(1);
  2045. if_block = null;
  2046. }
  2047. },
  2048. d: function d(detaching) {
  2049. if (detaching) detach(div);
  2050. if (if_block) if_block.d();
  2051. /*div_binding_1*/
  2052. ctx[84](null);
  2053. }
  2054. };
  2055. } // (979:10) {#if !_titleElement}
  2056. function create_if_block_4(ctx) {
  2057. var if_block_anchor;
  2058. function select_block_type(ctx, dirty) {
  2059. if (
  2060. /*titleTrusted*/
  2061. ctx[6]) return create_if_block_5;
  2062. return create_else_block_1;
  2063. }
  2064. var current_block_type = select_block_type(ctx);
  2065. var if_block = current_block_type(ctx);
  2066. return {
  2067. c: function c() {
  2068. if_block.c();
  2069. if_block_anchor = empty();
  2070. },
  2071. m: function m(target, anchor) {
  2072. if_block.m(target, anchor);
  2073. insert(target, if_block_anchor, anchor);
  2074. },
  2075. p: function p(ctx, dirty) {
  2076. if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
  2077. if_block.p(ctx, dirty);
  2078. } else {
  2079. if_block.d(1);
  2080. if_block = current_block_type(ctx);
  2081. if (if_block) {
  2082. if_block.c();
  2083. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  2084. }
  2085. }
  2086. },
  2087. d: function d(detaching) {
  2088. if_block.d(detaching);
  2089. if (detaching) detach(if_block_anchor);
  2090. }
  2091. };
  2092. } // (982:12) {:else}
  2093. function create_else_block_1(ctx) {
  2094. var span;
  2095. var t;
  2096. return {
  2097. c: function c() {
  2098. span = element("span");
  2099. t = text(
  2100. /*title*/
  2101. ctx[5]);
  2102. attr(span, "class", "pnotify-pre-line");
  2103. },
  2104. m: function m(target, anchor) {
  2105. insert(target, span, anchor);
  2106. append(span, t);
  2107. },
  2108. p: function p(ctx, dirty) {
  2109. if (dirty[0] &
  2110. /*title*/
  2111. 32) set_data(t,
  2112. /*title*/
  2113. ctx[5]);
  2114. },
  2115. d: function d(detaching) {
  2116. if (detaching) detach(span);
  2117. }
  2118. };
  2119. } // (980:12) {#if titleTrusted}
  2120. function create_if_block_5(ctx) {
  2121. var html_tag;
  2122. var html_anchor;
  2123. return {
  2124. c: function c() {
  2125. html_anchor = empty();
  2126. html_tag = new HtmlTag(html_anchor);
  2127. },
  2128. m: function m(target, anchor) {
  2129. html_tag.m(
  2130. /*title*/
  2131. ctx[5], target, anchor);
  2132. insert(target, html_anchor, anchor);
  2133. },
  2134. p: function p(ctx, dirty) {
  2135. if (dirty[0] &
  2136. /*title*/
  2137. 32) html_tag.p(
  2138. /*title*/
  2139. ctx[5]);
  2140. },
  2141. d: function d(detaching) {
  2142. if (detaching) detach(html_anchor);
  2143. if (detaching) html_tag.d();
  2144. }
  2145. };
  2146. } // (988:6) {#if text !== false}
  2147. function create_if_block(ctx) {
  2148. var div;
  2149. var div_class_value;
  2150. var if_block = !
  2151. /*_textElement*/
  2152. ctx[35] && create_if_block_1(ctx);
  2153. return {
  2154. c: function c() {
  2155. div = element("div");
  2156. if (if_block) if_block.c();
  2157. attr(div, "class", div_class_value = "pnotify-text ".concat(
  2158. /*getStyle*/
  2159. ctx[21]("text"), " ").concat(
  2160. /*_maxTextHeightStyle*/
  2161. ctx[33] === "" ? "" : "pnotify-text-with-max-height"));
  2162. attr(div, "style",
  2163. /*_maxTextHeightStyle*/
  2164. ctx[33]);
  2165. attr(div, "role", "alert");
  2166. },
  2167. m: function m(target, anchor) {
  2168. insert(target, div, anchor);
  2169. if (if_block) if_block.m(div, null);
  2170. /*div_binding_2*/
  2171. ctx[85](div);
  2172. },
  2173. p: function p(ctx, dirty) {
  2174. if (!
  2175. /*_textElement*/
  2176. ctx[35]) {
  2177. if (if_block) {
  2178. if_block.p(ctx, dirty);
  2179. } else {
  2180. if_block = create_if_block_1(ctx);
  2181. if_block.c();
  2182. if_block.m(div, null);
  2183. }
  2184. } else if (if_block) {
  2185. if_block.d(1);
  2186. if_block = null;
  2187. }
  2188. if (dirty[1] &
  2189. /*_maxTextHeightStyle*/
  2190. 4 && div_class_value !== (div_class_value = "pnotify-text ".concat(
  2191. /*getStyle*/
  2192. ctx[21]("text"), " ").concat(
  2193. /*_maxTextHeightStyle*/
  2194. ctx[33] === "" ? "" : "pnotify-text-with-max-height"))) {
  2195. attr(div, "class", div_class_value);
  2196. }
  2197. if (dirty[1] &
  2198. /*_maxTextHeightStyle*/
  2199. 4) {
  2200. attr(div, "style",
  2201. /*_maxTextHeightStyle*/
  2202. ctx[33]);
  2203. }
  2204. },
  2205. d: function d(detaching) {
  2206. if (detaching) detach(div);
  2207. if (if_block) if_block.d();
  2208. /*div_binding_2*/
  2209. ctx[85](null);
  2210. }
  2211. };
  2212. } // (995:10) {#if !_textElement}
  2213. function create_if_block_1(ctx) {
  2214. var if_block_anchor;
  2215. function select_block_type_1(ctx, dirty) {
  2216. if (
  2217. /*textTrusted*/
  2218. ctx[8]) return create_if_block_2;
  2219. return create_else_block;
  2220. }
  2221. var current_block_type = select_block_type_1(ctx);
  2222. var if_block = current_block_type(ctx);
  2223. return {
  2224. c: function c() {
  2225. if_block.c();
  2226. if_block_anchor = empty();
  2227. },
  2228. m: function m(target, anchor) {
  2229. if_block.m(target, anchor);
  2230. insert(target, if_block_anchor, anchor);
  2231. },
  2232. p: function p(ctx, dirty) {
  2233. if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block) {
  2234. if_block.p(ctx, dirty);
  2235. } else {
  2236. if_block.d(1);
  2237. if_block = current_block_type(ctx);
  2238. if (if_block) {
  2239. if_block.c();
  2240. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  2241. }
  2242. }
  2243. },
  2244. d: function d(detaching) {
  2245. if_block.d(detaching);
  2246. if (detaching) detach(if_block_anchor);
  2247. }
  2248. };
  2249. } // (998:12) {:else}
  2250. function create_else_block(ctx) {
  2251. var span;
  2252. var t;
  2253. return {
  2254. c: function c() {
  2255. span = element("span");
  2256. t = text(
  2257. /*text*/
  2258. ctx[7]);
  2259. attr(span, "class", "pnotify-pre-line");
  2260. },
  2261. m: function m(target, anchor) {
  2262. insert(target, span, anchor);
  2263. append(span, t);
  2264. },
  2265. p: function p(ctx, dirty) {
  2266. if (dirty[0] &
  2267. /*text*/
  2268. 128) set_data(t,
  2269. /*text*/
  2270. ctx[7]);
  2271. },
  2272. d: function d(detaching) {
  2273. if (detaching) detach(span);
  2274. }
  2275. };
  2276. } // (996:12) {#if textTrusted}
  2277. function create_if_block_2(ctx) {
  2278. var html_tag;
  2279. var html_anchor;
  2280. return {
  2281. c: function c() {
  2282. html_anchor = empty();
  2283. html_tag = new HtmlTag(html_anchor);
  2284. },
  2285. m: function m(target, anchor) {
  2286. html_tag.m(
  2287. /*text*/
  2288. ctx[7], target, anchor);
  2289. insert(target, html_anchor, anchor);
  2290. },
  2291. p: function p(ctx, dirty) {
  2292. if (dirty[0] &
  2293. /*text*/
  2294. 128) html_tag.p(
  2295. /*text*/
  2296. ctx[7]);
  2297. },
  2298. d: function d(detaching) {
  2299. if (detaching) detach(html_anchor);
  2300. if (detaching) html_tag.d();
  2301. }
  2302. };
  2303. } // (1004:6) {#each modulesAppendContent as [module, options] (module)}
  2304. function create_each_block_1(key_1, ctx) {
  2305. var first;
  2306. var switch_instance;
  2307. var switch_instance_anchor;
  2308. var current;
  2309. var switch_instance_spread_levels = [{
  2310. self:
  2311. /*self*/
  2312. ctx[42]
  2313. },
  2314. /*options*/
  2315. ctx[110]];
  2316. var switch_value =
  2317. /*module*/
  2318. ctx[109]["default"];
  2319. function switch_props(ctx) {
  2320. var switch_instance_props = {};
  2321. for (var i = 0; i < switch_instance_spread_levels.length; i += 1) {
  2322. switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
  2323. }
  2324. return {
  2325. props: switch_instance_props
  2326. };
  2327. }
  2328. if (switch_value) {
  2329. switch_instance = new switch_value(switch_props());
  2330. }
  2331. return {
  2332. key: key_1,
  2333. first: null,
  2334. c: function c() {
  2335. first = empty();
  2336. if (switch_instance) create_component(switch_instance.$$.fragment);
  2337. switch_instance_anchor = empty();
  2338. this.first = first;
  2339. },
  2340. m: function m(target, anchor) {
  2341. insert(target, first, anchor);
  2342. if (switch_instance) {
  2343. mount_component(switch_instance, target, anchor);
  2344. }
  2345. insert(target, switch_instance_anchor, anchor);
  2346. current = true;
  2347. },
  2348. p: function p(ctx, dirty) {
  2349. var switch_instance_changes = dirty[1] &
  2350. /*self, modulesAppendContent*/
  2351. 2560 ? get_spread_update(switch_instance_spread_levels, [dirty[1] &
  2352. /*self*/
  2353. 2048 && {
  2354. self:
  2355. /*self*/
  2356. ctx[42]
  2357. }, dirty[1] &
  2358. /*modulesAppendContent*/
  2359. 512 && get_spread_object(
  2360. /*options*/
  2361. ctx[110])]) : {};
  2362. if (switch_value !== (switch_value =
  2363. /*module*/
  2364. ctx[109]["default"])) {
  2365. if (switch_instance) {
  2366. group_outros();
  2367. var old_component = switch_instance;
  2368. transition_out(old_component.$$.fragment, 1, 0, function () {
  2369. destroy_component(old_component, 1);
  2370. });
  2371. check_outros();
  2372. }
  2373. if (switch_value) {
  2374. switch_instance = new switch_value(switch_props());
  2375. create_component(switch_instance.$$.fragment);
  2376. transition_in(switch_instance.$$.fragment, 1);
  2377. mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
  2378. } else {
  2379. switch_instance = null;
  2380. }
  2381. } else if (switch_value) {
  2382. switch_instance.$set(switch_instance_changes);
  2383. }
  2384. },
  2385. i: function i(local) {
  2386. if (current) return;
  2387. if (switch_instance) transition_in(switch_instance.$$.fragment, local);
  2388. current = true;
  2389. },
  2390. o: function o(local) {
  2391. if (switch_instance) transition_out(switch_instance.$$.fragment, local);
  2392. current = false;
  2393. },
  2394. d: function d(detaching) {
  2395. if (detaching) detach(first);
  2396. if (detaching) detach(switch_instance_anchor);
  2397. if (switch_instance) destroy_component(switch_instance, detaching);
  2398. }
  2399. };
  2400. } // (1008:4) {#each modulesAppendContainer as [module, options] (module)}
  2401. function create_each_block(key_1, ctx) {
  2402. var first;
  2403. var switch_instance;
  2404. var switch_instance_anchor;
  2405. var current;
  2406. var switch_instance_spread_levels = [{
  2407. self:
  2408. /*self*/
  2409. ctx[42]
  2410. },
  2411. /*options*/
  2412. ctx[110]];
  2413. var switch_value =
  2414. /*module*/
  2415. ctx[109]["default"];
  2416. function switch_props(ctx) {
  2417. var switch_instance_props = {};
  2418. for (var i = 0; i < switch_instance_spread_levels.length; i += 1) {
  2419. switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
  2420. }
  2421. return {
  2422. props: switch_instance_props
  2423. };
  2424. }
  2425. if (switch_value) {
  2426. switch_instance = new switch_value(switch_props());
  2427. }
  2428. return {
  2429. key: key_1,
  2430. first: null,
  2431. c: function c() {
  2432. first = empty();
  2433. if (switch_instance) create_component(switch_instance.$$.fragment);
  2434. switch_instance_anchor = empty();
  2435. this.first = first;
  2436. },
  2437. m: function m(target, anchor) {
  2438. insert(target, first, anchor);
  2439. if (switch_instance) {
  2440. mount_component(switch_instance, target, anchor);
  2441. }
  2442. insert(target, switch_instance_anchor, anchor);
  2443. current = true;
  2444. },
  2445. p: function p(ctx, dirty) {
  2446. var switch_instance_changes = dirty[1] &
  2447. /*self, modulesAppendContainer*/
  2448. 3072 ? get_spread_update(switch_instance_spread_levels, [dirty[1] &
  2449. /*self*/
  2450. 2048 && {
  2451. self:
  2452. /*self*/
  2453. ctx[42]
  2454. }, dirty[1] &
  2455. /*modulesAppendContainer*/
  2456. 1024 && get_spread_object(
  2457. /*options*/
  2458. ctx[110])]) : {};
  2459. if (switch_value !== (switch_value =
  2460. /*module*/
  2461. ctx[109]["default"])) {
  2462. if (switch_instance) {
  2463. group_outros();
  2464. var old_component = switch_instance;
  2465. transition_out(old_component.$$.fragment, 1, 0, function () {
  2466. destroy_component(old_component, 1);
  2467. });
  2468. check_outros();
  2469. }
  2470. if (switch_value) {
  2471. switch_instance = new switch_value(switch_props());
  2472. create_component(switch_instance.$$.fragment);
  2473. transition_in(switch_instance.$$.fragment, 1);
  2474. mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
  2475. } else {
  2476. switch_instance = null;
  2477. }
  2478. } else if (switch_value) {
  2479. switch_instance.$set(switch_instance_changes);
  2480. }
  2481. },
  2482. i: function i(local) {
  2483. if (current) return;
  2484. if (switch_instance) transition_in(switch_instance.$$.fragment, local);
  2485. current = true;
  2486. },
  2487. o: function o(local) {
  2488. if (switch_instance) transition_out(switch_instance.$$.fragment, local);
  2489. current = false;
  2490. },
  2491. d: function d(detaching) {
  2492. if (detaching) detach(first);
  2493. if (detaching) detach(switch_instance_anchor);
  2494. if (switch_instance) destroy_component(switch_instance, detaching);
  2495. }
  2496. };
  2497. }
  2498. function create_fragment(ctx) {
  2499. var div2;
  2500. var div1;
  2501. var each_blocks_3 = [];
  2502. var each0_lookup = new Map_1();
  2503. var t0;
  2504. var t1;
  2505. var t2;
  2506. var t3;
  2507. var div0;
  2508. var each_blocks_2 = [];
  2509. var each1_lookup = new Map_1();
  2510. var t4;
  2511. var t5;
  2512. var t6;
  2513. var each_blocks_1 = [];
  2514. var each2_lookup = new Map_1();
  2515. var div0_class_value;
  2516. var t7;
  2517. var each_blocks = [];
  2518. var each3_lookup = new Map_1();
  2519. var div1_class_value;
  2520. var div1_style_value;
  2521. var div2_class_value;
  2522. var forwardEvents_action;
  2523. var current;
  2524. var mounted;
  2525. var dispose;
  2526. var each_value_3 =
  2527. /*modulesPrependContainer*/
  2528. ctx[38];
  2529. var get_key = function get_key(ctx) {
  2530. return (
  2531. /*module*/
  2532. ctx[109]
  2533. );
  2534. };
  2535. for (var i = 0; i < each_value_3.length; i += 1) {
  2536. var child_ctx = get_each_context_3(ctx, each_value_3, i);
  2537. var key = get_key(child_ctx);
  2538. each0_lookup.set(key, each_blocks_3[i] = create_each_block_3(key, child_ctx));
  2539. }
  2540. var if_block0 =
  2541. /*closer*/
  2542. ctx[16] && !
  2543. /*_nonBlock*/
  2544. ctx[36] && create_if_block_8(ctx);
  2545. var if_block1 =
  2546. /*sticker*/
  2547. ctx[18] && !
  2548. /*_nonBlock*/
  2549. ctx[36] && create_if_block_7(ctx);
  2550. var if_block2 =
  2551. /*icon*/
  2552. ctx[13] !== false && create_if_block_6(ctx);
  2553. var each_value_2 =
  2554. /*modulesPrependContent*/
  2555. ctx[39];
  2556. var get_key_1 = function get_key_1(ctx) {
  2557. return (
  2558. /*module*/
  2559. ctx[109]
  2560. );
  2561. };
  2562. for (var _i = 0; _i < each_value_2.length; _i += 1) {
  2563. var _child_ctx = get_each_context_2(ctx, each_value_2, _i);
  2564. var _key = get_key_1(_child_ctx);
  2565. each1_lookup.set(_key, each_blocks_2[_i] = create_each_block_2(_key, _child_ctx));
  2566. }
  2567. var if_block3 =
  2568. /*title*/
  2569. ctx[5] !== false && create_if_block_3(ctx);
  2570. var if_block4 =
  2571. /*text*/
  2572. ctx[7] !== false && create_if_block(ctx);
  2573. var each_value_1 =
  2574. /*modulesAppendContent*/
  2575. ctx[40];
  2576. var get_key_2 = function get_key_2(ctx) {
  2577. return (
  2578. /*module*/
  2579. ctx[109]
  2580. );
  2581. };
  2582. for (var _i2 = 0; _i2 < each_value_1.length; _i2 += 1) {
  2583. var _child_ctx2 = get_each_context_1(ctx, each_value_1, _i2);
  2584. var _key2 = get_key_2(_child_ctx2);
  2585. each2_lookup.set(_key2, each_blocks_1[_i2] = create_each_block_1(_key2, _child_ctx2));
  2586. }
  2587. var each_value =
  2588. /*modulesAppendContainer*/
  2589. ctx[41];
  2590. var get_key_3 = function get_key_3(ctx) {
  2591. return (
  2592. /*module*/
  2593. ctx[109]
  2594. );
  2595. };
  2596. for (var _i3 = 0; _i3 < each_value.length; _i3 += 1) {
  2597. var _child_ctx3 = get_each_context(ctx, each_value, _i3);
  2598. var _key3 = get_key_3(_child_ctx3);
  2599. each3_lookup.set(_key3, each_blocks[_i3] = create_each_block(_key3, _child_ctx3));
  2600. }
  2601. return {
  2602. c: function c() {
  2603. div2 = element("div");
  2604. div1 = element("div");
  2605. for (var _i4 = 0; _i4 < each_blocks_3.length; _i4 += 1) {
  2606. each_blocks_3[_i4].c();
  2607. }
  2608. t0 = space();
  2609. if (if_block0) if_block0.c();
  2610. t1 = space();
  2611. if (if_block1) if_block1.c();
  2612. t2 = space();
  2613. if (if_block2) if_block2.c();
  2614. t3 = space();
  2615. div0 = element("div");
  2616. for (var _i5 = 0; _i5 < each_blocks_2.length; _i5 += 1) {
  2617. each_blocks_2[_i5].c();
  2618. }
  2619. t4 = space();
  2620. if (if_block3) if_block3.c();
  2621. t5 = space();
  2622. if (if_block4) if_block4.c();
  2623. t6 = space();
  2624. for (var _i6 = 0; _i6 < each_blocks_1.length; _i6 += 1) {
  2625. each_blocks_1[_i6].c();
  2626. }
  2627. t7 = space();
  2628. for (var _i7 = 0; _i7 < each_blocks.length; _i7 += 1) {
  2629. each_blocks[_i7].c();
  2630. }
  2631. attr(div0, "class", div0_class_value = "pnotify-content ".concat(
  2632. /*getStyle*/
  2633. ctx[21]("content")));
  2634. attr(div1, "class", div1_class_value = "pnotify-container ".concat(
  2635. /*getStyle*/
  2636. ctx[21]("container"), " ").concat(
  2637. /*getStyle*/
  2638. ctx[21](
  2639. /*type*/
  2640. ctx[4]), " ").concat(
  2641. /*shadow*/
  2642. ctx[15] ? "pnotify-shadow" : "", " ").concat(
  2643. /*_moduleClasses*/
  2644. ctx[27].container.join(" ")));
  2645. attr(div1, "style", div1_style_value = "".concat(
  2646. /*_widthStyle*/
  2647. ctx[31], " ").concat(
  2648. /*_minHeightStyle*/
  2649. ctx[32]));
  2650. attr(div1, "role", "alert");
  2651. attr(div2, "data-pnotify", "");
  2652. attr(div2, "class", div2_class_value = "pnotify ".concat(!
  2653. /*stack*/
  2654. ctx[0] ||
  2655. /*stack*/
  2656. ctx[0].positioned ? "pnotify-positioned" : "", " ").concat(
  2657. /*icon*/
  2658. ctx[13] !== false ? "pnotify-with-icon" : "", " ").concat(
  2659. /*getStyle*/
  2660. ctx[21]("elem"), " pnotify-mode-").concat(
  2661. /*mode*/
  2662. ctx[9], " ").concat(
  2663. /*addClass*/
  2664. ctx[10], " ").concat(
  2665. /*_animatingClass*/
  2666. ctx[24], " ").concat(
  2667. /*_moveClass*/
  2668. ctx[25], " ").concat(
  2669. /*_stackDirClass*/
  2670. ctx[37], " ").concat(
  2671. /*animation*/
  2672. ctx[2] === "fade" ? "pnotify-fade-".concat(
  2673. /*animateSpeed*/
  2674. ctx[14]) : "", " ").concat(
  2675. /*_modal*/
  2676. ctx[30] ? "pnotify-modal ".concat(
  2677. /*addModalClass*/
  2678. ctx[11]) :
  2679. /*addModelessClass*/
  2680. ctx[12], " ").concat(
  2681. /*_masking*/
  2682. ctx[28] ? "pnotify-masking" : "", " ").concat(
  2683. /*_maskingIn*/
  2684. ctx[29] ? "pnotify-masking-in" : "", " ").concat(
  2685. /*_moduleClasses*/
  2686. ctx[27].elem.join(" ")));
  2687. attr(div2, "aria-live", "assertive");
  2688. attr(div2, "role", "alertdialog");
  2689. },
  2690. m: function m(target, anchor) {
  2691. insert(target, div2, anchor);
  2692. append(div2, div1);
  2693. for (var _i8 = 0; _i8 < each_blocks_3.length; _i8 += 1) {
  2694. each_blocks_3[_i8].m(div1, null);
  2695. }
  2696. append(div1, t0);
  2697. if (if_block0) if_block0.m(div1, null);
  2698. append(div1, t1);
  2699. if (if_block1) if_block1.m(div1, null);
  2700. append(div1, t2);
  2701. if (if_block2) if_block2.m(div1, null);
  2702. append(div1, t3);
  2703. append(div1, div0);
  2704. for (var _i9 = 0; _i9 < each_blocks_2.length; _i9 += 1) {
  2705. each_blocks_2[_i9].m(div0, null);
  2706. }
  2707. append(div0, t4);
  2708. if (if_block3) if_block3.m(div0, null);
  2709. append(div0, t5);
  2710. if (if_block4) if_block4.m(div0, null);
  2711. append(div0, t6);
  2712. for (var _i10 = 0; _i10 < each_blocks_1.length; _i10 += 1) {
  2713. each_blocks_1[_i10].m(div0, null);
  2714. }
  2715. /*div0_binding*/
  2716. ctx[86](div0);
  2717. append(div1, t7);
  2718. for (var _i11 = 0; _i11 < each_blocks.length; _i11 += 1) {
  2719. each_blocks[_i11].m(div1, null);
  2720. }
  2721. /*div1_binding*/
  2722. ctx[87](div1);
  2723. /*div2_binding*/
  2724. ctx[88](div2);
  2725. current = true;
  2726. if (!mounted) {
  2727. dispose = [action_destroyer(forwardEvents_action =
  2728. /*forwardEvents*/
  2729. ctx[43].call(null, div2)), listen(div2, "mouseenter",
  2730. /*handleInteraction*/
  2731. ctx[44]), listen(div2, "mouseleave",
  2732. /*handleLeaveInteraction*/
  2733. ctx[45]), listen(div2, "focusin",
  2734. /*handleInteraction*/
  2735. ctx[44]), listen(div2, "focusout",
  2736. /*handleLeaveInteraction*/
  2737. ctx[45])];
  2738. mounted = true;
  2739. }
  2740. },
  2741. p: function p(ctx, dirty) {
  2742. if (dirty[1] &
  2743. /*modulesPrependContainer, self*/
  2744. 2176) {
  2745. var _each_value_ =
  2746. /*modulesPrependContainer*/
  2747. ctx[38];
  2748. group_outros();
  2749. each_blocks_3 = update_keyed_each(each_blocks_3, dirty, get_key, 1, ctx, _each_value_, each0_lookup, div1, outro_and_destroy_block, create_each_block_3, t0, get_each_context_3);
  2750. check_outros();
  2751. }
  2752. if (
  2753. /*closer*/
  2754. ctx[16] && !
  2755. /*_nonBlock*/
  2756. ctx[36]) {
  2757. if (if_block0) {
  2758. if_block0.p(ctx, dirty);
  2759. } else {
  2760. if_block0 = create_if_block_8(ctx);
  2761. if_block0.c();
  2762. if_block0.m(div1, t1);
  2763. }
  2764. } else if (if_block0) {
  2765. if_block0.d(1);
  2766. if_block0 = null;
  2767. }
  2768. if (
  2769. /*sticker*/
  2770. ctx[18] && !
  2771. /*_nonBlock*/
  2772. ctx[36]) {
  2773. if (if_block1) {
  2774. if_block1.p(ctx, dirty);
  2775. } else {
  2776. if_block1 = create_if_block_7(ctx);
  2777. if_block1.c();
  2778. if_block1.m(div1, t2);
  2779. }
  2780. } else if (if_block1) {
  2781. if_block1.d(1);
  2782. if_block1 = null;
  2783. }
  2784. if (
  2785. /*icon*/
  2786. ctx[13] !== false) {
  2787. if (if_block2) {
  2788. if_block2.p(ctx, dirty);
  2789. } else {
  2790. if_block2 = create_if_block_6(ctx);
  2791. if_block2.c();
  2792. if_block2.m(div1, t3);
  2793. }
  2794. } else if (if_block2) {
  2795. if_block2.d(1);
  2796. if_block2 = null;
  2797. }
  2798. if (dirty[1] &
  2799. /*modulesPrependContent, self*/
  2800. 2304) {
  2801. var _each_value_2 =
  2802. /*modulesPrependContent*/
  2803. ctx[39];
  2804. group_outros();
  2805. each_blocks_2 = update_keyed_each(each_blocks_2, dirty, get_key_1, 1, ctx, _each_value_2, each1_lookup, div0, outro_and_destroy_block, create_each_block_2, t4, get_each_context_2);
  2806. check_outros();
  2807. }
  2808. if (
  2809. /*title*/
  2810. ctx[5] !== false) {
  2811. if (if_block3) {
  2812. if_block3.p(ctx, dirty);
  2813. } else {
  2814. if_block3 = create_if_block_3(ctx);
  2815. if_block3.c();
  2816. if_block3.m(div0, t5);
  2817. }
  2818. } else if (if_block3) {
  2819. if_block3.d(1);
  2820. if_block3 = null;
  2821. }
  2822. if (
  2823. /*text*/
  2824. ctx[7] !== false) {
  2825. if (if_block4) {
  2826. if_block4.p(ctx, dirty);
  2827. } else {
  2828. if_block4 = create_if_block(ctx);
  2829. if_block4.c();
  2830. if_block4.m(div0, t6);
  2831. }
  2832. } else if (if_block4) {
  2833. if_block4.d(1);
  2834. if_block4 = null;
  2835. }
  2836. if (dirty[1] &
  2837. /*modulesAppendContent, self*/
  2838. 2560) {
  2839. var _each_value_3 =
  2840. /*modulesAppendContent*/
  2841. ctx[40];
  2842. group_outros();
  2843. each_blocks_1 = update_keyed_each(each_blocks_1, dirty, get_key_2, 1, ctx, _each_value_3, each2_lookup, div0, outro_and_destroy_block, create_each_block_1, null, get_each_context_1);
  2844. check_outros();
  2845. }
  2846. if (dirty[1] &
  2847. /*modulesAppendContainer, self*/
  2848. 3072) {
  2849. var _each_value =
  2850. /*modulesAppendContainer*/
  2851. ctx[41];
  2852. group_outros();
  2853. each_blocks = update_keyed_each(each_blocks, dirty, get_key_3, 1, ctx, _each_value, each3_lookup, div1, outro_and_destroy_block, create_each_block, null, get_each_context);
  2854. check_outros();
  2855. }
  2856. if (!current || dirty[0] &
  2857. /*type, shadow, _moduleClasses*/
  2858. 134250512 && div1_class_value !== (div1_class_value = "pnotify-container ".concat(
  2859. /*getStyle*/
  2860. ctx[21]("container"), " ").concat(
  2861. /*getStyle*/
  2862. ctx[21](
  2863. /*type*/
  2864. ctx[4]), " ").concat(
  2865. /*shadow*/
  2866. ctx[15] ? "pnotify-shadow" : "", " ").concat(
  2867. /*_moduleClasses*/
  2868. ctx[27].container.join(" ")))) {
  2869. attr(div1, "class", div1_class_value);
  2870. }
  2871. if (!current || dirty[1] &
  2872. /*_widthStyle, _minHeightStyle*/
  2873. 3 && div1_style_value !== (div1_style_value = "".concat(
  2874. /*_widthStyle*/
  2875. ctx[31], " ").concat(
  2876. /*_minHeightStyle*/
  2877. ctx[32]))) {
  2878. attr(div1, "style", div1_style_value);
  2879. }
  2880. if (!current || dirty[0] &
  2881. /*stack, icon, mode, addClass, _animatingClass, _moveClass, animation, animateSpeed, _modal, addModalClass, addModelessClass, _masking, _maskingIn, _moduleClasses*/
  2882. 2063629829 | dirty[1] &
  2883. /*_stackDirClass*/
  2884. 64 && div2_class_value !== (div2_class_value = "pnotify ".concat(!
  2885. /*stack*/
  2886. ctx[0] ||
  2887. /*stack*/
  2888. ctx[0].positioned ? "pnotify-positioned" : "", " ").concat(
  2889. /*icon*/
  2890. ctx[13] !== false ? "pnotify-with-icon" : "", " ").concat(
  2891. /*getStyle*/
  2892. ctx[21]("elem"), " pnotify-mode-").concat(
  2893. /*mode*/
  2894. ctx[9], " ").concat(
  2895. /*addClass*/
  2896. ctx[10], " ").concat(
  2897. /*_animatingClass*/
  2898. ctx[24], " ").concat(
  2899. /*_moveClass*/
  2900. ctx[25], " ").concat(
  2901. /*_stackDirClass*/
  2902. ctx[37], " ").concat(
  2903. /*animation*/
  2904. ctx[2] === "fade" ? "pnotify-fade-".concat(
  2905. /*animateSpeed*/
  2906. ctx[14]) : "", " ").concat(
  2907. /*_modal*/
  2908. ctx[30] ? "pnotify-modal ".concat(
  2909. /*addModalClass*/
  2910. ctx[11]) :
  2911. /*addModelessClass*/
  2912. ctx[12], " ").concat(
  2913. /*_masking*/
  2914. ctx[28] ? "pnotify-masking" : "", " ").concat(
  2915. /*_maskingIn*/
  2916. ctx[29] ? "pnotify-masking-in" : "", " ").concat(
  2917. /*_moduleClasses*/
  2918. ctx[27].elem.join(" ")))) {
  2919. attr(div2, "class", div2_class_value);
  2920. }
  2921. },
  2922. i: function i(local) {
  2923. if (current) return;
  2924. for (var _i12 = 0; _i12 < each_value_3.length; _i12 += 1) {
  2925. transition_in(each_blocks_3[_i12]);
  2926. }
  2927. for (var _i13 = 0; _i13 < each_value_2.length; _i13 += 1) {
  2928. transition_in(each_blocks_2[_i13]);
  2929. }
  2930. for (var _i14 = 0; _i14 < each_value_1.length; _i14 += 1) {
  2931. transition_in(each_blocks_1[_i14]);
  2932. }
  2933. for (var _i15 = 0; _i15 < each_value.length; _i15 += 1) {
  2934. transition_in(each_blocks[_i15]);
  2935. }
  2936. current = true;
  2937. },
  2938. o: function o(local) {
  2939. for (var _i16 = 0; _i16 < each_blocks_3.length; _i16 += 1) {
  2940. transition_out(each_blocks_3[_i16]);
  2941. }
  2942. for (var _i17 = 0; _i17 < each_blocks_2.length; _i17 += 1) {
  2943. transition_out(each_blocks_2[_i17]);
  2944. }
  2945. for (var _i18 = 0; _i18 < each_blocks_1.length; _i18 += 1) {
  2946. transition_out(each_blocks_1[_i18]);
  2947. }
  2948. for (var _i19 = 0; _i19 < each_blocks.length; _i19 += 1) {
  2949. transition_out(each_blocks[_i19]);
  2950. }
  2951. current = false;
  2952. },
  2953. d: function d(detaching) {
  2954. if (detaching) detach(div2);
  2955. for (var _i20 = 0; _i20 < each_blocks_3.length; _i20 += 1) {
  2956. each_blocks_3[_i20].d();
  2957. }
  2958. if (if_block0) if_block0.d();
  2959. if (if_block1) if_block1.d();
  2960. if (if_block2) if_block2.d();
  2961. for (var _i21 = 0; _i21 < each_blocks_2.length; _i21 += 1) {
  2962. each_blocks_2[_i21].d();
  2963. }
  2964. if (if_block3) if_block3.d();
  2965. if (if_block4) if_block4.d();
  2966. for (var _i22 = 0; _i22 < each_blocks_1.length; _i22 += 1) {
  2967. each_blocks_1[_i22].d();
  2968. }
  2969. /*div0_binding*/
  2970. ctx[86](null);
  2971. for (var _i23 = 0; _i23 < each_blocks.length; _i23 += 1) {
  2972. each_blocks[_i23].d();
  2973. }
  2974. /*div1_binding*/
  2975. ctx[87](null);
  2976. /*div2_binding*/
  2977. ctx[88](null);
  2978. mounted = false;
  2979. run_all(dispose);
  2980. }
  2981. };
  2982. }
  2983. var alert = function alert(options) {
  2984. return component(getDefaultArgs(options));
  2985. };
  2986. var notice = function notice(options) {
  2987. return component(getDefaultArgs(options, "notice"));
  2988. };
  2989. var info = function info(options) {
  2990. return component(getDefaultArgs(options, "info"));
  2991. };
  2992. var success = function success(options) {
  2993. return component(getDefaultArgs(options, "success"));
  2994. };
  2995. var error = function error(options) {
  2996. return component(getDefaultArgs(options, "error"));
  2997. }; // Default arguments for the new notice helper functions.
  2998. function getDefaultArgs(options, type) {
  2999. if (_typeof(options) !== "object") {
  3000. options = {
  3001. text: options
  3002. };
  3003. } // Only assign the type if it was requested, so we don't overwrite
  3004. // options.type if it has something assigned.
  3005. if (type) {
  3006. options.type = type;
  3007. }
  3008. var target = document.body;
  3009. if ("stack" in options && options.stack && options.stack.context) {
  3010. target = options.stack.context;
  3011. }
  3012. return {
  3013. target: target,
  3014. props: options
  3015. };
  3016. }
  3017. var defaultStack = new Stack({
  3018. dir1: "down",
  3019. dir2: "left",
  3020. firstpos1: 25,
  3021. firstpos2: 25,
  3022. spacing1: 36,
  3023. spacing2: 36,
  3024. push: "bottom"
  3025. });
  3026. var defaultModules = new Map();
  3027. var defaults = {
  3028. type: "notice",
  3029. title: false,
  3030. titleTrusted: false,
  3031. text: false,
  3032. textTrusted: false,
  3033. styling: "brighttheme",
  3034. icons: "brighttheme",
  3035. mode: "no-preference",
  3036. addClass: "",
  3037. addModalClass: "",
  3038. addModelessClass: "",
  3039. autoOpen: true,
  3040. width: "360px",
  3041. minHeight: "16px",
  3042. maxTextHeight: "200px",
  3043. icon: true,
  3044. animation: "fade",
  3045. animateSpeed: "normal",
  3046. shadow: true,
  3047. hide: true,
  3048. delay: 8000,
  3049. mouseReset: true,
  3050. closer: true,
  3051. closerHover: true,
  3052. sticker: true,
  3053. stickerHover: true,
  3054. labels: {
  3055. close: "Close",
  3056. stick: "Pin",
  3057. unstick: "Unpin"
  3058. },
  3059. remove: true,
  3060. destroy: true,
  3061. stack: defaultStack,
  3062. modules: defaultModules
  3063. };
  3064. var posTimer; // These actions need to be done once the DOM is ready.
  3065. function onDocumentLoaded() {
  3066. if (!defaultStack.context) {
  3067. defaultStack.context = document.body;
  3068. } // Reposition the notices when the window resizes.
  3069. window.addEventListener("resize", function () {
  3070. // This timer is used for queueing the position event so it doesn't run
  3071. // repeatedly.
  3072. if (posTimer) {
  3073. clearTimeout(posTimer);
  3074. }
  3075. posTimer = setTimeout(function () {
  3076. var event = new Event("pnotify:position");
  3077. document.body.dispatchEvent(event);
  3078. posTimer = null;
  3079. }, 10);
  3080. });
  3081. } // Run the deferred actions once the DOM is ready.
  3082. if (window && document.body) {
  3083. onDocumentLoaded();
  3084. } else {
  3085. document.addEventListener("DOMContentLoaded", onDocumentLoaded);
  3086. }
  3087. function instance($$self, $$props, $$invalidate) {
  3088. var self = get_current_component();
  3089. var dispatch = createEventDispatcher();
  3090. var forwardEvents = forwardEventsBuilder(self, ["pnotify:init", "pnotify:mount", "pnotify:update", "pnotify:beforeOpen", "pnotify:afterOpen", "pnotify:enterModal", "pnotify:leaveModal", "pnotify:beforeClose", "pnotify:afterClose", "pnotify:beforeDestroy", "pnotify:afterDestroy", "focusin", "focusout", "animationend", "transitionend"]);
  3091. var _$$props$modules = $$props.modules,
  3092. modules = _$$props$modules === void 0 ? new Map(defaults.modules) : _$$props$modules;
  3093. var _$$props$stack = $$props.stack,
  3094. stack = _$$props$stack === void 0 ? defaults.stack : _$$props$stack;
  3095. var refs = {
  3096. elem: null,
  3097. container: null,
  3098. content: null,
  3099. iconContainer: null,
  3100. titleContainer: null,
  3101. textContainer: null
  3102. }; // Run init to give a chance for modules to override defaults.
  3103. var selfDefaults = _objectSpread2({}, defaults);
  3104. dispatchLifecycleEvent("init", {
  3105. notice: self,
  3106. defaults: selfDefaults
  3107. });
  3108. var _$$props$type = $$props.type,
  3109. type = _$$props$type === void 0 ? selfDefaults.type : _$$props$type;
  3110. var _$$props$title = $$props.title,
  3111. title = _$$props$title === void 0 ? selfDefaults.title : _$$props$title;
  3112. var _$$props$titleTrusted = $$props.titleTrusted,
  3113. titleTrusted = _$$props$titleTrusted === void 0 ? selfDefaults.titleTrusted : _$$props$titleTrusted;
  3114. var _$$props$text = $$props.text,
  3115. text = _$$props$text === void 0 ? selfDefaults.text : _$$props$text;
  3116. var _$$props$textTrusted = $$props.textTrusted,
  3117. textTrusted = _$$props$textTrusted === void 0 ? selfDefaults.textTrusted : _$$props$textTrusted;
  3118. var _$$props$styling = $$props.styling,
  3119. styling = _$$props$styling === void 0 ? selfDefaults.styling : _$$props$styling;
  3120. var _$$props$icons = $$props.icons,
  3121. icons = _$$props$icons === void 0 ? selfDefaults.icons : _$$props$icons;
  3122. var _$$props$mode = $$props.mode,
  3123. mode = _$$props$mode === void 0 ? selfDefaults.mode : _$$props$mode;
  3124. var _$$props$addClass = $$props.addClass,
  3125. addClass = _$$props$addClass === void 0 ? selfDefaults.addClass : _$$props$addClass;
  3126. var _$$props$addModalClas = $$props.addModalClass,
  3127. addModalClass = _$$props$addModalClas === void 0 ? selfDefaults.addModalClass : _$$props$addModalClas;
  3128. var _$$props$addModelessC = $$props.addModelessClass,
  3129. addModelessClass = _$$props$addModelessC === void 0 ? selfDefaults.addModelessClass : _$$props$addModelessC;
  3130. var _$$props$autoOpen = $$props.autoOpen,
  3131. autoOpen = _$$props$autoOpen === void 0 ? selfDefaults.autoOpen : _$$props$autoOpen;
  3132. var _$$props$width = $$props.width,
  3133. width = _$$props$width === void 0 ? selfDefaults.width : _$$props$width;
  3134. var _$$props$minHeight = $$props.minHeight,
  3135. minHeight = _$$props$minHeight === void 0 ? selfDefaults.minHeight : _$$props$minHeight;
  3136. var _$$props$maxTextHeigh = $$props.maxTextHeight,
  3137. maxTextHeight = _$$props$maxTextHeigh === void 0 ? selfDefaults.maxTextHeight : _$$props$maxTextHeigh;
  3138. var _$$props$icon = $$props.icon,
  3139. icon = _$$props$icon === void 0 ? selfDefaults.icon : _$$props$icon;
  3140. var _$$props$animation = $$props.animation,
  3141. animation = _$$props$animation === void 0 ? selfDefaults.animation : _$$props$animation;
  3142. var _$$props$animateSpeed = $$props.animateSpeed,
  3143. animateSpeed = _$$props$animateSpeed === void 0 ? selfDefaults.animateSpeed : _$$props$animateSpeed;
  3144. var _$$props$shadow = $$props.shadow,
  3145. shadow = _$$props$shadow === void 0 ? selfDefaults.shadow : _$$props$shadow;
  3146. var _$$props$hide = $$props.hide,
  3147. hide = _$$props$hide === void 0 ? selfDefaults.hide : _$$props$hide;
  3148. var _$$props$delay = $$props.delay,
  3149. delay = _$$props$delay === void 0 ? selfDefaults.delay : _$$props$delay;
  3150. var _$$props$mouseReset = $$props.mouseReset,
  3151. mouseReset = _$$props$mouseReset === void 0 ? selfDefaults.mouseReset : _$$props$mouseReset;
  3152. var _$$props$closer = $$props.closer,
  3153. closer = _$$props$closer === void 0 ? selfDefaults.closer : _$$props$closer;
  3154. var _$$props$closerHover = $$props.closerHover,
  3155. closerHover = _$$props$closerHover === void 0 ? selfDefaults.closerHover : _$$props$closerHover;
  3156. var _$$props$sticker = $$props.sticker,
  3157. sticker = _$$props$sticker === void 0 ? selfDefaults.sticker : _$$props$sticker;
  3158. var _$$props$stickerHover = $$props.stickerHover,
  3159. stickerHover = _$$props$stickerHover === void 0 ? selfDefaults.stickerHover : _$$props$stickerHover;
  3160. var _$$props$labels = $$props.labels,
  3161. labels = _$$props$labels === void 0 ? selfDefaults.labels : _$$props$labels;
  3162. var _$$props$remove = $$props.remove,
  3163. remove = _$$props$remove === void 0 ? selfDefaults.remove : _$$props$remove;
  3164. var _$$props$destroy = $$props.destroy,
  3165. destroy = _$$props$destroy === void 0 ? selfDefaults.destroy : _$$props$destroy; // The state can be 'waiting', 'opening', 'open', 'closing', or 'closed'.
  3166. var _state = "closed"; // Auto close timer.
  3167. var _timer = null; // Animation timers.
  3168. var _animInTimer = null;
  3169. var _animOutTimer = null; // Stores what is currently being animated (in or out).
  3170. var _animating = false; // Stores the class that adds entry/exit animation effects.
  3171. var _animatingClass = ""; // Stores the class that adds movement animation effects.
  3172. var _moveClass = ""; // Stores whether the notice was hidden by a timer.
  3173. var _timerHide = false; // Whether the mouse is over the notice or the notice is focused.
  3174. var _interacting = false; // Holds classes that modules add for the notice element or container element.
  3175. var _moduleClasses = {
  3176. elem: [],
  3177. container: []
  3178. }; // Modules that change how the notice displays (causing the notice element to
  3179. // not appear) can set these to true to make PNotify handle it correctly.
  3180. var _moduleHandled = false;
  3181. var _moduleOpen = false; // The masking control for the second notice in a modalish stack when the
  3182. // first notice is hovered.
  3183. var _masking = false;
  3184. var _maskingIn = false;
  3185. var _maskingTimer = null; // Save the old value of hide, so we can reset the timer if it changes.
  3186. var _oldHide = hide; // Promise that resolves when the notice has opened.
  3187. var _openPromise = null; // Promise that resolved when the notice closes.
  3188. var _closePromise = null;
  3189. var getState = function getState() {
  3190. return _state;
  3191. };
  3192. var getTimer = function getTimer() {
  3193. return _timer;
  3194. };
  3195. var getStyle = function getStyle(name) {
  3196. return typeof styling === "string" ? "".concat(styling, "-").concat(name) : name in styling ? styling[name] : "".concat(styling.prefix, "-").concat(name);
  3197. };
  3198. var getIcon = function getIcon(name) {
  3199. return typeof icons === "string" ? "".concat(icons, "-icon-").concat(name) : name in icons ? icons[name] : "".concat(icons.prefix, "-icon-").concat(name);
  3200. }; // Whether the notification is in a modal stack (or a modalish stack in modal
  3201. // state).
  3202. var _modal = stack && (stack.modal === true || stack.modal === "ish" && _timer === "prevented");
  3203. var _oldStack = NaN;
  3204. var _stackBeforeAddOverlayOff = null;
  3205. var _stackAfterRemoveOverlayOff = null;
  3206. onMount(function () {
  3207. dispatchLifecycleEvent("mount"); // Display the notice.
  3208. if (autoOpen) {
  3209. open()["catch"](function () {});
  3210. }
  3211. });
  3212. beforeUpdate(function () {
  3213. dispatchLifecycleEvent("update"); // Update the timed hiding.
  3214. if (_state !== "closed" && _state !== "waiting" && hide !== _oldHide) {
  3215. if (!hide) {
  3216. cancelClose();
  3217. } else if (!_oldHide) {
  3218. queueClose();
  3219. }
  3220. } // Queue a position
  3221. if (_state !== "closed" && _state !== "closing" && stack && !stack._collapsingModalState) {
  3222. stack.queuePosition();
  3223. } // Save old options.
  3224. _oldHide = hide;
  3225. });
  3226. function handleInteraction(e) {
  3227. $$invalidate(26, _interacting = true); // Stop animation, reset the removal timer when the user interacts.
  3228. if (mouseReset && _state === "closing") {
  3229. if (!_timerHide) {
  3230. return;
  3231. }
  3232. cancelClose();
  3233. } // Stop the close timer.
  3234. if (hide && mouseReset) {
  3235. cancelClose();
  3236. }
  3237. }
  3238. function handleLeaveInteraction(e) {
  3239. $$invalidate(26, _interacting = false); // Start the close timer.
  3240. if (hide && mouseReset && _animating !== "out" && ["open", "opening"].indexOf(_state) !== -1) {
  3241. queueClose();
  3242. }
  3243. } // This runs an event on all the modules.
  3244. function dispatchLifecycleEvent(event) {
  3245. var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3246. var eventDetail = _objectSpread2({
  3247. notice: self
  3248. }, detail);
  3249. if (event === "init") {
  3250. Array.from(modules).forEach(function (_ref) {
  3251. var _ref2 = _slicedToArray(_ref, 2),
  3252. module = _ref2[0],
  3253. options = _ref2[1];
  3254. return "init" in module && module.init(eventDetail);
  3255. });
  3256. }
  3257. var target = refs.elem || stack && stack.context || document.body;
  3258. if (!target) {
  3259. dispatch("pnotify:".concat(event), eventDetail);
  3260. return true;
  3261. }
  3262. var eventObj = new Event("pnotify:".concat(event), {
  3263. bubbles: event === "init" || event === "mount",
  3264. cancelable: event.startsWith("before")
  3265. });
  3266. eventObj.detail = eventDetail;
  3267. target.dispatchEvent(eventObj);
  3268. return !eventObj.defaultPrevented;
  3269. }
  3270. function insertIntoDOM() {
  3271. // If the notice is not in the DOM, or in the wrong context, append it.
  3272. var target = stack && stack.context || document.body;
  3273. if (!target) {
  3274. throw new Error("No context to insert this notice into.");
  3275. }
  3276. if (!refs.elem) {
  3277. throw new Error("Trying to insert notice before element is available.");
  3278. }
  3279. if (refs.elem.parentNode !== target) {
  3280. target.appendChild(refs.elem);
  3281. }
  3282. }
  3283. function removeFromDOM() {
  3284. refs.elem && refs.elem.parentNode.removeChild(refs.elem);
  3285. }
  3286. var _$$props$open = $$props.open,
  3287. open = _$$props$open === void 0 ? function (immediate) {
  3288. if (_state === "opening") {
  3289. return _openPromise;
  3290. }
  3291. if (_state === "open") {
  3292. if (hide) {
  3293. queueClose();
  3294. }
  3295. return Promise.resolve();
  3296. }
  3297. if (!_moduleHandled && stack && stack._shouldNoticeWait(self)) {
  3298. _state = "waiting";
  3299. return Promise.reject();
  3300. }
  3301. if (!dispatchLifecycleEvent("beforeOpen", {
  3302. immediate: immediate
  3303. })) {
  3304. return Promise.reject();
  3305. }
  3306. _state = "opening";
  3307. $$invalidate(28, _masking = false); // This makes the notice visibity: hidden; so its dimensions can be
  3308. // determined.
  3309. $$invalidate(24, _animatingClass = "pnotify-initial pnotify-hidden");
  3310. var resolve;
  3311. var reject;
  3312. var promise = new Promise(function (res, rej) {
  3313. resolve = res;
  3314. reject = rej;
  3315. });
  3316. _openPromise = promise;
  3317. var afterOpenCallback = function afterOpenCallback() {
  3318. // Now set it to hide.
  3319. if (hide) {
  3320. queueClose();
  3321. }
  3322. _state = "open";
  3323. dispatchLifecycleEvent("afterOpen", {
  3324. immediate: immediate
  3325. });
  3326. _openPromise = null;
  3327. resolve();
  3328. };
  3329. if (_moduleOpen) {
  3330. afterOpenCallback();
  3331. return Promise.resolve();
  3332. }
  3333. insertIntoDOM(); // Wait until the DOM is updated.
  3334. window.requestAnimationFrame(function () {
  3335. if (_state !== "opening") {
  3336. reject();
  3337. _openPromise = null;
  3338. return;
  3339. }
  3340. if (stack) {
  3341. // Mark the stack so it won't animate the new notice.
  3342. $$invalidate(0, stack._animation = false, stack);
  3343. if (stack.push === "top") {
  3344. // Reset the position data so the notice is positioned as the first
  3345. // notice.
  3346. stack._resetPositionData();
  3347. } // Now position the stack's the notices.
  3348. stack._positionNotice(self);
  3349. stack.queuePosition(0); // Reset animation.
  3350. $$invalidate(0, stack._animation = true, stack);
  3351. }
  3352. animateIn(afterOpenCallback, immediate);
  3353. });
  3354. return promise;
  3355. } : _$$props$open;
  3356. var _$$props$close = $$props.close,
  3357. close = _$$props$close === void 0 ? function (immediate, timerHide, waitAfterward) {
  3358. if (_state === "closing") {
  3359. return _closePromise;
  3360. }
  3361. if (_state === "closed") {
  3362. return Promise.resolve();
  3363. }
  3364. var runDestroy = function runDestroy() {
  3365. if (!dispatchLifecycleEvent("beforeDestroy")) {
  3366. return;
  3367. }
  3368. if (stack) {
  3369. stack._removeNotice(self);
  3370. }
  3371. self.$destroy();
  3372. dispatchLifecycleEvent("afterDestroy");
  3373. };
  3374. if (_state === "waiting") {
  3375. if (waitAfterward) {
  3376. return Promise.resolve();
  3377. }
  3378. _state = "closed"; // It's debatable whether the notice should be destroyed in this case, but
  3379. // I'm going to go ahead and say yes.
  3380. if (destroy && !waitAfterward) {
  3381. runDestroy();
  3382. }
  3383. return Promise.resolve();
  3384. }
  3385. if (!dispatchLifecycleEvent("beforeClose", {
  3386. immediate: immediate,
  3387. timerHide: timerHide,
  3388. waitAfterward: waitAfterward
  3389. })) {
  3390. return Promise.reject();
  3391. }
  3392. _state = "closing";
  3393. _timerHide = !!timerHide; // Make sure it's a boolean.
  3394. if (_timer && _timer !== "prevented" && clearTimeout) {
  3395. clearTimeout(_timer);
  3396. }
  3397. _timer = null;
  3398. var resolve;
  3399. var promise = new Promise(function (res, rej) {
  3400. resolve = res;
  3401. });
  3402. _closePromise = promise;
  3403. animateOut(function () {
  3404. $$invalidate(26, _interacting = false);
  3405. _timerHide = false;
  3406. _state = waitAfterward ? "waiting" : "closed";
  3407. dispatchLifecycleEvent("afterClose", {
  3408. immediate: immediate,
  3409. timerHide: timerHide,
  3410. waitAfterward: waitAfterward
  3411. });
  3412. _closePromise = null;
  3413. resolve();
  3414. if (!waitAfterward) {
  3415. if (destroy) {
  3416. // If we're supposed to destroy the notice, run the destroy module
  3417. // events, remove from stack, and let Svelte handle DOM removal.
  3418. runDestroy();
  3419. } else if (remove) {
  3420. // If we're supposed to remove the notice from the DOM, do it.
  3421. removeFromDOM();
  3422. }
  3423. }
  3424. }, immediate);
  3425. return promise;
  3426. } : _$$props$close;
  3427. var _$$props$animateIn = $$props.animateIn,
  3428. animateIn = _$$props$animateIn === void 0 ? function (callback, immediate) {
  3429. // Declare that the notice is animating in.
  3430. _animating = "in";
  3431. var finished = function finished(event) {
  3432. if (event && refs.elem && event.target !== refs.elem) {
  3433. return;
  3434. }
  3435. refs.elem && refs.elem.removeEventListener("transitionend", finished);
  3436. if (_animInTimer) {
  3437. clearTimeout(_animInTimer);
  3438. }
  3439. if (_animating !== "in") {
  3440. return;
  3441. }
  3442. var visible = _moduleOpen;
  3443. if (!visible && refs.elem) {
  3444. var domRect = refs.elem.getBoundingClientRect();
  3445. for (var prop in domRect) {
  3446. if (domRect[prop] > 0) {
  3447. visible = true;
  3448. break;
  3449. }
  3450. }
  3451. }
  3452. if (visible) {
  3453. if (callback) {
  3454. callback.call();
  3455. } // Declare that the notice has completed animating.
  3456. _animating = false;
  3457. } else {
  3458. _animInTimer = setTimeout(finished, 40);
  3459. }
  3460. };
  3461. if (animation === "fade" && !immediate) {
  3462. refs.elem && refs.elem.addEventListener("transitionend", finished);
  3463. $$invalidate(24, _animatingClass = "pnotify-in");
  3464. tick().then(function () {
  3465. $$invalidate(24, _animatingClass = "pnotify-in pnotify-fade-in"); // Just in case the event doesn't fire, call it after 650 ms.
  3466. _animInTimer = setTimeout(finished, 650);
  3467. });
  3468. } else {
  3469. var _animation = animation;
  3470. $$invalidate(2, animation = "none");
  3471. $$invalidate(24, _animatingClass = "pnotify-in ".concat(_animation === "fade" ? "pnotify-fade-in" : ""));
  3472. tick().then(function () {
  3473. $$invalidate(2, animation = _animation);
  3474. finished();
  3475. });
  3476. }
  3477. } : _$$props$animateIn;
  3478. var _$$props$animateOut = $$props.animateOut,
  3479. animateOut = _$$props$animateOut === void 0 ? function (callback, immediate) {
  3480. // Declare that the notice is animating out.
  3481. _animating = "out";
  3482. var finished = function finished(event) {
  3483. if (event && refs.elem && event.target !== refs.elem) {
  3484. return;
  3485. }
  3486. refs.elem && refs.elem.removeEventListener("transitionend", finished);
  3487. if (_animOutTimer) {
  3488. clearTimeout(_animOutTimer);
  3489. }
  3490. if (_animating !== "out") {
  3491. return;
  3492. }
  3493. var visible = _moduleOpen;
  3494. if (!visible && refs.elem) {
  3495. var domRect = refs.elem.getBoundingClientRect();
  3496. for (var prop in domRect) {
  3497. if (domRect[prop] > 0) {
  3498. visible = true;
  3499. break;
  3500. }
  3501. }
  3502. }
  3503. if (!refs.elem || !refs.elem.style.opacity || refs.elem.style.opacity === "0" || !visible) {
  3504. $$invalidate(24, _animatingClass = "");
  3505. if (callback) {
  3506. callback.call();
  3507. } // Declare that the notice has completed animating.
  3508. _animating = false;
  3509. } else {
  3510. // In case this was called before the notice finished animating.
  3511. _animOutTimer = setTimeout(finished, 40);
  3512. }
  3513. };
  3514. if (animation === "fade" && !immediate) {
  3515. refs.elem && refs.elem.addEventListener("transitionend", finished);
  3516. $$invalidate(24, _animatingClass = "pnotify-in"); // Just in case the event doesn't fire, call it after 650 ms.
  3517. _animOutTimer = setTimeout(finished, 650);
  3518. } else {
  3519. $$invalidate(24, _animatingClass = "");
  3520. tick().then(function () {
  3521. finished();
  3522. });
  3523. }
  3524. } : _$$props$animateOut;
  3525. function cancelClose() {
  3526. if (_timer && _timer !== "prevented") {
  3527. clearTimeout(_timer);
  3528. _timer = null;
  3529. }
  3530. if (_animOutTimer) {
  3531. clearTimeout(_animOutTimer);
  3532. }
  3533. if (_state === "closing") {
  3534. // If it's animating out, stop it.
  3535. _state = "open";
  3536. _animating = false;
  3537. $$invalidate(24, _animatingClass = animation === "fade" ? "pnotify-in pnotify-fade-in" : "pnotify-in");
  3538. }
  3539. }
  3540. function queueClose() {
  3541. if (_timer === "prevented") {
  3542. return;
  3543. } // Cancel any current close timer.
  3544. cancelClose();
  3545. if (delay !== Infinity) {
  3546. _timer = setTimeout(function () {
  3547. return close(false, true);
  3548. }, isNaN(delay) ? 0 : delay);
  3549. }
  3550. }
  3551. function _preventTimerClose(prevent) {
  3552. if (prevent) {
  3553. cancelClose();
  3554. _timer = "prevented";
  3555. } else if (_timer === "prevented") {
  3556. _timer = null;
  3557. if (_state === "open" && hide) {
  3558. queueClose();
  3559. }
  3560. }
  3561. }
  3562. function on() {
  3563. return self.$on.apply(self, arguments);
  3564. }
  3565. function update() {
  3566. return self.$set.apply(self, arguments);
  3567. }
  3568. function fire(name, detail) {
  3569. dispatch(name, detail);
  3570. }
  3571. function addModuleClass(element) {
  3572. for (var i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
  3573. var className = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1];
  3574. if (_moduleClasses[element].indexOf(className) === -1) {
  3575. _moduleClasses[element].push(className);
  3576. }
  3577. }
  3578. $$invalidate(27, _moduleClasses);
  3579. }
  3580. function removeModuleClass(element) {
  3581. for (var i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
  3582. var className = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1];
  3583. var idx = _moduleClasses[element].indexOf(className);
  3584. if (idx !== -1) {
  3585. _moduleClasses[element].splice(idx, 1);
  3586. }
  3587. }
  3588. $$invalidate(27, _moduleClasses);
  3589. }
  3590. function hasModuleClass(element) {
  3591. for (var i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
  3592. var className = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1];
  3593. if (_moduleClasses[element].indexOf(className) === -1) {
  3594. return false;
  3595. }
  3596. }
  3597. return true;
  3598. }
  3599. function getModuleHandled() {
  3600. return _moduleHandled;
  3601. }
  3602. function setModuleHandled(value) {
  3603. return _moduleHandled = value;
  3604. }
  3605. function getModuleOpen() {
  3606. return _moduleOpen;
  3607. }
  3608. function setModuleOpen(value) {
  3609. return _moduleOpen = value;
  3610. }
  3611. function setAnimating(value) {
  3612. return _animating = value;
  3613. }
  3614. function getAnimatingClass() {
  3615. return _animatingClass;
  3616. }
  3617. function setAnimatingClass(value) {
  3618. return $$invalidate(24, _animatingClass = value);
  3619. }
  3620. function _getMoveClass() {
  3621. return _moveClass;
  3622. }
  3623. function _setMoveClass(value) {
  3624. return $$invalidate(25, _moveClass = value);
  3625. }
  3626. function _setMasking(value, immediate, callback) {
  3627. if (_maskingTimer) {
  3628. clearTimeout(_maskingTimer);
  3629. }
  3630. if (_masking === value) {
  3631. return;
  3632. }
  3633. if (value) {
  3634. $$invalidate(28, _masking = true);
  3635. $$invalidate(29, _maskingIn = !!immediate);
  3636. insertIntoDOM();
  3637. tick().then(function () {
  3638. window.requestAnimationFrame(function () {
  3639. if (_masking) {
  3640. if (immediate && callback) {
  3641. callback();
  3642. } else {
  3643. $$invalidate(29, _maskingIn = true);
  3644. var finished = function finished() {
  3645. refs.elem && refs.elem.removeEventListener("transitionend", finished);
  3646. if (_maskingTimer) {
  3647. clearTimeout(_maskingTimer);
  3648. }
  3649. if (_maskingIn && callback) {
  3650. callback();
  3651. }
  3652. };
  3653. refs.elem && refs.elem.addEventListener("transitionend", finished);
  3654. _maskingTimer = setTimeout(finished, 650);
  3655. }
  3656. }
  3657. });
  3658. });
  3659. } else if (immediate) {
  3660. $$invalidate(28, _masking = false);
  3661. $$invalidate(29, _maskingIn = false);
  3662. if (remove && ["open", "opening", "closing"].indexOf(_state) === -1) {
  3663. removeFromDOM();
  3664. }
  3665. if (callback) {
  3666. callback();
  3667. }
  3668. } else {
  3669. var finished = function finished() {
  3670. refs.elem && refs.elem.removeEventListener("transitionend", finished);
  3671. if (_maskingTimer) {
  3672. clearTimeout(_maskingTimer);
  3673. }
  3674. if (!_maskingIn) {
  3675. $$invalidate(28, _masking = false);
  3676. if (remove && ["open", "opening", "closing"].indexOf(_state) === -1) {
  3677. removeFromDOM();
  3678. }
  3679. if (callback) {
  3680. callback();
  3681. }
  3682. }
  3683. };
  3684. $$invalidate(29, _maskingIn = false);
  3685. refs.elem && refs.elem.addEventListener("transitionend", finished);
  3686. refs.elem && refs.elem.style.opacity; // This line is necessary for some reason. Some notices don't fade without it.
  3687. // Just in case the event doesn't fire, call it after 650 ms.
  3688. _maskingTimer = setTimeout(finished, 650);
  3689. }
  3690. }
  3691. var click_handler = function click_handler() {
  3692. return close(false);
  3693. };
  3694. var click_handler_1 = function click_handler_1() {
  3695. return $$invalidate(3, hide = !hide);
  3696. };
  3697. function div_binding($$value) {
  3698. binding_callbacks[$$value ? "unshift" : "push"](function () {
  3699. refs.iconContainer = $$value;
  3700. $$invalidate(1, refs);
  3701. });
  3702. }
  3703. function div_binding_1($$value) {
  3704. binding_callbacks[$$value ? "unshift" : "push"](function () {
  3705. refs.titleContainer = $$value;
  3706. $$invalidate(1, refs);
  3707. });
  3708. }
  3709. function div_binding_2($$value) {
  3710. binding_callbacks[$$value ? "unshift" : "push"](function () {
  3711. refs.textContainer = $$value;
  3712. $$invalidate(1, refs);
  3713. });
  3714. }
  3715. function div0_binding($$value) {
  3716. binding_callbacks[$$value ? "unshift" : "push"](function () {
  3717. refs.content = $$value;
  3718. $$invalidate(1, refs);
  3719. });
  3720. }
  3721. function div1_binding($$value) {
  3722. binding_callbacks[$$value ? "unshift" : "push"](function () {
  3723. refs.container = $$value;
  3724. $$invalidate(1, refs);
  3725. });
  3726. }
  3727. function div2_binding($$value) {
  3728. binding_callbacks[$$value ? "unshift" : "push"](function () {
  3729. refs.elem = $$value;
  3730. $$invalidate(1, refs);
  3731. });
  3732. }
  3733. $$self.$$set = function ($$props) {
  3734. if ("modules" in $$props) $$invalidate(46, modules = $$props.modules);
  3735. if ("stack" in $$props) $$invalidate(0, stack = $$props.stack);
  3736. if ("type" in $$props) $$invalidate(4, type = $$props.type);
  3737. if ("title" in $$props) $$invalidate(5, title = $$props.title);
  3738. if ("titleTrusted" in $$props) $$invalidate(6, titleTrusted = $$props.titleTrusted);
  3739. if ("text" in $$props) $$invalidate(7, text = $$props.text);
  3740. if ("textTrusted" in $$props) $$invalidate(8, textTrusted = $$props.textTrusted);
  3741. if ("styling" in $$props) $$invalidate(47, styling = $$props.styling);
  3742. if ("icons" in $$props) $$invalidate(48, icons = $$props.icons);
  3743. if ("mode" in $$props) $$invalidate(9, mode = $$props.mode);
  3744. if ("addClass" in $$props) $$invalidate(10, addClass = $$props.addClass);
  3745. if ("addModalClass" in $$props) $$invalidate(11, addModalClass = $$props.addModalClass);
  3746. if ("addModelessClass" in $$props) $$invalidate(12, addModelessClass = $$props.addModelessClass);
  3747. if ("autoOpen" in $$props) $$invalidate(49, autoOpen = $$props.autoOpen);
  3748. if ("width" in $$props) $$invalidate(50, width = $$props.width);
  3749. if ("minHeight" in $$props) $$invalidate(51, minHeight = $$props.minHeight);
  3750. if ("maxTextHeight" in $$props) $$invalidate(52, maxTextHeight = $$props.maxTextHeight);
  3751. if ("icon" in $$props) $$invalidate(13, icon = $$props.icon);
  3752. if ("animation" in $$props) $$invalidate(2, animation = $$props.animation);
  3753. if ("animateSpeed" in $$props) $$invalidate(14, animateSpeed = $$props.animateSpeed);
  3754. if ("shadow" in $$props) $$invalidate(15, shadow = $$props.shadow);
  3755. if ("hide" in $$props) $$invalidate(3, hide = $$props.hide);
  3756. if ("delay" in $$props) $$invalidate(53, delay = $$props.delay);
  3757. if ("mouseReset" in $$props) $$invalidate(54, mouseReset = $$props.mouseReset);
  3758. if ("closer" in $$props) $$invalidate(16, closer = $$props.closer);
  3759. if ("closerHover" in $$props) $$invalidate(17, closerHover = $$props.closerHover);
  3760. if ("sticker" in $$props) $$invalidate(18, sticker = $$props.sticker);
  3761. if ("stickerHover" in $$props) $$invalidate(19, stickerHover = $$props.stickerHover);
  3762. if ("labels" in $$props) $$invalidate(20, labels = $$props.labels);
  3763. if ("remove" in $$props) $$invalidate(55, remove = $$props.remove);
  3764. if ("destroy" in $$props) $$invalidate(56, destroy = $$props.destroy);
  3765. if ("open" in $$props) $$invalidate(59, open = $$props.open);
  3766. if ("close" in $$props) $$invalidate(23, close = $$props.close);
  3767. if ("animateIn" in $$props) $$invalidate(60, animateIn = $$props.animateIn);
  3768. if ("animateOut" in $$props) $$invalidate(61, animateOut = $$props.animateOut);
  3769. };
  3770. var _widthStyle;
  3771. var _minHeightStyle;
  3772. var _maxTextHeightStyle;
  3773. var _titleElement;
  3774. var _textElement;
  3775. var _nonBlock;
  3776. var _stackDirClass;
  3777. var modulesPrependContainer;
  3778. var modulesPrependContent;
  3779. var modulesAppendContent;
  3780. var modulesAppendContainer;
  3781. $$self.$$.update = function () {
  3782. if ($$self.$$.dirty[1] &
  3783. /*width*/
  3784. 524288) {
  3785. // Grab the icons from the icons object or use provided icons
  3786. $$invalidate(31, _widthStyle = typeof width === "string" ? "width: ".concat(width, ";") : "");
  3787. }
  3788. if ($$self.$$.dirty[1] &
  3789. /*minHeight*/
  3790. 1048576) {
  3791. $$invalidate(32, _minHeightStyle = typeof minHeight === "string" ? "min-height: ".concat(minHeight, ";") : "");
  3792. }
  3793. if ($$self.$$.dirty[1] &
  3794. /*maxTextHeight*/
  3795. 2097152) {
  3796. $$invalidate(33, _maxTextHeightStyle = typeof maxTextHeight === "string" ? "max-height: ".concat(maxTextHeight, ";") : "");
  3797. }
  3798. if ($$self.$$.dirty[0] &
  3799. /*title*/
  3800. 32) {
  3801. $$invalidate(34, _titleElement = title instanceof HTMLElement);
  3802. }
  3803. if ($$self.$$.dirty[0] &
  3804. /*text*/
  3805. 128) {
  3806. $$invalidate(35, _textElement = text instanceof HTMLElement);
  3807. }
  3808. if ($$self.$$.dirty[0] &
  3809. /*stack*/
  3810. 1 | $$self.$$.dirty[3] &
  3811. /*_oldStack, _stackBeforeAddOverlayOff, _stackAfterRemoveOverlayOff*/
  3812. 1792) {
  3813. if (_oldStack !== stack) {
  3814. if (_oldStack) {
  3815. // Remove the notice from the old stack.
  3816. _oldStack._removeNotice(self); // Remove the listeners.
  3817. $$invalidate(30, _modal = false);
  3818. _stackBeforeAddOverlayOff();
  3819. _stackAfterRemoveOverlayOff();
  3820. }
  3821. if (stack) {
  3822. // Add the notice to the stack.
  3823. stack._addNotice(self); // Add listeners for modal state.
  3824. $$invalidate(102, _stackBeforeAddOverlayOff = stack.on("beforeAddOverlay", function () {
  3825. $$invalidate(30, _modal = true);
  3826. dispatchLifecycleEvent("enterModal");
  3827. }));
  3828. $$invalidate(103, _stackAfterRemoveOverlayOff = stack.on("afterRemoveOverlay", function () {
  3829. $$invalidate(30, _modal = false);
  3830. dispatchLifecycleEvent("leaveModal");
  3831. }));
  3832. }
  3833. $$invalidate(101, _oldStack = stack);
  3834. }
  3835. }
  3836. if ($$self.$$.dirty[0] &
  3837. /*addClass, addModalClass, _modal, addModelessClass*/
  3838. 1073748992) {
  3839. $$invalidate(36, _nonBlock = addClass.match(/\bnonblock\b/) || addModalClass.match(/\bnonblock\b/) && _modal || addModelessClass.match(/\bnonblock\b/) && !_modal);
  3840. }
  3841. if ($$self.$$.dirty[0] &
  3842. /*stack*/
  3843. 1) {
  3844. // This is for specific styling for how notices stack.
  3845. $$invalidate(37, _stackDirClass = stack && stack.dir1 ? "pnotify-stack-".concat(stack.dir1) : "");
  3846. }
  3847. if ($$self.$$.dirty[1] &
  3848. /*modules*/
  3849. 32768) {
  3850. // Filter through the module objects, getting an array for each position.
  3851. $$invalidate(38, modulesPrependContainer = Array.from(modules).filter(function (_ref3) {
  3852. var _ref4 = _slicedToArray(_ref3, 2),
  3853. module = _ref4[0],
  3854. options = _ref4[1];
  3855. return module.position === "PrependContainer";
  3856. }));
  3857. }
  3858. if ($$self.$$.dirty[1] &
  3859. /*modules*/
  3860. 32768) {
  3861. $$invalidate(39, modulesPrependContent = Array.from(modules).filter(function (_ref5) {
  3862. var _ref6 = _slicedToArray(_ref5, 2),
  3863. module = _ref6[0],
  3864. options = _ref6[1];
  3865. return module.position === "PrependContent";
  3866. }));
  3867. }
  3868. if ($$self.$$.dirty[1] &
  3869. /*modules*/
  3870. 32768) {
  3871. $$invalidate(40, modulesAppendContent = Array.from(modules).filter(function (_ref7) {
  3872. var _ref8 = _slicedToArray(_ref7, 2),
  3873. module = _ref8[0],
  3874. options = _ref8[1];
  3875. return module.position === "AppendContent";
  3876. }));
  3877. }
  3878. if ($$self.$$.dirty[1] &
  3879. /*modules*/
  3880. 32768) {
  3881. $$invalidate(41, modulesAppendContainer = Array.from(modules).filter(function (_ref9) {
  3882. var _ref10 = _slicedToArray(_ref9, 2),
  3883. module = _ref10[0],
  3884. options = _ref10[1];
  3885. return module.position === "AppendContainer";
  3886. }));
  3887. }
  3888. if ($$self.$$.dirty[0] &
  3889. /*refs, title*/
  3890. 34 | $$self.$$.dirty[1] &
  3891. /*_titleElement*/
  3892. 8) {
  3893. if (_titleElement && refs.titleContainer) {
  3894. refs.titleContainer.appendChild(title);
  3895. }
  3896. }
  3897. if ($$self.$$.dirty[0] &
  3898. /*refs, text*/
  3899. 130 | $$self.$$.dirty[1] &
  3900. /*_textElement*/
  3901. 16) {
  3902. if (_textElement && refs.textContainer) {
  3903. refs.textContainer.appendChild(text);
  3904. }
  3905. }
  3906. };
  3907. return [stack, refs, animation, hide, type, title, titleTrusted, text, textTrusted, mode, addClass, addModalClass, addModelessClass, icon, animateSpeed, shadow, closer, closerHover, sticker, stickerHover, labels, getStyle, getIcon, close, _animatingClass, _moveClass, _interacting, _moduleClasses, _masking, _maskingIn, _modal, _widthStyle, _minHeightStyle, _maxTextHeightStyle, _titleElement, _textElement, _nonBlock, _stackDirClass, modulesPrependContainer, modulesPrependContent, modulesAppendContent, modulesAppendContainer, self, forwardEvents, handleInteraction, handleLeaveInteraction, modules, styling, icons, autoOpen, width, minHeight, maxTextHeight, delay, mouseReset, remove, destroy, getState, getTimer, open, animateIn, animateOut, cancelClose, queueClose, _preventTimerClose, on, update, fire, addModuleClass, removeModuleClass, hasModuleClass, getModuleHandled, setModuleHandled, getModuleOpen, setModuleOpen, setAnimating, getAnimatingClass, setAnimatingClass, _getMoveClass, _setMoveClass, _setMasking, click_handler, click_handler_1, div_binding, div_binding_1, div_binding_2, div0_binding, div1_binding, div2_binding];
  3908. }
  3909. var Core = /*#__PURE__*/function (_SvelteComponent) {
  3910. _inherits(Core, _SvelteComponent);
  3911. var _super = _createSuper(Core);
  3912. function Core(options) {
  3913. var _this;
  3914. _classCallCheck(this, Core);
  3915. _this = _super.call(this);
  3916. init(_assertThisInitialized(_this), options, instance, create_fragment, safe_not_equal, {
  3917. modules: 46,
  3918. stack: 0,
  3919. refs: 1,
  3920. type: 4,
  3921. title: 5,
  3922. titleTrusted: 6,
  3923. text: 7,
  3924. textTrusted: 8,
  3925. styling: 47,
  3926. icons: 48,
  3927. mode: 9,
  3928. addClass: 10,
  3929. addModalClass: 11,
  3930. addModelessClass: 12,
  3931. autoOpen: 49,
  3932. width: 50,
  3933. minHeight: 51,
  3934. maxTextHeight: 52,
  3935. icon: 13,
  3936. animation: 2,
  3937. animateSpeed: 14,
  3938. shadow: 15,
  3939. hide: 3,
  3940. delay: 53,
  3941. mouseReset: 54,
  3942. closer: 16,
  3943. closerHover: 17,
  3944. sticker: 18,
  3945. stickerHover: 19,
  3946. labels: 20,
  3947. remove: 55,
  3948. destroy: 56,
  3949. getState: 57,
  3950. getTimer: 58,
  3951. getStyle: 21,
  3952. getIcon: 22,
  3953. open: 59,
  3954. close: 23,
  3955. animateIn: 60,
  3956. animateOut: 61,
  3957. cancelClose: 62,
  3958. queueClose: 63,
  3959. _preventTimerClose: 64,
  3960. on: 65,
  3961. update: 66,
  3962. fire: 67,
  3963. addModuleClass: 68,
  3964. removeModuleClass: 69,
  3965. hasModuleClass: 70,
  3966. getModuleHandled: 71,
  3967. setModuleHandled: 72,
  3968. getModuleOpen: 73,
  3969. setModuleOpen: 74,
  3970. setAnimating: 75,
  3971. getAnimatingClass: 76,
  3972. setAnimatingClass: 77,
  3973. _getMoveClass: 78,
  3974. _setMoveClass: 79,
  3975. _setMasking: 80
  3976. }, [-1, -1, -1, -1]);
  3977. return _this;
  3978. }
  3979. _createClass(Core, [{
  3980. key: "modules",
  3981. get: function get() {
  3982. return this.$$.ctx[46];
  3983. },
  3984. set: function set(modules) {
  3985. this.$set({
  3986. modules: modules
  3987. });
  3988. flush();
  3989. }
  3990. }, {
  3991. key: "stack",
  3992. get: function get() {
  3993. return this.$$.ctx[0];
  3994. },
  3995. set: function set(stack) {
  3996. this.$set({
  3997. stack: stack
  3998. });
  3999. flush();
  4000. }
  4001. }, {
  4002. key: "refs",
  4003. get: function get() {
  4004. return this.$$.ctx[1];
  4005. }
  4006. }, {
  4007. key: "type",
  4008. get: function get() {
  4009. return this.$$.ctx[4];
  4010. },
  4011. set: function set(type) {
  4012. this.$set({
  4013. type: type
  4014. });
  4015. flush();
  4016. }
  4017. }, {
  4018. key: "title",
  4019. get: function get() {
  4020. return this.$$.ctx[5];
  4021. },
  4022. set: function set(title) {
  4023. this.$set({
  4024. title: title
  4025. });
  4026. flush();
  4027. }
  4028. }, {
  4029. key: "titleTrusted",
  4030. get: function get() {
  4031. return this.$$.ctx[6];
  4032. },
  4033. set: function set(titleTrusted) {
  4034. this.$set({
  4035. titleTrusted: titleTrusted
  4036. });
  4037. flush();
  4038. }
  4039. }, {
  4040. key: "text",
  4041. get: function get() {
  4042. return this.$$.ctx[7];
  4043. },
  4044. set: function set(text) {
  4045. this.$set({
  4046. text: text
  4047. });
  4048. flush();
  4049. }
  4050. }, {
  4051. key: "textTrusted",
  4052. get: function get() {
  4053. return this.$$.ctx[8];
  4054. },
  4055. set: function set(textTrusted) {
  4056. this.$set({
  4057. textTrusted: textTrusted
  4058. });
  4059. flush();
  4060. }
  4061. }, {
  4062. key: "styling",
  4063. get: function get() {
  4064. return this.$$.ctx[47];
  4065. },
  4066. set: function set(styling) {
  4067. this.$set({
  4068. styling: styling
  4069. });
  4070. flush();
  4071. }
  4072. }, {
  4073. key: "icons",
  4074. get: function get() {
  4075. return this.$$.ctx[48];
  4076. },
  4077. set: function set(icons) {
  4078. this.$set({
  4079. icons: icons
  4080. });
  4081. flush();
  4082. }
  4083. }, {
  4084. key: "mode",
  4085. get: function get() {
  4086. return this.$$.ctx[9];
  4087. },
  4088. set: function set(mode) {
  4089. this.$set({
  4090. mode: mode
  4091. });
  4092. flush();
  4093. }
  4094. }, {
  4095. key: "addClass",
  4096. get: function get() {
  4097. return this.$$.ctx[10];
  4098. },
  4099. set: function set(addClass) {
  4100. this.$set({
  4101. addClass: addClass
  4102. });
  4103. flush();
  4104. }
  4105. }, {
  4106. key: "addModalClass",
  4107. get: function get() {
  4108. return this.$$.ctx[11];
  4109. },
  4110. set: function set(addModalClass) {
  4111. this.$set({
  4112. addModalClass: addModalClass
  4113. });
  4114. flush();
  4115. }
  4116. }, {
  4117. key: "addModelessClass",
  4118. get: function get() {
  4119. return this.$$.ctx[12];
  4120. },
  4121. set: function set(addModelessClass) {
  4122. this.$set({
  4123. addModelessClass: addModelessClass
  4124. });
  4125. flush();
  4126. }
  4127. }, {
  4128. key: "autoOpen",
  4129. get: function get() {
  4130. return this.$$.ctx[49];
  4131. },
  4132. set: function set(autoOpen) {
  4133. this.$set({
  4134. autoOpen: autoOpen
  4135. });
  4136. flush();
  4137. }
  4138. }, {
  4139. key: "width",
  4140. get: function get() {
  4141. return this.$$.ctx[50];
  4142. },
  4143. set: function set(width) {
  4144. this.$set({
  4145. width: width
  4146. });
  4147. flush();
  4148. }
  4149. }, {
  4150. key: "minHeight",
  4151. get: function get() {
  4152. return this.$$.ctx[51];
  4153. },
  4154. set: function set(minHeight) {
  4155. this.$set({
  4156. minHeight: minHeight
  4157. });
  4158. flush();
  4159. }
  4160. }, {
  4161. key: "maxTextHeight",
  4162. get: function get() {
  4163. return this.$$.ctx[52];
  4164. },
  4165. set: function set(maxTextHeight) {
  4166. this.$set({
  4167. maxTextHeight: maxTextHeight
  4168. });
  4169. flush();
  4170. }
  4171. }, {
  4172. key: "icon",
  4173. get: function get() {
  4174. return this.$$.ctx[13];
  4175. },
  4176. set: function set(icon) {
  4177. this.$set({
  4178. icon: icon
  4179. });
  4180. flush();
  4181. }
  4182. }, {
  4183. key: "animation",
  4184. get: function get() {
  4185. return this.$$.ctx[2];
  4186. },
  4187. set: function set(animation) {
  4188. this.$set({
  4189. animation: animation
  4190. });
  4191. flush();
  4192. }
  4193. }, {
  4194. key: "animateSpeed",
  4195. get: function get() {
  4196. return this.$$.ctx[14];
  4197. },
  4198. set: function set(animateSpeed) {
  4199. this.$set({
  4200. animateSpeed: animateSpeed
  4201. });
  4202. flush();
  4203. }
  4204. }, {
  4205. key: "shadow",
  4206. get: function get() {
  4207. return this.$$.ctx[15];
  4208. },
  4209. set: function set(shadow) {
  4210. this.$set({
  4211. shadow: shadow
  4212. });
  4213. flush();
  4214. }
  4215. }, {
  4216. key: "hide",
  4217. get: function get() {
  4218. return this.$$.ctx[3];
  4219. },
  4220. set: function set(hide) {
  4221. this.$set({
  4222. hide: hide
  4223. });
  4224. flush();
  4225. }
  4226. }, {
  4227. key: "delay",
  4228. get: function get() {
  4229. return this.$$.ctx[53];
  4230. },
  4231. set: function set(delay) {
  4232. this.$set({
  4233. delay: delay
  4234. });
  4235. flush();
  4236. }
  4237. }, {
  4238. key: "mouseReset",
  4239. get: function get() {
  4240. return this.$$.ctx[54];
  4241. },
  4242. set: function set(mouseReset) {
  4243. this.$set({
  4244. mouseReset: mouseReset
  4245. });
  4246. flush();
  4247. }
  4248. }, {
  4249. key: "closer",
  4250. get: function get() {
  4251. return this.$$.ctx[16];
  4252. },
  4253. set: function set(closer) {
  4254. this.$set({
  4255. closer: closer
  4256. });
  4257. flush();
  4258. }
  4259. }, {
  4260. key: "closerHover",
  4261. get: function get() {
  4262. return this.$$.ctx[17];
  4263. },
  4264. set: function set(closerHover) {
  4265. this.$set({
  4266. closerHover: closerHover
  4267. });
  4268. flush();
  4269. }
  4270. }, {
  4271. key: "sticker",
  4272. get: function get() {
  4273. return this.$$.ctx[18];
  4274. },
  4275. set: function set(sticker) {
  4276. this.$set({
  4277. sticker: sticker
  4278. });
  4279. flush();
  4280. }
  4281. }, {
  4282. key: "stickerHover",
  4283. get: function get() {
  4284. return this.$$.ctx[19];
  4285. },
  4286. set: function set(stickerHover) {
  4287. this.$set({
  4288. stickerHover: stickerHover
  4289. });
  4290. flush();
  4291. }
  4292. }, {
  4293. key: "labels",
  4294. get: function get() {
  4295. return this.$$.ctx[20];
  4296. },
  4297. set: function set(labels) {
  4298. this.$set({
  4299. labels: labels
  4300. });
  4301. flush();
  4302. }
  4303. }, {
  4304. key: "remove",
  4305. get: function get() {
  4306. return this.$$.ctx[55];
  4307. },
  4308. set: function set(remove) {
  4309. this.$set({
  4310. remove: remove
  4311. });
  4312. flush();
  4313. }
  4314. }, {
  4315. key: "destroy",
  4316. get: function get() {
  4317. return this.$$.ctx[56];
  4318. },
  4319. set: function set(destroy) {
  4320. this.$set({
  4321. destroy: destroy
  4322. });
  4323. flush();
  4324. }
  4325. }, {
  4326. key: "getState",
  4327. get: function get() {
  4328. return this.$$.ctx[57];
  4329. }
  4330. }, {
  4331. key: "getTimer",
  4332. get: function get() {
  4333. return this.$$.ctx[58];
  4334. }
  4335. }, {
  4336. key: "getStyle",
  4337. get: function get() {
  4338. return this.$$.ctx[21];
  4339. }
  4340. }, {
  4341. key: "getIcon",
  4342. get: function get() {
  4343. return this.$$.ctx[22];
  4344. }
  4345. }, {
  4346. key: "open",
  4347. get: function get() {
  4348. return this.$$.ctx[59];
  4349. },
  4350. set: function set(open) {
  4351. this.$set({
  4352. open: open
  4353. });
  4354. flush();
  4355. }
  4356. }, {
  4357. key: "close",
  4358. get: function get() {
  4359. return this.$$.ctx[23];
  4360. },
  4361. set: function set(close) {
  4362. this.$set({
  4363. close: close
  4364. });
  4365. flush();
  4366. }
  4367. }, {
  4368. key: "animateIn",
  4369. get: function get() {
  4370. return this.$$.ctx[60];
  4371. },
  4372. set: function set(animateIn) {
  4373. this.$set({
  4374. animateIn: animateIn
  4375. });
  4376. flush();
  4377. }
  4378. }, {
  4379. key: "animateOut",
  4380. get: function get() {
  4381. return this.$$.ctx[61];
  4382. },
  4383. set: function set(animateOut) {
  4384. this.$set({
  4385. animateOut: animateOut
  4386. });
  4387. flush();
  4388. }
  4389. }, {
  4390. key: "cancelClose",
  4391. get: function get() {
  4392. return this.$$.ctx[62];
  4393. }
  4394. }, {
  4395. key: "queueClose",
  4396. get: function get() {
  4397. return this.$$.ctx[63];
  4398. }
  4399. }, {
  4400. key: "_preventTimerClose",
  4401. get: function get() {
  4402. return this.$$.ctx[64];
  4403. }
  4404. }, {
  4405. key: "on",
  4406. get: function get() {
  4407. return this.$$.ctx[65];
  4408. }
  4409. }, {
  4410. key: "update",
  4411. get: function get() {
  4412. return this.$$.ctx[66];
  4413. }
  4414. }, {
  4415. key: "fire",
  4416. get: function get() {
  4417. return this.$$.ctx[67];
  4418. }
  4419. }, {
  4420. key: "addModuleClass",
  4421. get: function get() {
  4422. return this.$$.ctx[68];
  4423. }
  4424. }, {
  4425. key: "removeModuleClass",
  4426. get: function get() {
  4427. return this.$$.ctx[69];
  4428. }
  4429. }, {
  4430. key: "hasModuleClass",
  4431. get: function get() {
  4432. return this.$$.ctx[70];
  4433. }
  4434. }, {
  4435. key: "getModuleHandled",
  4436. get: function get() {
  4437. return this.$$.ctx[71];
  4438. }
  4439. }, {
  4440. key: "setModuleHandled",
  4441. get: function get() {
  4442. return this.$$.ctx[72];
  4443. }
  4444. }, {
  4445. key: "getModuleOpen",
  4446. get: function get() {
  4447. return this.$$.ctx[73];
  4448. }
  4449. }, {
  4450. key: "setModuleOpen",
  4451. get: function get() {
  4452. return this.$$.ctx[74];
  4453. }
  4454. }, {
  4455. key: "setAnimating",
  4456. get: function get() {
  4457. return this.$$.ctx[75];
  4458. }
  4459. }, {
  4460. key: "getAnimatingClass",
  4461. get: function get() {
  4462. return this.$$.ctx[76];
  4463. }
  4464. }, {
  4465. key: "setAnimatingClass",
  4466. get: function get() {
  4467. return this.$$.ctx[77];
  4468. }
  4469. }, {
  4470. key: "_getMoveClass",
  4471. get: function get() {
  4472. return this.$$.ctx[78];
  4473. }
  4474. }, {
  4475. key: "_setMoveClass",
  4476. get: function get() {
  4477. return this.$$.ctx[79];
  4478. }
  4479. }, {
  4480. key: "_setMasking",
  4481. get: function get() {
  4482. return this.$$.ctx[80];
  4483. }
  4484. }]);
  4485. return Core;
  4486. }(SvelteComponent);
  4487. exports.Stack = Stack;
  4488. exports.alert = alert;
  4489. exports.default = Core;
  4490. exports.defaultModules = defaultModules;
  4491. exports.defaultStack = defaultStack;
  4492. exports.defaults = defaults;
  4493. exports.error = error;
  4494. exports.info = info;
  4495. exports.notice = notice;
  4496. exports.success = success;
  4497. Object.defineProperty(exports, '__esModule', { value: true });
  4498. })));