├── .gitignore
├── .vercelignore
├── .github
├── dependabot.yml
└── workflows
│ └── links-check.yml
├── .editorconfig
├── vercel.json
├── dist
├── clippy.svg
├── icon.svg
├── js
│ ├── clipboard.min.js
│ ├── clipboard.js
│ └── notiflix-3.2.6.min.js
└── css
│ └── notiflix-3.2.6.min.css
├── go.mod
├── handlers
├── response.go
├── action_handler.go
└── redis_handler.go
├── delete.go
├── redis
└── redis.go
├── resync.go
├── generate_md.go
├── LICENSE
├── upgrade.go
├── README.md
├── api
└── api.go
├── mirror.html
└── go.sum
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .env
3 | Links.md
4 | site.txt
5 |
--------------------------------------------------------------------------------
/.vercelignore:
--------------------------------------------------------------------------------
1 | .github
2 | .editorconfig
3 | .gitignore
4 | generate_md.go
5 | LICENSE
6 | README.md
7 | resync.go
8 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "github-actions"
4 | directory: "/"
5 | schedule:
6 | interval: monthly
7 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [.json]
12 | indent_size = tab
13 |
14 | [*.{yml, yaml}]
15 | indent_size = 2
16 |
--------------------------------------------------------------------------------
/vercel.json:
--------------------------------------------------------------------------------
1 | {
2 | "routes": [
3 | {
4 | "src": "/",
5 | "dest": "/mirror.html"
6 | },
7 | {
8 | "src": "/api/urls",
9 | "dest": "/api/api.go"
10 | },
11 | {
12 | "src": "/api/url/save",
13 | "dest": "/api/api.go"
14 | },
15 | {
16 | "src": "/(?!((.*?)(.css$|.js$|.svg$)))(.*?)",
17 | "dest": "/api/api.go"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/dist/clippy.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/xiaoxuan6/github-mirror
2 |
3 | go 1.20
4 |
5 | require (
6 | github.com/go-redis/redis/v8 v8.11.0
7 | github.com/joho/godotenv v1.5.1
8 | github.com/sirupsen/logrus v1.9.3
9 | github.com/thoas/go-funk v0.9.3
10 | github.com/tidwall/gjson v1.18.0
11 | )
12 |
13 | require (
14 | github.com/cespare/xxhash/v2 v2.1.1 // indirect
15 | github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
16 | github.com/tidwall/match v1.1.1 // indirect
17 | github.com/tidwall/pretty v1.2.0 // indirect
18 | golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
19 | )
20 |
--------------------------------------------------------------------------------
/handlers/response.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | type Response struct {
4 | Code int `json:"code"`
5 | Msg string `json:"msg"`
6 | Data []string `json:"data"`
7 | }
8 |
9 | func Success(data []string) *Response {
10 | return &Response{
11 | Code: 200,
12 | Msg: "ok",
13 | Data: data,
14 | }
15 | }
16 |
17 | func Error(err error) *Response {
18 | return &Response{
19 | Code: 500,
20 | Msg: err.Error(),
21 | Data: nil,
22 | }
23 | }
24 |
25 | func ErrorM(msg string) *Response {
26 | return &Response{
27 | Code: 500,
28 | Msg: msg,
29 | Data: nil,
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/delete.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "github.com/joho/godotenv"
6 | "github.com/thoas/go-funk"
7 | "github.com/xiaoxuan6/github-mirror/handlers"
8 | "strings"
9 | )
10 |
11 | var input string
12 |
13 | func main() {
14 | println("请输入需要删除的链接地址:")
15 | _, _ = fmt.Scanln(&input)
16 |
17 | _ = godotenv.Load()
18 | url := handlers.RedisHandler.GetWithBody()
19 | urls := strings.Split(url, ",")
20 |
21 | newUrls := funk.FilterString(urls, func(s string) bool {
22 | return strings.Compare(s, strings.TrimSpace(input)) != 0
23 | })
24 | newUrl := strings.Join(newUrls, ",")
25 | handlers.RedisHandler.Set(newUrl)
26 | println("delete rul successfully")
27 | }
28 |
--------------------------------------------------------------------------------
/handlers/action_handler.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | import (
4 | "github.com/joho/godotenv"
5 | "github.com/thoas/go-funk"
6 | "strings"
7 | )
8 |
9 | var ActionHandler = new(actionHandler)
10 |
11 | type actionHandler struct{}
12 |
13 | func (actionHandler) Save(urls []string) {
14 | _ = godotenv.Load()
15 |
16 | response := RedisHandler.GetWithBody()
17 | if response == "" {
18 | return
19 | }
20 |
21 | responseUrls := strings.Split(response, ",")
22 | for _, url := range urls {
23 | responseUrls = append(responseUrls, url)
24 | }
25 |
26 | uniqUrls := funk.UniqString(responseUrls)
27 | uniqUrl := strings.Join(uniqUrls, ",")
28 | RedisHandler.Set(uniqUrl)
29 | println("upgrade successfully")
30 | }
31 |
--------------------------------------------------------------------------------
/redis/redis.go:
--------------------------------------------------------------------------------
1 | package redis
2 |
3 | import (
4 | "context"
5 | "crypto/tls"
6 | "github.com/go-redis/redis/v8"
7 | "os"
8 | )
9 |
10 | type Redis struct {
11 | client *redis.Client
12 | }
13 |
14 | func NewClient() *Redis {
15 | url := os.Getenv("KV_URL")
16 | options, err := redis.ParseURL(url)
17 | if err != nil {
18 | panic(err.Error())
19 | }
20 |
21 | options.TLSConfig = &tls.Config{InsecureSkipVerify: true}
22 | redisClient := redis.NewClient(options)
23 |
24 | return &Redis{client: redisClient}
25 | }
26 |
27 | func (r *Redis) Get(key string) (string, error) {
28 | res, err := r.client.Get(context.Background(), key).Result()
29 | if err != nil {
30 | return "", err
31 | }
32 |
33 | return res, nil
34 | }
35 |
36 | func (r *Redis) Set(key, value string) string {
37 | return r.client.Set(context.Background(), key, value, 0).String()
38 | }
39 |
--------------------------------------------------------------------------------
/resync.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/joho/godotenv"
5 | "github.com/sirupsen/logrus"
6 | "github.com/thoas/go-funk"
7 | "github.com/xiaoxuan6/github-mirror/handlers"
8 | "os"
9 | "strings"
10 | )
11 |
12 | func main() {
13 | _ = godotenv.Load()
14 |
15 | b, _ := os.ReadFile("out.md")
16 | failUrls := strings.Split(string(b), " ")
17 | if len(failUrls) < 1 {
18 | logrus.Error("not fail urls")
19 | return
20 | }
21 |
22 | response, err := handlers.RedisHandler.Get()
23 | if err != nil {
24 | logrus.Error("kv get value fail: ", err.Error())
25 | return
26 | }
27 |
28 | diffUrls, _ := funk.Difference(response.Data, failUrls)
29 | diffs := diffUrls.([]string)
30 | if len(diffs) > 0 {
31 | body := strings.Join(diffs, ",")
32 | handlers.RedisHandler.Set(body)
33 | }
34 |
35 | logrus.Info("resync done.")
36 | }
37 |
--------------------------------------------------------------------------------
/generate_md.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "github.com/joho/godotenv"
6 | "github.com/xiaoxuan6/github-mirror/handlers"
7 | "io/ioutil"
8 | "os"
9 | "strings"
10 | )
11 |
12 | func main() {
13 | _ = godotenv.Load()
14 |
15 | res, err := handlers.RedisHandler.Get()
16 | if err != nil {
17 | fmt.Printf("kv 获取失败:%s", err.Error())
18 | return
19 | }
20 |
21 | result := res.Data
22 | fmt.Println("urls count: ", len(res.Data))
23 |
24 | var content strings.Builder
25 | for _, val := range result {
26 | uri := fmt.Sprintf("http://%s", val)
27 | content.WriteString(fmt.Sprintf("[%s](%s)\n", uri, uri))
28 | }
29 |
30 | err = ioutil.WriteFile("./Links.md", []byte(content.String()), os.ModePerm)
31 | if err != nil {
32 | fmt.Printf("Error writing to file: %s\n", err.Error())
33 | }
34 |
35 | fmt.Println("generate md done.")
36 | }
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 xiaoxuan6
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/handlers/redis_handler.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | import (
4 | "errors"
5 | "fmt"
6 | "github.com/joho/godotenv"
7 | "github.com/thoas/go-funk"
8 | "github.com/xiaoxuan6/github-mirror/redis"
9 | "os"
10 | "strings"
11 | )
12 |
13 | var (
14 | client *redis.Redis
15 | RedisHandler = new(redisHandler)
16 | )
17 |
18 | type redisHandler struct {
19 | }
20 |
21 | func init() {
22 | _ = godotenv.Load()
23 | client = redis.NewClient()
24 | }
25 |
26 | func (kh redisHandler) Get() (*Response, error) {
27 | result, err := client.Get(os.Getenv("key"))
28 | if err != nil {
29 | return nil, err
30 | }
31 |
32 | return Success(strings.Split(result, ",")), nil
33 | }
34 |
35 | func (kh redisHandler) GetWithBody() string {
36 | result, err := client.Get(os.Getenv("key"))
37 | if err != nil {
38 | return ""
39 | }
40 |
41 | return result
42 | }
43 |
44 | func (kh redisHandler) Set(value string) string {
45 | return client.Set(os.Getenv("key"), value)
46 | }
47 |
48 | func (kh redisHandler) SetWithUrl(url string) error {
49 | result, err := client.Get(os.Getenv("key"))
50 | if err != nil {
51 | return errors.New("kv get value fail")
52 | }
53 |
54 | urls := funk.UniqString(strings.Split(result, ","))
55 | if funk.ContainsString(urls, url) {
56 | return errors.New(fmt.Sprintf("url [%s] is exists", url))
57 | }
58 |
59 | urls = append(urls, url)
60 | kh.Set(strings.Join(urls, ","))
61 | return nil
62 | }
63 |
--------------------------------------------------------------------------------
/upgrade.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "github.com/tidwall/gjson"
6 | "github.com/xiaoxuan6/github-mirror/handlers"
7 | "io/ioutil"
8 | "net/http"
9 | "strings"
10 | "sync"
11 | )
12 |
13 | func main() {
14 | response, err := http.DefaultClient.Get("https://git.mxg.pub/api/github/list")
15 | if err != nil {
16 | panic(err)
17 | }
18 | defer response.Body.Close()
19 |
20 | var (
21 | wg sync.WaitGroup
22 | mu sync.Mutex
23 | urls []string
24 | )
25 | b, _ := ioutil.ReadAll(response.Body)
26 | data := gjson.GetBytes(b, "data").Array()
27 | for _, item := range data {
28 | url := gjson.Get(item.String(), "url").String()
29 |
30 | wg.Add(1)
31 | go func(url string) {
32 | defer wg.Done()
33 | re, err := http.DefaultClient.Get(url)
34 | if err != nil {
35 | println(fmt.Sprintf("url [%s] fetch failed", url))
36 | return
37 | }
38 |
39 | defer re.Body.Close()
40 | if re.StatusCode != 200 {
41 | println(fmt.Sprintf("url [%s] status not 200", url))
42 | return
43 | }
44 |
45 | b, _ = ioutil.ReadAll(re.Body)
46 | if ok := strings.Contains(string(b), "href=\"https://github.com/hunshcn/gh-proxy\">hunshcn/gh-proxy"); !ok {
47 | println(fmt.Sprintf("url [%s] not support github proxy", url))
48 | return
49 | }
50 |
51 | mu.Lock()
52 | urls = append(urls, strings.TrimLeft(strings.TrimLeft(url, "http://"), "https://"))
53 | mu.Unlock()
54 | }(url)
55 | }
56 |
57 | wg.Wait()
58 | handlers.ActionHandler.Save(urls)
59 | }
60 |
--------------------------------------------------------------------------------
/.github/workflows/links-check.yml:
--------------------------------------------------------------------------------
1 | name: 🔗 检查链接
2 |
3 | on:
4 | workflow_dispatch:
5 | workflow_call:
6 | schedule:
7 | - cron: "00 16 * * 1"
8 |
9 | jobs:
10 | linkChecker:
11 | runs-on: ubuntu-latest
12 | if: github.repository == 'xiaoxuan6/github-mirror'
13 | steps:
14 | - uses: actions/checkout@v5
15 |
16 | - uses: actions/setup-go@v5
17 | with:
18 | go-version: '1.20'
19 |
20 | - name: generate links.md
21 | env:
22 | key: ${{ secrets.key }}
23 | KV_URL: ${{ secrets.KV_URL }}
24 | run: |
25 | go run generate_md.go
26 |
27 | - name: Link Checker
28 | id: lychee
29 | uses: lycheeverse/lychee-action@v2.6.1
30 | env:
31 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
32 | with:
33 | args: >-
34 | --verbose
35 | --no-progress
36 | --user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'
37 | 'Links.md'
38 |
39 | - name: Create Issue From File
40 | if: env.lychee_exit_code != 0
41 | uses: peter-evans/create-issue-from-file@v5
42 | with:
43 | title: 🔗 链接检查报告
44 | content-filepath: ./lychee/out.md
45 | labels: report
46 |
47 | - name: check fail url and resync kv
48 | if: success()
49 | env:
50 | key: ${{ secrets.key }}
51 | KV_URL: ${{ secrets.KV_URL }}
52 | run: |
53 | echo $(cat lychee/out.md | awk '/\* \[/ {print $3}' | sort -u | sed -e 's|\[||g' -e 's|\].*||g' -e 's|http://||g' | tr -d '/')
54 | cat lychee/out.md | awk '/\* \[/ {print $3}' | sort -u | sed -e 's|\[||g' -e 's|\].*||g' -e 's|http://||g' | tr -d '/' | xargs echo > out.md
55 | go run resync.go
56 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # github-mirror
2 |
3 | GitHub 文件加速支持release、archive以及文件,右键复制出来的链接都是符合标准的
4 |
5 | 随机复制一个节点,添加到 `git` 地址前面即可
6 |
7 | [](https://github.com/xiaoxuan6/github-mirror)
8 | 
9 | 
10 | [](https://github.com/xiaoxuan6/github-mirror/actions/workflows/links-check.yml)
11 | 
12 | 
13 |
14 | # 免责声明
15 |
16 | 本项目仅做学习使用,如果使用到您的网站,您不满意,请联系我删除。
17 |
18 | ## 公益站
19 |
20 | [https://github-mirror-alpha.vercel.app](https://github-mirror-alpha.vercel.app) (墙)
21 |
22 | ~[https://github-mirror.us.kg](https://github-mirror.us.kg)~
23 |
24 | [https://github-mirror.xiaoxuan6.me](https://github-mirror.xiaoxuan6.me)
25 |
26 | [https://www.github-mirrors.zone.id](https://www.github-mirrors.zone.id)
27 |
28 | [https://github-mirrors.zone.id](https://github-mirrors.zone.id)
29 |
30 | ## Example
31 |
32 | > [!NOTE]
33 | > 网站部署在 `vercel` 中,大流量请绕行!!!
34 |
35 | 例如:
36 |
37 | ```shell
38 | https://github-mirror.xiaoxuan6.me/https://github.com/xiaoxuan6/github-mirror/blob/main/README.md
39 | ```
40 |
41 | 以下都是合法输入:
42 |
43 | 分支源码:`https://github.com/xiaoxuan6/project/archive/master.zip`
44 |
45 | release源码:`https://github.com/xiaoxuan6/project/archive/v1.0.tar.gz`
46 |
47 | release文件:`https://github.com/xiaoxuan6/project/releases/download/v1.0/example.zip`
48 |
49 | 分支文件:`https://github.com/xiaoxuan6/project/blob/master/filename`
50 |
51 | commit 文件:`https://github.com/xiaoxuan6/project/blob/xxxxxxxxx/filename`
52 |
53 | # 赏一杯咖啡
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/dist/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/api/api.go:
--------------------------------------------------------------------------------
1 | package api
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 | "github.com/sirupsen/logrus"
7 | "github.com/thoas/go-funk"
8 | "github.com/xiaoxuan6/github-mirror/handlers"
9 | "github.com/xiaoxuan6/github-mirror/redis"
10 | "io/ioutil"
11 | "net/http"
12 | "os"
13 | "strings"
14 | )
15 |
16 | func Api(w http.ResponseWriter, r *http.Request) {
17 |
18 | client := redis.NewClient()
19 |
20 | uri := r.RequestURI
21 | uri = strings.Trim(uri, "/")
22 | if ok := strings.Compare(uri, "api/urls"); ok == 0 {
23 | w.Header().Set("Content-Type", "application/json;charset=utf-8")
24 |
25 | response, err := handlers.RedisHandler.Get()
26 | if err != nil {
27 | response = handlers.Error(err)
28 | } else {
29 | var urls []string
30 | for _, val := range response.Data {
31 | urls = append(urls, fmt.Sprintf("http://%s", val))
32 | }
33 |
34 | response = handlers.Success(urls)
35 | }
36 |
37 | output(response, w)
38 | return
39 | }
40 |
41 | if ok := strings.Compare(uri, "api/url/save"); ok == 0 {
42 | w.Header().Set("Content-Type", "application/json;charset=utf-8")
43 |
44 | type RequestBody struct {
45 | Url string `json:"url"`
46 | Response string `json:"response"`
47 | }
48 | var requestBody RequestBody
49 | _ = json.NewDecoder(r.Body).Decode(&requestBody)
50 | logrus.Info("请求参数 requestBody.url:", requestBody)
51 |
52 | if len(requestBody.Response) < 1 {
53 | output(handlers.ErrorM("验证失败"), w)
54 | return
55 | }
56 |
57 | if ok := turnstileVerify(requestBody.Response); !ok {
58 | output(handlers.ErrorM("验证失败"), w)
59 | return
60 | }
61 |
62 | res, err := http.Get(requestBody.Url)
63 | defer res.Body.Close()
64 | if err != nil {
65 | output(handlers.ErrorM(fmt.Sprintf("get url body fail: %s", err.Error())), w)
66 | return
67 | }
68 |
69 | if res.StatusCode != 200 {
70 | output(handlers.ErrorM(fmt.Sprintf("url fail status code: %s", res.Status)), w)
71 | return
72 | }
73 |
74 | body, _ := ioutil.ReadAll(res.Body)
75 | if ok := strings.Contains(string(body), "href=\"https://github.com/hunshcn/gh-proxy\">hunshcn/gh-proxy"); !ok {
76 | output(handlers.ErrorM(fmt.Sprintf("url [%s] not support github proxy", requestBody.Url)), w)
77 | return
78 | }
79 |
80 | url := strings.TrimLeft(strings.TrimLeft(requestBody.Url, "http://"), "https://")
81 | url = strings.Trim(url, "/")
82 |
83 | if err = handlers.RedisHandler.SetWithUrl(url); err != nil {
84 | output(handlers.Error(err), w)
85 | } else {
86 | output(handlers.Success(nil), w)
87 | }
88 |
89 | return
90 | }
91 |
92 | if ok := strings.HasPrefix(uri, "https:/github.com"); ok == false {
93 | _, _ = w.Write([]byte("The URL prefix must be https://github.com"))
94 | return
95 | }
96 |
97 | res, err := client.Get(os.Getenv("key"))
98 | if err != nil {
99 | _, _ = w.Write([]byte(err.Error()))
100 | return
101 | }
102 |
103 | result := strings.Split(res, ",")
104 | i := funk.RandomInt(0, len(result)-1)
105 | proxy := result[i]
106 | if len(proxy) == 0 {
107 | proxy = "ghp.ci"
108 | }
109 |
110 | newUri := fmt.Sprintf("http://%s/%s", proxy, strings.ReplaceAll(uri, "https:/", "https://"))
111 | response, err := http.Get(newUri)
112 | defer response.Body.Close()
113 | if err != nil {
114 | _, _ = w.Write([]byte(err.Error()))
115 | return
116 | }
117 |
118 | b, _ := ioutil.ReadAll(response.Body)
119 | _, _ = w.Write(b)
120 | }
121 |
122 | func turnstileVerify(response string) bool {
123 | body := `{"secret":"` + os.Getenv("secret") + `", "response":"` + response + `"}`
124 | re, _ := http.NewRequest(http.MethodPost, "https://challenges.cloudflare.com/turnstile/v0/siteverify", strings.NewReader(body))
125 | re.Header.Set("Content-Type", "application/json")
126 | res, err := http.DefaultClient.Do(re)
127 | defer res.Body.Close()
128 | if err != nil {
129 | logrus.Error("http client fail: " + err.Error())
130 | return false
131 | }
132 |
133 | result := struct {
134 | Success bool `json:"success"`
135 | ErrorCodes []string `json:"error-codes"`
136 | ChallengeTs string `json:"challenge_ts"`
137 | Hostname string `json:"hostname"`
138 | }{}
139 |
140 | b, _ := ioutil.ReadAll(res.Body)
141 | _ = json.Unmarshal(b, &result)
142 | if result.Success != true {
143 | return false
144 | }
145 |
146 | return true
147 | }
148 |
149 | func output(response *handlers.Response, w http.ResponseWriter) {
150 | b, _ := json.Marshal(response)
151 | _, _ = w.Write(b)
152 | }
153 |
--------------------------------------------------------------------------------
/mirror.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GitHub Mirror 文件加速
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
Github-Mirror
17 |
18 |
随机复制一个节点,添加到 git 地址前面即可
19 |
20 |
例如:
21 |
https://example.com
22 | /https://github.com/xiaoxuan6/github-mirror/blob/main/README.md
23 |
24 |
25 |
or:
26 |
27 | /https://github.com/xiaoxuan6/github-mirror/blob/main/README.md
28 |
29 |
30 |
31 |
39 |
40 |
47 |
50 |
51 |
52 |
53 |
54 |
169 |
170 |
171 |
--------------------------------------------------------------------------------
/dist/js/clipboard.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * clipboard.js v2.0.11
3 | * https://clipboardjs.com/
4 | *
5 | * Licensed MIT © Zeno Rocha
6 | */
7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1div{pointer-events:all;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:"Quicksand",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;width:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;position:relative;margin:0 0 10px;border-radius:5px;background:#1e1e1e;color:#fff;padding:10px 12px;font-size:14px;line-height:1.4}[id^=NotiflixNotifyWrap]>div:last-child{margin:0}[id^=NotiflixNotifyWrap]>div.nx-with-callback{cursor:pointer}[id^=NotiflixNotifyWrap]>div.nx-with-icon{padding:8px;min-height:56px}[id^=NotiflixNotifyWrap]>div.nx-paused{cursor:auto}[id^=NotiflixNotifyWrap]>div.nx-notify-click-to-close{cursor:pointer}[id^=NotiflixNotifyWrap]>div.nx-with-close-button{padding:10px 36px 10px 12px}[id^=NotiflixNotifyWrap]>div.nx-with-icon.nx-with-close-button{padding:6px 36px 6px 6px}[id^=NotiflixNotifyWrap]>div>span.nx-message{cursor:inherit;font-weight:normal;font-family:inherit!important;word-break:break-all;word-break:break-word}[id^=NotiflixNotifyWrap]>div>span.nx-close-button{cursor:pointer;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:absolute;right:8px;top:0;bottom:0;margin:auto;color:inherit;width:20px;height:20px}[id^=NotiflixNotifyWrap]>div>span.nx-close-button:hover{-webkit-transform:rotate(90deg);transform:rotate(90deg)}[id^=NotiflixNotifyWrap]>div>span.nx-close-button>svg{position:absolute;width:16px;height:16px;right:2px;top:2px}[id^=NotiflixNotifyWrap]>div>.nx-message-icon{position:absolute;width:40px;height:40px;font-size:30px;line-height:40px;text-align:center;left:8px;top:0;bottom:0;margin:auto;border-radius:inherit}[id^=NotiflixNotifyWrap]>div>.nx-message-icon-fa.nx-message-icon-fa-shadow{color:inherit;background:rgba(0,0,0,.15);-webkit-box-shadow:inset 0 0 34px rgba(0,0,0,.2);box-shadow:inset 0 0 34px rgba(0,0,0,.2);text-shadow:0 0 10px rgba(0,0,0,.3)}[id^=NotiflixNotifyWrap]>div>span.nx-with-icon{position:relative;float:left;width:calc(100% - 40px);margin:0 0 0 40px;padding:0 0 0 10px;-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixNotifyWrap]>div.nx-rtl-on>.nx-message-icon{left:auto;right:8px}[id^=NotiflixNotifyWrap]>div.nx-rtl-on>span.nx-with-icon{padding:0 10px 0 0;margin:0 40px 0 0}[id^=NotiflixNotifyWrap]>div.nx-rtl-on>span.nx-close-button{right:auto;left:8px}[id^=NotiflixNotifyWrap]>div.nx-with-icon.nx-with-close-button.nx-rtl-on{padding:6px 6px 6px 36px}[id^=NotiflixNotifyWrap]>div.nx-with-close-button.nx-rtl-on{padding:10px 12px 10px 36px}[id^=NotiflixNotifyOverlay].nx-with-animation,[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-fade{-webkit-animation:notify-animation-fade .3s ease-in-out 0s normal;animation:notify-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes notify-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-zoom{-webkit-animation:notify-animation-zoom .3s ease-in-out 0s normal;animation:notify-animation-zoom .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-zoom{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.05);transform:scale(1.05)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes notify-animation-zoom{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.05);transform:scale(1.05)}100%{-webkit-transform:scale(1);transform:scale(1)}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-right{-webkit-animation:notify-animation-from-right .3s ease-in-out 0s normal;animation:notify-animation-from-right .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-from-right{0%{right:-300px;opacity:0}50%{right:8px;opacity:1}100%{right:0;opacity:1}}@keyframes notify-animation-from-right{0%{right:-300px;opacity:0}50%{right:8px;opacity:1}100%{right:0;opacity:1}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-left{-webkit-animation:notify-animation-from-left .3s ease-in-out 0s normal;animation:notify-animation-from-left .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-from-left{0%{left:-300px;opacity:0}50%{left:8px;opacity:1}100%{left:0;opacity:1}}@keyframes notify-animation-from-left{0%{left:-300px;opacity:0}50%{left:8px;opacity:1}100%{left:0;opacity:1}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-top{-webkit-animation:notify-animation-from-top .3s ease-in-out 0s normal;animation:notify-animation-from-top .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-from-top{0%{top:-50px;opacity:0}50%{top:8px;opacity:1}100%{top:0;opacity:1}}@keyframes notify-animation-from-top{0%{top:-50px;opacity:0}50%{top:8px;opacity:1}100%{top:0;opacity:1}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-bottom{-webkit-animation:notify-animation-from-bottom .3s ease-in-out 0s normal;animation:notify-animation-from-bottom .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-from-bottom{0%{bottom:-50px;opacity:0}50%{bottom:8px;opacity:1}100%{bottom:0;opacity:1}}@keyframes notify-animation-from-bottom{0%{bottom:-50px;opacity:0}50%{bottom:8px;opacity:1}100%{bottom:0;opacity:1}}[id^=NotiflixNotifyOverlay].nx-with-animation.nx-remove,[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-fade.nx-remove{opacity:0;-webkit-animation:notify-remove-fade .3s ease-in-out 0s normal;animation:notify-remove-fade .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-fade{0%{opacity:1}100%{opacity:0}}@keyframes notify-remove-fade{0%{opacity:1}100%{opacity:0}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-zoom.nx-remove{-webkit-transform:scale(0);transform:scale(0);-webkit-animation:notify-remove-zoom .3s ease-in-out 0s normal;animation:notify-remove-zoom .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-zoom{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.05);transform:scale(1.05)}100%{-webkit-transform:scale(0);transform:scale(0)}}@keyframes notify-remove-zoom{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.05);transform:scale(1.05)}100%{-webkit-transform:scale(0);transform:scale(0)}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-top.nx-remove{opacity:0;-webkit-animation:notify-remove-to-top .3s ease-in-out 0s normal;animation:notify-remove-to-top .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-to-top{0%{top:0;opacity:1}50%{top:8px;opacity:1}100%{top:-50px;opacity:0}}@keyframes notify-remove-to-top{0%{top:0;opacity:1}50%{top:8px;opacity:1}100%{top:-50px;opacity:0}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-right.nx-remove{opacity:0;-webkit-animation:notify-remove-to-right .3s ease-in-out 0s normal;animation:notify-remove-to-right .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-to-right{0%{right:0;opacity:1}50%{right:8px;opacity:1}100%{right:-300px;opacity:0}}@keyframes notify-remove-to-right{0%{right:0;opacity:1}50%{right:8px;opacity:1}100%{right:-300px;opacity:0}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-bottom.nx-remove{opacity:0;-webkit-animation:notify-remove-to-bottom .3s ease-in-out 0s normal;animation:notify-remove-to-bottom .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-to-bottom{0%{bottom:0;opacity:1}50%{bottom:8px;opacity:1}100%{bottom:-50px;opacity:0}}@keyframes notify-remove-to-bottom{0%{bottom:0;opacity:1}50%{bottom:8px;opacity:1}100%{bottom:-50px;opacity:0}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-left.nx-remove{opacity:0;-webkit-animation:notify-remove-to-left .3s ease-in-out 0s normal;animation:notify-remove-to-left .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-to-left{0%{left:0;opacity:1}50%{left:8px;opacity:1}100%{left:-300px;opacity:0}}@keyframes notify-remove-to-left{0%{left:0;opacity:1}50%{left:8px;opacity:1}100%{left:-300px;opacity:0}}[id^=NotiflixReportWrap]{position:fixed;z-index:4002;width:100%;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Quicksand",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;left:0;top:0;padding:10px;color:#1e1e1e;border-radius:25px;background:transparent;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}[id^=NotiflixReportWrap] *{-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixReportWrap]>div[class*="-overlay"]{width:100%;height:100%;left:0;top:0;background:rgba(255,255,255,.5);position:fixed;z-index:0}[id^=NotiflixReportWrap]>div.nx-report-click-to-close{cursor:pointer}[id^=NotiflixReportWrap]>div[class*="-content"]{width:320px;max-width:100%;max-height:96vh;overflow-x:hidden;overflow-y:auto;border-radius:inherit;padding:10px;-webkit-filter:drop-shadow(0 0 5px rgba(0,0,0,0.05));filter:drop-shadow(0 0 5px rgba(0, 0, 0, .05));border:1px solid rgba(0,0,0,.03);background:#f8f8f8;position:relative;z-index:1}[id^=NotiflixReportWrap]>div[class*="-content"]::-webkit-scrollbar{width:0;height:0}[id^=NotiflixReportWrap]>div[class*="-content"]::-webkit-scrollbar-thumb{background:transparent}[id^=NotiflixReportWrap]>div[class*="-content"]::-webkit-scrollbar-track{background:transparent}[id^=NotiflixReportWrap]>div[class*="-content"]>div[class$="-icon"]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:110px;height:110px;display:block;margin:6px auto 12px}[id^=NotiflixReportWrap]>div[class*="-content"]>div[class$="-icon"] svg{min-width:100%;max-width:100%;height:auto}[id^=NotiflixReportWrap]>*>h5{word-break:break-all;word-break:break-word;font-family:inherit!important;font-size:16px;font-weight:500;line-height:1.4;margin:0 0 10px;padding:0 0 10px;border-bottom:1px solid rgba(0,0,0,.1);float:left;width:100%;text-align:center}[id^=NotiflixReportWrap]>*>p{word-break:break-all;word-break:break-word;font-family:inherit!important;font-size:13px;line-height:1.4;font-weight:normal;float:left;width:100%;padding:0 10px;margin:0 0 10px}[id^=NotiflixReportWrap] a#NXReportButton{word-break:break-all;word-break:break-word;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:inherit!important;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out;cursor:pointer;float:right;padding:7px 17px;background:#32c682;font-size:14px;line-height:1.4;font-weight:500;border-radius:inherit!important;color:#fff}[id^=NotiflixReportWrap] a#NXReportButton:hover{-webkit-box-shadow:inset 0 -60px 5px -5px rgba(0,0,0,.25);box-shadow:inset 0 -60px 5px -5px rgba(0,0,0,.25)}[id^=NotiflixReportWrap].nx-rtl-on a#NXReportButton{float:left}[id^=NotiflixReportWrap]>div[class*="-overlay"].nx-with-animation{-webkit-animation:report-overlay-animation .3s ease-in-out 0s normal;animation:report-overlay-animation .3s ease-in-out 0s normal}@-webkit-keyframes report-overlay-animation{0%{opacity:0}100%{opacity:1}}@keyframes report-overlay-animation{0%{opacity:0}100%{opacity:1}}[id^=NotiflixReportWrap]>div[class*="-content"].nx-with-animation.nx-fade{-webkit-animation:report-animation-fade .3s ease-in-out 0s normal;animation:report-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes report-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes report-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixReportWrap]>div[class*="-content"].nx-with-animation.nx-zoom{-webkit-animation:report-animation-zoom .3s ease-in-out 0s normal;animation:report-animation-zoom .3s ease-in-out 0s normal}@-webkit-keyframes report-animation-zoom{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}50%{opacity:1;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes report-animation-zoom{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}50%{opacity:1;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}[id^=NotiflixReportWrap].nx-remove>div[class*="-overlay"].nx-with-animation{opacity:0;-webkit-animation:report-overlay-animation-remove .3s ease-in-out 0s normal;animation:report-overlay-animation-remove .3s ease-in-out 0s normal}@-webkit-keyframes report-overlay-animation-remove{0%{opacity:1}100%{opacity:0}}@keyframes report-overlay-animation-remove{0%{opacity:1}100%{opacity:0}}[id^=NotiflixReportWrap].nx-remove>div[class*="-content"].nx-with-animation.nx-fade{opacity:0;-webkit-animation:report-animation-fade-remove .3s ease-in-out 0s normal;animation:report-animation-fade-remove .3s ease-in-out 0s normal}@-webkit-keyframes report-animation-fade-remove{0%{opacity:1}100%{opacity:0}}@keyframes report-animation-fade-remove{0%{opacity:1}100%{opacity:0}}[id^=NotiflixReportWrap].nx-remove>div[class*="-content"].nx-with-animation.nx-zoom{opacity:0;-webkit-animation:report-animation-zoom-remove .3s ease-in-out 0s normal;animation:report-animation-zoom-remove .3s ease-in-out 0s normal}@-webkit-keyframes report-animation-zoom-remove{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}50%{opacity:.5;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@keyframes report-animation-zoom-remove{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}50%{opacity:.5;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}[id^=NotiflixConfirmWrap]{position:fixed;z-index:4003;width:100%;height:100%;left:0;top:0;padding:10px;-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent;font-family:"Quicksand",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}[id^=NotiflixConfirmWrap].nx-position-center-top{-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start}[id^=NotiflixConfirmWrap].nx-position-center-bottom{-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end}[id^=NotiflixConfirmWrap].nx-position-left-top{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start}[id^=NotiflixConfirmWrap].nx-position-left-center{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start}[id^=NotiflixConfirmWrap].nx-position-left-bottom{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end}[id^=NotiflixConfirmWrap].nx-position-right-top{-webkit-box-align:end;-webkit-align-items:flex-end;-ms-flex-align:end;align-items:flex-end;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start}[id^=NotiflixConfirmWrap].nx-position-right-center{-webkit-box-align:end;-webkit-align-items:flex-end;-ms-flex-align:end;align-items:flex-end}[id^=NotiflixConfirmWrap].nx-position-right-bottom{-webkit-box-align:end;-webkit-align-items:flex-end;-ms-flex-align:end;align-items:flex-end;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end}[id^=NotiflixConfirmWrap] *{-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixConfirmWrap]>div[class*="-overlay"]{width:100%;height:100%;left:0;top:0;background:rgba(255,255,255,.5);position:fixed;z-index:0}[id^=NotiflixConfirmWrap]>div[class*="-overlay"].nx-with-animation{-webkit-animation:confirm-overlay-animation .3s ease-in-out 0s normal;animation:confirm-overlay-animation .3s ease-in-out 0s normal}@-webkit-keyframes confirm-overlay-animation{0%{opacity:0}100%{opacity:1}}@keyframes confirm-overlay-animation{0%{opacity:0}100%{opacity:1}}[id^=NotiflixConfirmWrap].nx-remove>div[class*="-overlay"].nx-with-animation{opacity:0;-webkit-animation:confirm-overlay-animation-remove .3s ease-in-out 0s normal;animation:confirm-overlay-animation-remove .3s ease-in-out 0s normal}@-webkit-keyframes confirm-overlay-animation-remove{0%{opacity:1}100%{opacity:0}}@keyframes confirm-overlay-animation-remove{0%{opacity:1}100%{opacity:0}}[id^=NotiflixConfirmWrap]>div[class*="-content"]{width:300px;max-width:100%;max-height:96vh;overflow-x:hidden;overflow-y:auto;border-radius:25px;padding:10px;margin:0;-webkit-filter:drop-shadow(0 0 5px rgba(0,0,0,0.05));filter:drop-shadow(0 0 5px rgba(0, 0, 0, .05));background:#f8f8f8;color:#1e1e1e;position:relative;z-index:1;text-align:center}[id^=NotiflixConfirmWrap]>div[class*="-content"]::-webkit-scrollbar{width:0;height:0}[id^=NotiflixConfirmWrap]>div[class*="-content"]::-webkit-scrollbar-thumb{background:transparent}[id^=NotiflixConfirmWrap]>div[class*="-content"]::-webkit-scrollbar-track{background:transparent}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]{float:left;width:100%;text-align:inherit}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]>h5{float:left;width:100%;margin:0;padding:0 0 10px;border-bottom:1px solid rgba(0,0,0,.1);color:#32c682;font-family:inherit!important;font-size:16px;line-height:1.4;font-weight:500;text-align:inherit}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]>div{font-family:inherit!important;margin:15px 0 20px;padding:0 10px;float:left;width:100%;font-size:14px;line-height:1.4;font-weight:normal;color:inherit;text-align:inherit}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]>div>div{font-family:inherit!important;float:left;width:100%;margin:15px 0 0;padding:0}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]>div>div>input{font-family:inherit!important;float:left;width:100%;height:40px;margin:0;padding:0 15px;border:1px solid rgba(0,0,0,.1);border-radius:25px;font-size:14px;font-weight:normal;line-height:1;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out;text-align:left}[id^=NotiflixConfirmWrap].nx-rtl-on>div[class*="-content"]>div[class*="-head"]>div>div>input{text-align:right}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]>div>div>input:hover{border-color:rgba(0,0,0,.1)}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]>div>div>input:focus{border-color:rgba(0,0,0,.3)}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]>div>div>input.nx-validation-failure{border-color:#ff5549}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-head"]>div>div>input.nx-validation-success{border-color:#32c682}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-buttons"]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:inherit;float:left;width:100%;text-align:inherit}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-buttons"]>a{cursor:pointer;font-family:inherit!important;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out;float:left;width:48%;padding:9px 5px;border-radius:inherit!important;font-weight:500;font-size:15px;line-height:1.4;color:#f8f8f8;text-align:inherit}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-buttons"]>a.nx-confirm-button-ok{margin:0 2% 0 0;background:#32c682}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-buttons"]>a.nx-confirm-button-cancel{margin:0 0 0 2%;background:#a9a9a9}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-buttons"]>a.nx-full{margin:0;width:100%}[id^=NotiflixConfirmWrap]>div[class*="-content"]>div[class*="-buttons"]>a:hover{-webkit-box-shadow:inset 0 -60px 5px -5px rgba(0,0,0,.25);box-shadow:inset 0 -60px 5px -5px rgba(0,0,0,.25)}[id^=NotiflixConfirmWrap].nx-rtl-on>div[class*="-content"]>div[class*="-buttons"],[id^=NotiflixConfirmWrap].nx-rtl-on>div[class*="-content"]>div[class*="-buttons"]>a{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}[id^=NotiflixConfirmWrap].nx-with-animation.nx-fade>div[class*="-content"]{-webkit-animation:confirm-animation-fade .3s ease-in-out 0s normal;animation:confirm-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes confirm-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes confirm-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixConfirmWrap].nx-with-animation.nx-zoom>div[class*="-content"]{-webkit-animation:confirm-animation-zoom .3s ease-in-out 0s normal;animation:confirm-animation-zoom .3s ease-in-out 0s normal}@-webkit-keyframes confirm-animation-zoom{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}50%{opacity:1;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes confirm-animation-zoom{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}50%{opacity:1;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}[id^=NotiflixConfirmWrap].nx-with-animation.nx-fade.nx-remove>div[class*="-content"]{opacity:0;-webkit-animation:confirm-animation-fade-remove .3s ease-in-out 0s normal;animation:confirm-animation-fade-remove .3s ease-in-out 0s normal}@-webkit-keyframes confirm-animation-fade-remove{0%{opacity:1}100%{opacity:0}}@keyframes confirm-animation-fade-remove{0%{opacity:1}100%{opacity:0}}[id^=NotiflixConfirmWrap].nx-with-animation.nx-zoom.nx-remove>div[class*="-content"]{opacity:0;-webkit-animation:confirm-animation-zoom-remove .3s ease-in-out 0s normal;animation:confirm-animation-zoom-remove .3s ease-in-out 0s normal}@-webkit-keyframes confirm-animation-zoom-remove{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}50%{opacity:.5;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@keyframes confirm-animation-zoom-remove{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}50%{opacity:.5;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}[id^=NotiflixLoadingWrap]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:fixed;z-index:4000;width:100%;height:100%;left:0;top:0;right:0;bottom:0;margin:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;background:rgba(0,0,0,.8);font-family:"Quicksand",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}[id^=NotiflixLoadingWrap] *{-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixLoadingWrap].nx-loading-click-to-close{cursor:pointer}[id^=NotiflixLoadingWrap]>div[class*="-icon"]{width:60px;height:60px;position:relative;-webkit-transition:top .2s ease-in-out;-o-transition:top .2s ease-in-out;transition:top .2s ease-in-out;margin:0 auto}[id^=NotiflixLoadingWrap]>div[class*="-icon"] img,[id^=NotiflixLoadingWrap]>div[class*="-icon"] svg{max-width:unset;max-height:unset;width:100%;height:auto;position:absolute;left:0;top:0}[id^=NotiflixLoadingWrap]>p{position:relative;margin:10px auto 0;font-family:inherit!important;font-weight:normal;font-size:15px;line-height:1.4;padding:0 10px;width:100%;text-align:center}[id^=NotiflixLoadingWrap].nx-with-animation{-webkit-animation:loading-animation-fade .3s ease-in-out 0s normal;animation:loading-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes loading-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes loading-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixLoadingWrap].nx-with-animation.nx-remove{opacity:0;-webkit-animation:loading-animation-fade-remove .3s ease-in-out 0s normal;animation:loading-animation-fade-remove .3s ease-in-out 0s normal}@-webkit-keyframes loading-animation-fade-remove{0%{opacity:1}100%{opacity:0}}@keyframes loading-animation-fade-remove{0%{opacity:1}100%{opacity:0}}[id^=NotiflixLoadingWrap]>p.nx-loading-message-new{-webkit-animation:loading-new-message-fade .3s ease-in-out 0s normal;animation:loading-new-message-fade .3s ease-in-out 0s normal}@-webkit-keyframes loading-new-message-fade{0%{opacity:0}100%{opacity:1}}@keyframes loading-new-message-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixBlockWrap]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;z-index:1000;font-family:"Quicksand",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:rgba(255,255,255,.9);text-align:center;animation-duration:.4s;width:100%;height:100%;left:0;top:0;border-radius:inherit;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}[id^=NotiflixBlockWrap] *{-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixBlockWrap]>span[class*="-icon"]{display:block;width:45px;height:45px;position:relative;margin:0 auto}[id^=NotiflixBlockWrap]>span[class*="-icon"] svg{width:inherit;height:inherit}[id^=NotiflixBlockWrap]>span[class*="-message"]{position:relative;display:block;width:100%;margin:10px auto 0;padding:0 10px;font-family:inherit!important;font-weight:normal;font-size:14px;line-height:1.4}[id^=NotiflixBlockWrap].nx-with-animation{-webkit-animation:block-animation-fade .3s ease-in-out 0s normal;animation:block-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes block-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes block-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixBlockWrap].nx-with-animation.nx-remove{opacity:0;-webkit-animation:block-animation-fade-remove .3s ease-in-out 0s normal;animation:block-animation-fade-remove .3s ease-in-out 0s normal}@-webkit-keyframes block-animation-fade-remove{0%{opacity:1}100%{opacity:0}}@keyframes block-animation-fade-remove{0%{opacity:1}100%{opacity:0}}
4 |
--------------------------------------------------------------------------------
/dist/js/clipboard.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * clipboard.js v2.0.11
3 | * https://clipboardjs.com/
4 | *
5 | * Licensed MIT © Zeno Rocha
6 | */
7 | (function webpackUniversalModuleDefinition(root, factory) {
8 | if(typeof exports === 'object' && typeof module === 'object')
9 | module.exports = factory();
10 | else if(typeof define === 'function' && define.amd)
11 | define([], factory);
12 | else if(typeof exports === 'object')
13 | exports["ClipboardJS"] = factory();
14 | else
15 | root["ClipboardJS"] = factory();
16 | })(this, function() {
17 | return /******/ (function() { // webpackBootstrap
18 | /******/ var __webpack_modules__ = ({
19 |
20 | /***/ 686:
21 | /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
22 |
23 | "use strict";
24 |
25 | // EXPORTS
26 | __webpack_require__.d(__webpack_exports__, {
27 | "default": function() { return /* binding */ clipboard; }
28 | });
29 |
30 | // EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
31 | var tiny_emitter = __webpack_require__(279);
32 | var tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);
33 | // EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js
34 | var listen = __webpack_require__(370);
35 | var listen_default = /*#__PURE__*/__webpack_require__.n(listen);
36 | // EXTERNAL MODULE: ./node_modules/select/src/select.js
37 | var src_select = __webpack_require__(817);
38 | var select_default = /*#__PURE__*/__webpack_require__.n(src_select);
39 | ;// CONCATENATED MODULE: ./src/common/command.js
40 | /**
41 | * Executes a given operation type.
42 | * @param {String} type
43 | * @return {Boolean}
44 | */
45 | function command(type) {
46 | try {
47 | return document.execCommand(type);
48 | } catch (err) {
49 | return false;
50 | }
51 | }
52 | ;// CONCATENATED MODULE: ./src/actions/cut.js
53 |
54 |
55 | /**
56 | * Cut action wrapper.
57 | * @param {String|HTMLElement} target
58 | * @return {String}
59 | */
60 |
61 | var ClipboardActionCut = function ClipboardActionCut(target) {
62 | var selectedText = select_default()(target);
63 | command('cut');
64 | return selectedText;
65 | };
66 |
67 | /* harmony default export */ var actions_cut = (ClipboardActionCut);
68 | ;// CONCATENATED MODULE: ./src/common/create-fake-element.js
69 | /**
70 | * Creates a fake textarea element with a value.
71 | * @param {String} value
72 | * @return {HTMLElement}
73 | */
74 | function createFakeElement(value) {
75 | var isRTL = document.documentElement.getAttribute('dir') === 'rtl';
76 | var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS
77 |
78 | fakeElement.style.fontSize = '12pt'; // Reset box model
79 |
80 | fakeElement.style.border = '0';
81 | fakeElement.style.padding = '0';
82 | fakeElement.style.margin = '0'; // Move element out of screen horizontally
83 |
84 | fakeElement.style.position = 'absolute';
85 | fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically
86 |
87 | var yPosition = window.pageYOffset || document.documentElement.scrollTop;
88 | fakeElement.style.top = "".concat(yPosition, "px");
89 | fakeElement.setAttribute('readonly', '');
90 | fakeElement.value = value;
91 | return fakeElement;
92 | }
93 | ;// CONCATENATED MODULE: ./src/actions/copy.js
94 |
95 |
96 |
97 | /**
98 | * Create fake copy action wrapper using a fake element.
99 | * @param {String} target
100 | * @param {Object} options
101 | * @return {String}
102 | */
103 |
104 | var fakeCopyAction = function fakeCopyAction(value, options) {
105 | var fakeElement = createFakeElement(value);
106 | options.container.appendChild(fakeElement);
107 | var selectedText = select_default()(fakeElement);
108 | command('copy');
109 | fakeElement.remove();
110 | return selectedText;
111 | };
112 | /**
113 | * Copy action wrapper.
114 | * @param {String|HTMLElement} target
115 | * @param {Object} options
116 | * @return {String}
117 | */
118 |
119 |
120 | var ClipboardActionCopy = function ClipboardActionCopy(target) {
121 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
122 | container: document.body
123 | };
124 | var selectedText = '';
125 |
126 | if (typeof target === 'string') {
127 | selectedText = fakeCopyAction(target, options);
128 | } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {
129 | // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
130 | selectedText = fakeCopyAction(target.value, options);
131 | } else {
132 | selectedText = select_default()(target);
133 | command('copy');
134 | }
135 |
136 | return selectedText;
137 | };
138 |
139 | /* harmony default export */ var actions_copy = (ClipboardActionCopy);
140 | ;// CONCATENATED MODULE: ./src/actions/default.js
141 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
142 |
143 |
144 |
145 | /**
146 | * Inner function which performs selection from either `text` or `target`
147 | * properties and then executes copy or cut operations.
148 | * @param {Object} options
149 | */
150 |
151 | var ClipboardActionDefault = function ClipboardActionDefault() {
152 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
153 | // Defines base properties passed from constructor.
154 | var _options$action = options.action,
155 | action = _options$action === void 0 ? 'copy' : _options$action,
156 | container = options.container,
157 | target = options.target,
158 | text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.
159 |
160 | if (action !== 'copy' && action !== 'cut') {
161 | throw new Error('Invalid "action" value, use either "copy" or "cut"');
162 | } // Sets the `target` property using an element that will be have its content copied.
163 |
164 |
165 | if (target !== undefined) {
166 | if (target && _typeof(target) === 'object' && target.nodeType === 1) {
167 | if (action === 'copy' && target.hasAttribute('disabled')) {
168 | throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
169 | }
170 |
171 | if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
172 | throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
173 | }
174 | } else {
175 | throw new Error('Invalid "target" value, use a valid Element');
176 | }
177 | } // Define selection strategy based on `text` property.
178 |
179 |
180 | if (text) {
181 | return actions_copy(text, {
182 | container: container
183 | });
184 | } // Defines which selection strategy based on `target` property.
185 |
186 |
187 | if (target) {
188 | return action === 'cut' ? actions_cut(target) : actions_copy(target, {
189 | container: container
190 | });
191 | }
192 | };
193 |
194 | /* harmony default export */ var actions_default = (ClipboardActionDefault);
195 | ;// CONCATENATED MODULE: ./src/clipboard.js
196 | function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); }
197 |
198 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
199 |
200 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
201 |
202 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
203 |
204 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
205 |
206 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
207 |
208 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
209 |
210 | function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
211 |
212 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
213 |
214 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
215 |
216 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
217 |
218 |
219 |
220 |
221 |
222 |
223 | /**
224 | * Helper function to retrieve attribute value.
225 | * @param {String} suffix
226 | * @param {Element} element
227 | */
228 |
229 | function getAttributeValue(suffix, element) {
230 | var attribute = "data-clipboard-".concat(suffix);
231 |
232 | if (!element.hasAttribute(attribute)) {
233 | return;
234 | }
235 |
236 | return element.getAttribute(attribute);
237 | }
238 | /**
239 | * Base class which takes one or more elements, adds event listeners to them,
240 | * and instantiates a new `ClipboardAction` on each click.
241 | */
242 |
243 |
244 | var Clipboard = /*#__PURE__*/function (_Emitter) {
245 | _inherits(Clipboard, _Emitter);
246 |
247 | var _super = _createSuper(Clipboard);
248 |
249 | /**
250 | * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
251 | * @param {Object} options
252 | */
253 | function Clipboard(trigger, options) {
254 | var _this;
255 |
256 | _classCallCheck(this, Clipboard);
257 |
258 | _this = _super.call(this);
259 |
260 | _this.resolveOptions(options);
261 |
262 | _this.listenClick(trigger);
263 |
264 | return _this;
265 | }
266 | /**
267 | * Defines if attributes would be resolved using internal setter functions
268 | * or custom functions that were passed in the constructor.
269 | * @param {Object} options
270 | */
271 |
272 |
273 | _createClass(Clipboard, [{
274 | key: "resolveOptions",
275 | value: function resolveOptions() {
276 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
277 | this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
278 | this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
279 | this.text = typeof options.text === 'function' ? options.text : this.defaultText;
280 | this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;
281 | }
282 | /**
283 | * Adds a click event listener to the passed trigger.
284 | * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
285 | */
286 |
287 | }, {
288 | key: "listenClick",
289 | value: function listenClick(trigger) {
290 | var _this2 = this;
291 |
292 | this.listener = listen_default()(trigger, 'click', function (e) {
293 | return _this2.onClick(e);
294 | });
295 | }
296 | /**
297 | * Defines a new `ClipboardAction` on each click event.
298 | * @param {Event} e
299 | */
300 |
301 | }, {
302 | key: "onClick",
303 | value: function onClick(e) {
304 | var trigger = e.delegateTarget || e.currentTarget;
305 | var action = this.action(trigger) || 'copy';
306 | var text = actions_default({
307 | action: action,
308 | container: this.container,
309 | target: this.target(trigger),
310 | text: this.text(trigger)
311 | }); // Fires an event based on the copy operation result.
312 |
313 | this.emit(text ? 'success' : 'error', {
314 | action: action,
315 | text: text,
316 | trigger: trigger,
317 | clearSelection: function clearSelection() {
318 | if (trigger) {
319 | trigger.focus();
320 | }
321 |
322 | window.getSelection().removeAllRanges();
323 | }
324 | });
325 | }
326 | /**
327 | * Default `action` lookup function.
328 | * @param {Element} trigger
329 | */
330 |
331 | }, {
332 | key: "defaultAction",
333 | value: function defaultAction(trigger) {
334 | return getAttributeValue('action', trigger);
335 | }
336 | /**
337 | * Default `target` lookup function.
338 | * @param {Element} trigger
339 | */
340 |
341 | }, {
342 | key: "defaultTarget",
343 | value: function defaultTarget(trigger) {
344 | var selector = getAttributeValue('target', trigger);
345 |
346 | if (selector) {
347 | return document.querySelector(selector);
348 | }
349 | }
350 | /**
351 | * Allow fire programmatically a copy action
352 | * @param {String|HTMLElement} target
353 | * @param {Object} options
354 | * @returns Text copied.
355 | */
356 |
357 | }, {
358 | key: "defaultText",
359 |
360 | /**
361 | * Default `text` lookup function.
362 | * @param {Element} trigger
363 | */
364 | value: function defaultText(trigger) {
365 | return getAttributeValue('text', trigger);
366 | }
367 | /**
368 | * Destroy lifecycle.
369 | */
370 |
371 | }, {
372 | key: "destroy",
373 | value: function destroy() {
374 | this.listener.destroy();
375 | }
376 | }], [{
377 | key: "copy",
378 | value: function copy(target) {
379 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
380 | container: document.body
381 | };
382 | return actions_copy(target, options);
383 | }
384 | /**
385 | * Allow fire programmatically a cut action
386 | * @param {String|HTMLElement} target
387 | * @returns Text cutted.
388 | */
389 |
390 | }, {
391 | key: "cut",
392 | value: function cut(target) {
393 | return actions_cut(target);
394 | }
395 | /**
396 | * Returns the support of the given action, or all actions if no action is
397 | * given.
398 | * @param {String} [action]
399 | */
400 |
401 | }, {
402 | key: "isSupported",
403 | value: function isSupported() {
404 | var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
405 | var actions = typeof action === 'string' ? [action] : action;
406 | var support = !!document.queryCommandSupported;
407 | actions.forEach(function (action) {
408 | support = support && !!document.queryCommandSupported(action);
409 | });
410 | return support;
411 | }
412 | }]);
413 |
414 | return Clipboard;
415 | }((tiny_emitter_default()));
416 |
417 | /* harmony default export */ var clipboard = (Clipboard);
418 |
419 | /***/ }),
420 |
421 | /***/ 828:
422 | /***/ (function(module) {
423 |
424 | var DOCUMENT_NODE_TYPE = 9;
425 |
426 | /**
427 | * A polyfill for Element.matches()
428 | */
429 | if (typeof Element !== 'undefined' && !Element.prototype.matches) {
430 | var proto = Element.prototype;
431 |
432 | proto.matches = proto.matchesSelector ||
433 | proto.mozMatchesSelector ||
434 | proto.msMatchesSelector ||
435 | proto.oMatchesSelector ||
436 | proto.webkitMatchesSelector;
437 | }
438 |
439 | /**
440 | * Finds the closest parent that matches a selector.
441 | *
442 | * @param {Element} element
443 | * @param {String} selector
444 | * @return {Function}
445 | */
446 | function closest (element, selector) {
447 | while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
448 | if (typeof element.matches === 'function' &&
449 | element.matches(selector)) {
450 | return element;
451 | }
452 | element = element.parentNode;
453 | }
454 | }
455 |
456 | module.exports = closest;
457 |
458 |
459 | /***/ }),
460 |
461 | /***/ 438:
462 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
463 |
464 | var closest = __webpack_require__(828);
465 |
466 | /**
467 | * Delegates event to a selector.
468 | *
469 | * @param {Element} element
470 | * @param {String} selector
471 | * @param {String} type
472 | * @param {Function} callback
473 | * @param {Boolean} useCapture
474 | * @return {Object}
475 | */
476 | function _delegate(element, selector, type, callback, useCapture) {
477 | var listenerFn = listener.apply(this, arguments);
478 |
479 | element.addEventListener(type, listenerFn, useCapture);
480 |
481 | return {
482 | destroy: function() {
483 | element.removeEventListener(type, listenerFn, useCapture);
484 | }
485 | }
486 | }
487 |
488 | /**
489 | * Delegates event to a selector.
490 | *
491 | * @param {Element|String|Array} [elements]
492 | * @param {String} selector
493 | * @param {String} type
494 | * @param {Function} callback
495 | * @param {Boolean} useCapture
496 | * @return {Object}
497 | */
498 | function delegate(elements, selector, type, callback, useCapture) {
499 | // Handle the regular Element usage
500 | if (typeof elements.addEventListener === 'function') {
501 | return _delegate.apply(null, arguments);
502 | }
503 |
504 | // Handle Element-less usage, it defaults to global delegation
505 | if (typeof type === 'function') {
506 | // Use `document` as the first parameter, then apply arguments
507 | // This is a short way to .unshift `arguments` without running into deoptimizations
508 | return _delegate.bind(null, document).apply(null, arguments);
509 | }
510 |
511 | // Handle Selector-based usage
512 | if (typeof elements === 'string') {
513 | elements = document.querySelectorAll(elements);
514 | }
515 |
516 | // Handle Array-like based usage
517 | return Array.prototype.map.call(elements, function (element) {
518 | return _delegate(element, selector, type, callback, useCapture);
519 | });
520 | }
521 |
522 | /**
523 | * Finds closest match and invokes callback.
524 | *
525 | * @param {Element} element
526 | * @param {String} selector
527 | * @param {String} type
528 | * @param {Function} callback
529 | * @return {Function}
530 | */
531 | function listener(element, selector, type, callback) {
532 | return function(e) {
533 | e.delegateTarget = closest(e.target, selector);
534 |
535 | if (e.delegateTarget) {
536 | callback.call(element, e);
537 | }
538 | }
539 | }
540 |
541 | module.exports = delegate;
542 |
543 |
544 | /***/ }),
545 |
546 | /***/ 879:
547 | /***/ (function(__unused_webpack_module, exports) {
548 |
549 | /**
550 | * Check if argument is a HTML element.
551 | *
552 | * @param {Object} value
553 | * @return {Boolean}
554 | */
555 | exports.node = function(value) {
556 | return value !== undefined
557 | && value instanceof HTMLElement
558 | && value.nodeType === 1;
559 | };
560 |
561 | /**
562 | * Check if argument is a list of HTML elements.
563 | *
564 | * @param {Object} value
565 | * @return {Boolean}
566 | */
567 | exports.nodeList = function(value) {
568 | var type = Object.prototype.toString.call(value);
569 |
570 | return value !== undefined
571 | && (type === '[object NodeList]' || type === '[object HTMLCollection]')
572 | && ('length' in value)
573 | && (value.length === 0 || exports.node(value[0]));
574 | };
575 |
576 | /**
577 | * Check if argument is a string.
578 | *
579 | * @param {Object} value
580 | * @return {Boolean}
581 | */
582 | exports.string = function(value) {
583 | return typeof value === 'string'
584 | || value instanceof String;
585 | };
586 |
587 | /**
588 | * Check if argument is a function.
589 | *
590 | * @param {Object} value
591 | * @return {Boolean}
592 | */
593 | exports.fn = function(value) {
594 | var type = Object.prototype.toString.call(value);
595 |
596 | return type === '[object Function]';
597 | };
598 |
599 |
600 | /***/ }),
601 |
602 | /***/ 370:
603 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
604 |
605 | var is = __webpack_require__(879);
606 | var delegate = __webpack_require__(438);
607 |
608 | /**
609 | * Validates all params and calls the right
610 | * listener function based on its target type.
611 | *
612 | * @param {String|HTMLElement|HTMLCollection|NodeList} target
613 | * @param {String} type
614 | * @param {Function} callback
615 | * @return {Object}
616 | */
617 | function listen(target, type, callback) {
618 | if (!target && !type && !callback) {
619 | throw new Error('Missing required arguments');
620 | }
621 |
622 | if (!is.string(type)) {
623 | throw new TypeError('Second argument must be a String');
624 | }
625 |
626 | if (!is.fn(callback)) {
627 | throw new TypeError('Third argument must be a Function');
628 | }
629 |
630 | if (is.node(target)) {
631 | return listenNode(target, type, callback);
632 | }
633 | else if (is.nodeList(target)) {
634 | return listenNodeList(target, type, callback);
635 | }
636 | else if (is.string(target)) {
637 | return listenSelector(target, type, callback);
638 | }
639 | else {
640 | throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
641 | }
642 | }
643 |
644 | /**
645 | * Adds an event listener to a HTML element
646 | * and returns a remove listener function.
647 | *
648 | * @param {HTMLElement} node
649 | * @param {String} type
650 | * @param {Function} callback
651 | * @return {Object}
652 | */
653 | function listenNode(node, type, callback) {
654 | node.addEventListener(type, callback);
655 |
656 | return {
657 | destroy: function() {
658 | node.removeEventListener(type, callback);
659 | }
660 | }
661 | }
662 |
663 | /**
664 | * Add an event listener to a list of HTML elements
665 | * and returns a remove listener function.
666 | *
667 | * @param {NodeList|HTMLCollection} nodeList
668 | * @param {String} type
669 | * @param {Function} callback
670 | * @return {Object}
671 | */
672 | function listenNodeList(nodeList, type, callback) {
673 | Array.prototype.forEach.call(nodeList, function(node) {
674 | node.addEventListener(type, callback);
675 | });
676 |
677 | return {
678 | destroy: function() {
679 | Array.prototype.forEach.call(nodeList, function(node) {
680 | node.removeEventListener(type, callback);
681 | });
682 | }
683 | }
684 | }
685 |
686 | /**
687 | * Add an event listener to a selector
688 | * and returns a remove listener function.
689 | *
690 | * @param {String} selector
691 | * @param {String} type
692 | * @param {Function} callback
693 | * @return {Object}
694 | */
695 | function listenSelector(selector, type, callback) {
696 | return delegate(document.body, selector, type, callback);
697 | }
698 |
699 | module.exports = listen;
700 |
701 |
702 | /***/ }),
703 |
704 | /***/ 817:
705 | /***/ (function(module) {
706 |
707 | function select(element) {
708 | var selectedText;
709 |
710 | if (element.nodeName === 'SELECT') {
711 | element.focus();
712 |
713 | selectedText = element.value;
714 | }
715 | else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
716 | var isReadOnly = element.hasAttribute('readonly');
717 |
718 | if (!isReadOnly) {
719 | element.setAttribute('readonly', '');
720 | }
721 |
722 | element.select();
723 | element.setSelectionRange(0, element.value.length);
724 |
725 | if (!isReadOnly) {
726 | element.removeAttribute('readonly');
727 | }
728 |
729 | selectedText = element.value;
730 | }
731 | else {
732 | if (element.hasAttribute('contenteditable')) {
733 | element.focus();
734 | }
735 |
736 | var selection = window.getSelection();
737 | var range = document.createRange();
738 |
739 | range.selectNodeContents(element);
740 | selection.removeAllRanges();
741 | selection.addRange(range);
742 |
743 | selectedText = selection.toString();
744 | }
745 |
746 | return selectedText;
747 | }
748 |
749 | module.exports = select;
750 |
751 |
752 | /***/ }),
753 |
754 | /***/ 279:
755 | /***/ (function(module) {
756 |
757 | function E () {
758 | // Keep this empty so it's easier to inherit from
759 | // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
760 | }
761 |
762 | E.prototype = {
763 | on: function (name, callback, ctx) {
764 | var e = this.e || (this.e = {});
765 |
766 | (e[name] || (e[name] = [])).push({
767 | fn: callback,
768 | ctx: ctx
769 | });
770 |
771 | return this;
772 | },
773 |
774 | once: function (name, callback, ctx) {
775 | var self = this;
776 | function listener () {
777 | self.off(name, listener);
778 | callback.apply(ctx, arguments);
779 | };
780 |
781 | listener._ = callback
782 | return this.on(name, listener, ctx);
783 | },
784 |
785 | emit: function (name) {
786 | var data = [].slice.call(arguments, 1);
787 | var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
788 | var i = 0;
789 | var len = evtArr.length;
790 |
791 | for (i; i < len; i++) {
792 | evtArr[i].fn.apply(evtArr[i].ctx, data);
793 | }
794 |
795 | return this;
796 | },
797 |
798 | off: function (name, callback) {
799 | var e = this.e || (this.e = {});
800 | var evts = e[name];
801 | var liveEvents = [];
802 |
803 | if (evts && callback) {
804 | for (var i = 0, len = evts.length; i < len; i++) {
805 | if (evts[i].fn !== callback && evts[i].fn._ !== callback)
806 | liveEvents.push(evts[i]);
807 | }
808 | }
809 |
810 | // Remove event from queue to prevent memory leak
811 | // Suggested by https://github.com/lazd
812 | // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
813 |
814 | (liveEvents.length)
815 | ? e[name] = liveEvents
816 | : delete e[name];
817 |
818 | return this;
819 | }
820 | };
821 |
822 | module.exports = E;
823 | module.exports.TinyEmitter = E;
824 |
825 |
826 | /***/ })
827 |
828 | /******/ });
829 | /************************************************************************/
830 | /******/ // The module cache
831 | /******/ var __webpack_module_cache__ = {};
832 | /******/
833 | /******/ // The require function
834 | /******/ function __webpack_require__(moduleId) {
835 | /******/ // Check if module is in cache
836 | /******/ if(__webpack_module_cache__[moduleId]) {
837 | /******/ return __webpack_module_cache__[moduleId].exports;
838 | /******/ }
839 | /******/ // Create a new module (and put it into the cache)
840 | /******/ var module = __webpack_module_cache__[moduleId] = {
841 | /******/ // no module.id needed
842 | /******/ // no module.loaded needed
843 | /******/ exports: {}
844 | /******/ };
845 | /******/
846 | /******/ // Execute the module function
847 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
848 | /******/
849 | /******/ // Return the exports of the module
850 | /******/ return module.exports;
851 | /******/ }
852 | /******/
853 | /************************************************************************/
854 | /******/ /* webpack/runtime/compat get default export */
855 | /******/ !function() {
856 | /******/ // getDefaultExport function for compatibility with non-harmony modules
857 | /******/ __webpack_require__.n = function(module) {
858 | /******/ var getter = module && module.__esModule ?
859 | /******/ function() { return module['default']; } :
860 | /******/ function() { return module; };
861 | /******/ __webpack_require__.d(getter, { a: getter });
862 | /******/ return getter;
863 | /******/ };
864 | /******/ }();
865 | /******/
866 | /******/ /* webpack/runtime/define property getters */
867 | /******/ !function() {
868 | /******/ // define getter functions for harmony exports
869 | /******/ __webpack_require__.d = function(exports, definition) {
870 | /******/ for(var key in definition) {
871 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
872 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
873 | /******/ }
874 | /******/ }
875 | /******/ };
876 | /******/ }();
877 | /******/
878 | /******/ /* webpack/runtime/hasOwnProperty shorthand */
879 | /******/ !function() {
880 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
881 | /******/ }();
882 | /******/
883 | /************************************************************************/
884 | /******/ // module exports must be returned from runtime so entry inlining is disabled
885 | /******/ // startup
886 | /******/ // Load entry module and return exports
887 | /******/ return __webpack_require__(686);
888 | /******/ })()
889 | .default;
890 | });
--------------------------------------------------------------------------------
/dist/js/notiflix-3.2.6.min.js:
--------------------------------------------------------------------------------
1 | /* Notiflix (https://notiflix.github.io) - Version: 3.2.6 - Author: Furkan (https://github.com/furcan) - Copyright 2019 - 2023 Notiflix, MIT Licence (https://opensource.org/licenses/MIT) */
2 |
3 | (function(t,e){"function"==typeof define&&define.amd?define([],function(){return e(t)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(t):t.Notiflix=e(t)})("undefined"==typeof global?"undefined"==typeof window?this:window:global,function(t){'use strict';if("undefined"==typeof t&&"undefined"==typeof t.document)return!1;var e,a,n,i,o,s="\n\nVisit documentation page to learn more: https://notiflix.github.io/documentation",r="-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif",l={Success:"Success",Failure:"Failure",Warning:"Warning",Info:"Info"},c={wrapID:"NotiflixNotifyWrap",overlayID:"NotiflixNotifyOverlay",width:"280px",position:"right-top",distance:"10px",opacity:1,borderRadius:"5px",rtl:!1,timeout:3e3,messageMaxLength:110,backOverlay:!1,backOverlayColor:"rgba(0,0,0,0.5)",plainText:!0,showOnlyTheLastOne:!1,clickToClose:!1,pauseOnHover:!0,ID:"NotiflixNotify",className:"notiflix-notify",zindex:4001,fontFamily:"Quicksand",fontSize:"13px",cssAnimation:!0,cssAnimationDuration:400,cssAnimationStyle:"fade",closeButton:!1,useIcon:!0,useFontAwesome:!1,fontAwesomeIconStyle:"basic",fontAwesomeIconSize:"34px",success:{background:"#32c682",textColor:"#fff",childClassName:"notiflix-notify-success",notiflixIconColor:"rgba(0,0,0,0.2)",fontAwesomeClassName:"fas fa-check-circle",fontAwesomeIconColor:"rgba(0,0,0,0.2)",backOverlayColor:"rgba(50,198,130,0.2)"},failure:{background:"#ff5549",textColor:"#fff",childClassName:"notiflix-notify-failure",notiflixIconColor:"rgba(0,0,0,0.2)",fontAwesomeClassName:"fas fa-times-circle",fontAwesomeIconColor:"rgba(0,0,0,0.2)",backOverlayColor:"rgba(255,85,73,0.2)"},warning:{background:"#eebf31",textColor:"#fff",childClassName:"notiflix-notify-warning",notiflixIconColor:"rgba(0,0,0,0.2)",fontAwesomeClassName:"fas fa-exclamation-circle",fontAwesomeIconColor:"rgba(0,0,0,0.2)",backOverlayColor:"rgba(238,191,49,0.2)"},info:{background:"#26c0d3",textColor:"#fff",childClassName:"notiflix-notify-info",notiflixIconColor:"rgba(0,0,0,0.2)",fontAwesomeClassName:"fas fa-info-circle",fontAwesomeIconColor:"rgba(0,0,0,0.2)",backOverlayColor:"rgba(38,192,211,0.2)"}},m={Success:"Success",Failure:"Failure",Warning:"Warning",Info:"Info"},p={ID:"NotiflixReportWrap",className:"notiflix-report",width:"320px",backgroundColor:"#f8f8f8",borderRadius:"25px",rtl:!1,zindex:4002,backOverlay:!0,backOverlayColor:"rgba(0,0,0,0.5)",backOverlayClickToClose:!1,fontFamily:"Quicksand",svgSize:"110px",plainText:!0,titleFontSize:"16px",titleMaxLength:34,messageFontSize:"13px",messageMaxLength:400,buttonFontSize:"14px",buttonMaxLength:34,cssAnimation:!0,cssAnimationDuration:360,cssAnimationStyle:"fade",success:{svgColor:"#32c682",titleColor:"#1e1e1e",messageColor:"#242424",buttonBackground:"#32c682",buttonColor:"#fff",backOverlayColor:"rgba(50,198,130,0.2)"},failure:{svgColor:"#ff5549",titleColor:"#1e1e1e",messageColor:"#242424",buttonBackground:"#ff5549",buttonColor:"#fff",backOverlayColor:"rgba(255,85,73,0.2)"},warning:{svgColor:"#eebf31",titleColor:"#1e1e1e",messageColor:"#242424",buttonBackground:"#eebf31",buttonColor:"#fff",backOverlayColor:"rgba(238,191,49,0.2)"},info:{svgColor:"#26c0d3",titleColor:"#1e1e1e",messageColor:"#242424",buttonBackground:"#26c0d3",buttonColor:"#fff",backOverlayColor:"rgba(38,192,211,0.2)"}},d={Show:"Show",Ask:"Ask",Prompt:"Prompt"},f={ID:"NotiflixConfirmWrap",className:"notiflix-confirm",width:"300px",zindex:4003,position:"center",distance:"10px",backgroundColor:"#f8f8f8",borderRadius:"25px",backOverlay:!0,backOverlayColor:"rgba(0,0,0,0.5)",rtl:!1,fontFamily:"Quicksand",cssAnimation:!0,cssAnimationDuration:300,cssAnimationStyle:"fade",plainText:!0,titleColor:"#32c682",titleFontSize:"16px",titleMaxLength:34,messageColor:"#1e1e1e",messageFontSize:"14px",messageMaxLength:110,buttonsFontSize:"15px",buttonsMaxLength:34,okButtonColor:"#f8f8f8",okButtonBackground:"#32c682",cancelButtonColor:"#f8f8f8",cancelButtonBackground:"#a9a9a9"},x={Standard:"Standard",Hourglass:"Hourglass",Circle:"Circle",Arrows:"Arrows",Dots:"Dots",Pulse:"Pulse",Custom:"Custom",Notiflix:"Notiflix"},g={ID:"NotiflixLoadingWrap",className:"notiflix-loading",zindex:4e3,backgroundColor:"rgba(0,0,0,0.8)",rtl:!1,fontFamily:"Quicksand",cssAnimation:!0,cssAnimationDuration:400,clickToClose:!1,customSvgUrl:null,customSvgCode:null,svgSize:"80px",svgColor:"#32c682",messageID:"NotiflixLoadingMessage",messageFontSize:"15px",messageMaxLength:34,messageColor:"#dcdcdc"},u={Standard:"Standard",Hourglass:"Hourglass",Circle:"Circle",Arrows:"Arrows",Dots:"Dots",Pulse:"Pulse"},b={ID:"NotiflixBlockWrap",querySelectorLimit:200,className:"notiflix-block",position:"absolute",zindex:1e3,backgroundColor:"rgba(255,255,255,0.9)",rtl:!1,fontFamily:"Quicksand",cssAnimation:!0,cssAnimationDuration:300,svgSize:"45px",svgColor:"#383838",messageFontSize:"14px",messageMaxLength:34,messageColor:"#383838"},y=function(t){return console.error("%c Notiflix Error ","padding:2px;border-radius:20px;color:#fff;background:#ff5549","\n"+t+s)},h=function(t){return console.log("%c Notiflix Info ","padding:2px;border-radius:20px;color:#fff;background:#26c0d3","\n"+t+s)},k=function(e){return e||(e="head"),null!==t.document[e]||(y("\nNotiflix needs to be appended to the \"<"+e+">\" element, but you called it before the \"<"+e+">\" element has been created."),!1)},w=function(e,a){if(!k("head"))return!1;if(null!==e()&&!t.document.getElementById(a)){var n=t.document.createElement("style");n.id=a,n.innerHTML=e(),t.document.head.appendChild(n)}},v=function(){var t={},e=!1,a=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],a++);for(var n=function(a){for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=e&&"[object Object]"===Object.prototype.toString.call(a[n])?v(t[n],a[n]):a[n])};a ";return a},z=function(t,e){t||(t="110px"),e||(e="#ff5549");var a=" ";return a},S=function(t,e){t||(t="110px"),e||(e="#eebf31");var a=" ";return a},L=function(t,e){t||(t="110px"),e||(e="#26c0d3");var a=" ";return a},I=function(t,e){t||(t="60px"),e||(e="#32c682");var a=" ";return a},A=function(t,e){t||(t="60px"),e||(e="#32c682");var a=" ";return a},M=function(t,e){t||(t="60px"),e||(e="#32c682");var a=" ";return a},X=function(t,e){t||(t="60px"),e||(e="#32c682");var a=" ";return a},R=function(t,e){t||(t="60px"),e||(e="#32c682");var a=" ";return a},B=function(t,e){t||(t="60px"),e||(e="#32c682");var a=" ";return a},D=function(t,e,a){t||(t="60px"),e||(e="#f8f8f8"),a||(a="#32c682");var n=" ";return n},T=function(){return null},F=0,E=function(a,n,o,s){if(!k("body"))return!1;e||G.Notify.init({});var m=v(!0,e,{});if("object"==typeof o&&!Array.isArray(o)||"object"==typeof s&&!Array.isArray(s)){var p={};"object"==typeof o?p=o:"object"==typeof s&&(p=s),e=v(!0,e,p)}var d=e[a.toLocaleLowerCase("en")];F++,"string"!=typeof n&&(n="Notiflix "+a),e.plainText&&(n=N(n)),!e.plainText&&n.length>e.messageMaxLength&&(e=v(!0,e,{closeButton:!0,messageMaxLength:150}),n="Possible HTML Tags Error: The \"plainText\" option is \"false\" and the notification content length is more than the \"messageMaxLength\" option."),n.length>e.messageMaxLength&&(n=n.substring(0,e.messageMaxLength)+"..."),"shadow"===e.fontAwesomeIconStyle&&(d.fontAwesomeIconColor=d.background),e.cssAnimation||(e.cssAnimationDuration=0);var f=t.document.getElementById(c.wrapID)||t.document.createElement("div");if(f.id=c.wrapID,f.style.width=e.width,f.style.zIndex=e.zindex,f.style.opacity=e.opacity,"center-center"===e.position?(f.style.left=e.distance,f.style.top=e.distance,f.style.right=e.distance,f.style.bottom=e.distance,f.style.margin="auto",f.classList.add("nx-flex-center-center"),f.style.maxHeight="calc((100vh - "+e.distance+") - "+e.distance+")",f.style.display="flex",f.style.flexWrap="wrap",f.style.flexDirection="column",f.style.justifyContent="center",f.style.alignItems="center",f.style.pointerEvents="none"):"center-top"===e.position?(f.style.left=e.distance,f.style.right=e.distance,f.style.top=e.distance,f.style.bottom="auto",f.style.margin="auto"):"center-bottom"===e.position?(f.style.left=e.distance,f.style.right=e.distance,f.style.bottom=e.distance,f.style.top="auto",f.style.margin="auto"):"right-bottom"===e.position?(f.style.right=e.distance,f.style.bottom=e.distance,f.style.top="auto",f.style.left="auto"):"left-top"===e.position?(f.style.left=e.distance,f.style.top=e.distance,f.style.right="auto",f.style.bottom="auto"):"left-bottom"===e.position?(f.style.left=e.distance,f.style.bottom=e.distance,f.style.top="auto",f.style.right="auto"):(f.style.right=e.distance,f.style.top=e.distance,f.style.left="auto",f.style.bottom="auto"),e.backOverlay){var x=t.document.getElementById(c.overlayID)||t.document.createElement("div");x.id=c.overlayID,x.style.width="100%",x.style.height="100%",x.style.position="fixed",x.style.zIndex=e.zindex-1,x.style.left=0,x.style.top=0,x.style.right=0,x.style.bottom=0,x.style.background=d.backOverlayColor||e.backOverlayColor,x.className=e.cssAnimation?"nx-with-animation":"",x.style.animationDuration=e.cssAnimation?e.cssAnimationDuration+"ms":"",t.document.getElementById(c.overlayID)||t.document.body.appendChild(x)}t.document.getElementById(c.wrapID)||t.document.body.appendChild(f);var g=t.document.createElement("div");g.id=e.ID+"-"+F,g.className=e.className+" "+d.childClassName+" "+(e.cssAnimation?"nx-with-animation":"")+" "+(e.useIcon?"nx-with-icon":"")+" nx-"+e.cssAnimationStyle+" "+(e.closeButton&&"function"!=typeof o?"nx-with-close-button":"")+" "+("function"==typeof o?"nx-with-callback":"")+" "+(e.clickToClose?"nx-notify-click-to-close":""),g.style.fontSize=e.fontSize,g.style.color=d.textColor,g.style.background=d.background,g.style.borderRadius=e.borderRadius,g.style.pointerEvents="all",e.rtl&&(g.setAttribute("dir","rtl"),g.classList.add("nx-rtl-on")),g.style.fontFamily="\""+e.fontFamily+"\", "+r,e.cssAnimation&&(g.style.animationDuration=e.cssAnimationDuration+"ms");var u="";if(e.closeButton&&"function"!=typeof o&&(u=" "),!e.useIcon)g.innerHTML=""+n+" "+(e.closeButton?u:"");else if(e.useFontAwesome)g.innerHTML=""+n+" "+(e.closeButton?u:"");else{var b="";a===l.Success?b=" ":a===l.Failure?b=" ":a===l.Warning?b=" ":a===l.Info&&(b=" "),g.innerHTML=b+""+n+" "+(e.closeButton?u:"")}if("left-bottom"===e.position||"right-bottom"===e.position){var y=t.document.getElementById(c.wrapID);y.insertBefore(g,y.firstChild)}else t.document.getElementById(c.wrapID).appendChild(g);var h=t.document.getElementById(g.id);if(h){var w,C,z=function(){h.classList.add("nx-remove");var e=t.document.getElementById(c.overlayID);e&&0>=f.childElementCount&&e.classList.add("nx-remove"),clearTimeout(w)},S=function(){if(h&&null!==h.parentNode&&h.parentNode.removeChild(h),0>=f.childElementCount&&null!==f.parentNode){f.parentNode.removeChild(f);var e=t.document.getElementById(c.overlayID);e&&null!==e.parentNode&&e.parentNode.removeChild(e)}clearTimeout(C)};if(e.closeButton&&"function"!=typeof o){var L=t.document.getElementById(g.id).querySelector("span.nx-close-button");L.addEventListener("click",function(){z();var t=setTimeout(function(){S(),clearTimeout(t)},e.cssAnimationDuration)})}if(("function"==typeof o||e.clickToClose)&&h.addEventListener("click",function(){"function"==typeof o&&o(),z();var t=setTimeout(function(){S(),clearTimeout(t)},e.cssAnimationDuration)}),!e.closeButton&&"function"!=typeof o){var I=function(){w=setTimeout(function(){z()},e.timeout),C=setTimeout(function(){S()},e.timeout+e.cssAnimationDuration)};I(),e.pauseOnHover&&(h.addEventListener("mouseenter",function(){h.classList.add("nx-paused"),clearTimeout(w),clearTimeout(C)}),h.addEventListener("mouseleave",function(){h.classList.remove("nx-paused"),I()}))}}if(e.showOnlyTheLastOne&&0 - Albert Einstein":e===m.Failure?i="\"Failure is simply the opportunity to begin again, this time more intelligently.\" - Henry Ford":e===m.Warning?i="\"The peoples who want to live comfortably without producing and fatigue; they are doomed to lose their dignity, then liberty, and then independence and destiny.\" - Mustafa Kemal Ataturk":e===m.Info&&(i="\"Knowledge rests not upon truth alone, but upon error also.\" - Carl Gustav Jung")),"string"!=typeof o&&(o="Okay"),a.plainText&&(n=N(n),i=N(i),o=N(o)),a.plainText||(n.length>a.titleMaxLength&&(n="Possible HTML Tags Error",i="The \"plainText\" option is \"false\" and the title content length is more than the \"titleMaxLength\" option.",o="Okay"),i.length>a.messageMaxLength&&(n="Possible HTML Tags Error",i="The \"plainText\" option is \"false\" and the message content length is more than the \"messageMaxLength\" option.",o="Okay"),o.length>a.buttonMaxLength&&(n="Possible HTML Tags Error",i="The \"plainText\" option is \"false\" and the button content length is more than the \"buttonMaxLength\" option.",o="Okay")),n.length>a.titleMaxLength&&(n=n.substring(0,a.titleMaxLength)+"..."),i.length>a.messageMaxLength&&(i=i.substring(0,a.messageMaxLength)+"..."),o.length>a.buttonMaxLength&&(o=o.substring(0,a.buttonMaxLength)+"..."),a.cssAnimation||(a.cssAnimationDuration=0);var x=t.document.createElement("div");x.id=p.ID,x.className=a.className,x.style.zIndex=a.zindex,x.style.borderRadius=a.borderRadius,x.style.fontFamily="\""+a.fontFamily+"\", "+r,a.rtl&&(x.setAttribute("dir","rtl"),x.classList.add("nx-rtl-on")),x.style.display="flex",x.style.flexWrap="wrap",x.style.flexDirection="column",x.style.alignItems="center",x.style.justifyContent="center";var g="",u=!0===a.backOverlayClickToClose;a.backOverlay&&(g="
");var b="";if(e===m.Success?b=C(a.svgSize,f.svgColor):e===m.Failure?b=z(a.svgSize,f.svgColor):e===m.Warning?b=S(a.svgSize,f.svgColor):e===m.Info&&(b=L(a.svgSize,f.svgColor)),x.innerHTML=g+"",!t.document.getElementById(x.id)){t.document.body.appendChild(x);var y=function(){var e=t.document.getElementById(x.id);e.classList.add("nx-remove");var n=setTimeout(function(){null!==e.parentNode&&e.parentNode.removeChild(e),clearTimeout(n)},a.cssAnimationDuration)},h=t.document.getElementById("NXReportButton");if(h.addEventListener("click",function(){"function"==typeof s&&s(),y()}),g&&u){var w=t.document.querySelector(".nx-report-click-to-close");w.addEventListener("click",function(){y()})}}a=v(!0,a,c)},W=function(){return null},j=function(e,a,i,o,s,l,c,m,p){if(!k("body"))return!1;n||G.Confirm.init({});var x=v(!0,n,{});"object"!=typeof p||Array.isArray(p)||(n=v(!0,n,p)),"string"!=typeof a&&(a="Notiflix Confirm"),"string"!=typeof i&&(i="Do you agree with me?"),"string"!=typeof s&&(s="Yes"),"string"!=typeof l&&(l="No"),"function"!=typeof c&&(c=void 0),"function"!=typeof m&&(m=void 0),n.plainText&&(a=N(a),i=N(i),s=N(s),l=N(l)),n.plainText||(a.length>n.titleMaxLength&&(a="Possible HTML Tags Error",i="The \"plainText\" option is \"false\" and the title content length is more than \"titleMaxLength\" option.",s="Okay",l="..."),i.length>n.messageMaxLength&&(a="Possible HTML Tags Error",i="The \"plainText\" option is \"false\" and the message content length is more than \"messageMaxLength\" option.",s="Okay",l="..."),(s.length||l.length)>n.buttonsMaxLength&&(a="Possible HTML Tags Error",i="The \"plainText\" option is \"false\" and the buttons content length is more than \"buttonsMaxLength\" option.",s="Okay",l="...")),a.length>n.titleMaxLength&&(a=a.substring(0,n.titleMaxLength)+"..."),i.length>n.messageMaxLength&&(i=i.substring(0,n.messageMaxLength)+"..."),s.length>n.buttonsMaxLength&&(s=s.substring(0,n.buttonsMaxLength)+"..."),l.length>n.buttonsMaxLength&&(l=l.substring(0,n.buttonsMaxLength)+"..."),n.cssAnimation||(n.cssAnimationDuration=0);var g=t.document.createElement("div");g.id=f.ID,g.className=n.className+(n.cssAnimation?" nx-with-animation nx-"+n.cssAnimationStyle:""),g.style.zIndex=n.zindex,g.style.padding=n.distance,n.rtl&&(g.setAttribute("dir","rtl"),g.classList.add("nx-rtl-on"));var u="string"==typeof n.position?n.position.trim():"center";g.classList.add("nx-position-"+u),g.style.fontFamily="\""+n.fontFamily+"\", "+r;var b="";n.backOverlay&&(b="
");var y="";"function"==typeof c&&(y=""+l+" ");var h="",w=null,C=void 0;if(e===d.Ask||e===d.Prompt){w=o||"";var z=e===d.Ask?Math.ceil(1.5*w.length):200 "}if(g.innerHTML=b+"",!t.document.getElementById(g.id)){t.document.body.appendChild(g);var L=t.document.getElementById(g.id),I=t.document.getElementById("NXConfirmButtonOk"),A=t.document.getElementById("NXConfirmValidationInput");if(A&&(A.focus(),A.setSelectionRange(0,(A.value||"").length),A.addEventListener("keyup",function(t){var a=t.target.value;if(e===d.Ask&&a!==w)t.preventDefault(),A.classList.add("nx-validation-failure"),A.classList.remove("nx-validation-success");else{e===d.Ask&&(A.classList.remove("nx-validation-failure"),A.classList.add("nx-validation-success"));var n="enter"===(t.key||"").toLocaleLowerCase("en")||13===t.keyCode;n&&I.dispatchEvent(new Event("click"))}})),I.addEventListener("click",function(t){if(e===d.Ask&&w&&A){var a=(A.value||"").toString();if(a!==w)return A.focus(),A.classList.add("nx-validation-failure"),t.stopPropagation(),t.preventDefault(),t.returnValue=!1,t.cancelBubble=!0,!1;A.classList.remove("nx-validation-failure")}"function"==typeof c&&(e===d.Prompt&&A&&(C=A.value||""),c(C)),L.classList.add("nx-remove");var i=setTimeout(function(){null!==L.parentNode&&(L.parentNode.removeChild(L),clearTimeout(i))},n.cssAnimationDuration)}),"function"==typeof c){var M=t.document.getElementById("NXConfirmButtonCancel");M.addEventListener("click",function(){"function"==typeof m&&(e===d.Prompt&&A&&(C=A.value||""),m(C)),L.classList.add("nx-remove");var t=setTimeout(function(){null!==L.parentNode&&(L.parentNode.removeChild(L),clearTimeout(t))},n.cssAnimationDuration)})}}n=v(!0,n,x)},P=function(){return null},V=function(e,a,n,o,s){if(!k("body"))return!1;i||G.Loading.init({});var l=v(!0,i,{});if("object"==typeof a&&!Array.isArray(a)||"object"==typeof n&&!Array.isArray(n)){var c={};"object"==typeof a?c=a:"object"==typeof n&&(c=n),i=v(!0,i,c)}var m="";if("string"==typeof a&&0i.messageMaxLength?N(m).toString().substring(0,i.messageMaxLength)+"...":N(m).toString();var p="";0"+m+""),i.cssAnimation||(i.cssAnimationDuration=0);var d="";if(e===x.Standard)d=I(i.svgSize,i.svgColor);else if(e===x.Hourglass)d=A(i.svgSize,i.svgColor);else if(e===x.Circle)d=M(i.svgSize,i.svgColor);else if(e===x.Arrows)d=X(i.svgSize,i.svgColor);else if(e===x.Dots)d=R(i.svgSize,i.svgColor);else if(e===x.Pulse)d=B(i.svgSize,i.svgColor);else if(e===x.Custom&&null!==i.customSvgCode&&null===i.customSvgUrl)d=i.customSvgCode||"";else if(e===x.Custom&&null!==i.customSvgUrl&&null===i.customSvgCode)d=" ";else{if(e===x.Custom&&(null===i.customSvgUrl||null===i.customSvgCode))return y("You have to set a static SVG url to \"customSvgUrl\" option to use Loading Custom."),!1;d=D(i.svgSize,"#f8f8f8","#32c682")}var f=parseInt((i.svgSize||"").replace(/[^0-9]/g,"")),u=t.innerWidth,b=f>=u?u-40+"px":f+"px",h=""+d+"
",w=t.document.createElement("div");if(w.id=g.ID,w.className=i.className+(i.cssAnimation?" nx-with-animation":"")+(i.clickToClose?" nx-loading-click-to-close":""),w.style.zIndex=i.zindex,w.style.background=i.backgroundColor,w.style.animationDuration=i.cssAnimationDuration+"ms",w.style.fontFamily="\""+i.fontFamily+"\", "+r,w.style.display="flex",w.style.flexWrap="wrap",w.style.flexDirection="column",w.style.alignItems="center",w.style.justifyContent="center",i.rtl&&(w.setAttribute("dir","rtl"),w.classList.add("nx-rtl-on")),w.innerHTML=h+p,!t.document.getElementById(w.id)&&(t.document.body.appendChild(w),i.clickToClose)){var C=t.document.getElementById(w.id);C.addEventListener("click",function(){w.classList.add("nx-remove");var t=setTimeout(function(){null!==w.parentNode&&(w.parentNode.removeChild(w),clearTimeout(t))},i.cssAnimationDuration)})}}else if(t.document.getElementById(g.ID))var z=t.document.getElementById(g.ID),S=setTimeout(function(){z.classList.add("nx-remove");var t=setTimeout(function(){null!==z.parentNode&&(z.parentNode.removeChild(z),clearTimeout(t))},i.cssAnimationDuration);clearTimeout(S)},s);i=v(!0,i,l)},q=function(e){"string"!=typeof e&&(e="");var a=t.document.getElementById(g.ID);if(a)if(0i.messageMaxLength?N(e).substring(0,i.messageMaxLength)+"...":N(e);var n=a.getElementsByTagName("p")[0];if(n)n.innerHTML=e;else{var o=t.document.createElement("p");o.id=i.messageID,o.className="nx-loading-message nx-loading-message-new",o.style.color=i.messageColor,o.style.fontSize=i.messageFontSize,o.innerHTML=e,a.appendChild(o)}}else y("Where is the new message?")},Y=function(){return null},U=0,Q=function(e,a,n,i,s,l){var c;if(Array.isArray(n)){if(1>n.length)return y("Array of HTMLElements should contains at least one HTMLElement."),!1;c=n}else if(Object.prototype.isPrototypeOf.call(NodeList.prototype,n)){if(1>n.length)return y("NodeListOf should contains at least one HTMLElement."),!1;c=Array.prototype.slice.call(n)}else{var m="string"!=typeof n||1>(n||"").length||1===(n||"").length&&("#"===(n||"")[0]||"."===(n||"")[0]);if(m)return y("The selector parameter must be a string and matches a specified CSS selector(s)."),!1;var p=t.document.querySelectorAll(n);if(1>p.length)return y("You called the \"Notiflix.Block...\" function with \""+n+"\" selector, but there is no such element(s) in the document."),!1;c=p}o||G.Block.init({});var d=v(!0,o,{});if("object"==typeof i&&!Array.isArray(i)||"object"==typeof s&&!Array.isArray(s)){var f={};"object"==typeof i?f=i:"object"==typeof s&&(f=s),o=v(!0,o,f)}var x="";"string"==typeof i&&0=w?w:c.length,z="nx-block-temporary-position";if(e){for(var S,L=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","html","head","title","script","style","iframe"],D=0;DT.length){var F="";a&&(a===u.Hourglass?F=A(o.svgSize,o.svgColor):a===u.Circle?F=M(o.svgSize,o.svgColor):a===u.Arrows?F=X(o.svgSize,o.svgColor):a===u.Dots?F=R(o.svgSize,o.svgColor):a===u.Pulse?F=B(o.svgSize,o.svgColor):F=I(o.svgSize,o.svgColor));var E=""+F+" ",O="";0o.messageMaxLength?N(x).substring(0,o.messageMaxLength)+"...":N(x),O=""+x+" "),U++;var H=t.document.createElement("div");H.id=b.ID+"-"+U,H.className=g+(o.cssAnimation?" nx-with-animation":""),H.style.position=o.position,H.style.zIndex=o.zindex,H.style.background=o.backgroundColor,H.style.animationDuration=o.cssAnimationDuration+"ms",H.style.fontFamily="\""+o.fontFamily+"\", "+r,H.style.display="flex",H.style.flexWrap="wrap",H.style.flexDirection="column",H.style.alignItems="center",H.style.justifyContent="center",o.rtl&&(H.setAttribute("dir","rtl"),H.classList.add("nx-rtl-on")),H.innerHTML=E+O;var W=t.getComputedStyle(S).getPropertyValue("position"),j="string"==typeof W?W.toLocaleLowerCase("en"):"relative",P=Math.round(1.25*parseInt(o.svgSize))+40,V=S.offsetHeight||0,q="";P>V&&(q="min-height:"+P+"px;");var Y="";Y=S.getAttribute("id")?"#"+S.getAttribute("id"):S.classList[0]?"."+S.classList[0]:(S.tagName||"").toLocaleLowerCase("en");var Q="",K=-1>=["absolute","relative","fixed","sticky"].indexOf(j);if(K||0"+Y+"."+z+"{"+Q+q+"}",Z=t.document.createRange();Z.selectNode(t.document.head);var $=Z.createContextualFragment(J);t.document.head.appendChild($),S.classList.add(z)}S.appendChild(H)}}}else var _=function(e){var a=setTimeout(function(){null!==e.parentNode&&e.parentNode.removeChild(e);var n=e.getAttribute("id"),i=t.document.getElementById("Style-"+n);i&&null!==i.parentNode&&i.parentNode.removeChild(i),clearTimeout(a)},o.cssAnimationDuration)},tt=function(t){if(t&&0\" or \"NodeListOf\" does not have a \"Block\" element to remove.")},et=function(t){var e=setTimeout(function(){t.classList.remove(z),clearTimeout(e)},o.cssAnimationDuration+300)},at=setTimeout(function(){for(var t,e=0;e