Template Kit – Import - Version 1.0.3

Version Description

  • 2020-04-29 =
  • Fix certain import conditions so it runs smoother
Download this release

Release Info

Developer envato
Plugin Icon 128x128 Template Kit – Import
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

Files changed (131) hide show
  1. assets/css/main.min.css +0 -118
  2. assets/elementor_modal.css +1 -0
  3. assets/elementor_modal.js +1 -0
  4. assets/images/template-kit-import.svg +0 -1
  5. assets/img/144ef025370632ad477e0bebd9edab2b.svg +28 -0
  6. assets/img/1ce1ac5c2ebe545fa015e53785fd1dd8.svg +20 -0
  7. assets/img/335d44c8f32adfd28a587315c1d23982.svg +62 -0
  8. assets/img/7b1453e570abffbb55937a53ebfc4e10.png +0 -0
  9. assets/img/a600e1639caf18e7ed558d6e102335c0.svg +20 -0
  10. assets/img/ab1b153a91691a58ceca55efc120b195.svg +20 -0
  11. assets/img/d0e1f98594bcb43cd7efe3ae4a05fc11.svg +20 -0
  12. assets/js/importer.min.js +0 -1
  13. assets/main.css +1 -0
  14. assets/main.js +55 -0
  15. inc/api/class-api.php +77 -0
  16. inc/api/class-requirements.php +338 -0
  17. inc/api/class-template-kit-import.php +202 -0
  18. inc/api/class-template-kit-install.php +241 -0
  19. inc/backend/class-elementor-modal.php +51 -0
  20. inc/backend/class-options.php +102 -0
  21. inc/backend/class-rest.php +100 -0
  22. inc/backend/class-template-kits.php +196 -0
  23. inc/backend/class-welcome.php +93 -0
  24. inc/bootstrap.php +18 -11
  25. inc/class-importer.php +0 -164
  26. inc/class-plugin.php +19 -52
  27. inc/utils/class-base.php +83 -0
  28. inc/utils/class-content-api.php +171 -0
  29. inc/utils/class-extensions-api.php +169 -0
  30. languages/template-kit-import.pot +19 -131
  31. readme.txt +4 -1
  32. views/importer/step8.php → review/review.php +41 -0
  33. src/js/react/components/Actions/ButtonActionProvider.jsx +106 -0
  34. src/js/react/components/Banners/MissingRequirements.jsx +186 -0
  35. src/js/react/components/Banners/MissingRequirements.module.scss +38 -0
  36. src/js/react/components/Buttons/Button.jsx +32 -0
  37. src/js/react/components/Buttons/ButtonElement.jsx +53 -0
  38. src/js/react/components/Buttons/ButtonElement.module.scss +97 -0
  39. src/js/react/components/Buttons/ButtonIconAndLabel.jsx +44 -0
  40. src/js/react/components/Buttons/ButtonIconAndLabel.module.scss +19 -0
  41. src/js/react/components/Buttons/ButtonWrapper.jsx +10 -0
  42. src/js/react/components/Buttons/ButtonWrapper.module.scss +8 -0
  43. src/js/react/components/Buttons/Buttons.stories.jsx +103 -0
  44. src/js/react/components/Buttons/Dashicons.stories.jsx +26 -0
  45. src/js/react/components/Buttons/DeleteTemplateKit.jsx +37 -0
  46. src/js/react/components/Buttons/DismissBanner.jsx +49 -0
  47. src/js/react/components/Buttons/DismissBanner.module.scss +5 -0
  48. src/js/react/components/Buttons/ExternalLink.jsx +7 -0
  49. src/js/react/components/Buttons/ExternalLinkButton.jsx +29 -0
  50. src/js/react/components/Buttons/ImportSingleTemplate.jsx +46 -0
  51. src/js/react/components/Buttons/ImportSingleTemplate.stories.jsx +89 -0
  52. src/js/react/components/Buttons/InsertTemplateToPage.jsx +40 -0
  53. src/js/react/components/Buttons/InstallFreeTemplateKitButton.jsx +44 -0
  54. src/js/react/components/Buttons/InternalLink.jsx +8 -0
  55. src/js/react/components/Buttons/InternalLinkButton.jsx +27 -0
  56. src/js/react/components/Buttons/UploadTemplateKitButton.jsx +44 -0
  57. src/js/react/components/Buttons/UploadTemplateKitButton.module.scss +6 -0
  58. src/js/react/components/Buttons/WordPressLink.jsx +15 -0
  59. src/js/react/components/Card/ImageCarousel.jsx +68 -0
  60. src/js/react/components/Card/ImageCarousel.module.scss +103 -0
  61. src/js/react/components/Card/ItemCard.jsx +21 -0
  62. src/js/react/components/Card/ItemCard.module.scss +66 -0
  63. src/js/react/components/Card/KitCard.jsx +46 -0
  64. src/js/react/components/Card/KitCard.module.scss +28 -0
  65. src/js/react/components/Card/SettingsCard.jsx +13 -0
  66. src/js/react/components/Card/SettingsCard.module.scss +10 -0
  67. src/js/react/components/Card/UploadKitCard.jsx +37 -0
  68. src/js/react/components/Card/UploadKitCard.module.scss +58 -0
  69. src/js/react/components/Contexts/GlobalConfigProvider.jsx +30 -0
  70. src/js/react/components/Contexts/useGlobalConfig.js +99 -0
  71. src/js/react/components/Errors/APIErrorMessage.jsx +96 -0
  72. src/js/react/components/Errors/APIErrorMessage.module.scss +25 -0
  73. src/js/react/components/Errors/APIErrorMessage.spec.jsx +24 -0
  74. src/js/react/components/Errors/APIErrorMessage.stories.jsx +31 -0
  75. src/js/react/components/Errors/APIErrorProvider.jsx +31 -0
  76. src/js/react/components/Errors/ErrorLoadingData.jsx +16 -0
  77. src/js/react/components/Errors/ErrorLoadingData.module.scss +18 -0
  78. src/js/react/components/Errors/useAPIError.js +9 -0
  79. src/js/react/components/Grid/GridItem.jsx +37 -0
  80. src/js/react/components/Grid/GridItem.module.scss +42 -0
  81. src/js/react/components/Grid/GridWrapper.jsx +13 -0
  82. src/js/react/components/Grid/GridWrapper.module.scss +16 -0
  83. src/js/react/components/InstalledTemplateKits/TemplateItemCardWrapper.jsx +102 -0
  84. src/js/react/components/InstalledTemplateKits/TemplateItemCardWrapper.module.scss +32 -0
  85. src/js/react/components/InstalledTemplateKits/TemplateKitSwitcher.jsx +38 -0
  86. src/js/react/components/InstalledTemplateKits/TemplateKitSwitcher.module.scss +107 -0
  87. src/js/react/components/InstalledTemplateKits/TemplateList.jsx +15 -0
  88. src/js/react/components/Loading/LoadingAnimation.jsx +11 -0
  89. src/js/react/components/Loading/LoadingAnimation.module.scss +80 -0
  90. src/js/react/components/Loading/LoadingAnimation.stories.jsx +10 -0
  91. src/js/react/components/Modal/MagicModalWrapper.jsx +67 -0
  92. src/js/react/components/Modal/MagicModalWrapper.module.scss +74 -0
  93. src/js/react/components/Modal/ModalEnvatoIcon.jsx +24 -0
  94. src/js/react/components/Modal/ModalEnvatoIcon.module.scss +11 -0
  95. src/js/react/components/Modal/ModalWrapper.jsx +63 -0
  96. src/js/react/components/Modal/ModalWrapper.module.scss +29 -0
  97. src/js/react/components/Modal/TemplateModalWrapper.jsx +101 -0
  98. src/js/react/components/Modal/TemplateModalWrapper.module.scss +67 -0
  99. src/js/react/components/Modal/TemplatePreviewModal.jsx +13 -0
  100. src/js/react/components/Modal/TemplatePreviewModal.module.scss +4 -0
  101. src/js/react/components/Navigation/NavigationBar.jsx +34 -0
  102. src/js/react/components/Navigation/NavigationBar.module.scss +280 -0
  103. src/js/react/components/Titles/MainHeading.jsx +11 -0
  104. src/js/react/components/Titles/MainHeading.module.scss +14 -0
  105. src/js/react/components/Titles/Titles.stories.jsx +7 -0
  106. src/scss/admin/_global.scss +0 -29
  107. src/scss/admin/_plugins.scss +0 -92
  108. src/scss/admin/_section.scss +0 -88
  109. src/scss/admin/_tabs.scss +0 -38
  110. src/scss/admin/_templates.scss +0 -141
  111. src/scss/admin/_upload.scss +0 -116
  112. template-kit-import.php +12 -11
  113. uninstall.php +16 -0
  114. vendor/template-kit-import/inc/bootstrap.php +41 -0
  115. {inc → vendor/template-kit-import/inc}/class-base.php +0 -0
  116. {inc → vendor/template-kit-import/inc}/class-builder-elementor.php +9 -5
  117. {inc → vendor/template-kit-import/inc}/class-builder-gutenberg.php +0 -0
  118. {inc → vendor/template-kit-import/inc}/class-builder.php +0 -0
  119. {inc → vendor/template-kit-import/inc}/class-cpt-kits.php +11 -2
  120. {inc → vendor/template-kit-import/inc}/class-cpt.php +0 -0
  121. {inc → vendor/template-kit-import/inc}/class-delete.php +1 -5
  122. vendor/template-kit-import/inc/class-importer.php +110 -0
  123. {inc → vendor/template-kit-import/inc}/class-required-plugin.php +0 -0
  124. {inc → vendor/template-kit-import/inc}/helper.php +0 -0
  125. vendor/template-kit-import/template-kit-import.php +11 -0
  126. views/importer/importer.php +0 -81
  127. views/importer/step1-upload.php +0 -18
  128. views/importer/step1.php +0 -80
  129. views/importer/step2.php +0 -98
  130. views/importer/step3.php +0 -96
  131. views/wrapper.php +0 -42
assets/css/main.min.css DELETED
@@ -1,118 +0,0 @@
1
- .envato-template-kit-import-screen-only,.screen-reader-text,.screen-reader-text span,.ui-helper-hidden-accessible{position:absolute;top:-10000em;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}
2
- .envato-template-kit-import-clearfix:after{content:'';display:block;clear:both;width:0;height:0}
3
- .envato-template-kit-import__wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;min-height:85vh;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;color:#555d66;background:#f1f1f1;margin:0 0 0 -20px}
4
- .envato-template-kit-import__wrapper .dashicons{vertical-align:bottom}
5
- .envato-template-kit-import__header{background-color:#fff;border-bottom:1px solid #e0e5e9;padding:30px}
6
- .envato-template-kit-import__header p{margin-bottom:0}
7
- .envato-template-kit-import__header-logo{position:absolute;right:26px;top:15px}
8
- .envato-template-kit-import__tabset{background:#f9f9f9;border-top:1px solid #f1f1f1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
9
- .envato-template-kit-import__tab{border-right:1px solid #e0e5e9;color:#000;cursor:pointer;font-weight:bold;padding:17px 30px 14px;text-decoration:none}
10
- .envato-template-kit-import__tab:focus,.envato-template-kit-import__tab:active{outline:0;-webkit-box-shadow:none;box-shadow:none}
11
- .envato-template-kit-import__tab--current{border-bottom:2px solid #837e7e}
12
- .envato-template-kit-import__tab-panel{background:#f1f1f1;border-top:1px solid #e0e5e9;color:#000;padding:20px 30px;overflow:hidden}
13
- .envato-template-kit-import__template-kit{background-color:#fff;border:1px solid #e0e5e9;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-bottom:40px;padding:20px}
14
- .envato-template-kit-import__template-kit:hover .envato-template-kit-import__btn-delete{left:0}
15
- .envato-template-kit-import__template-kit--imported .envato-template-kit-import__template-meta:before{content:"\f147";font-family:dashicons;display:block;line-height:1;font-weight:400;font-style:normal;speak:none;text-decoration:inherit;position:absolute;font-size:60px;color:#82b541}
16
- .envato-template-kit-import__template-kit--imported .envato-template-kit-import__title,.envato-template-kit-import__template-kit--imported .envato-template-kit-import__message{margin:0 0 10px 70px}
17
- .envato-template-kit-import__title{font-weight:bold;text-transform:capitalize}
18
- .envato-template-kit-import__screenshot{margin-right:25px;max-width:300px;height:200px;overflow:hidden}
19
- .envato-template-kit-import__screenshot img{width:100%;height:auto}
20
- .envato-template-kit-import__btn-delete{background:transparent;border:0;color:#a00;font-size:13px;position:relative;left:-9999em}
21
- .envato-template-kit-import__btn-delete:hover{color:#dc3232}
22
- .envato-template-kit-import__next{margin-left:auto}
23
- .envato-template-kit-import__upload{background-color:#fff;border:1px solid #e0e5e9;margin-right:auto;margin-left:auto;padding:50px 25px;max-width:900px}
24
- .envato-template-kit-import__upload-form{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}
25
- .envato-template-kit-import__upload-btn{background:#f7f7f7;border:1px solid #ccc;border-radius:3px;padding:16px}
26
- .envato-template-kit-import__upload-btn-next{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
27
- .envato-template-kit-import__upload-btn-next:hover,.envato-template-kit-import__upload-btn-next:focus{background:#0090c9;border-color:#007aab;color:#fff}
28
- .envato-template-kit-import__upload-btn-next:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
29
- .envato-template-kit-import__upload-btn-next:active{background:#0073a1;border-color:#0073a1;color:#fff}
30
- .envato-template-kit-import__upload-btn-next-input{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1;width:200px}
31
- .envato-template-kit-import__upload-btn-next-input:hover,.envato-template-kit-import__upload-btn-next-input:focus{background:#0090c9;border-color:#007aab;color:#fff}
32
- .envato-template-kit-import__upload-btn-next-input:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
33
- .envato-template-kit-import__upload-btn-next-input:active{background:#0073a1;border-color:#0073a1;color:#fff}
34
- .envato-template-kit-import__upload-btn-next-link{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1;padding-right:87px;padding-left:87px}
35
- .envato-template-kit-import__upload-btn-next-link:hover,.envato-template-kit-import__upload-btn-next-link:focus{background:#0090c9;border-color:#007aab;color:#fff}
36
- .envato-template-kit-import__upload-btn-next-link:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
37
- .envato-template-kit-import__upload-btn-next-link:active{background:#0073a1;border-color:#0073a1;color:#fff}
38
- .envato-template-kit-import__upload-hidden{display:none}
39
- .envato-template-kit-import__plugin-warning{background-color:#f2dede;border:1px solid #ebcccc;color:#a94442;padding:.75rem 1.25rem;margin-top:20px;border-radius:.25rem}
40
- .envato-template-kit-import__templates{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%;margin:40px auto 40px}
41
- .envato-template-kit-import__template{-webkit-box-flex:0;-webkit-flex:0 0 30%;-ms-flex:0 0 30%;flex:0 0 30%;margin-right:3%;margin-bottom:3%;background:#fff;border:1px solid #ccd6df}
42
- .envato-template-kit-import__imported-flag{display:none}
43
- .envato-template-kit-import__template-screenshot-wrapper{height:300px;overflow:hidden}
44
- .envato-template-kit-import__template-screenshot{max-width:100%;height:auto}
45
- .envato-template-kit-import__template-title{text-align:center;padding:20px 0 0;font-size:16px}
46
- .envato-template-kit-import__template-information{border-radius:3px;padding:10px;border:1px solid #efefef;margin:14px 20px 0}
47
- .envato-template-kit-import__template-information p{margin:0;padding:0}
48
- .envato-template-kit-import__template-import-options{text-align:center;padding:20px 0}
49
- .envato-template-kit-import__template-import-option--imported,.envato-template-kit-import__template-import-option--unmet-requirements{display:none}
50
- .envato-template-kit-import__template--imported{position:relative;overflow:hidden}
51
- .envato-template-kit-import__template--imported .envato-template-kit-import__template-import-option--fresh{display:none}
52
- .envato-template-kit-import__template--imported .envato-template-kit-import__template-import-option--imported{display:block}
53
- .envato-template-kit-import__template--imported .envato-template-kit-import__imported-flag{width:200px;display:block;background:#0085ba;position:absolute;top:21px;text-align:center;line-height:30px;letter-spacing:1px;color:#fff;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);right:-65px}
54
- .envato-template-kit-import__template--importing .envato-template-kit-import__button-import-again,.envato-template-kit-import__template--importing .envato-template-kit-import__button-import{padding-right:40px;position:relative}
55
- .envato-template-kit-import__template--importing .envato-template-kit-import__button-import-again:after,.envato-template-kit-import__template--importing .envato-template-kit-import__button-import:after{content:"\f463";font-family:dashicons;display:block;line-height:1;font-weight:400;font-style:normal;speak:none;text-decoration:inherit;position:absolute;font-size:27px;right:6px;top:10px;color:#fff;-webkit-animation:templateImportSpin 4s linear infinite;animation:templateImportSpin 4s linear infinite}
56
- .envato-template-kit-import__template--unmet-requirements .envato-template-kit-import__template-import-option--fresh,.envato-template-kit-import__template--unmet-requirements .envato-template-kit-import__template-import-option--imported{display:none}
57
- .envato-template-kit-import__template--unmet-requirements .envato-template-kit-import__template-import-option--unmet-requirements{display:block}
58
- .envato-template-kit-import__button-import{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
59
- .envato-template-kit-import__button-import:hover,.envato-template-kit-import__button-import:focus{background:#0090c9;border-color:#007aab;color:#fff}
60
- .envato-template-kit-import__button-import:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
61
- .envato-template-kit-import__button-import:active{background:#0073a1;border-color:#0073a1;color:#fff}
62
- .envato-template-kit-import__button-edit{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
63
- .envato-template-kit-import__button-edit:hover,.envato-template-kit-import__button-edit:focus{background:#0090c9;border-color:#007aab;color:#fff}
64
- .envato-template-kit-import__button-edit:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
65
- .envato-template-kit-import__button-edit:active{background:#0073a1;border-color:#0073a1;color:#fff}
66
- .envato-template-kit-import__button-import-again{background:#818a91;border-color:#818a91;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #747d85;box-shadow:inset 0 -2px 0 #747d85}
67
- .envato-template-kit-import__button-import-again:hover,.envato-template-kit-import__button-import-again:focus{background:#899298;border-color:#79828a;color:#fff}
68
- .envato-template-kit-import__button-import-again:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91;box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91}
69
- .envato-template-kit-import__button-import-again:active{background:#747d85;border-color:#747d85;color:#fff}
70
- .envato-template-kit-import__button-upload-new{background:#818a91;border-color:#818a91;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #747d85;box-shadow:inset 0 -2px 0 #747d85}
71
- .envato-template-kit-import__button-upload-new:hover,.envato-template-kit-import__button-upload-new:focus{background:#899298;border-color:#79828a;color:#fff}
72
- .envato-template-kit-import__button-upload-new:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91;box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91}
73
- .envato-template-kit-import__button-upload-new:active{background:#747d85;border-color:#747d85;color:#fff}
74
- .envato-template-kit-import__button-ignore-requirements{background:#d9534f;border-color:#d9534f;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #d43f3a;box-shadow:inset 0 -2px 0 #d43f3a}
75
- .envato-template-kit-import__button-ignore-requirements:hover,.envato-template-kit-import__button-ignore-requirements:focus{background:#dc5f5c;border-color:#d64742;color:#fff}
76
- .envato-template-kit-import__button-ignore-requirements:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #d9534f;box-shadow:0 0 0 1px #fff,0 0 0 3px #d9534f}
77
- .envato-template-kit-import__button-ignore-requirements:active{background:#d43f3a;border-color:#d43f3a;color:#fff}
78
- .envato-template-kit-import__requirements{background:#fff;border:1px solid #ccd6df;margin:40px auto 40px;padding:20px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}
79
- .envato-template-kit-import__requirement-list-wrapper{-webkit-box-flex:0;-webkit-flex:0 0 690px;-ms-flex:0 0 690px;flex:0 0 690px}
80
- .envato-template-kit-import__requirement-list{padding-top:10px;padding-left:10px}
81
- .envato-template-kit-import__requirement{border-bottom:1px solid #ccd6df;padding:10px 0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:100%}
82
- .envato-template-kit-import__requirement-title{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}
83
- .envato-template-kit-import__requirement-status{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px}
84
- .envato-template-kit-import__requirement-status--deactivated{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
85
- .envato-template-kit-import__requirement-status--deactivated:hover,.envato-template-kit-import__requirement-status--deactivated:focus{background:#0090c9;border-color:#007aab;color:#fff}
86
- .envato-template-kit-import__requirement-status--deactivated:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
87
- .envato-template-kit-import__requirement-status--deactivated:active{background:#0073a1;border-color:#0073a1;color:#fff}
88
- .envato-template-kit-import__requirement-status--deactivated [data-theme-status="deactivated"],.envato-template-kit-import__requirement-status--deactivated [data-plugin-status="deactivated"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
89
- .envato-template-kit-import__requirement-status--update{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
90
- .envato-template-kit-import__requirement-status--update:hover,.envato-template-kit-import__requirement-status--update:focus{background:#0090c9;border-color:#007aab;color:#fff}
91
- .envato-template-kit-import__requirement-status--update:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
92
- .envato-template-kit-import__requirement-status--update:active{background:#0073a1;border-color:#0073a1;color:#fff}
93
- .envato-template-kit-import__requirement-status--update [data-theme-status="update"],.envato-template-kit-import__requirement-status--update [data-plugin-status="update"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
94
- .envato-template-kit-import__requirement-status--install{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
95
- .envato-template-kit-import__requirement-status--install:hover,.envato-template-kit-import__requirement-status--install:focus{background:#0090c9;border-color:#007aab;color:#fff}
96
- .envato-template-kit-import__requirement-status--install:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
97
- .envato-template-kit-import__requirement-status--install:active{background:#0073a1;border-color:#0073a1;color:#fff}
98
- .envato-template-kit-import__requirement-status--install [data-theme-status="install"],.envato-template-kit-import__requirement-status--install [data-plugin-status="install"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
99
- .envato-template-kit-import__requirement-status--activated{background:#d0d0d0;border-color:#d0d0d0;color:#030303;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #c3c3c3;box-shadow:inset 0 -2px 0 #c3c3c3}
100
- .envato-template-kit-import__requirement-status--activated:hover,.envato-template-kit-import__requirement-status--activated:focus{background:#d8d8d8;border-color:#c8c8c8;color:#030303}
101
- .envato-template-kit-import__requirement-status--activated:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #d0d0d0;box-shadow:0 0 0 1px #fff,0 0 0 3px #d0d0d0}
102
- .envato-template-kit-import__requirement-status--activated:active{background:#c3c3c3;border-color:#c3c3c3;color:#030303}
103
- .envato-template-kit-import__requirement-status--activated [data-theme-status="activated"],.envato-template-kit-import__requirement-status--activated [data-plugin-status="activated"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
104
- .envato-template-kit-import__requirement-status--activated [data-theme-status="activated"] .dashicons-yes,.envato-template-kit-import__requirement-status--activated [data-plugin-status="activated"] .dashicons-yes{color:#5cb85c}
105
- .envato-template-kit-import__requirement-status--error{background:#818a91;border-color:#818a91;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #747d85;box-shadow:inset 0 -2px 0 #747d85}
106
- .envato-template-kit-import__requirement-status--error:hover,.envato-template-kit-import__requirement-status--error:focus{background:#899298;border-color:#79828a;color:#fff}
107
- .envato-template-kit-import__requirement-status--error:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91;box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91}
108
- .envato-template-kit-import__requirement-status--error:active{background:#747d85;border-color:#747d85;color:#fff}
109
- .envato-template-kit-import__requirement-status--error [data-theme-status="error"],.envato-template-kit-import__requirement-status--error [data-plugin-status="error"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
110
- .envato-template-kit-import__requirement-status-text{display:none;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}
111
- .envato-template-kit-import__requirement-list-next{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;padding:60px}
112
- .envato-template-kit-import__requirement-list-next-button{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
113
- .envato-template-kit-import__requirement-list-next-button:hover,.envato-template-kit-import__requirement-list-next-button:focus{background:#0090c9;border-color:#007aab;color:#fff}
114
- .envato-template-kit-import__requirement-list-next-button:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
115
- .envato-template-kit-import__requirement-list-next-button:active{background:#0073a1;border-color:#0073a1;color:#fff}
116
- @-webkit-keyframes templateImportSpin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}
117
- }@keyframes templateImportSpin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/elementor_modal.css ADDED
@@ -0,0 +1 @@
 
1
+ .elementor-add-new-section .elementor-add-envato-button{background-color:#81b440;margin-left:5px;background-image:url(img/335d44c8f32adfd28a587315c1d23982.svg);background-repeat:no-repeat;background-position:48% 50%;background-size:17px auto}.elementor-add-new-section .elementor-add-envato-button i:before{content:"."}.elementor-add-new-section .elementor-add-envato-button i.fa{visibility:hidden}
assets/elementor_modal.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=57)}({57:function(e,t,n){"use strict";n.r(t);var o;n(58);"undefined"!=typeof jQuery&&(o=jQuery)((function(){function e(e){var t=0;elementorCommon&&(t=jQuery(e.target).parents(".elementor-section-wrap").length>0?jQuery(this).parents(".elementor-add-section").index():-1)>=0&&jQuery(e.target).parents(".elementor-add-section-inline").remove();var n=document.getElementById("template-kit-import-magic-button-holder");n||((n=document.createElement("div")).id="template-kit-import-magic-button-holder",document.body.appendChild(n));var o={mode:"elementorMagicButton",insertCallback:function(e){if("undefined"!=typeof elementor)if("undefined"!=typeof $e){for(var o=$e.internal("document/history/start-log",{type:"add",title:"Add Envato Elements Content"}),r=0;r<e.content.length;r++)$e.run("document/elements/create",{container:elementor.getPreviewContainer(),model:e.content[r],options:t>=0?{at:t++}:{}});$e.internal("document/history/end-log",{id:o})}else{var i=new Backbone.Model({getTitle:function(){return"Test"}});elementor.channels.data.trigger("template:before:insert",i);for(var a=0;a<e.content.length;a++)elementor.getPreviewView().addChildElement(e.content[a],t>=0?{at:t++}:null);elementor.channels.data.trigger("template:after:insert",{})}window.templateKitImport.closeMagicButton(n)}};window.templateKitImport.initMagicButton(n,o)}var t=o("#tmpl-elementor-add-section");if(t.length>0){var n=t.text();n=n.replace('<div class="elementor-add-section-drag-title','<div class="elementor-add-section-area-button elementor-add-envato-button" title="Envato Elements"> <i class="fa fa-folder"></i> </div><div class="elementor-add-section-drag-title'),t.text(n),elementor.on("preview:loaded",(function(){o(elementor.$previewContents[0].body).on("click",".elementor-add-envato-button",e)}))}}))},58:function(e,t,n){}});
assets/images/template-kit-import.svg DELETED
@@ -1 +0,0 @@
1
- <svg width="253" height="27" viewBox="0 0 253 27" xmlns="http://www.w3.org/2000/svg"><g id="-Resources" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Desktop" transform="translate(-102 -1229)"><g id="Imported-Layers-Copy-8" transform="translate(102 1229.436)"><path d="M16.45 4.883c-.628-.348-2.427-.133-4.588.536-3.783 2.585-6.975 6.394-7.198 12.51-.04.147-.413-.02-.487-.064-1.021-1.958-1.426-4.02-.573-6.993.159-.265-.36-.59-.455-.498-.186.188-.967 1.019-1.485 1.918C-.905 16.75.775 22.46 5.27 24.958c4.493 2.503 10.168.888 12.67-3.607 2.894-5.187.207-15.52-1.49-16.468" id="Fill-1" fill="#7AAC41"/><path d="M32.535 7.373c-5.328 0-9.196 3.961-9.196 9.419 0 5.502 3.857 9.345 9.381 9.345 2.79 0 5-.873 6.756-2.669.525-.566.581-1.112.581-1.321 0-.89-.661-1.536-1.573-1.536-.46 0-.844.173-1.285.581-.994.927-2.304 1.874-4.479 1.874-3.023 0-5.482-2.27-5.637-5.185h12.034c1.308 0 1.944-.612 1.944-1.87 0-.37 0-.638-.075-1.165-.648-4.68-3.807-7.473-8.45-7.473zm0 2.922c2.89 0 4.743 1.841 4.857 4.813H27.087c.27-2.75 2.596-4.813 5.448-4.813z" id="Fill-2" fill="#131412"/><path d="M52.553 7.373c-2.42 0-4.818 1.392-5.754 3.325V9.504c0-1.851-1.434-1.945-1.722-1.945-.849 0-1.758.511-1.758 1.945v14.428c0 1.921 1.527 2.018 1.833 2.018.306 0 1.833-.097 1.833-2.018v-7.735c0-3.365 1.907-5.716 4.638-5.716 2.644 0 3.93 1.735 3.93 5.307v8.144c0 1.921 1.527 2.018 1.834 2.018.305 0 1.832-.097 1.832-2.018v-9.297c0-3.51-1.751-7.262-6.666-7.262" id="Fill-3" fill="#131412"/><path d="M75.805 7.56c-.847 0-1.46.494-1.827 1.466l-5.015 12.611-4.977-12.611c-.39-.987-1-1.467-1.865-1.467-1.01 0-1.833.79-1.833 1.759 0 .24.027.55.23 1.037l5.764 13.61c.687 1.641 1.816 1.985 2.643 1.985.827 0 1.957-.344 2.646-1.985l5.8-13.685c.2-.48.23-.832.23-1 0-.98-.773-1.72-1.796-1.72" id="Fill-4" fill="#131412"/><path d="M86.465 7.373c-2.345 0-4.529.653-6.149 1.838-.549.379-.816.851-.816 1.446 0 .818.625 1.46 1.424 1.46.346 0 .733-.138 1.088-.387 1.392-.928 2.7-1.36 4.117-1.36 2.71 0 4.266 1.378 4.266 3.782v.398c-6.084.006-12.272.742-12.272 6.034 0 3.81 3.256 5.515 6.482 5.515 2.57 0 4.621-1.018 5.938-2.945v.927c0 1.38.927 1.87 1.723 1.87.167 0 1.646-.053 1.646-1.87v-9.706c0-4.384-2.785-7.002-7.447-7.002zm3.16 9.876h.77v.844c0 3.089-1.966 5.084-5.01 5.084-.825 0-3.52-.192-3.52-2.667 0-2.923 4.428-3.261 7.76-3.261z" id="Fill-5" fill="#131412"/><path d="M103.458 10.89c1.604 0 1.685-1.248 1.685-1.498 0-.742-.443-1.535-1.685-1.535h-3.298V4.52c0-1.49-.967-2.02-1.795-2.02-.307 0-1.833.098-1.833 2.02v15.841c0 3.656 1.803 5.588 5.216 5.588.883 0 1.743-.156 2.305-.418.646-.322 1.015-.85 1.015-1.451 0-.847-.614-1.461-1.462-1.461-.163 0-.396.04-.652.114a2.979 2.979 0 01-.76.109c-1.388 0-2.034-.906-2.034-2.853v-9.1h3.298" id="Fill-6" fill="#131412"/><path d="M115.58 7.373c-5.544 0-9.567 3.93-9.567 9.344 0 2.636.974 5.038 2.743 6.764 1.756 1.713 4.178 2.656 6.824 2.656 5.475 0 9.604-4.05 9.604-9.42 0-5.414-4.04-9.344-9.604-9.344zm0 15.656c-3.803 0-5.79-3.175-5.79-6.312 0-4.31 3-6.273 5.79-6.273 2.788 0 5.79 1.963 5.79 6.273 0 4.337-3.002 6.312-5.79 6.312z" id="Fill-7" fill="#131412"/><path d="M136.306 6.965a7.048 7.048 0 00-3.973 1.214c-1.198.799-2.152 1.924-2.833 3.343-.673 1.403-1.015 2.965-1.015 4.642v.722c0 1.68.354 3.235 1.052 4.62.703 1.396 1.693 2.51 2.94 3.314a7.537 7.537 0 004.15 1.217c2.72 0 4.807-1.023 6.202-3.04a.548.548 0 00-.133-.757l-.61-.433a.547.547 0 00-.747.11c-.574.735-1.239 1.284-1.974 1.632-.739.351-1.66.528-2.738.528a5.552 5.552 0 01-3.089-.933c-.955-.626-1.715-1.503-2.261-2.608-.553-1.118-.833-2.353-.833-3.668v-.397h12.448a.548.548 0 00.547-.547v-.914c0-2.37-.667-4.32-1.982-5.795-1.33-1.493-3.064-2.25-5.15-2.25zm-5.735 7.547c.26-1.547.877-2.85 1.84-3.878 1.077-1.15 2.35-1.71 3.895-1.71.968 0 1.852.254 2.629.754.782.504 1.406 1.223 1.856 2.137.41.832.637 1.737.68 2.697h-10.9z" id="Fill-8" fill="#7AAC41"/><path d="M147.134.223h-.865a.547.547 0 00-.547.547v24.611c0 .303.245.547.547.547h.865a.547.547 0 00.547-.547V.771a.547.547 0 00-.547-.548" id="Fill-9" fill="#7AAC41"/><path d="M157.765 6.965a7.048 7.048 0 00-3.973 1.214c-1.199.799-2.153 1.924-2.833 3.343-.674 1.403-1.016 2.965-1.016 4.642v.722c0 1.68.354 3.235 1.053 4.62.703 1.396 1.693 2.511 2.939 3.314a7.542 7.542 0 004.15 1.217c2.72 0 4.807-1.023 6.202-3.04a.547.547 0 00-.133-.757l-.61-.433a.547.547 0 00-.747.11c-.573.734-1.238 1.283-1.974 1.632-.74.351-1.66.528-2.738.528a5.555 5.555 0 01-3.09-.933c-.954-.626-1.715-1.503-2.26-2.608-.553-1.117-.832-2.352-.832-3.668v-.397h12.447a.548.548 0 00.547-.547v-.914c0-2.37-.667-4.32-1.981-5.795-1.33-1.493-3.064-2.25-5.151-2.25zm-5.736 7.547c.26-1.547.878-2.85 1.841-3.878 1.077-1.15 2.35-1.71 3.895-1.71.98 0 1.839.247 2.627.754.782.504 1.407 1.223 1.857 2.137.408.832.637 1.738.681 2.697h-10.9z" id="Fill-10" fill="#7AAC41"/><path d="M186.634 7.125c-1.531 0-2.935.404-4.174 1.2a6.996 6.996 0 00-2.058 2.01c-.375-.928-.928-1.648-1.653-2.15-1.013-.703-2.318-1.06-3.876-1.06a6.7 6.7 0 00-3.936 1.254 7.243 7.243 0 00-1.654 1.628V7.993a.547.547 0 00-.547-.547h-.88a.547.547 0 00-.548.547v17.336c0 .302.245.548.547.548h.88a.547.547 0 00.548-.548V14.434a7.91 7.91 0 011.323-3.064c1.108-1.538 2.488-2.286 4.219-2.286 1.474 0 2.547.367 3.187 1.09.66.742.998 1.926 1.008 3.518v11.637c0 .302.245.548.547.548h.866a.548.548 0 00.547-.548l-.002-11.486c.056-.776.408-1.605 1.046-2.465 1.132-1.514 2.626-2.264 4.568-2.294 1.489-.026 2.512.354 3.171 1.142.675.806 1.018 2.107 1.018 3.866V25.33c0 .302.245.548.547.548h.865a.547.547 0 00.547-.548V14.015c-.011-2.24-.522-3.959-1.519-5.114-1.018-1.179-2.561-1.776-4.587-1.776" id="Fill-11" fill="#7AAC41"/><path d="M202.937 6.965a7.048 7.048 0 00-3.973 1.214c-1.199.799-2.153 1.924-2.833 3.343-.674 1.403-1.016 2.965-1.016 4.642v.722c0 1.68.354 3.235 1.052 4.62.704 1.396 1.693 2.51 2.94 3.314a7.55 7.55 0 004.15 1.217c2.72 0 4.807-1.023 6.203-3.04a.548.548 0 00-.134-.757l-.61-.433a.547.547 0 00-.747.11c-.574.735-1.238 1.284-1.974 1.633-.739.35-1.66.527-2.738.527a5.55 5.55 0 01-3.089-.933c-.953-.625-1.714-1.503-2.261-2.608-.553-1.118-.832-2.353-.832-3.668v-.397h12.447a.548.548 0 00.547-.547v-.914c0-2.37-.667-4.32-1.981-5.795-1.33-1.493-3.064-2.25-5.151-2.25zm-5.736 7.547c.26-1.547.877-2.85 1.84-3.878 1.077-1.15 2.351-1.71 3.896-1.71.98 0 1.84.247 2.628.754.781.504 1.406 1.223 1.856 2.137.41.833.638 1.738.68 2.697h-10.9z" id="Fill-12" fill="#7AAC41"/><path d="M220.08 7.095a6.74 6.74 0 00-3.969 1.27 7.48 7.48 0 00-1.636 1.586V7.962a.547.547 0 00-.547-.547h-.866a.547.547 0 00-.547.547V25.3c0 .302.246.547.547.547h.866a.548.548 0 00.547-.547V14.27c.362-1.537 1.052-2.806 2.052-3.777.998-.967 2.145-1.437 3.505-1.437 1.447 0 2.503.383 3.139 1.14.66.787 1 2.057 1.01 3.77V25.3c0 .302.244.547.546.547h.865a.548.548 0 00.548-.547V13.985c-.012-2.25-.517-3.972-1.503-5.121-1.007-1.174-2.54-1.769-4.556-1.769" id="Fill-13" fill="#7AAC41"/><path d="M236.947 23.94c-1.746.248-2.73.18-3.197-.505-.335-.494-.506-1.308-.506-2.42V9.246h3.395a.547.547 0 00.547-.548v-.864a.547.547 0 00-.547-.547h-3.395V3.154a.547.547 0 00-.547-.548h-.881a.547.547 0 00-.547.548v4.132h-2.657a.547.547 0 00-.548.547v.864c0 .303.245.547.548.547h2.657v11.887c.013 1.647.322 2.839.949 3.644.65.837 1.707 1.262 3.139 1.262.927 0 1.581-.074 1.998-.226a.547.547 0 00.351-.608l-.144-.818a.55.55 0 00-.615-.446" id="Fill-14" fill="#7AAC41"/><path d="M251.88 18.404c-.424-.696-1.104-1.298-2.02-1.792-.872-.47-2.06-.88-3.532-1.221-1.386-.32-2.448-.655-3.157-.994-.663-.317-1.14-.666-1.415-1.035-.258-.345-.389-.853-.389-1.508 0-.818.364-1.487 1.11-2.045.787-.587 1.89-.885 3.279-.885 1.447 0 2.626.354 3.505 1.052.853.676 1.267 1.49 1.267 2.487 0 .302.245.547.547.547h.881a.547.547 0 00.547-.547c0-1.686-.641-3.046-1.906-4.043-1.227-.965-2.855-1.455-4.841-1.455-1.835 0-3.357.453-4.522 1.347-1.211.927-1.825 2.13-1.825 3.574 0 1.422.49 2.562 1.457 3.388.923.789 2.475 1.407 4.745 1.89 3.33.704 4.95 1.933 4.95 3.76 0 .85-.403 1.563-1.231 2.18-.866.646-2.025.973-3.446.973-1.567 0-2.814-.31-3.705-.92-.85-.585-1.3-1.38-1.373-2.432a.547.547 0 00-.546-.509h-.865a.547.547 0 00-.547.547c0 1.566.676 2.859 2.008 3.844 1.281.949 2.973 1.43 5.028 1.43 1.927 0 3.52-.457 4.732-1.358 1.264-.938 1.904-2.196 1.904-3.74 0-.985-.217-1.837-.64-2.535" id="Fill-15" fill="#7AAC41"/></g></g></g></svg>
 
assets/img/144ef025370632ad477e0bebd9edab2b.svg ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="253px" height="27px" viewBox="0 0 253 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
3
+ <!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Envato elements black</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="-Resources" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
8
+ <g id="Desktop" sketch:type="MSArtboardGroup" transform="translate(-102.000000, -1229.000000)">
9
+ <g id="Imported-Layers-Copy-8" sketch:type="MSLayerGroup" transform="translate(102.000000, 1229.435670)">
10
+ <path d="M16.4495708,4.88314894 C15.8221839,4.53468743 14.0228411,4.75032729 11.8617547,5.41912336 C8.07946291,8.00445774 4.88705546,11.8133139 4.66438386,17.9293603 C4.62375607,18.0762454 4.25107414,17.9098277 4.17685027,17.8645121 C3.15568617,15.9065647 2.75097079,13.8454852 3.60415457,10.8718428 C3.76275925,10.6069808 3.2431922,10.2811771 3.14943574,10.3741523 C2.96270412,10.5616652 2.1821816,11.3929724 1.66417716,12.2922532 C-0.904749835,16.7488102 0.775053399,22.4593599 5.26989433,24.9579695 C9.76317266,27.461267 15.4377824,25.846312 17.9402985,21.3514711 C20.8342479,16.1636136 18.1465628,5.83165179 16.4495708,4.88314894" id="Fill-1" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
11
+ <path d="M32.5350541,7.37316424 C27.206562,7.37316424 23.339108,11.3343747 23.339108,16.7917819 C23.339108,22.2937235 27.196405,26.136957 32.7202231,26.136957 C35.5102591,26.136957 37.7197863,25.2642406 39.4761573,23.4680231 C40.0011935,22.9015779 40.0574474,22.3562278 40.0574474,22.1468384 C40.0574474,21.2569333 39.395683,20.610795 38.4839014,20.610795 C38.0244948,20.610795 37.6400933,20.7842445 37.199438,21.1920851 C36.2048382,22.1187114 34.8945917,23.066433 32.7202231,23.066433 C29.6965773,23.066433 27.2378141,20.795964 27.083116,17.8809195 L39.1167576,17.8809195 C40.4254415,17.8809195 41.0606415,17.2691586 41.0606415,16.0112594 C41.0606415,15.6409214 41.0606415,15.3729342 40.9864176,14.8455541 C40.3379354,10.1663254 37.1791241,7.37316424 32.5350541,7.37316424 L32.5350541,7.37316424 Z M32.5350541,10.2952406 C35.4243157,10.2952406 37.2775683,12.1359924 37.39242,15.1080722 L27.0870225,15.1080722 C27.3573536,12.3578827 29.6825138,10.2952406 32.5350541,10.2952406 L32.5350541,10.2952406 Z" id="Fill-2" fill="#131412" sketch:type="MSShapeGroup"></path>
12
+ <path d="M52.5528395,7.37316424 C50.1323602,7.37316424 47.7353201,8.76466636 46.7993181,10.697612 L46.7993181,9.50377979 C46.7993181,7.65287101 45.3648443,7.55911455 45.0773245,7.55911455 C44.2280472,7.55911455 43.3193909,8.07008726 43.3193909,9.50377979 L43.3193909,23.9321176 C43.3193909,25.8533437 44.8460585,25.9502254 45.1523296,25.9502254 C45.4578194,25.9502254 46.9852684,25.8533437 46.9852684,23.9321176 L46.9852684,16.1972097 C46.9852684,12.8321341 48.8924311,10.4811909 51.623088,10.4811909 C54.2670201,10.4811909 55.5530462,12.2164667 55.5530462,15.7878065 L55.5530462,23.9321176 C55.5530462,25.8533437 57.0804952,25.9502254 57.3867663,25.9502254 C57.6922561,25.9502254 59.2189238,25.8533437 59.2189238,23.9321176 L59.2189238,14.6353833 C59.2189238,11.1242039 57.4680219,7.37316424 52.5528395,7.37316424" id="Fill-3" fill="#131412" sketch:type="MSShapeGroup"></path>
13
+ <path d="M75.8052228,7.55911455 C74.9582894,7.55911455 74.3441846,8.05367988 73.9777531,9.02562184 L68.9625639,21.6374283 L63.9856585,9.02562184 C63.5957878,8.03883511 62.9863709,7.55911455 62.1206862,7.55911455 C61.1104604,7.55911455 60.2877474,8.34823142 60.2877474,9.31782948 C60.2877474,9.55768975 60.3150931,9.86864868 60.5182321,10.3546197 L66.2819104,23.9641511 C66.9686765,25.6064517 68.0984418,25.9502254 68.9250613,25.9502254 C69.7516807,25.9502254 70.8822274,25.6064517 71.570556,23.9649324 L77.371737,10.2796145 C77.5701882,9.79989394 77.600659,9.44752591 77.600659,9.28032689 C77.600659,8.29979059 76.8279495,7.55911455 75.8052228,7.55911455" id="Fill-4" fill="#131412" sketch:type="MSShapeGroup"></path>
14
+ <path d="M86.464551,7.37316424 C84.1198582,7.37316424 81.936114,8.02633425 80.3164711,9.21079085 C79.7672145,9.58972321 79.5000086,10.062412 79.5000086,10.6569842 C79.5000086,11.4750094 80.1250517,12.1172411 80.9243255,12.1172411 C81.2696618,12.1172411 81.6571885,11.9789503 82.0119004,11.7304957 C83.4041838,10.8023068 84.7128678,10.3694644 86.1293716,10.3694644 C88.8397146,10.3694644 90.3952905,11.7476844 90.3952905,14.1517563 L90.3952905,14.5502212 C84.3112776,14.5564717 78.1233513,15.2916786 78.1233513,20.5842307 C78.1233513,24.3938682 81.3790443,26.0994544 84.6050478,26.0994544 C87.1747561,26.0994544 89.22646,25.0814155 90.5429569,23.153939 L90.5429569,24.0805653 C90.5429569,25.4611292 91.4703646,25.9502254 92.2657319,25.9502254 C92.4329309,25.9502254 93.9119391,25.8978781 93.9119391,24.0805653 L93.9119391,14.3752092 C93.9119391,9.99053207 91.1265909,7.37316424 86.464551,7.37316424 L86.464551,7.37316424 Z M89.6241436,17.2488447 L90.3952905,17.2488447 L90.3952905,18.0934341 C90.3952905,21.1819281 88.4287488,23.1773781 85.3855704,23.1773781 C84.5597322,23.1773781 81.864234,22.9851774 81.864234,20.5100068 C81.864234,17.5871492 86.2926641,17.2488447 89.6241436,17.2488447 L89.6241436,17.2488447 Z" id="Fill-5" fill="#131412" sketch:type="MSShapeGroup"></path>
15
+ <path d="M103.457909,10.8898128 C105.061926,10.8898128 105.143182,9.64207057 105.143182,9.39205334 C105.143182,8.6498147 104.700182,7.85679131 103.457909,7.85679131 L100.160026,7.85679131 L100.160026,4.52062396 C100.160026,3.03067756 99.1927716,2.50173486 98.3645896,2.50173486 C98.0583185,2.50173486 96.5316508,2.59861654 96.5316508,4.52062396 L96.5316508,20.3623404 C96.5316508,24.018061 98.3349,25.9502254 101.747635,25.9502254 C102.630508,25.9502254 103.490724,25.7939646 104.053263,25.5322279 C104.69862,25.2103307 105.068176,24.681388 105.068176,24.0805653 C105.068176,23.233632 104.454072,22.6195272 103.606357,22.6195272 C103.443064,22.6195272 103.210236,22.6593737 102.953968,22.7335975 C102.639884,22.8117279 102.42737,22.8429801 102.194541,22.8429801 C100.806164,22.8429801 100.160026,21.9366676 100.160026,19.9896585 L100.160026,10.8898128 L103.457909,10.8898128" id="Fill-6" fill="#131412" sketch:type="MSShapeGroup"></path>
16
+ <path d="M115.579838,7.37316424 C110.035706,7.37316424 106.012773,11.3031225 106.012773,16.7167767 C106.012773,19.3528959 106.987059,21.7554051 108.755931,23.4813053 C110.51152,25.1939233 112.934343,26.136957 115.579838,26.136957 C121.055215,26.136957 125.184406,22.0874593 125.184406,16.7167767 C125.184406,11.3031225 121.144284,7.37316424 115.579838,7.37316424 L115.579838,7.37316424 Z M115.579838,23.0289304 C111.777232,23.0289304 109.789595,19.8537116 109.789595,16.7167767 C109.789595,12.4071048 112.790584,10.4436883 115.579838,10.4436883 C118.368312,10.4436883 121.370081,12.4071048 121.370081,16.7167767 C121.370081,21.0537943 118.368312,23.0289304 115.579838,23.0289304 L115.579838,23.0289304 Z" id="Fill-7" fill="#131412" sketch:type="MSShapeGroup"></path>
17
+ <path d="M136.306266,6.96454234 C134.878043,6.96454234 133.541232,7.37316424 132.333336,8.17868849 C131.134816,8.97796231 130.180844,10.1030398 129.500329,11.5218876 C128.826845,12.9251093 128.484634,14.4869356 128.484634,16.1643949 L128.484634,16.8855384 C128.484634,18.5669042 128.838564,20.1209175 129.53705,21.5053879 C130.240223,22.9015779 131.230135,24.0164984 132.477877,24.8196788 C133.731089,25.6275469 135.127279,26.0369501 136.626601,26.0369501 C139.347882,26.0369501 141.433963,25.0142234 142.829372,22.9968969 C142.998915,22.7507862 142.939536,22.413263 142.695769,22.2398135 L142.086352,21.8069712 C141.848054,21.6382096 141.519125,21.6858691 141.338644,21.9163537 C140.765167,22.6515606 140.100278,23.2008172 139.365071,23.5492787 C138.625957,23.9000842 137.7048,24.0774401 136.626601,24.0774401 C135.522618,24.0774401 134.484266,23.763356 133.538107,23.1437821 C132.583353,22.5179577 131.823145,21.6405535 131.277013,20.5357899 C130.72385,19.4177441 130.444144,18.183284 130.444144,16.8675684 L130.444144,16.4714473 L142.891876,16.4714473 C143.193459,16.4714473 143.438789,16.2261179 143.438789,15.9237534 L143.438789,15.0104092 C143.438789,12.6399334 142.771555,10.689799 141.457402,9.21469737 C140.126842,7.72240706 138.393129,6.96454234 136.306266,6.96454234 L136.306266,6.96454234 Z M130.570715,14.5119373 C130.830108,12.9649558 131.448119,11.6625223 132.411467,10.6335451 C133.488103,9.48346589 134.761629,8.92405235 136.306266,8.92405235 C137.27352,8.92405235 138.157956,9.17797609 138.934572,9.67801054 C139.716657,10.1819515 140.340919,10.900751 140.79095,11.8148765 C141.200353,12.6469651 141.428494,13.5524962 141.471466,14.5119373 L130.570715,14.5119373 L130.570715,14.5119373 Z" id="Fill-8" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
18
+ <path d="M147.134356,0.223452895 L146.268671,0.223452895 C145.967088,0.223452895 145.721759,0.468000994 145.721759,0.770365576 L145.721759,25.3814362 C145.721759,25.6838008 145.967088,25.9283489 146.268671,25.9283489 L147.134356,25.9283489 C147.436721,25.9283489 147.681269,25.6838008 147.681269,25.3814362 L147.681269,0.770365576 C147.681269,0.468000994 147.436721,0.223452895 147.134356,0.223452895" id="Fill-9" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
19
+ <path d="M157.764776,6.96454234 C156.336552,6.96454234 154.999742,7.37316424 153.791846,8.17868849 C152.593326,8.97796231 151.639354,10.1030398 150.958838,11.5218876 C150.285354,12.9251093 149.943143,14.4869356 149.943143,16.1643949 L149.943143,16.8855384 C149.943143,18.5669042 150.297074,20.1209175 150.995559,21.5053879 C151.698733,22.9023592 152.688645,24.0172797 153.934824,24.8196788 C155.188817,25.6275469 156.585007,26.0369501 158.08511,26.0369501 C160.80561,26.0369501 162.892473,25.0142234 164.2871,22.9968969 C164.457424,22.7507862 164.398045,22.413263 164.154279,22.2398135 L163.544862,21.8069712 C163.306564,21.6382096 162.977635,21.6858691 162.797154,21.9163537 C162.223677,22.6507793 161.558787,23.2000359 160.822799,23.5492787 C160.083686,23.9000842 159.162528,24.0774401 158.08511,24.0774401 C156.981128,24.0774401 155.941994,23.763356 154.995835,23.1437821 C154.041082,22.5179577 153.280092,21.6405535 152.734742,20.5357899 C152.18236,19.4185254 151.902653,18.1840653 151.902653,16.8675684 L151.902653,16.4714473 L164.350386,16.4714473 C164.651969,16.4714473 164.897299,16.2261179 164.897299,15.9237534 L164.897299,15.0104092 C164.897299,12.6399334 164.230065,10.689799 162.915912,9.21469737 C161.585352,7.72240706 159.851638,6.96454234 157.764776,6.96454234 L157.764776,6.96454234 Z M152.029224,14.5119373 C152.288617,12.9649558 152.906629,11.6625223 153.869976,10.6335451 C154.946613,9.48346589 156.220138,8.92405235 157.764776,8.92405235 C158.745312,8.92405235 159.603965,9.17094436 160.392301,9.67801054 C161.174386,10.1819515 161.798648,10.900751 162.248679,11.8148765 C162.6573,12.6469651 162.886222,13.5532775 162.929975,14.5119373 L152.029224,14.5119373 L152.029224,14.5119373 Z" id="Fill-10" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
20
+ <path d="M186.633952,7.12549093 C185.102597,7.12549093 183.698594,7.52942501 182.460227,8.32557361 C181.620326,8.86701717 180.931997,9.53971976 180.402273,10.3350871 C180.027247,9.40689811 179.474084,8.68731729 178.749034,8.18415762 C177.735683,7.48176548 176.430906,7.12549093 174.872986,7.12549093 C173.439293,7.12549093 172.114983,7.547395 170.936777,8.37948358 C170.308609,8.82248285 169.756227,9.36627031 169.282757,10.0069395 L169.282757,7.99273818 C169.282757,7.6903736 169.038209,7.4458255 168.735844,7.4458255 L167.855315,7.4458255 C167.55295,7.4458255 167.308402,7.6903736 167.308402,7.99273818 L167.308402,25.3290889 C167.308402,25.6314534 167.55295,25.8767828 167.855315,25.8767828 L168.735844,25.8767828 C169.038209,25.8767828 169.282757,25.6314534 169.282757,25.3290889 L169.282757,14.433807 C169.504647,13.3212303 169.950772,12.2899092 170.606286,11.3703146 C171.714174,9.8319274 173.093957,9.08421963 174.824545,9.08421963 C176.298865,9.08421963 177.371595,9.45065113 178.012265,10.1733572 C178.671685,10.9155958 179.00999,12.1000524 179.020147,13.6915683 L179.020147,25.3290889 C179.020147,25.6314534 179.264695,25.8767828 179.567059,25.8767828 L180.432744,25.8767828 C180.734327,25.8767828 180.979657,25.6314534 180.979657,25.3290889 L180.978094,13.8431413 C181.034348,13.0673066 181.385935,12.2375619 182.02426,11.3781277 C183.155588,9.86396085 184.650222,9.11390918 186.591762,9.08421963 C188.080927,9.0584366 189.104435,9.43815027 189.763074,10.2257045 C190.438121,11.0320101 190.781113,12.332881 190.781113,14.0923772 L190.781113,25.3290889 C190.781113,25.6314534 191.025661,25.8767828 191.328026,25.8767828 L192.192929,25.8767828 C192.495294,25.8767828 192.739842,25.6314534 192.739842,25.3290889 L192.739842,14.0150281 C192.728904,11.7758113 192.217931,10.0561616 191.220987,8.90139453 C190.202948,7.72240706 188.659873,7.12549093 186.633952,7.12549093" id="Fill-11" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
21
+ <path d="M202.936638,6.96454234 C201.508415,6.96454234 200.171604,7.37316424 198.963708,8.17868849 C197.765188,8.97796231 196.811216,10.1030398 196.1307,11.5218876 C195.457217,12.9251093 195.115005,14.4869356 195.115005,16.1643949 L195.115005,16.8855384 C195.115005,18.5669042 195.468936,20.1209175 196.167422,21.5053879 C196.870595,22.9015779 197.859726,24.0164984 199.107468,24.8204601 C200.362242,25.6275469 201.757651,26.0369501 203.256973,26.0369501 C205.977473,26.0369501 208.064335,25.0142234 209.459744,22.9968969 C209.629287,22.7507862 209.569908,22.413263 209.326141,22.2398135 L208.716724,21.8069712 C208.478426,21.6382096 208.149497,21.6858691 207.969016,21.9163537 C207.394758,22.6515606 206.730649,23.2008172 205.994661,23.55006 C205.256329,23.9000842 204.335172,24.0774401 203.256973,24.0774401 C202.15299,24.0774401 201.113856,23.763356 200.168479,23.1437821 C199.214507,22.518739 198.454298,21.6413348 197.906604,20.5357899 C197.354222,19.4177441 197.074515,18.1825027 197.074515,16.8675684 L197.074515,16.4714473 L209.522248,16.4714473 C209.823831,16.4714473 210.069161,16.2261179 210.069161,15.9237534 L210.069161,15.0104092 C210.069161,12.6399334 209.401927,10.689799 208.087774,9.21469737 C206.757214,7.72240706 205.023501,6.96454234 202.936638,6.96454234 L202.936638,6.96454234 Z M197.201087,14.5119373 C197.46048,12.9649558 198.078491,11.6625223 199.041839,10.6335451 C200.118475,9.48346589 201.392,8.92405235 202.936638,8.92405235 C203.917174,8.92405235 204.776609,9.17094436 205.564944,9.67801054 C206.346248,10.1819515 206.97051,10.900751 207.421322,11.8148765 C207.830725,12.6477464 208.058866,13.5532775 208.101838,14.5119373 L197.201087,14.5119373 L197.201087,14.5119373 Z" id="Fill-12" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
22
+ <path d="M220.080788,7.09502008 C218.636157,7.09502008 217.300128,7.52239327 216.110983,8.36542011 C215.487503,8.80763808 214.941371,9.33736207 214.474933,9.95146688 L214.474933,7.96226733 C214.474933,7.65990275 214.229604,7.41535465 213.92802,7.41535465 L213.062336,7.41535465 C212.760752,7.41535465 212.515423,7.65990275 212.515423,7.96226733 L212.515423,25.298618 C212.515423,25.6009826 212.760752,25.846312 213.062336,25.846312 L213.92802,25.846312 C214.229604,25.846312 214.474933,25.6009826 214.474933,25.298618 L214.474933,14.2689518 C214.837458,12.7321272 215.527349,11.4625085 216.527418,10.4921291 C217.525143,9.52487499 218.672097,9.05453009 220.032347,9.05453009 C221.479322,9.05453009 222.534863,9.43815027 223.170845,10.1952337 C223.830265,10.9820066 224.170132,12.2516254 224.180289,13.965806 L224.180289,25.298618 C224.180289,25.6009826 224.424837,25.846312 224.727202,25.846312 L225.592105,25.846312 C225.89447,25.846312 226.139799,25.6009826 226.139799,25.298618 L226.139799,13.9845573 C226.12808,11.7351835 225.622576,10.0131899 224.637352,8.86389195 C223.630251,7.6903736 222.097333,7.09502008 220.080788,7.09502008" id="Fill-13" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
23
+ <path d="M236.946794,23.9391494 C235.201361,24.1883853 234.216918,24.1204118 233.75048,23.4352084 C233.414519,22.9406431 233.244195,22.1273058 233.244195,21.0155104 L233.244195,9.24438692 L236.63896,9.24438692 C236.941325,9.24438692 237.185873,8.99983882 237.185873,8.69747424 L237.185873,7.8325709 C237.185873,7.53020631 236.941325,7.28565821 236.63896,7.28565821 L233.244195,7.28565821 L233.244195,3.15412356 C233.244195,2.85175898 232.999647,2.60642958 232.697282,2.60642958 L231.815972,2.60642958 C231.513607,2.60642958 231.269059,2.85175898 231.269059,3.15412356 L231.269059,7.28565821 L228.611845,7.28565821 C228.30948,7.28565821 228.064151,7.53020631 228.064151,7.8325709 L228.064151,8.69747424 C228.064151,8.99983882 228.30948,9.24438692 228.611845,9.24438692 L231.269059,9.24438692 L231.269059,21.1311434 C231.28156,22.7781319 231.590956,23.9696202 232.217562,24.7751444 C232.868388,25.6119209 233.924711,26.0369501 235.356841,26.0369501 C236.284248,26.0369501 236.938199,25.9627263 237.354634,25.8111533 C237.60387,25.7205221 237.752318,25.4634731 237.706221,25.2025176 L237.562461,24.3852738 C237.510895,24.0946288 237.235876,23.8993029 236.946794,23.9391494" id="Fill-14" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
24
+ <path d="M251.879073,18.4036117 C251.455606,17.7082513 250.775872,17.1058661 249.860184,16.612082 C248.988248,16.1425184 247.799885,15.7315526 246.327909,15.3909041 C244.941876,15.0705696 243.880084,14.7361715 243.171441,14.3970857 C242.508114,14.0798763 242.031519,13.7314148 241.755719,13.3618581 C241.497889,13.0173031 241.367411,12.5094556 241.367411,11.8539417 C241.367411,11.0359166 241.730717,10.3671205 242.477644,9.80926959 C243.263635,9.22172911 244.366055,8.92405235 245.755995,8.92405235 C247.202969,8.92405235 248.381957,9.27798298 249.260923,9.9756873 C250.114107,10.6515151 250.528198,11.4656337 250.528198,12.4633587 C250.528198,12.764942 250.772746,13.0102714 251.075111,13.0102714 L251.956422,13.0102714 C252.258786,13.0102714 252.503334,12.764942 252.503334,12.4633587 C252.503334,10.777305 251.861884,9.41705506 250.596953,8.42011138 C249.370306,7.45520115 247.742069,6.96454234 245.755995,6.96454234 C243.920712,6.96454234 242.398732,7.41847987 241.233808,8.31151014 C240.022787,9.23891779 239.408682,10.4413444 239.408682,11.8859752 C239.408682,13.3079481 239.89856,14.4478704 240.865814,15.2744899 C241.788534,16.0628254 243.340984,16.6808368 245.610672,17.1644638 C248.94137,17.8684186 250.560232,19.0974095 250.560232,20.9233166 C250.560232,21.7733751 250.15786,22.4867055 249.329678,23.1047169 C248.463994,23.7500738 247.304539,24.0774401 245.884128,24.0774401 C244.316833,24.0774401 243.069872,23.7672625 242.179186,23.1562829 C241.329127,22.5718676 240.879096,21.7765003 240.805653,20.7248654 C240.78534,20.4381269 240.547042,20.2162366 240.259522,20.2162366 L239.394619,20.2162366 C239.092254,20.2162366 238.847706,20.4607847 238.847706,20.7631493 C238.847706,22.3288822 239.523534,23.62194 240.855657,24.6071641 C242.136995,25.555667 243.828518,26.0369501 245.884128,26.0369501 C247.810824,26.0369501 249.403902,25.5798874 250.615704,24.6790441 C251.879854,23.7406982 252.519742,22.482799 252.519742,20.9389426 C252.519742,19.9544998 252.303321,19.1020973 251.879073,18.4036117" id="Fill-15" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
25
+ </g>
26
+ </g>
27
+ </g>
28
+ </svg>
assets/img/1ce1ac5c2ebe545fa015e53785fd1dd8.svg ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="120px" height="27px" viewBox="0 0 120 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
3
+ <!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Envato elements black</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="-Resources" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
8
+ <g id="Desktop" sketch:type="MSArtboardGroup" transform="translate(-102.000000, -1229.000000)">
9
+ <g id="Imported-Layers-Copy-8" sketch:type="MSLayerGroup" transform="translate(102.000000, 1229.435670)">
10
+ <path d="M16.4495708,4.88314894 C15.8221839,4.53468743 14.0228411,4.75032729 11.8617547,5.41912336 C8.07946291,8.00445774 4.88705546,11.8133139 4.66438386,17.9293603 C4.62375607,18.0762454 4.25107414,17.9098277 4.17685027,17.8645121 C3.15568617,15.9065647 2.75097079,13.8454852 3.60415457,10.8718428 C3.76275925,10.6069808 3.2431922,10.2811771 3.14943574,10.3741523 C2.96270412,10.5616652 2.1821816,11.3929724 1.66417716,12.2922532 C-0.904749835,16.7488102 0.775053399,22.4593599 5.26989433,24.9579695 C9.76317266,27.461267 15.4377824,25.846312 17.9402985,21.3514711 C20.8342479,16.1636136 18.1465628,5.83165179 16.4495708,4.88314894" id="Fill-1" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
11
+ <path d="M32.5350541,7.37316424 C27.206562,7.37316424 23.339108,11.3343747 23.339108,16.7917819 C23.339108,22.2937235 27.196405,26.136957 32.7202231,26.136957 C35.5102591,26.136957 37.7197863,25.2642406 39.4761573,23.4680231 C40.0011935,22.9015779 40.0574474,22.3562278 40.0574474,22.1468384 C40.0574474,21.2569333 39.395683,20.610795 38.4839014,20.610795 C38.0244948,20.610795 37.6400933,20.7842445 37.199438,21.1920851 C36.2048382,22.1187114 34.8945917,23.066433 32.7202231,23.066433 C29.6965773,23.066433 27.2378141,20.795964 27.083116,17.8809195 L39.1167576,17.8809195 C40.4254415,17.8809195 41.0606415,17.2691586 41.0606415,16.0112594 C41.0606415,15.6409214 41.0606415,15.3729342 40.9864176,14.8455541 C40.3379354,10.1663254 37.1791241,7.37316424 32.5350541,7.37316424 L32.5350541,7.37316424 Z M32.5350541,10.2952406 C35.4243157,10.2952406 37.2775683,12.1359924 37.39242,15.1080722 L27.0870225,15.1080722 C27.3573536,12.3578827 29.6825138,10.2952406 32.5350541,10.2952406 L32.5350541,10.2952406 Z" id="Fill-2" fill="#131412" sketch:type="MSShapeGroup"></path>
12
+ <path d="M52.5528395,7.37316424 C50.1323602,7.37316424 47.7353201,8.76466636 46.7993181,10.697612 L46.7993181,9.50377979 C46.7993181,7.65287101 45.3648443,7.55911455 45.0773245,7.55911455 C44.2280472,7.55911455 43.3193909,8.07008726 43.3193909,9.50377979 L43.3193909,23.9321176 C43.3193909,25.8533437 44.8460585,25.9502254 45.1523296,25.9502254 C45.4578194,25.9502254 46.9852684,25.8533437 46.9852684,23.9321176 L46.9852684,16.1972097 C46.9852684,12.8321341 48.8924311,10.4811909 51.623088,10.4811909 C54.2670201,10.4811909 55.5530462,12.2164667 55.5530462,15.7878065 L55.5530462,23.9321176 C55.5530462,25.8533437 57.0804952,25.9502254 57.3867663,25.9502254 C57.6922561,25.9502254 59.2189238,25.8533437 59.2189238,23.9321176 L59.2189238,14.6353833 C59.2189238,11.1242039 57.4680219,7.37316424 52.5528395,7.37316424" id="Fill-3" fill="#131412" sketch:type="MSShapeGroup"></path>
13
+ <path d="M75.8052228,7.55911455 C74.9582894,7.55911455 74.3441846,8.05367988 73.9777531,9.02562184 L68.9625639,21.6374283 L63.9856585,9.02562184 C63.5957878,8.03883511 62.9863709,7.55911455 62.1206862,7.55911455 C61.1104604,7.55911455 60.2877474,8.34823142 60.2877474,9.31782948 C60.2877474,9.55768975 60.3150931,9.86864868 60.5182321,10.3546197 L66.2819104,23.9641511 C66.9686765,25.6064517 68.0984418,25.9502254 68.9250613,25.9502254 C69.7516807,25.9502254 70.8822274,25.6064517 71.570556,23.9649324 L77.371737,10.2796145 C77.5701882,9.79989394 77.600659,9.44752591 77.600659,9.28032689 C77.600659,8.29979059 76.8279495,7.55911455 75.8052228,7.55911455" id="Fill-4" fill="#131412" sketch:type="MSShapeGroup"></path>
14
+ <path d="M86.464551,7.37316424 C84.1198582,7.37316424 81.936114,8.02633425 80.3164711,9.21079085 C79.7672145,9.58972321 79.5000086,10.062412 79.5000086,10.6569842 C79.5000086,11.4750094 80.1250517,12.1172411 80.9243255,12.1172411 C81.2696618,12.1172411 81.6571885,11.9789503 82.0119004,11.7304957 C83.4041838,10.8023068 84.7128678,10.3694644 86.1293716,10.3694644 C88.8397146,10.3694644 90.3952905,11.7476844 90.3952905,14.1517563 L90.3952905,14.5502212 C84.3112776,14.5564717 78.1233513,15.2916786 78.1233513,20.5842307 C78.1233513,24.3938682 81.3790443,26.0994544 84.6050478,26.0994544 C87.1747561,26.0994544 89.22646,25.0814155 90.5429569,23.153939 L90.5429569,24.0805653 C90.5429569,25.4611292 91.4703646,25.9502254 92.2657319,25.9502254 C92.4329309,25.9502254 93.9119391,25.8978781 93.9119391,24.0805653 L93.9119391,14.3752092 C93.9119391,9.99053207 91.1265909,7.37316424 86.464551,7.37316424 L86.464551,7.37316424 Z M89.6241436,17.2488447 L90.3952905,17.2488447 L90.3952905,18.0934341 C90.3952905,21.1819281 88.4287488,23.1773781 85.3855704,23.1773781 C84.5597322,23.1773781 81.864234,22.9851774 81.864234,20.5100068 C81.864234,17.5871492 86.2926641,17.2488447 89.6241436,17.2488447 L89.6241436,17.2488447 Z" id="Fill-5" fill="#131412" sketch:type="MSShapeGroup"></path>
15
+ <path d="M103.457909,10.8898128 C105.061926,10.8898128 105.143182,9.64207057 105.143182,9.39205334 C105.143182,8.6498147 104.700182,7.85679131 103.457909,7.85679131 L100.160026,7.85679131 L100.160026,4.52062396 C100.160026,3.03067756 99.1927716,2.50173486 98.3645896,2.50173486 C98.0583185,2.50173486 96.5316508,2.59861654 96.5316508,4.52062396 L96.5316508,20.3623404 C96.5316508,24.018061 98.3349,25.9502254 101.747635,25.9502254 C102.630508,25.9502254 103.490724,25.7939646 104.053263,25.5322279 C104.69862,25.2103307 105.068176,24.681388 105.068176,24.0805653 C105.068176,23.233632 104.454072,22.6195272 103.606357,22.6195272 C103.443064,22.6195272 103.210236,22.6593737 102.953968,22.7335975 C102.639884,22.8117279 102.42737,22.8429801 102.194541,22.8429801 C100.806164,22.8429801 100.160026,21.9366676 100.160026,19.9896585 L100.160026,10.8898128 L103.457909,10.8898128" id="Fill-6" fill="#131412" sketch:type="MSShapeGroup"></path>
16
+ <path d="M115.579838,7.37316424 C110.035706,7.37316424 106.012773,11.3031225 106.012773,16.7167767 C106.012773,19.3528959 106.987059,21.7554051 108.755931,23.4813053 C110.51152,25.1939233 112.934343,26.136957 115.579838,26.136957 C121.055215,26.136957 125.184406,22.0874593 125.184406,16.7167767 C125.184406,11.3031225 121.144284,7.37316424 115.579838,7.37316424 L115.579838,7.37316424 Z M115.579838,23.0289304 C111.777232,23.0289304 109.789595,19.8537116 109.789595,16.7167767 C109.789595,12.4071048 112.790584,10.4436883 115.579838,10.4436883 C118.368312,10.4436883 121.370081,12.4071048 121.370081,16.7167767 C121.370081,21.0537943 118.368312,23.0289304 115.579838,23.0289304 L115.579838,23.0289304 Z" id="Fill-7" fill="#131412" sketch:type="MSShapeGroup"></path>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
assets/img/335d44c8f32adfd28a587315c1d23982.svg ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
4
+ xmlns:cc="http://creativecommons.org/ns#"
5
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
+ xmlns:svg="http://www.w3.org/2000/svg"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10
+ version="1.1"
11
+ id="svg4170"
12
+ viewBox="0 0 20 21.000001"
13
+ height="21"
14
+ width="20"
15
+ inkscape:version="0.91 r13725"
16
+ sodipodi:docname="envato-logo-white.svg">
17
+ <sodipodi:namedview
18
+ pagecolor="#ffffff"
19
+ bordercolor="#666666"
20
+ borderopacity="1"
21
+ objecttolerance="10"
22
+ gridtolerance="10"
23
+ guidetolerance="10"
24
+ inkscape:pageopacity="0"
25
+ inkscape:pageshadow="2"
26
+ inkscape:window-width="1231"
27
+ inkscape:window-height="660"
28
+ id="namedview4831"
29
+ showgrid="false"
30
+ units="px"
31
+ inkscape:zoom="14.528412"
32
+ inkscape:cx="14.69007"
33
+ inkscape:cy="10.298952"
34
+ inkscape:window-x="236"
35
+ inkscape:window-y="291"
36
+ inkscape:window-maximized="0"
37
+ inkscape:current-layer="layer1" />
38
+ <defs
39
+ id="defs4172" />
40
+ <metadata
41
+ id="metadata4175">
42
+ <rdf:RDF>
43
+ <cc:Work
44
+ rdf:about="">
45
+ <dc:format>image/svg+xml</dc:format>
46
+ <dc:type
47
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
48
+ <dc:title></dc:title>
49
+ </cc:Work>
50
+ </rdf:RDF>
51
+ </metadata>
52
+ <g
53
+ transform="matrix(0.15258256,0,0,0.15258256,-1.9696686,-10.697943)"
54
+ id="layer1">
55
+ <path
56
+ style="fill:#f0f5fa;fill-opacity:1"
57
+ id="path7"
58
+ d="m 118.40629,74.265145 c -3.43888,-1.900432 -13.30303,-0.723974 -25.158105,2.895897 -20.814261,14.207996 -38.280142,35.112798 -39.547097,68.687128 -0.180993,0.81448 -2.26242,-0.0905 -2.714901,-0.36198 -5.610801,-10.76912 -7.782724,-22.08122 -3.167387,-38.37067 0.904967,-1.44795 -1.99093,-3.25788 -2.533911,-2.7149 -0.995464,0.99546 -5.33931,5.6108 -8.144711,10.49762 -14.117499,24.43417 -4.886826,55.83655 19.818795,69.59206 24.705623,13.75552 55.836517,4.88683 69.592027,-19.81879 15.92743,-28.50649 1.17646,-85.248048 -8.14471,-90.406365 z"
59
+ class="st0"
60
+ inkscape:connector-curvature="0" />
61
+ </g>
62
+ </svg>
assets/img/7b1453e570abffbb55937a53ebfc4e10.png ADDED
Binary file
assets/img/a600e1639caf18e7ed558d6e102335c0.svg ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="130px" height="27px" viewBox="0 0 120 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
3
+ <!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Envato elements black</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="-Resources" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
8
+ <g id="Desktop" sketch:type="MSArtboardGroup" transform="translate(-102.000000, -1229.000000)">
9
+ <g id="Imported-Layers-Copy-8" sketch:type="MSLayerGroup" transform="translate(102.000000, 1229.435670)">
10
+ <path d="M16.4495708,4.88314894 C15.8221839,4.53468743 14.0228411,4.75032729 11.8617547,5.41912336 C8.07946291,8.00445774 4.88705546,11.8133139 4.66438386,17.9293603 C4.62375607,18.0762454 4.25107414,17.9098277 4.17685027,17.8645121 C3.15568617,15.9065647 2.75097079,13.8454852 3.60415457,10.8718428 C3.76275925,10.6069808 3.2431922,10.2811771 3.14943574,10.3741523 C2.96270412,10.5616652 2.1821816,11.3929724 1.66417716,12.2922532 C-0.904749835,16.7488102 0.775053399,22.4593599 5.26989433,24.9579695 C9.76317266,27.461267 15.4377824,25.846312 17.9402985,21.3514711 C20.8342479,16.1636136 18.1465628,5.83165179 16.4495708,4.88314894" id="Fill-1" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
11
+ <path d="M32.5350541,7.37316424 C27.206562,7.37316424 23.339108,11.3343747 23.339108,16.7917819 C23.339108,22.2937235 27.196405,26.136957 32.7202231,26.136957 C35.5102591,26.136957 37.7197863,25.2642406 39.4761573,23.4680231 C40.0011935,22.9015779 40.0574474,22.3562278 40.0574474,22.1468384 C40.0574474,21.2569333 39.395683,20.610795 38.4839014,20.610795 C38.0244948,20.610795 37.6400933,20.7842445 37.199438,21.1920851 C36.2048382,22.1187114 34.8945917,23.066433 32.7202231,23.066433 C29.6965773,23.066433 27.2378141,20.795964 27.083116,17.8809195 L39.1167576,17.8809195 C40.4254415,17.8809195 41.0606415,17.2691586 41.0606415,16.0112594 C41.0606415,15.6409214 41.0606415,15.3729342 40.9864176,14.8455541 C40.3379354,10.1663254 37.1791241,7.37316424 32.5350541,7.37316424 L32.5350541,7.37316424 Z M32.5350541,10.2952406 C35.4243157,10.2952406 37.2775683,12.1359924 37.39242,15.1080722 L27.0870225,15.1080722 C27.3573536,12.3578827 29.6825138,10.2952406 32.5350541,10.2952406 L32.5350541,10.2952406 Z" id="Fill-2" fill="#131412" sketch:type="MSShapeGroup"></path>
12
+ <path d="M52.5528395,7.37316424 C50.1323602,7.37316424 47.7353201,8.76466636 46.7993181,10.697612 L46.7993181,9.50377979 C46.7993181,7.65287101 45.3648443,7.55911455 45.0773245,7.55911455 C44.2280472,7.55911455 43.3193909,8.07008726 43.3193909,9.50377979 L43.3193909,23.9321176 C43.3193909,25.8533437 44.8460585,25.9502254 45.1523296,25.9502254 C45.4578194,25.9502254 46.9852684,25.8533437 46.9852684,23.9321176 L46.9852684,16.1972097 C46.9852684,12.8321341 48.8924311,10.4811909 51.623088,10.4811909 C54.2670201,10.4811909 55.5530462,12.2164667 55.5530462,15.7878065 L55.5530462,23.9321176 C55.5530462,25.8533437 57.0804952,25.9502254 57.3867663,25.9502254 C57.6922561,25.9502254 59.2189238,25.8533437 59.2189238,23.9321176 L59.2189238,14.6353833 C59.2189238,11.1242039 57.4680219,7.37316424 52.5528395,7.37316424" id="Fill-3" fill="#131412" sketch:type="MSShapeGroup"></path>
13
+ <path d="M75.8052228,7.55911455 C74.9582894,7.55911455 74.3441846,8.05367988 73.9777531,9.02562184 L68.9625639,21.6374283 L63.9856585,9.02562184 C63.5957878,8.03883511 62.9863709,7.55911455 62.1206862,7.55911455 C61.1104604,7.55911455 60.2877474,8.34823142 60.2877474,9.31782948 C60.2877474,9.55768975 60.3150931,9.86864868 60.5182321,10.3546197 L66.2819104,23.9641511 C66.9686765,25.6064517 68.0984418,25.9502254 68.9250613,25.9502254 C69.7516807,25.9502254 70.8822274,25.6064517 71.570556,23.9649324 L77.371737,10.2796145 C77.5701882,9.79989394 77.600659,9.44752591 77.600659,9.28032689 C77.600659,8.29979059 76.8279495,7.55911455 75.8052228,7.55911455" id="Fill-4" fill="#131412" sketch:type="MSShapeGroup"></path>
14
+ <path d="M86.464551,7.37316424 C84.1198582,7.37316424 81.936114,8.02633425 80.3164711,9.21079085 C79.7672145,9.58972321 79.5000086,10.062412 79.5000086,10.6569842 C79.5000086,11.4750094 80.1250517,12.1172411 80.9243255,12.1172411 C81.2696618,12.1172411 81.6571885,11.9789503 82.0119004,11.7304957 C83.4041838,10.8023068 84.7128678,10.3694644 86.1293716,10.3694644 C88.8397146,10.3694644 90.3952905,11.7476844 90.3952905,14.1517563 L90.3952905,14.5502212 C84.3112776,14.5564717 78.1233513,15.2916786 78.1233513,20.5842307 C78.1233513,24.3938682 81.3790443,26.0994544 84.6050478,26.0994544 C87.1747561,26.0994544 89.22646,25.0814155 90.5429569,23.153939 L90.5429569,24.0805653 C90.5429569,25.4611292 91.4703646,25.9502254 92.2657319,25.9502254 C92.4329309,25.9502254 93.9119391,25.8978781 93.9119391,24.0805653 L93.9119391,14.3752092 C93.9119391,9.99053207 91.1265909,7.37316424 86.464551,7.37316424 L86.464551,7.37316424 Z M89.6241436,17.2488447 L90.3952905,17.2488447 L90.3952905,18.0934341 C90.3952905,21.1819281 88.4287488,23.1773781 85.3855704,23.1773781 C84.5597322,23.1773781 81.864234,22.9851774 81.864234,20.5100068 C81.864234,17.5871492 86.2926641,17.2488447 89.6241436,17.2488447 L89.6241436,17.2488447 Z" id="Fill-5" fill="#131412" sketch:type="MSShapeGroup"></path>
15
+ <path d="M103.457909,10.8898128 C105.061926,10.8898128 105.143182,9.64207057 105.143182,9.39205334 C105.143182,8.6498147 104.700182,7.85679131 103.457909,7.85679131 L100.160026,7.85679131 L100.160026,4.52062396 C100.160026,3.03067756 99.1927716,2.50173486 98.3645896,2.50173486 C98.0583185,2.50173486 96.5316508,2.59861654 96.5316508,4.52062396 L96.5316508,20.3623404 C96.5316508,24.018061 98.3349,25.9502254 101.747635,25.9502254 C102.630508,25.9502254 103.490724,25.7939646 104.053263,25.5322279 C104.69862,25.2103307 105.068176,24.681388 105.068176,24.0805653 C105.068176,23.233632 104.454072,22.6195272 103.606357,22.6195272 C103.443064,22.6195272 103.210236,22.6593737 102.953968,22.7335975 C102.639884,22.8117279 102.42737,22.8429801 102.194541,22.8429801 C100.806164,22.8429801 100.160026,21.9366676 100.160026,19.9896585 L100.160026,10.8898128 L103.457909,10.8898128" id="Fill-6" fill="#131412" sketch:type="MSShapeGroup"></path>
16
+ <path d="M115.579838,7.37316424 C110.035706,7.37316424 106.012773,11.3031225 106.012773,16.7167767 C106.012773,19.3528959 106.987059,21.7554051 108.755931,23.4813053 C110.51152,25.1939233 112.934343,26.136957 115.579838,26.136957 C121.055215,26.136957 125.184406,22.0874593 125.184406,16.7167767 C125.184406,11.3031225 121.144284,7.37316424 115.579838,7.37316424 L115.579838,7.37316424 Z M115.579838,23.0289304 C111.777232,23.0289304 109.789595,19.8537116 109.789595,16.7167767 C109.789595,12.4071048 112.790584,10.4436883 115.579838,10.4436883 C118.368312,10.4436883 121.370081,12.4071048 121.370081,16.7167767 C121.370081,21.0537943 118.368312,23.0289304 115.579838,23.0289304 L115.579838,23.0289304 Z" id="Fill-7" fill="#131412" sketch:type="MSShapeGroup"></path>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
assets/img/ab1b153a91691a58ceca55efc120b195.svg ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="130px" height="27px" viewBox="0 0 130 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
3
+ <!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Envato elements black</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="-Resources" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
8
+ <g id="Desktop" sketch:type="MSArtboardGroup" transform="translate(-102.000000, -1229.000000)">
9
+ <g id="Imported-Layers-Copy-8" sketch:type="MSLayerGroup" transform="translate(102.000000, 1229.435670)">
10
+ <path d="M16.4495708,4.88314894 C15.8221839,4.53468743 14.0228411,4.75032729 11.8617547,5.41912336 C8.07946291,8.00445774 4.88705546,11.8133139 4.66438386,17.9293603 C4.62375607,18.0762454 4.25107414,17.9098277 4.17685027,17.8645121 C3.15568617,15.9065647 2.75097079,13.8454852 3.60415457,10.8718428 C3.76275925,10.6069808 3.2431922,10.2811771 3.14943574,10.3741523 C2.96270412,10.5616652 2.1821816,11.3929724 1.66417716,12.2922532 C-0.904749835,16.7488102 0.775053399,22.4593599 5.26989433,24.9579695 C9.76317266,27.461267 15.4377824,25.846312 17.9402985,21.3514711 C20.8342479,16.1636136 18.1465628,5.83165179 16.4495708,4.88314894" id="Fill-1" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
11
+ <path d="M32.5350541,7.37316424 C27.206562,7.37316424 23.339108,11.3343747 23.339108,16.7917819 C23.339108,22.2937235 27.196405,26.136957 32.7202231,26.136957 C35.5102591,26.136957 37.7197863,25.2642406 39.4761573,23.4680231 C40.0011935,22.9015779 40.0574474,22.3562278 40.0574474,22.1468384 C40.0574474,21.2569333 39.395683,20.610795 38.4839014,20.610795 C38.0244948,20.610795 37.6400933,20.7842445 37.199438,21.1920851 C36.2048382,22.1187114 34.8945917,23.066433 32.7202231,23.066433 C29.6965773,23.066433 27.2378141,20.795964 27.083116,17.8809195 L39.1167576,17.8809195 C40.4254415,17.8809195 41.0606415,17.2691586 41.0606415,16.0112594 C41.0606415,15.6409214 41.0606415,15.3729342 40.9864176,14.8455541 C40.3379354,10.1663254 37.1791241,7.37316424 32.5350541,7.37316424 L32.5350541,7.37316424 Z M32.5350541,10.2952406 C35.4243157,10.2952406 37.2775683,12.1359924 37.39242,15.1080722 L27.0870225,15.1080722 C27.3573536,12.3578827 29.6825138,10.2952406 32.5350541,10.2952406 L32.5350541,10.2952406 Z" id="Fill-2" fill="#131412" sketch:type="MSShapeGroup"></path>
12
+ <path d="M52.5528395,7.37316424 C50.1323602,7.37316424 47.7353201,8.76466636 46.7993181,10.697612 L46.7993181,9.50377979 C46.7993181,7.65287101 45.3648443,7.55911455 45.0773245,7.55911455 C44.2280472,7.55911455 43.3193909,8.07008726 43.3193909,9.50377979 L43.3193909,23.9321176 C43.3193909,25.8533437 44.8460585,25.9502254 45.1523296,25.9502254 C45.4578194,25.9502254 46.9852684,25.8533437 46.9852684,23.9321176 L46.9852684,16.1972097 C46.9852684,12.8321341 48.8924311,10.4811909 51.623088,10.4811909 C54.2670201,10.4811909 55.5530462,12.2164667 55.5530462,15.7878065 L55.5530462,23.9321176 C55.5530462,25.8533437 57.0804952,25.9502254 57.3867663,25.9502254 C57.6922561,25.9502254 59.2189238,25.8533437 59.2189238,23.9321176 L59.2189238,14.6353833 C59.2189238,11.1242039 57.4680219,7.37316424 52.5528395,7.37316424" id="Fill-3" fill="#131412" sketch:type="MSShapeGroup"></path>
13
+ <path d="M75.8052228,7.55911455 C74.9582894,7.55911455 74.3441846,8.05367988 73.9777531,9.02562184 L68.9625639,21.6374283 L63.9856585,9.02562184 C63.5957878,8.03883511 62.9863709,7.55911455 62.1206862,7.55911455 C61.1104604,7.55911455 60.2877474,8.34823142 60.2877474,9.31782948 C60.2877474,9.55768975 60.3150931,9.86864868 60.5182321,10.3546197 L66.2819104,23.9641511 C66.9686765,25.6064517 68.0984418,25.9502254 68.9250613,25.9502254 C69.7516807,25.9502254 70.8822274,25.6064517 71.570556,23.9649324 L77.371737,10.2796145 C77.5701882,9.79989394 77.600659,9.44752591 77.600659,9.28032689 C77.600659,8.29979059 76.8279495,7.55911455 75.8052228,7.55911455" id="Fill-4" fill="#131412" sketch:type="MSShapeGroup"></path>
14
+ <path d="M86.464551,7.37316424 C84.1198582,7.37316424 81.936114,8.02633425 80.3164711,9.21079085 C79.7672145,9.58972321 79.5000086,10.062412 79.5000086,10.6569842 C79.5000086,11.4750094 80.1250517,12.1172411 80.9243255,12.1172411 C81.2696618,12.1172411 81.6571885,11.9789503 82.0119004,11.7304957 C83.4041838,10.8023068 84.7128678,10.3694644 86.1293716,10.3694644 C88.8397146,10.3694644 90.3952905,11.7476844 90.3952905,14.1517563 L90.3952905,14.5502212 C84.3112776,14.5564717 78.1233513,15.2916786 78.1233513,20.5842307 C78.1233513,24.3938682 81.3790443,26.0994544 84.6050478,26.0994544 C87.1747561,26.0994544 89.22646,25.0814155 90.5429569,23.153939 L90.5429569,24.0805653 C90.5429569,25.4611292 91.4703646,25.9502254 92.2657319,25.9502254 C92.4329309,25.9502254 93.9119391,25.8978781 93.9119391,24.0805653 L93.9119391,14.3752092 C93.9119391,9.99053207 91.1265909,7.37316424 86.464551,7.37316424 L86.464551,7.37316424 Z M89.6241436,17.2488447 L90.3952905,17.2488447 L90.3952905,18.0934341 C90.3952905,21.1819281 88.4287488,23.1773781 85.3855704,23.1773781 C84.5597322,23.1773781 81.864234,22.9851774 81.864234,20.5100068 C81.864234,17.5871492 86.2926641,17.2488447 89.6241436,17.2488447 L89.6241436,17.2488447 Z" id="Fill-5" fill="#131412" sketch:type="MSShapeGroup"></path>
15
+ <path d="M103.457909,10.8898128 C105.061926,10.8898128 105.143182,9.64207057 105.143182,9.39205334 C105.143182,8.6498147 104.700182,7.85679131 103.457909,7.85679131 L100.160026,7.85679131 L100.160026,4.52062396 C100.160026,3.03067756 99.1927716,2.50173486 98.3645896,2.50173486 C98.0583185,2.50173486 96.5316508,2.59861654 96.5316508,4.52062396 L96.5316508,20.3623404 C96.5316508,24.018061 98.3349,25.9502254 101.747635,25.9502254 C102.630508,25.9502254 103.490724,25.7939646 104.053263,25.5322279 C104.69862,25.2103307 105.068176,24.681388 105.068176,24.0805653 C105.068176,23.233632 104.454072,22.6195272 103.606357,22.6195272 C103.443064,22.6195272 103.210236,22.6593737 102.953968,22.7335975 C102.639884,22.8117279 102.42737,22.8429801 102.194541,22.8429801 C100.806164,22.8429801 100.160026,21.9366676 100.160026,19.9896585 L100.160026,10.8898128 L103.457909,10.8898128" id="Fill-6" fill="#131412" sketch:type="MSShapeGroup"></path>
16
+ <path d="M115.579838,7.37316424 C110.035706,7.37316424 106.012773,11.3031225 106.012773,16.7167767 C106.012773,19.3528959 106.987059,21.7554051 108.755931,23.4813053 C110.51152,25.1939233 112.934343,26.136957 115.579838,26.136957 C121.055215,26.136957 125.184406,22.0874593 125.184406,16.7167767 C125.184406,11.3031225 121.144284,7.37316424 115.579838,7.37316424 L115.579838,7.37316424 Z M115.579838,23.0289304 C111.777232,23.0289304 109.789595,19.8537116 109.789595,16.7167767 C109.789595,12.4071048 112.790584,10.4436883 115.579838,10.4436883 C118.368312,10.4436883 121.370081,12.4071048 121.370081,16.7167767 C121.370081,21.0537943 118.368312,23.0289304 115.579838,23.0289304 L115.579838,23.0289304 Z" id="Fill-7" fill="#131412" sketch:type="MSShapeGroup"></path>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
assets/img/d0e1f98594bcb43cd7efe3ae4a05fc11.svg ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="253px" height="27px" viewBox="0 0 253 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
3
+ <!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Envato elements black</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="-Resources" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
8
+ <g id="Desktop" sketch:type="MSArtboardGroup" transform="translate(-102.000000, -1229.000000)">
9
+ <g id="Imported-Layers-Copy-8" sketch:type="MSLayerGroup" transform="translate(102.000000, 1229.435670)">
10
+ <path d="M16.4495708,4.88314894 C15.8221839,4.53468743 14.0228411,4.75032729 11.8617547,5.41912336 C8.07946291,8.00445774 4.88705546,11.8133139 4.66438386,17.9293603 C4.62375607,18.0762454 4.25107414,17.9098277 4.17685027,17.8645121 C3.15568617,15.9065647 2.75097079,13.8454852 3.60415457,10.8718428 C3.76275925,10.6069808 3.2431922,10.2811771 3.14943574,10.3741523 C2.96270412,10.5616652 2.1821816,11.3929724 1.66417716,12.2922532 C-0.904749835,16.7488102 0.775053399,22.4593599 5.26989433,24.9579695 C9.76317266,27.461267 15.4377824,25.846312 17.9402985,21.3514711 C20.8342479,16.1636136 18.1465628,5.83165179 16.4495708,4.88314894" id="Fill-1" fill="#7AAC41" sketch:type="MSShapeGroup"></path>
11
+ <path d="M32.5350541,7.37316424 C27.206562,7.37316424 23.339108,11.3343747 23.339108,16.7917819 C23.339108,22.2937235 27.196405,26.136957 32.7202231,26.136957 C35.5102591,26.136957 37.7197863,25.2642406 39.4761573,23.4680231 C40.0011935,22.9015779 40.0574474,22.3562278 40.0574474,22.1468384 C40.0574474,21.2569333 39.395683,20.610795 38.4839014,20.610795 C38.0244948,20.610795 37.6400933,20.7842445 37.199438,21.1920851 C36.2048382,22.1187114 34.8945917,23.066433 32.7202231,23.066433 C29.6965773,23.066433 27.2378141,20.795964 27.083116,17.8809195 L39.1167576,17.8809195 C40.4254415,17.8809195 41.0606415,17.2691586 41.0606415,16.0112594 C41.0606415,15.6409214 41.0606415,15.3729342 40.9864176,14.8455541 C40.3379354,10.1663254 37.1791241,7.37316424 32.5350541,7.37316424 L32.5350541,7.37316424 Z M32.5350541,10.2952406 C35.4243157,10.2952406 37.2775683,12.1359924 37.39242,15.1080722 L27.0870225,15.1080722 C27.3573536,12.3578827 29.6825138,10.2952406 32.5350541,10.2952406 L32.5350541,10.2952406 Z" id="Fill-2" fill="#131412" sketch:type="MSShapeGroup"></path>
12
+ <path d="M52.5528395,7.37316424 C50.1323602,7.37316424 47.7353201,8.76466636 46.7993181,10.697612 L46.7993181,9.50377979 C46.7993181,7.65287101 45.3648443,7.55911455 45.0773245,7.55911455 C44.2280472,7.55911455 43.3193909,8.07008726 43.3193909,9.50377979 L43.3193909,23.9321176 C43.3193909,25.8533437 44.8460585,25.9502254 45.1523296,25.9502254 C45.4578194,25.9502254 46.9852684,25.8533437 46.9852684,23.9321176 L46.9852684,16.1972097 C46.9852684,12.8321341 48.8924311,10.4811909 51.623088,10.4811909 C54.2670201,10.4811909 55.5530462,12.2164667 55.5530462,15.7878065 L55.5530462,23.9321176 C55.5530462,25.8533437 57.0804952,25.9502254 57.3867663,25.9502254 C57.6922561,25.9502254 59.2189238,25.8533437 59.2189238,23.9321176 L59.2189238,14.6353833 C59.2189238,11.1242039 57.4680219,7.37316424 52.5528395,7.37316424" id="Fill-3" fill="#131412" sketch:type="MSShapeGroup"></path>
13
+ <path d="M75.8052228,7.55911455 C74.9582894,7.55911455 74.3441846,8.05367988 73.9777531,9.02562184 L68.9625639,21.6374283 L63.9856585,9.02562184 C63.5957878,8.03883511 62.9863709,7.55911455 62.1206862,7.55911455 C61.1104604,7.55911455 60.2877474,8.34823142 60.2877474,9.31782948 C60.2877474,9.55768975 60.3150931,9.86864868 60.5182321,10.3546197 L66.2819104,23.9641511 C66.9686765,25.6064517 68.0984418,25.9502254 68.9250613,25.9502254 C69.7516807,25.9502254 70.8822274,25.6064517 71.570556,23.9649324 L77.371737,10.2796145 C77.5701882,9.79989394 77.600659,9.44752591 77.600659,9.28032689 C77.600659,8.29979059 76.8279495,7.55911455 75.8052228,7.55911455" id="Fill-4" fill="#131412" sketch:type="MSShapeGroup"></path>
14
+ <path d="M86.464551,7.37316424 C84.1198582,7.37316424 81.936114,8.02633425 80.3164711,9.21079085 C79.7672145,9.58972321 79.5000086,10.062412 79.5000086,10.6569842 C79.5000086,11.4750094 80.1250517,12.1172411 80.9243255,12.1172411 C81.2696618,12.1172411 81.6571885,11.9789503 82.0119004,11.7304957 C83.4041838,10.8023068 84.7128678,10.3694644 86.1293716,10.3694644 C88.8397146,10.3694644 90.3952905,11.7476844 90.3952905,14.1517563 L90.3952905,14.5502212 C84.3112776,14.5564717 78.1233513,15.2916786 78.1233513,20.5842307 C78.1233513,24.3938682 81.3790443,26.0994544 84.6050478,26.0994544 C87.1747561,26.0994544 89.22646,25.0814155 90.5429569,23.153939 L90.5429569,24.0805653 C90.5429569,25.4611292 91.4703646,25.9502254 92.2657319,25.9502254 C92.4329309,25.9502254 93.9119391,25.8978781 93.9119391,24.0805653 L93.9119391,14.3752092 C93.9119391,9.99053207 91.1265909,7.37316424 86.464551,7.37316424 L86.464551,7.37316424 Z M89.6241436,17.2488447 L90.3952905,17.2488447 L90.3952905,18.0934341 C90.3952905,21.1819281 88.4287488,23.1773781 85.3855704,23.1773781 C84.5597322,23.1773781 81.864234,22.9851774 81.864234,20.5100068 C81.864234,17.5871492 86.2926641,17.2488447 89.6241436,17.2488447 L89.6241436,17.2488447 Z" id="Fill-5" fill="#131412" sketch:type="MSShapeGroup"></path>
15
+ <path d="M103.457909,10.8898128 C105.061926,10.8898128 105.143182,9.64207057 105.143182,9.39205334 C105.143182,8.6498147 104.700182,7.85679131 103.457909,7.85679131 L100.160026,7.85679131 L100.160026,4.52062396 C100.160026,3.03067756 99.1927716,2.50173486 98.3645896,2.50173486 C98.0583185,2.50173486 96.5316508,2.59861654 96.5316508,4.52062396 L96.5316508,20.3623404 C96.5316508,24.018061 98.3349,25.9502254 101.747635,25.9502254 C102.630508,25.9502254 103.490724,25.7939646 104.053263,25.5322279 C104.69862,25.2103307 105.068176,24.681388 105.068176,24.0805653 C105.068176,23.233632 104.454072,22.6195272 103.606357,22.6195272 C103.443064,22.6195272 103.210236,22.6593737 102.953968,22.7335975 C102.639884,22.8117279 102.42737,22.8429801 102.194541,22.8429801 C100.806164,22.8429801 100.160026,21.9366676 100.160026,19.9896585 L100.160026,10.8898128 L103.457909,10.8898128" id="Fill-6" fill="#131412" sketch:type="MSShapeGroup"></path>
16
+ <path d="M115.579838,7.37316424 C110.035706,7.37316424 106.012773,11.3031225 106.012773,16.7167767 C106.012773,19.3528959 106.987059,21.7554051 108.755931,23.4813053 C110.51152,25.1939233 112.934343,26.136957 115.579838,26.136957 C121.055215,26.136957 125.184406,22.0874593 125.184406,16.7167767 C125.184406,11.3031225 121.144284,7.37316424 115.579838,7.37316424 L115.579838,7.37316424 Z M115.579838,23.0289304 C111.777232,23.0289304 109.789595,19.8537116 109.789595,16.7167767 C109.789595,12.4071048 112.790584,10.4436883 115.579838,10.4436883 C118.368312,10.4436883 121.370081,12.4071048 121.370081,16.7167767 C121.370081,21.0537943 118.368312,23.0289304 115.579838,23.0289304 L115.579838,23.0289304 Z" id="Fill-7" fill="#131412" sketch:type="MSShapeGroup"></path>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
assets/js/importer.min.js DELETED
@@ -1 +0,0 @@
1
- !function(l){window.TemplateKitImport=function(){function t(t){t.preventDefault();var e=l(this).data();if(e&&e.templateKitId&&e.nonce){var a=parseInt(e.templateIndex,10),n=l('.js-single-template[data-template-index="'+a+'"]');n.addClass("envato-template-kit-import__template--importing"),l.ajax({url:ajaxurl,method:"post",dataType:"json",data:{action:"envato_template_kit_import_process",template_kit_id:parseInt(e.templateKitId,10),template_index:a,nonce:e.nonce},success:function(t){n.addClass("envato-template-kit-import__template--imported"),n.find(".js-edit-template").attr("href",t.data.edit_url)},error:function(){alert("failed to import")},complete:function(){n.removeClass("envato-template-kit-import__template--importing")}})}return!1}function e(t){if(t.preventDefault(),confirm("Are you sure?")){var e=l(this).data();return e&&e.templateKitId&&e.nonce&&l.ajax({url:ajaxurl,type:"post",dataType:"json",data:{action:"envato_template_kit_delete_process",template_kit_id:parseInt(e.templateKitId,10),_ajax_nonce:e.nonce},success:function(t){l(".js-template-kit-id-"+e.templateKitId).remove(),l(".envato-template-kit-import__wrapper").not(".envato-template-kit-import__template-kit")&&location.reload(!0)},error:function(t){alert("Failed to remove template kit!")}}),!1}}function a(t){t.preventDefault();var e=l(this).data();switch(e.pluginStatus){case"deactivated":case"update":case"install":window.location.href=e.pluginUrl;break;case"activated":break;case"error":alert("Unknown error");break;default:alert("Unknown plugin action")}return!1}function n(t){t.preventDefault();var e=l(this).data();switch(e.themeStatus){case"deactivated":case"update":case"install":window.location.href=e.themeUrl;break;case"activated":break;case"error":alert("Unknown error");break;default:alert("Unknown theme action")}return!1}function i(t){t.preventDefault();var e=l(this).data("templateIndex");return l('.js-single-template[data-template-index="'+e+'"]').removeClass("envato-template-kit-import__template--unmet-requirements"),!1}function r(t){return!((l(".envato-template-kit-import__plugin-status--install")[0]||l(".envato-template-kit-import__plugin-status--deactivated")[0])&&!confirm("Some required plugins are not installed or actived. Proceed anyway?"))||(t.preventDefault(),!1)}return{initPluginPage:function(){l(".js-template-kit-plugin").click(a),l(".js-template-kit-theme").click(n),l(".js-template-kit-plugin-next").click(r)},initImportPage:function(){l(".js-template-kit-delete").click(e)},initTemplatePage:function(){l(".js-template-kit-import").click(t),l(".js-template-kit-ignore-requirements").click(i)}}}}(jQuery);
 
assets/main.css ADDED
@@ -0,0 +1 @@
 
1
+ @-webkit-keyframes awBQV-fm_slwwetLVPLAJ{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes awBQV-fm_slwwetLVPLAJ{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._3wneDPyPdcKZxFsyZS1uEb{width:650px;min-height:200px;display:flex;flex-direction:column;color:#7f7f7f}._3wneDPyPdcKZxFsyZS1uEb p{color:#7f7f7f;font-size:14px;line-height:1.8;margin:20px 0}._3wneDPyPdcKZxFsyZS1uEb p strong{color:#4a4a4a}.VtSuT3wmK4xwwtaJiZXoH{position:absolute;right:10px;top:10px;display:block;padding:0;cursor:pointer;color:#919191;border:0;background:transparent}._2bWF1DgEyIFZDL_rq1B6IZ{font-size:24px;height:24px;width:24px;opacity:.7;transition:opacity .2s ease-in-out}._2bWF1DgEyIFZDL_rq1B6IZ:hover{opacity:1}@-webkit-keyframes _6pqeA098THDiDBxyecgug{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _6pqeA098THDiDBxyecgug{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._13e6P0GohbDRkmHTroG_S7{margin:0 0 20px}._7itzF6XYog1bxkCKdFhMe{color:#565656;font-size:31px;font-weight:200;line-height:36px;margin:0;padding:0}.rGSE9GJtpKE5PnTMDw_Oq{color:#7f7f7f;font-size:14px;line-height:1.8;margin:8px 0 0}.rGSE9GJtpKE5PnTMDw_Oq strong{color:#4a4a4a}@-webkit-keyframes _2SZG3SVrcR_I2zhew5WVhr{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _2SZG3SVrcR_I2zhew5WVhr{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._1MRHp_f9iNB0Jtz-kf4sqO{margin:20px 0 0;padding:20px 0 0;border-top:1px solid #ddd}.MoygnBjVJavv8uBOGELlf{padding:0 10px 15px}._5M2DaeazCko44PvOq4fkS{white-space:pre-wrap;word-break:break-all;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;height:100px;width:100%;overflow:auto}.wlk5Cjgf9mEmY8nX8Otdg{color:#7f7f7f;font-size:14px;line-height:1.8;margin:20px 0}.wlk5Cjgf9mEmY8nX8Otdg strong{color:#4a4a4a}._2Hh1HrGBusC0Nmoy5qAW21{font-size:16px;height:16px;transition:none}._3oEmViP6o5wDeSfwFlQbnh{margin-right:4px}@-webkit-keyframes _12_U-KlguERdm4WaWQybRv{to{transform:rotate(1turn)}}@keyframes _12_U-KlguERdm4WaWQybRv{to{transform:rotate(1turn)}}._1RFvnV1ArPcXcuqxqVWYS-{-webkit-animation:_12_U-KlguERdm4WaWQybRv 4s linear infinite;animation:_12_U-KlguERdm4WaWQybRv 4s linear infinite}@-webkit-keyframes _2OzW5Q4M_GlxS0rApsiye2{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _2OzW5Q4M_GlxS0rApsiye2{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._2Be0Bw4xUsveTYiur3RrKz,._2usE8M0Nrup6TXbA9tXIKP,._18ctAe9xome7MXxtRBAQoB,._21iKyeS6-PWKrJ8f_wrLmN,._27o464fKNdOE0zlT86WLYI,.oE7H1W1AK6I1RGMmPCizU{border-radius:4px;padding:0 12px;min-height:36px;font-size:12px;line-height:20px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-weight:400;text-decoration:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap}._2Be0Bw4xUsveTYiur3RrKz[disabled],._2usE8M0Nrup6TXbA9tXIKP[disabled],._18ctAe9xome7MXxtRBAQoB[disabled],._21iKyeS6-PWKrJ8f_wrLmN[disabled],._27o464fKNdOE0zlT86WLYI[disabled],.oE7H1W1AK6I1RGMmPCizU[disabled]{cursor:not-allowed}@media screen and (min-width:1280px){._2Be0Bw4xUsveTYiur3RrKz,._2usE8M0Nrup6TXbA9tXIKP,._18ctAe9xome7MXxtRBAQoB,._21iKyeS6-PWKrJ8f_wrLmN,._27o464fKNdOE0zlT86WLYI,.oE7H1W1AK6I1RGMmPCizU{font-size:14px;padding:0 16px}}.oE7H1W1AK6I1RGMmPCizU{background:#fff;border:1px solid #81b441;color:#81b441}.oE7H1W1AK6I1RGMmPCizU:active,.oE7H1W1AK6I1RGMmPCizU:focus,.oE7H1W1AK6I1RGMmPCizU:hover{background:#639623;border-color:#639623;color:#fff}._27o464fKNdOE0zlT86WLYI{background:#81b441;border:1px solid #81b441;color:#fff}._27o464fKNdOE0zlT86WLYI:active,._27o464fKNdOE0zlT86WLYI:focus,._27o464fKNdOE0zlT86WLYI:hover{background:#639623;border-color:#639623;color:#fff}._2usE8M0Nrup6TXbA9tXIKP{background:#fff;border:1px solid #979797;color:#979797}._2usE8M0Nrup6TXbA9tXIKP:active,._2usE8M0Nrup6TXbA9tXIKP:focus,._2usE8M0Nrup6TXbA9tXIKP:hover{border-color:#23282d;color:#23282d}._18ctAe9xome7MXxtRBAQoB{background:#fff;border:1px solid #ef3962;color:#ef3962}._18ctAe9xome7MXxtRBAQoB:active,._18ctAe9xome7MXxtRBAQoB:focus,._18ctAe9xome7MXxtRBAQoB:hover{background:#ef3962;color:#fff}._21iKyeS6-PWKrJ8f_wrLmN{background:#fff;border:1px solid #ef8539;color:#ef8539}._21iKyeS6-PWKrJ8f_wrLmN:active,._21iKyeS6-PWKrJ8f_wrLmN:focus,._21iKyeS6-PWKrJ8f_wrLmN:hover{background:#ef8539;color:#fff}._12vOKU0MMbbHG4Y6M5o5Gn{display:flex;flex-wrap:wrap}._12vOKU0MMbbHG4Y6M5o5Gn>*{margin:0 10px 5px 0}._1iip-LV7Xv9ykAosgM5NuM{background-color:#fff;display:flex;border-bottom:1px solid #e0e5e9;z-index:20}._3ATGzAjLOmwSzucmY-YngZ{display:flex;justify-content:center;flex-direction:column;padding:0 10px 0 20px;min-height:54px;max-width:140px}._3ATGzAjLOmwSzucmY-YngZ img{height:22px}._3ATGzAjLOmwSzucmY-YngZ a:active,._3ATGzAjLOmwSzucmY-YngZ a:focus{outline:0;border:0;box-shadow:none}._3f2NedzSbwOx_JjYr8nDQA{background-image:url(img/ab1b153a91691a58ceca55efc120b195.svg);background-repeat:no-repeat;background-position:0;background-size:contain;height:22px;width:130px;overflow:hidden;cursor:pointer;text-indent:-9999px}.g4RTLFxxQQsdiP_q8ZEoR{display:flex;flex-direction:row;justify-content:space-between;border-left:1px solid #f1f1f1;flex:1}._1MEPMh6aEquzp_JZjrouzU{display:flex;flex-direction:row;justify-content:left;margin:0;padding:0}@media screen and (max-width:782px){._1MEPMh6aEquzp_JZjrouzU{flex:1;flex-wrap:wrap}}._1bm12lAbQ8gqKEt4fjLrQn{padding:0;margin:0;border-right:1px solid #f1f1f1;position:relative;display:flex;align-items:center}._1bm12lAbQ8gqKEt4fjLrQn:hover>._2WiEnh-1nVnmA2xejNL-jN:after{transform:rotate(90deg)}._3_Y7KIkNPB0VGaikLZPLXr>._2WiEnh-1nVnmA2xejNL-jN{padding:0 40px 0 30px}._3_Y7KIkNPB0VGaikLZPLXr>._2WiEnh-1nVnmA2xejNL-jN:after{content:"\f345";opacity:.7;top:50%;margin-top:-7px;font-family:dashicons;position:absolute;right:14px;transform:rotate(0deg);transform-origin:50% 50%;transition:transform .1s ease}._3_Y7KIkNPB0VGaikLZPLXr:hover ._1qVTgaPdTH08INPOcXB72z{transform:scale(1);transition-delay:.1s;overflow:visible;opacity:1;max-height:200px}._3_Y7KIkNPB0VGaikLZPLXr:hover ._1zR1wFdZwIcQuLgx4F-tr5{max-height:400px;overflow-y:auto;width:300px;right:0;left:auto}._3_Y7KIkNPB0VGaikLZPLXr:hover ._1zR1wFdZwIcQuLgx4F-tr5::-webkit-scrollbar{-webkit-appearance:none;width:7px}._3_Y7KIkNPB0VGaikLZPLXr:hover ._1zR1wFdZwIcQuLgx4F-tr5::-webkit-scrollbar-thumb{border-radius:4px;background-color:rgba(0,0,0,.5);-webkit-box-shadow:0 0 1px hsla(0,0%,100%,.5)}._2WiEnh-1nVnmA2xejNL-jN{display:flex;align-items:center;font-weight:500;text-align:center;justify-content:center;font-size:13px;text-decoration:none;color:#555d66;height:55px;padding:0 30px;cursor:pointer}._2WiEnh-1nVnmA2xejNL-jN:hover{color:#222;background:#f0f2f4}._2WiEnh-1nVnmA2xejNL-jN:active,._2WiEnh-1nVnmA2xejNL-jN:focus{outline:0;border:0;box-shadow:none}.Qvwt8B1yoF-HW_ej6t8Vh,.Qvwt8B1yoF-HW_ej6t8Vh:active,.Qvwt8B1yoF-HW_ej6t8Vh:focus{background-color:#f0f2f4;box-shadow:inset 0 -1px 0 0 #81b440}._1qVTgaPdTH08INPOcXB72z .Qvwt8B1yoF-HW_ej6t8Vh,._1qVTgaPdTH08INPOcXB72z .Qvwt8B1yoF-HW_ej6t8Vh:active,._1qVTgaPdTH08INPOcXB72z .Qvwt8B1yoF-HW_ej6t8Vh:focus{box-shadow:none}.PcQk9lTsWaOSq1mj45FBN:before{content:"NEW";display:block;position:absolute;right:-14px;top:4px;background:#81b440;font-size:10px;padding:1px 7px 0;text-transform:uppercase;color:#fff;font-weight:400;border-radius:9px;z-index:9;line-height:14px}._1qVTgaPdTH08INPOcXB72z{position:absolute;z-index:999;box-shadow:0 6px 18px 2px rgba(0,0,0,.09);width:200px;top:100%;left:-1px;display:flex;flex-direction:column;justify-content:left;margin:0;padding:0;background:#fff;border-top:1px solid #f1f1f1;border-left:1px solid #f1f1f1;border-right:1px solid #f1f1f1;overflow:hidden;max-height:0;opacity:0;transform:scale(.4);transform-origin:60% top;transition:max-height 0s linear 0s,opacity .2s cubic-bezier(.39,.575,.565,1),transform .15s cubic-bezier(.1,1.26,.83,1)}._1qVTgaPdTH08INPOcXB72z ._2WiEnh-1nVnmA2xejNL-jN{justify-content:left;height:45px}._1x0jWzfZZYwAlYcz98019Z{margin:0;padding:0;border-bottom:1px solid #f1f1f1}._3KaLU08cg_uuF1s32FUby1{display:none}@media (min-width:900px){._3KaLU08cg_uuF1s32FUby1{display:flex}._3KaLU08cg_uuF1s32FUby1 ._1bm12lAbQ8gqKEt4fjLrQn{border-right:0;margin-left:10px}}._3eW9zhI2KLBjal6xVn4RRz{position:absolute;display:block;font-size:10px;top:21px;right:13px;border-radius:5px;padding:0 4px;line-height:15px;background-color:#ca4a1f;color:#fff}.YTBkhdOlOh4QuqkDDPCMV{padding:20px}.smcJRtvHEzHA4K9EO3_1I{color:#363b3f;position:relative;padding:5px 0 10px 20px;margin-bottom:0}.LxNzl69Yk4tP4pD1P3Mii{opacity:.5;font-size:9px;text-transform:uppercase;margin-bottom:5px}._3yBF8inPK-HTdDK72RfE3A{font-size:14px;font-weight:700;padding:4px 0 0}.EQB2N9a2IBPzgeDYrPMNb{font-size:12px;word-break:break-word}.EQB2N9a2IBPzgeDYrPMNb p{margin:7px 0}.EQB2N9a2IBPzgeDYrPMNb p a{text-decoration:underline;color:#0073aa}@-webkit-keyframes _3cma45jhRlCxKjGn7bRO89{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _3cma45jhRlCxKjGn7bRO89{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.BLa__01xPXIkNtm7_TdSt{align-items:center;background:#ffecdb;box-shadow:0 1px 0 rgba(239,133,57,.4);color:#ef8539;padding:15px 20px;margin:-20px -20px 20px;display:flex;justify-content:space-between}._3ZL3iPUjoRL0ucRtkAs9o3{color:#7f7f7f;font-size:14px;line-height:1.8;margin:20px 0}._3ZL3iPUjoRL0ucRtkAs9o3 strong{color:#4a4a4a}._1-AMIXQBz-cte-N18jzCRX{margin:0 0 20px}._3vKAgI5R6s3k03eyhym7Df{display:flex;align-items:center}.-n-Jwtjn0DD7AfLrrLJaV{color:#80b341;margin-right:10px}._1b1-yc2PV8H2ahj8c4w44R{margin-right:10px}._1OTzvGGb3zrXM-8YtrNQMC{font-style:italic}@-webkit-keyframes _34GtVyhroSVFfJGkfXkPBN{0%{transform:translateY(0)}20%{transform:translateY(-100%)}50%{transform:translateY(0)}}@keyframes _34GtVyhroSVFfJGkfXkPBN{0%{transform:translateY(0)}20%{transform:translateY(-100%)}50%{transform:translateY(0)}}@-webkit-keyframes sPBhHQ4ITuT-1MaW9Xi6-{0%{opacity:0}to{opacity:1}}@keyframes sPBhHQ4ITuT-1MaW9Xi6-{0%{opacity:0}to{opacity:1}}.w2RTwQaOLn17YZod46h7u{width:130px;height:50px;position:relative;margin:100px auto;-webkit-animation:sPBhHQ4ITuT-1MaW9Xi6- 1s;animation:sPBhHQ4ITuT-1MaW9Xi6- 1s;padding-top:16px}.w2RTwQaOLn17YZod46h7u:before{background-color:#523ee8;-webkit-animation:_34GtVyhroSVFfJGkfXkPBN 1.1s linear -.6s infinite;animation:_34GtVyhroSVFfJGkfXkPBN 1.1s linear -.6s infinite}.w2RTwQaOLn17YZod46h7u:after,.w2RTwQaOLn17YZod46h7u:before{content:"";display:inline-block;width:16px;height:16px;border-radius:50%;margin:0 7px}.w2RTwQaOLn17YZod46h7u:after{background-color:#f73859;-webkit-animation:_34GtVyhroSVFfJGkfXkPBN 1.1s linear 0s infinite;animation:_34GtVyhroSVFfJGkfXkPBN 1.1s linear 0s infinite}._2-bzJzXs2sFLdVdJIzVXp9:before{background-color:#6d47d9;-webkit-animation:_34GtVyhroSVFfJGkfXkPBN 1.1s linear -.4s infinite;animation:_34GtVyhroSVFfJGkfXkPBN 1.1s linear -.4s infinite}._2-bzJzXs2sFLdVdJIzVXp9:after,._2-bzJzXs2sFLdVdJIzVXp9:before{content:"";display:inline-block;width:16px;height:16px;border-radius:50%;margin:0 7px}._2-bzJzXs2sFLdVdJIzVXp9:after{background-color:#f7bc28;-webkit-animation:_34GtVyhroSVFfJGkfXkPBN 1.1s linear -.2s infinite;animation:_34GtVyhroSVFfJGkfXkPBN 1.1s linear -.2s infinite}@-webkit-keyframes fgbtaCDtcZwMQ6i8kx_7h{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes fgbtaCDtcZwMQ6i8kx_7h{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.YCC_eH-Jpwsb9Q6mO0lTY{height:40px;padding:0 30px 0 0;line-height:40px;color:#767676;border-radius:2px;font-size:13px;cursor:pointer;position:relative}.YCC_eH-Jpwsb9Q6mO0lTY:after{content:"\f345";opacity:.7;margin-top:0;font-family:dashicons;position:absolute;right:7px;transform:rotate(0deg);transform-origin:50% 50%;transition:transform .1s ease;font-size:16px}.YCC_eH-Jpwsb9Q6mO0lTY:hover:after{transform:rotate(90deg)}.YCC_eH-Jpwsb9Q6mO0lTY:hover:before{content:"";position:absolute;display:block;left:0;right:0;bottom:-40px;top:100%;background:transparent}.YCC_eH-Jpwsb9Q6mO0lTY:hover .lIzKBHC22tUIXAarE8pxH{display:block}.lIzKBHC22tUIXAarE8pxH{background:#fff;border:1px solid #e0e5e9;border-radius:4px;box-shadow:0 10px 10px rgba(0,0,0,.1);display:none;line-height:30px;min-width:170px;padding:20px;position:absolute;left:-20px;top:130%;white-space:nowrap;z-index:8}.lIzKBHC22tUIXAarE8pxH:after,.lIzKBHC22tUIXAarE8pxH:before{content:"";display:block;position:absolute;bottom:100%;width:0;height:0;border-style:solid}.lIzKBHC22tUIXAarE8pxH:after{left:23px;border-color:transparent transparent #fff;border-width:10px}.lIzKBHC22tUIXAarE8pxH:before{left:23px;border-color:transparent transparent #e2e2e2;border-width:11px}._2K-Pi1nh0u1ynpVVVUGuEd{padding:0 30px}._2lNE8tECbqfbFxRnokrq14{color:#7f7f7f;text-decoration:none;border:0;background:transparent;padding:5px 0;cursor:pointer}._2lNE8tECbqfbFxRnokrq14:hover{color:#4a4a4a}._32agSzLa-PWm5rUc9iOYrN{text-decoration:underline}@-webkit-keyframes _2J9YN8sybBhsSv3bO6Y0dJ{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _2J9YN8sybBhsSv3bO6Y0dJ{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.flGvCh2JytH3XHesfMiTn{width:100%;height:100px;padding:20px;border-radius:4px;margin:0 auto 40px;background:#fff;display:flex;justify-content:center;align-items:center;box-shadow:0 2px 2px rgba(0,0,0,.1)}._3g-ohUYxC4304dELpbK6nX{color:#7f7f7f;font-size:14px;line-height:1.8;margin:20px 0}._3g-ohUYxC4304dELpbK6nX strong{color:#4a4a4a}._3HBo7OiY7oAhkUC0DcalC5{width:100%}._3mcQsRTzcMLIo_3aDXmSTW{display:flex;flex-wrap:wrap;margin:0 -1%;width:102%;padding:0;justify-content:space-between}._35oqEpQsw0Iem8sZOMFdPJ{flex:1}@-webkit-keyframes _1i74u9WkgBk4r-PvirUAjp{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _1i74u9WkgBk4r-PvirUAjp{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._29x1IWY7ih-Z_cuhziTX_h{flex:0 1 100%;padding:0 1% 2%;margin:0;min-width:0}@media (min-width:600px) and (max-width:999px){._29x1IWY7ih-Z_cuhziTX_h{flex:0 1 50%}}@media (min-width:1000px){._29x1IWY7ih-Z_cuhziTX_h._38zLz2nXY2NakXStBq7xZr{flex:0 1 20%}._29x1IWY7ih-Z_cuhziTX_h.ojjeLEVFrktXiNkPmioSa{flex:0 1 25%}._29x1IWY7ih-Z_cuhziTX_h._2iDZ0-OZSyg_cinELwspdB{flex:0 1 33.3333333%}._29x1IWY7ih-Z_cuhziTX_h._3ECSpiJkcXOuffVV4FDX4H{flex:0 1 40%}._29x1IWY7ih-Z_cuhziTX_h._1N209ISbx9eXpsnZ8gf_E8{flex:0 1 50%}._29x1IWY7ih-Z_cuhziTX_h.iL7A82T74DNFqR323gSkk{flex:0 1 60%}._29x1IWY7ih-Z_cuhziTX_h._1Z01QZCFXOC4Iptqxmm-wa{flex:0 1 100%}}@-webkit-keyframes GUvXxfZ5AjgA3maasKfZZ{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes GUvXxfZ5AjgA3maasKfZZ{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._2a4Y69W6c3mML4frSpYOmg{border-radius:4px;height:100%;overflow:visible;position:relative}._2a4Y69W6c3mML4frSpYOmg:hover:before{opacity:.15}._2a4Y69W6c3mML4frSpYOmg:before{content:"";position:absolute;top:0;left:0;bottom:0;right:0;opacity:.07;z-index:-1;box-shadow:0 2px 4px #000;transition:opacity .2s linear}._3M7jqxCB1Fqeew3rsDpX1t{height:100%;background:#fff;background-position:50%;background-size:cover;background-repeat:no-repeat;border-radius:4px;display:flex;flex-direction:column;overflow:hidden}._23eXjuy0IdpvkPq97ycwom{position:relative;display:block;width:100%}._30Q8QKN8kALE447Su96N1M{margin-top:auto;padding:13px 20px 10px}.Y-vzaeXp1NOUveSNYrCK{color:#000;font-size:18px;line-height:22px;margin:10px 0 2px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._1lfSIqVF-Gj7sxiaXFa6AD{color:#7f7f7f;font-size:14px;line-height:1.8;margin:0 0 13px}._1lfSIqVF-Gj7sxiaXFa6AD strong{color:#4a4a4a}._2Zt_cNkR6xj4U41EeK54Bt{background:#81b441;border-radius:3px;display:inline-block;padding:6px 7px}.IG22ss47WE-9H86QczzcI{position:relative;top:2px}@-webkit-keyframes _1UD--Zviw9FLEUxQOeDuW{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _1UD--Zviw9FLEUxQOeDuW{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._1hLv3Vplzcafex4sThG6ja{width:800px;min-height:200px;height:80vh;display:flex;flex-direction:column;color:#7f7f7f}._1hLv3Vplzcafex4sThG6ja p{color:#7f7f7f;font-size:14px;line-height:1.8;margin:20px 0}._1hLv3Vplzcafex4sThG6ja p strong{color:#4a4a4a}._3sz0952abrtBvMlC0tNXWY{align-items:center;background-color:#26292c;display:flex;flex-direction:row;padding:7px 13px}.swbP218Njg0YSBx52xzN-{flex:0 0 240px}._18YAF71-_PGUeWbsNymQjh{color:#fff;font-size:15px;margin:auto;text-align:center;padding:10px}._3lkT9iDnpJz683wkZ438oI{display:flex;justify-content:flex-end;flex-direction:row;flex:0 0 240px}._38J4xJEwecKHqwsqOOSmcP{cursor:pointer;color:#919191;border:0;background:transparent;margin-left:12px;padding-right:6px;display:flex}._38J4xJEwecKHqwsqOOSmcP:before{content:"";display:inline-block;border-left:1px solid #a5afb7;color:#fff;margin-right:10px;height:20px;opacity:.3}._1j9z4gjnHlcXa_Seeb8VNw{font-size:24px;height:24px;width:24px;opacity:.7;transition:opacity .2s ease-in-out}._1j9z4gjnHlcXa_Seeb8VNw:hover{opacity:1}._21gITcQFs6-1eXOnewtJIo{width:100%;height:auto}@-webkit-keyframes rS2x6Luy5j8HL3enXHplD{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes rS2x6Luy5j8HL3enXHplD{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._1syGJ-On-p-JGwC6hnuzCN{height:200px;overflow:hidden;position:relative;box-shadow:0 1px 2px rgba(0,0,0,.1);padding-bottom:66%}._1syGJ-On-p-JGwC6hnuzCN:hover ._3crHCTct5CMw3Zp5ijQNRN{opacity:1}._39DJgZVRV5xAn8z88mA-uG{margin:0;padding:0;line-height:0;font-size:0;display:block;width:100%}._3crHCTct5CMw3Zp5ijQNRN{position:absolute;bottom:10px;right:10px;opacity:0;transition:opacity .2s}._1zHW-Dd_M6fbS6Lk35I40I{color:#7f7f7f;font-size:14px;line-height:1.8;margin:20px 0}._1zHW-Dd_M6fbS6Lk35I40I strong{color:#4a4a4a}.OJk9AW6HhjoXS4r8kOe6a{align-self:center;display:flex}._2AsRtyYmk4u2ra-d2YsjGE{margin-left:auto}@-webkit-keyframes _9hudWSkYQfD6mHTPcIHOZ{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _9hudWSkYQfD6mHTPcIHOZ{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._1tM0JQuJNW5GDki987p_ZA:hover ._2KcZsZdCiISn45qXUKMRgV{opacity:1;transition:opacity .4s ease-in-out}._26nQzLECUlZzB9t8hf3ISe{display:block;padding-bottom:66%;overflow:hidden;position:relative;box-shadow:0 1px 2px rgba(0,0,0,.1)}.F1R9OT0JMbCsLNWZkvFh5{position:absolute;width:100%}._2KcZsZdCiISn45qXUKMRgV{opacity:0;margin:0 0 0 auto}@-webkit-keyframes _3dOp6uIisP8nxgn6DNzr7G{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _3dOp6uIisP8nxgn6DNzr7G{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._2vHHKAFgRCtc9rZyL4g6lx{position:relative;padding-bottom:66%;padding-top:136px;height:100%}._8i15mGt9tRuGZfTmoC28_{position:absolute;top:0;left:0;right:0;bottom:0;border:5px dashed rgba(0,0,0,.1);background:transparent;display:flex;align-items:center;flex-direction:column;justify-content:space-evenly}._8i15mGt9tRuGZfTmoC28_:hover{background:#ddd}._1CRwVNeu-DGYq7ZtYnaQQV{display:none}.sDTdiaai1sXMd7gMpzPPx{width:100px;height:100px}.sDTdiaai1sXMd7gMpzPPx:before{background:hsla(0,0%,60%,.1);border-radius:50%;display:inline-block;content:"\f132";-webkit-font-smoothing:antialiased;font:normal 74px/115px dashicons;width:100px;height:100px;vertical-align:middle;text-align:center;color:#999;position:absolute;padding:0;text-shadow:none;z-index:4;text-indent:-4px}._2QEWeBB-Unz4qsVLTW_9g8{font-size:18px}.pk0dHrPKaw-XkGQWVdEpD{display:none}._21RxIKPF66UF3i_0gurks6{margin-left:-20px}._21RxIKPF66UF3i_0gurks6 *{box-sizing:border-box}._21RxIKPF66UF3i_0gurks6 a:active,._21RxIKPF66UF3i_0gurks6 a:focus,._21RxIKPF66UF3i_0gurks6 button:active,._21RxIKPF66UF3i_0gurks6 button:focus,._21RxIKPF66UF3i_0gurks6 form:active,._21RxIKPF66UF3i_0gurks6 form:focus,._21RxIKPF66UF3i_0gurks6 input:active,._21RxIKPF66UF3i_0gurks6 input:focus{box-shadow:none;outline:none}@media screen and (max-width:782px){._21RxIKPF66UF3i_0gurks6{margin-left:-10px}}._1NCoEByT5qnU9-27CT6rhQ{padding:20px}@media screen and (max-width:782px){._1NCoEByT5qnU9-27CT6rhQ{padding:20px}}.toplevel_page_template-kit-import #wpbody-content>*{display:none}.toplevel_page_template-kit-import #wpbody-content>#template-kit-import-app-holder{display:block}@-webkit-keyframes _1kH5mtGfYJQ7INQWvAR_Bg{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _1kH5mtGfYJQ7INQWvAR_Bg{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._2-WTW-ONNDbBCZWx2E-iYf{width:1200px;max-width:90vw;min-height:200px;height:80vh;display:flex;flex-direction:column;color:#7f7f7f}._2-WTW-ONNDbBCZWx2E-iYf p{color:#7f7f7f;font-size:14px;line-height:1.8;margin:20px 0}._2-WTW-ONNDbBCZWx2E-iYf p strong{color:#4a4a4a}._25Lej_JkIhFX7HlXWkTUWY{align-items:center;background-color:#26292c;display:flex;flex-direction:row;padding:7px 13px}._3tiNOk61Dfy5TC8zxV8FJC{flex:0 0 240px}._1nzno2ylybbG--bLj3_vIA{color:#fff;display:flex;font-size:15px;margin:auto;text-align:center}._7yUfTOIDWGezhu5HtUwvH{display:flex;justify-content:flex-end;flex-direction:row;flex:0 0 240px}._29IB-UjZnCrhG5pH60uAQI{cursor:pointer;color:#919191;border:0;background:transparent;margin-left:12px;padding-right:6px;display:flex}._29IB-UjZnCrhG5pH60uAQI:before{content:"";display:inline-block;border-left:1px solid #a5afb7;color:#fff;margin-right:10px;height:20px;opacity:.3}._2R7nr7DH9EW42LxE_rbVIT{font-size:24px;height:24px;width:24px;opacity:.7;transition:opacity .2s ease-in-out}._2R7nr7DH9EW42LxE_rbVIT:hover{opacity:1}.RvNK3VwNt4oHQU8jY-Mfn{margin:auto 0;height:100%;padding:20px}
assets/main.js ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=59)}([function(e,t,n){"use strict";e.exports=n(39)},function(e,t,n){e.exports=n(44)()},function(e,t,n){e.exports={wrapper:"BLa__01xPXIkNtm7_TdSt",notice:"_3ZL3iPUjoRL0ucRtkAs9o3",requirements:"_1-AMIXQBz-cte-N18jzCRX",requirement:"_3vKAgI5R6s3k03eyhym7Df",icon:"-n-Jwtjn0DD7AfLrrLJaV",text:"_1b1-yc2PV8H2ahj8c4w44R",status:"_1OTzvGGb3zrXM-8YtrNQMC","icon-spin":"_3cma45jhRlCxKjGn7bRO89"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=n(43),o=(r=a)&&r.__esModule?r:{default:r};t.default=o.default,e.exports=t.default},function(e,t,n){e.exports={wrapper:"_1iip-LV7Xv9ykAosgM5NuM",logo:"_3ATGzAjLOmwSzucmY-YngZ",logoLink:"_3f2NedzSbwOx_JjYr8nDQA",menu:"g4RTLFxxQQsdiP_q8ZEoR",menuInner:"_1MEPMh6aEquzp_JZjrouzU",menuItem:"_1bm12lAbQ8gqKEt4fjLrQn",menuLink:"_2WiEnh-1nVnmA2xejNL-jN",menuItemHasChild:"_3_Y7KIkNPB0VGaikLZPLXr",subNavWrap:"_1qVTgaPdTH08INPOcXB72z",subNavWrapNotifications:"_1zR1wFdZwIcQuLgx4F-tr5",menuLinkActive:"Qvwt8B1yoF-HW_ej6t8Vh",menuLinkNew:"PcQk9lTsWaOSq1mj45FBN",subNavItem:"_1x0jWzfZZYwAlYcz98019Z",menuRight:"_3KaLU08cg_uuF1s32FUby1",menuCountLabel:"_3eW9zhI2KLBjal6xVn4RRz",dropDownInner:"YTBkhdOlOh4QuqkDDPCMV",notification:"smcJRtvHEzHA4K9EO3_1I",date:"LxNzl69Yk4tP4pD1P3Mii",title:"_3yBF8inPK-HTdDK72RfE3A",content:"EQB2N9a2IBPzgeDYrPMNb"}},function(e,t,n){e.exports={currentKit:"YCC_eH-Jpwsb9Q6mO0lTY",optionKitWrapper:"lIzKBHC22tUIXAarE8pxH",optionKit:"_2K-Pi1nh0u1ynpVVVUGuEd",optionKitLink:"_2lNE8tECbqfbFxRnokrq14",optionKitLinkCurrent:"_32agSzLa-PWm5rUc9iOYrN","icon-spin":"fgbtaCDtcZwMQ6i8kx_7h"}},function(e,t,n){e.exports={item:"_29x1IWY7ih-Z_cuhziTX_h",widthTwenty:"_38zLz2nXY2NakXStBq7xZr",widthTwentyFive:"ojjeLEVFrktXiNkPmioSa",widthThirtyThree:"_2iDZ0-OZSyg_cinELwspdB",widthFourty:"_3ECSpiJkcXOuffVV4FDX4H",widthFifty:"_1N209ISbx9eXpsnZ8gf_E8",widthSixty:"iL7A82T74DNFqR323gSkk",widthFull:"_1Z01QZCFXOC4Iptqxmm-wa","icon-spin":"_1i74u9WkgBk4r-PvirUAjp"}},function(e,t,n){e.exports={modalInner:"_2-WTW-ONNDbBCZWx2E-iYf",modalHeader:"_25Lej_JkIhFX7HlXWkTUWY",modalLogo:"_3tiNOk61Dfy5TC8zxV8FJC",headerNav:"_1nzno2ylybbG--bLj3_vIA",headerActions:"_7yUfTOIDWGezhu5HtUwvH",closeButton:"_29IB-UjZnCrhG5pH60uAQI",dismissIcon:"_2R7nr7DH9EW42LxE_rbVIT",magicModalInner:"RvNK3VwNt4oHQU8jY-Mfn","icon-spin":"_1kH5mtGfYJQ7INQWvAR_Bg"}},function(e,t,n){e.exports={debugWrapper:"_1MRHp_f9iNB0Jtz-kf4sqO",debugInformation:"MoygnBjVJavv8uBOGELlf",debugText:"_5M2DaeazCko44PvOq4fkS",copy:"wlk5Cjgf9mEmY8nX8Otdg","icon-spin":"_2SZG3SVrcR_I2zhew5WVhr"}},function(e,t,n){e.exports={modalInner:"_1hLv3Vplzcafex4sThG6ja",modalHeader:"_3sz0952abrtBvMlC0tNXWY",modalLogo:"swbP218Njg0YSBx52xzN-",headerTitle:"_18YAF71-_PGUeWbsNymQjh",headerActions:"_3lkT9iDnpJz683wkZ438oI",closeButton:"_38J4xJEwecKHqwsqOOSmcP",dismissIcon:"_1j9z4gjnHlcXa_Seeb8VNw","icon-spin":"_1UD--Zviw9FLEUxQOeDuW"}},function(e,t,n){e.exports={wrapper:"_2a4Y69W6c3mML4frSpYOmg",inner:"_3M7jqxCB1Fqeew3rsDpX1t",images:"_23eXjuy0IdpvkPq97ycwom",meta:"_30Q8QKN8kALE447Su96N1M",cardTitle:"Y-vzaeXp1NOUveSNYrCK",cardDescription:"_1lfSIqVF-Gj7sxiaXFa6AD","icon-spin":"GUvXxfZ5AjgA3maasKfZZ"}},function(e,t,n){e.exports={uploadCard:"_2vHHKAFgRCtc9rZyL4g6lx",uploadCardButton:"_8i15mGt9tRuGZfTmoC28_",formInput:"_1CRwVNeu-DGYq7ZtYnaQQV",icon:"sDTdiaai1sXMd7gMpzPPx",message:"_2QEWeBB-Unz4qsVLTW_9g8","icon-spin":"_3dOp6uIisP8nxgn6DNzr7G"}},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(40)},function(e,t,n){e.exports={button:"_2Be0Bw4xUsveTYiur3RrKz",ghost:"oE7H1W1AK6I1RGMmPCizU",primary:"_27o464fKNdOE0zlT86WLYI",secondary:"_2usE8M0Nrup6TXbA9tXIKP",warning:"_18ctAe9xome7MXxtRBAQoB",attention:"_21iKyeS6-PWKrJ8f_wrLmN","icon-spin":"_2OzW5Q4M_GlxS0rApsiye2"}},function(e,t,n){e.exports={imageWrapper:"_1syGJ-On-p-JGwC6hnuzCN",expandButton:"_3crHCTct5CMw3Zp5ijQNRN",image:"_39DJgZVRV5xAn8z88mA-uG",unmetRequirementsMessage:"_1zHW-Dd_M6fbS6Lk35I40I","icon-spin":"rS2x6Luy5j8HL3enXHplD"}},function(e,t,n){e.exports={itemCard:"_1tM0JQuJNW5GDki987p_ZA",itemDelete:"_2KcZsZdCiISn45qXUKMRgV",itemImageLink:"_26nQzLECUlZzB9t8hf3ISe",itemImage:"F1R9OT0JMbCsLNWZkvFh5","icon-spin":"_9hudWSkYQfD6mHTPcIHOZ"}},function(e,t,n){e.exports={modalInner:"_3wneDPyPdcKZxFsyZS1uEb",closeButton:"VtSuT3wmK4xwwtaJiZXoH",dismissIcon:"_2bWF1DgEyIFZDL_rq1B6IZ","icon-spin":"awBQV-fm_slwwetLVPLAJ"}},function(e,t,n){e.exports={wrapper:"_13e6P0GohbDRkmHTroG_S7",title:"_7itzF6XYog1bxkCKdFhMe",subtitle:"rGSE9GJtpKE5PnTMDw_Oq","icon-spin":"_6pqeA098THDiDBxyecgug"}},function(e,t,n){e.exports={icon:"_2Hh1HrGBusC0Nmoy5qAW21",iconWithLabel:"_3oEmViP6o5wDeSfwFlQbnh",iconSpinning:"_1RFvnV1ArPcXcuqxqVWYS-",iconSpin:"_12_U-KlguERdm4WaWQybRv"}},function(e,t,n){e.exports={wrapper:"_3HBo7OiY7oAhkUC0DcalC5",inner:"_3mcQsRTzcMLIo_3aDXmSTW",cardSpacing:"_35oqEpQsw0Iem8sZOMFdPJ"}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=void 0;var r,a=n(50);var o=((r=a)&&r.__esModule?r:{default:r}).default,i=o.canUseDOM?window.HTMLElement:{};t.canUseDOM=o.canUseDOM;t.default=i},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){var r=n(55);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return l(o(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=d;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,i=0,l="",s=t&&t.delimiter||"/";null!=(n=a.exec(e));){var f=n[0],d=n[1],p=n.index;if(l+=e.slice(i,p),i=p+f.length,d)l+=d[1];else{var m=e[i],h=n[2],y=n[3],v=n[4],g=n[5],b=n[6],w=n[7];l&&(r.push(l),l="");var E=null!=h&&null!=m&&m!==h,k="+"===b||"*"===b,x="?"===b||"*"===b,S=n[2]||s,C=v||g;r.push({name:y||o++,prefix:h||"",delimiter:S,optional:x,repeat:k,partial:E,asterisk:!!w,pattern:C?c(C):w?".*":"[^"+u(S)+"]+?"})}}return i<e.length&&(l+=e.substr(i)),l&&r.push(l),r}function i(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function l(e,t){for(var n=new Array(e.length),a=0;a<e.length;a++)"object"==typeof e[a]&&(n[a]=new RegExp("^(?:"+e[a].pattern+")$",f(t)));return function(t,a){for(var o="",l=t||{},u=(a||{}).pretty?i:encodeURIComponent,c=0;c<e.length;c++){var s=e[c];if("string"!=typeof s){var f,d=l[s.name];if(null==d){if(s.optional){s.partial&&(o+=s.prefix);continue}throw new TypeError('Expected "'+s.name+'" to be defined')}if(r(d)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but received `'+JSON.stringify(d)+"`");if(0===d.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var p=0;p<d.length;p++){if(f=u(d[p]),!n[c].test(f))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'", but received `'+JSON.stringify(f)+"`");o+=(0===p?s.prefix:s.delimiter)+f}}else{if(f=s.asterisk?encodeURI(d).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):u(d),!n[c].test(f))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but received "'+f+'"');o+=s.prefix+f}}else o+=s}return o}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function s(e,t){return e.keys=t,e}function f(e){return e&&e.sensitive?"":"i"}function d(e,t,n){r(t)||(n=t||n,t=[]);for(var a=(n=n||{}).strict,o=!1!==n.end,i="",l=0;l<e.length;l++){var c=e[l];if("string"==typeof c)i+=u(c);else{var d=u(c.prefix),p="(?:"+c.pattern+")";t.push(c),c.repeat&&(p+="(?:"+d+p+")*"),i+=p=c.optional?c.partial?d+"("+p+")?":"(?:"+d+"("+p+"))?":d+"("+p+")"}}var m=u(n.delimiter||"/"),h=i.slice(-m.length)===m;return a||(i=(h?i.slice(0,-m.length):i)+"(?:"+m+"(?=$))?"),i+=o?"$":a&&h?"":"(?="+m+"|$)",s(new RegExp("^"+i,f(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return s(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],a=0;a<e.length;a++)r.push(p(e[a],t,n).source);return s(new RegExp("(?:"+r.join("|")+")",f(n)),t)}(e,t,n):function(e,t,n){return d(o(e,n),t,n)}(e,t,n)}},function(e,t,n){e.exports={wrap:"w2RTwQaOLn17YZod46h7u",fadein:"sPBhHQ4ITuT-1MaW9Xi6-",bounceDot:"_34GtVyhroSVFfJGkfXkPBN",inner:"_2-bzJzXs2sFLdVdJIzVXp9"}},function(e,t,n){e.exports={message:"flGvCh2JytH3XHesfMiTn",copy:"_3g-ohUYxC4304dELpbK6nX","icon-spin":"_2J9YN8sybBhsSv3bO6Y0dJ"}},function(e,t,n){e.exports={svgWrapper:"_2Zt_cNkR6xj4U41EeK54Bt",svgEnvatoLogo:"IG22ss47WE-9H86QczzcI"}},function(e,t,n){e.exports={headerWrapper:"OJk9AW6HhjoXS4r8kOe6a",deleteKitWrapper:"_2AsRtyYmk4u2ra-d2YsjGE"}},function(e,t,n){e.exports={wrapper:"_21RxIKPF66UF3i_0gurks6",container:"_1NCoEByT5qnU9-27CT6rhQ"}},function(e,t,n){"use strict";
2
+ /*
3
+ object-assign
4
+ (c) Sindre Sorhus
5
+ @license MIT
6
+ */var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=i(e),c=1;c<arguments.length;c++){for(var s in n=Object(arguments[c]))a.call(n,s)&&(u[s]=n[s]);if(r){l=r(n);for(var f=0;f<l.length;f++)o.call(n,l[f])&&(u[l[f]]=n[l[f]])}}return u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return[].slice.call(e.querySelectorAll("*"),0).filter(i)};
7
+ /*!
8
+ * Adapted from jQuery UI core
9
+ *
10
+ * http://jqueryui.com
11
+ *
12
+ * Copyright 2014 jQuery Foundation and other contributors
13
+ * Released under the MIT license.
14
+ * http://jquery.org/license
15
+ *
16
+ * http://api.jqueryui.com/category/ui-core/
17
+ */
18
+ var r=/input|select|textarea|button|object/;function a(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;var n=window.getComputedStyle(e);return t?"visible"!==n.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0:"none"==n.getPropertyValue("display")}function o(e,t){var n=e.nodeName.toLowerCase();return(r.test(n)&&!e.disabled||"a"===n&&e.href||t)&&function(e){for(var t=e;t&&t!==document.body;){if(a(t))return!1;t=t.parentNode}return!0}(e)}function i(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&o(e,!n)}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNodeList=u,t.setElement=function(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);u(n,t),t="length"in n?n[0]:n}return l=t||l},t.validateElement=c,t.hide=function(e){c(e)&&(e||l).setAttribute("aria-hidden","true")},t.show=function(e){c(e)&&(e||l).removeAttribute("aria-hidden")},t.documentNotReadyOrSSRTesting=function(){l=null},t.resetForTesting=function(){l=null};var r,a=n(49),o=(r=a)&&r.__esModule?r:{default:r},i=n(21);var l=null;function u(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function c(e){return!(!e&&!l)||((0,o.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),!1)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=new function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]};t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=n(56)},function(e,t,n){"use strict";(function(t){var n="__global_unique_id__";e.exports=function(){return t[n]=(t[n]||0)+1}}).call(this,n(54))},function(e,t,n){"use strict";var r=n(33),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function u(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,s=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=s(n);f&&(i=i.concat(f(n)));for(var l=u(t),h=u(n),y=0;y<i.length;++y){var v=i[y];if(!(o[v]||r&&r[v]||h&&h[v]||l&&l[v])){var g=d(n,v);try{c(t,v,g)}catch(e){}}}}return t}},function(e,t,n){e.exports={wrapper:"_12vOKU0MMbbHG4Y6M5o5Gn"}},function(e,t,n){e.exports={previewTemplate:"_21gITcQFs6-1eXOnewtJIo"}},function(e,t,n){e.exports={formInput:"pk0dHrPKaw-XkGQWVdEpD"}},function(e,t,n){"use strict";
19
+ /** @license React v16.13.1
20
+ * react.production.min.js
21
+ *
22
+ * Copyright (c) Facebook, Inc. and its affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var r=n(29),a="function"==typeof Symbol&&Symbol.for,o=a?Symbol.for("react.element"):60103,i=a?Symbol.for("react.portal"):60106,l=a?Symbol.for("react.fragment"):60107,u=a?Symbol.for("react.strict_mode"):60108,c=a?Symbol.for("react.profiler"):60114,s=a?Symbol.for("react.provider"):60109,f=a?Symbol.for("react.context"):60110,d=a?Symbol.for("react.forward_ref"):60112,p=a?Symbol.for("react.suspense"):60113,m=a?Symbol.for("react.memo"):60115,h=a?Symbol.for("react.lazy"):60116,y="function"==typeof Symbol&&Symbol.iterator;function v(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b={};function w(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||g}function E(){}function k(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||g}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(v(85));this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},E.prototype=w.prototype;var x=k.prototype=new E;x.constructor=k,r(x,w.prototype),x.isPureReactComponent=!0;var S={current:null},C=Object.prototype.hasOwnProperty,T={key:!0,ref:!0,__self:!0,__source:!0};function O(e,t,n){var r,a={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)C.call(t,r)&&!T.hasOwnProperty(r)&&(a[r]=t[r]);var u=arguments.length-2;if(1===u)a.children=n;else if(1<u){for(var c=Array(u),s=0;s<u;s++)c[s]=arguments[s+2];a.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===a[r]&&(a[r]=u[r]);return{$$typeof:o,type:e,key:i,ref:l,props:a,_owner:S.current}}function _(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var P=/\/+/g,N=[];function I(e,t,n,r){if(N.length){var a=N.pop();return a.result=e,a.keyPrefix=t,a.func=n,a.context=r,a.count=0,a}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function j(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>N.length&&N.push(e)}function A(e,t,n){return null==e?0:function e(t,n,r,a){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var u=!1;if(null===t)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case o:case i:u=!0}}if(u)return r(a,t,""===n?"."+M(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var s=n+M(l=t[c],c);u+=e(l,s,r,a)}else if(null===t||"object"!=typeof t?s=null:s="function"==typeof(s=y&&t[y]||t["@@iterator"])?s:null,"function"==typeof s)for(t=s.call(t),c=0;!(l=t.next()).done;)u+=e(l=l.value,s=n+M(l,c++),r,a);else if("object"===l)throw r=""+t,Error(v(31,"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,""));return u}(e,"",t,n)}function M(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function R(e,t){e.func.call(e.context,t,e.count++)}function D(e,t,n){var r=e.result,a=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?L(e,r,n,(function(e){return e})):null!=e&&(_(e)&&(e=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,a+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(P,"$&/")+"/")+n)),r.push(e))}function L(e,t,n,r,a){var o="";null!=n&&(o=(""+n).replace(P,"$&/")+"/"),A(e,D,t=I(t,o,r,a)),j(t)}var F={current:null};function z(){var e=F.current;if(null===e)throw Error(v(321));return e}var U={ReactCurrentDispatcher:F,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:function(e,t,n){if(null==e)return e;var r=[];return L(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;A(e,R,t=I(null,null,t,n)),j(t)},count:function(e){return A(e,(function(){return null}),null)},toArray:function(e){var t=[];return L(e,t,null,(function(e){return e})),t},only:function(e){if(!_(e))throw Error(v(143));return e}},t.Component=w,t.Fragment=l,t.Profiler=c,t.PureComponent=k,t.StrictMode=u,t.Suspense=p,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,t.cloneElement=function(e,t,n){if(null==e)throw Error(v(267,e));var a=r({},e.props),i=e.key,l=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,u=S.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(s in t)C.call(t,s)&&!T.hasOwnProperty(s)&&(a[s]=void 0===t[s]&&void 0!==c?c[s]:t[s])}var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){c=Array(s);for(var f=0;f<s;f++)c[f]=arguments[f+2];a.children=c}return{$$typeof:o,type:e.type,key:i,ref:l,props:a,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=O,t.createFactory=function(e){var t=O.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:d,render:e}},t.isValidElement=_,t.lazy=function(e){return{$$typeof:h,_ctor:e,_status:-1,_result:null}},t.memo=function(e,t){return{$$typeof:m,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return z().useCallback(e,t)},t.useContext=function(e,t){return z().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return z().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return z().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return z().useLayoutEffect(e,t)},t.useMemo=function(e,t){return z().useMemo(e,t)},t.useReducer=function(e,t,n){return z().useReducer(e,t,n)},t.useRef=function(e){return z().useRef(e)},t.useState=function(e){return z().useState(e)},t.version="16.13.1"},function(e,t,n){"use strict";
27
+ /** @license React v16.13.1
28
+ * react-dom.production.min.js
29
+ *
30
+ * Copyright (c) Facebook, Inc. and its affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var r=n(0),a=n(29),o=n(41);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(i(227));function l(e,t,n,r,a,o,i,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var u=!1,c=null,s=!1,f=null,d={onError:function(e){u=!0,c=e}};function p(e,t,n,r,a,o,i,s,f){u=!1,c=null,l.apply(d,arguments)}var m=null,h=null,y=null;function v(e,t,n){var r=e.type||"unknown-event";e.currentTarget=y(n),function(e,t,n,r,a,o,l,d,m){if(p.apply(this,arguments),u){if(!u)throw Error(i(198));var h=c;u=!1,c=null,s||(s=!0,f=h)}}(r,t,void 0,e),e.currentTarget=null}var g=null,b={};function w(){if(g)for(var e in b){var t=b[e],n=g.indexOf(e);if(!(-1<n))throw Error(i(96,e));if(!k[n]){if(!t.extractEvents)throw Error(i(97,e));for(var r in k[n]=t,n=t.eventTypes){var a=void 0,o=n[r],l=t,u=r;if(x.hasOwnProperty(u))throw Error(i(99,u));x[u]=o;var c=o.phasedRegistrationNames;if(c){for(a in c)c.hasOwnProperty(a)&&E(c[a],l,u);a=!0}else o.registrationName?(E(o.registrationName,l,u),a=!0):a=!1;if(!a)throw Error(i(98,r,e))}}}}function E(e,t,n){if(S[e])throw Error(i(100,e));S[e]=t,C[e]=t.eventTypes[n].dependencies}var k=[],x={},S={},C={};function T(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!b.hasOwnProperty(t)||b[t]!==r){if(b[t])throw Error(i(102,t));b[t]=r,n=!0}}n&&w()}var O=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),_=null,P=null,N=null;function I(e){if(e=h(e)){if("function"!=typeof _)throw Error(i(280));var t=e.stateNode;t&&(t=m(t),_(e.stateNode,e.type,t))}}function j(e){P?N?N.push(e):N=[e]:P=e}function A(){if(P){var e=P,t=N;if(N=P=null,I(e),t)for(e=0;e<t.length;e++)I(t[e])}}function M(e,t){return e(t)}function R(e,t,n,r,a){return e(t,n,r,a)}function D(){}var L=M,F=!1,z=!1;function U(){null===P&&null===N||(D(),A())}function W(e,t,n){if(z)return e(t,n);z=!0;try{return L(e,t,n)}finally{z=!1,U()}}var B=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,K=Object.prototype.hasOwnProperty,H={},V={};function q(e,t,n,r,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o}var $={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){$[e]=new q(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];$[t]=new q(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){$[e]=new q(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){$[e]=new q(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){$[e]=new q(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){$[e]=new q(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){$[e]=new q(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){$[e]=new q(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){$[e]=new q(e,5,!1,e.toLowerCase(),null,!1)}));var Q=/[\-:]([a-z])/g;function Y(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(Q,Y);$[t]=new q(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(Q,Y);$[t]=new q(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(Q,Y);$[t]=new q(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){$[e]=new q(e,1,!1,e.toLowerCase(),null,!1)})),$.xlinkHref=new q("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){$[e]=new q(e,1,!1,e.toLowerCase(),null,!0)}));var X=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Z(e,t,n,r){var a=$.hasOwnProperty(t)?$[t]:null;(null!==a?0===a.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,a,r)&&(n=null),r||null===a?function(e){return!!K.call(V,e)||!K.call(H,e)&&(B.test(e)?V[e]=!0:(H[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}X.hasOwnProperty("ReactCurrentDispatcher")||(X.ReactCurrentDispatcher={current:null}),X.hasOwnProperty("ReactCurrentBatchConfig")||(X.ReactCurrentBatchConfig={suspense:null});var G=/^(.*)[\\\/]/,J="function"==typeof Symbol&&Symbol.for,ee=J?Symbol.for("react.element"):60103,te=J?Symbol.for("react.portal"):60106,ne=J?Symbol.for("react.fragment"):60107,re=J?Symbol.for("react.strict_mode"):60108,ae=J?Symbol.for("react.profiler"):60114,oe=J?Symbol.for("react.provider"):60109,ie=J?Symbol.for("react.context"):60110,le=J?Symbol.for("react.concurrent_mode"):60111,ue=J?Symbol.for("react.forward_ref"):60112,ce=J?Symbol.for("react.suspense"):60113,se=J?Symbol.for("react.suspense_list"):60120,fe=J?Symbol.for("react.memo"):60115,de=J?Symbol.for("react.lazy"):60116,pe=J?Symbol.for("react.block"):60121,me="function"==typeof Symbol&&Symbol.iterator;function he(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=me&&e[me]||e["@@iterator"])?e:null}function ye(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case ne:return"Fragment";case te:return"Portal";case ae:return"Profiler";case re:return"StrictMode";case ce:return"Suspense";case se:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ie:return"Context.Consumer";case oe:return"Context.Provider";case ue:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case fe:return ye(e.type);case pe:return ye(e.render);case de:if(e=1===e._status?e._result:null)return ye(e)}return null}function ve(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,a=e._debugSource,o=ye(e.type);n=null,r&&(n=ye(r.type)),r=o,o="",a?o=" (at "+a.fileName.replace(G,"")+":"+a.lineNumber+")":n&&(o=" (created by "+n+")"),n="\n in "+(r||"Unknown")+o}t+=n,e=e.return}while(e);return t}function ge(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function be(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function we(e){e._valueTracker||(e._valueTracker=function(e){var t=be(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var a=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Ee(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=be(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function ke(e,t){var n=t.checked;return a({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function xe(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=ge(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Se(e,t){null!=(t=t.checked)&&Z(e,"checked",t,!1)}function Ce(e,t){Se(e,t);var n=ge(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Oe(e,t.type,n):t.hasOwnProperty("defaultValue")&&Oe(e,t.type,ge(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Te(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Oe(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function _e(e,t){return e=a({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function Pe(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ge(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function Ne(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(i(91));return a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(i(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(i(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:ge(n)}}function je(e,t){var n=ge(t.value),r=ge(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Me="http://www.w3.org/1999/xhtml",Re="http://www.w3.org/2000/svg";function De(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?De(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Fe,ze=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Re||"innerHTML"in e)e.innerHTML=t;else{for((Fe=Fe||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Ue(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function We(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Be={animationend:We("Animation","AnimationEnd"),animationiteration:We("Animation","AnimationIteration"),animationstart:We("Animation","AnimationStart"),transitionend:We("Transition","TransitionEnd")},Ke={},He={};function Ve(e){if(Ke[e])return Ke[e];if(!Be[e])return e;var t,n=Be[e];for(t in n)if(n.hasOwnProperty(t)&&t in He)return Ke[e]=n[t];return e}O&&(He=document.createElement("div").style,"AnimationEvent"in window||(delete Be.animationend.animation,delete Be.animationiteration.animation,delete Be.animationstart.animation),"TransitionEvent"in window||delete Be.transitionend.transition);var qe=Ve("animationend"),$e=Ve("animationiteration"),Qe=Ve("animationstart"),Ye=Ve("transitionend"),Xe="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ze=new("function"==typeof WeakMap?WeakMap:Map);function Ge(e){var t=Ze.get(e);return void 0===t&&(t=new Map,Ze.set(e,t)),t}function Je(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function et(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function tt(e){if(Je(e)!==e)throw Error(i(188))}function nt(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Je(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var o=a.alternate;if(null===o){if(null!==(r=a.return)){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return tt(a),e;if(o===r)return tt(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var l=!1,u=a.child;u;){if(u===n){l=!0,n=a,r=o;break}if(u===r){l=!0,r=a,n=o;break}u=u.sibling}if(!l){for(u=o.child;u;){if(u===n){l=!0,n=o,r=a;break}if(u===r){l=!0,r=o,n=a;break}u=u.sibling}if(!l)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function rt(e,t){if(null==t)throw Error(i(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function at(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var ot=null;function it(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)v(e,t[r],n[r]);else t&&v(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function lt(e){if(null!==e&&(ot=rt(ot,e)),e=ot,ot=null,e){if(at(e,it),ot)throw Error(i(95));if(s)throw e=f,s=!1,f=null,e}}function ut(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function ct(e){if(!O)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var st=[];function ft(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>st.length&&st.push(e)}function dt(e,t,n,r){if(st.length){var a=st.pop();return a.topLevelType=e,a.eventSystemFlags=r,a.nativeEvent=t,a.targetInst=n,a}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function pt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=On(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var a=ut(e.nativeEvent);r=e.topLevelType;var o=e.nativeEvent,i=e.eventSystemFlags;0===n&&(i|=64);for(var l=null,u=0;u<k.length;u++){var c=k[u];c&&(c=c.extractEvents(r,t,o,a,i))&&(l=rt(l,c))}lt(l)}}function mt(e,t,n){if(!n.has(e)){switch(e){case"scroll":Qt(t,"scroll",!0);break;case"focus":case"blur":Qt(t,"focus",!0),Qt(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":ct(e)&&Qt(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Xe.indexOf(e)&&$t(e,t)}n.set(e,null)}}var ht,yt,vt,gt=!1,bt=[],wt=null,Et=null,kt=null,xt=new Map,St=new Map,Ct=[],Tt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),Ot="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function _t(e,t,n,r,a){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:a,container:r}}function Pt(e,t){switch(e){case"focus":case"blur":wt=null;break;case"dragenter":case"dragleave":Et=null;break;case"mouseover":case"mouseout":kt=null;break;case"pointerover":case"pointerout":xt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":St.delete(t.pointerId)}}function Nt(e,t,n,r,a,o){return null===e||e.nativeEvent!==o?(e=_t(t,n,r,a,o),null!==t&&(null!==(t=_n(t))&&yt(t)),e):(e.eventSystemFlags|=r,e)}function It(e){var t=On(e.target);if(null!==t){var n=Je(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=et(n)))return e.blockedOn=t,void o.unstable_runWithPriority(e.priority,(function(){vt(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function jt(e){if(null!==e.blockedOn)return!1;var t=Gt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=_n(t);return null!==n&&yt(n),e.blockedOn=t,!1}return!0}function At(e,t,n){jt(e)&&n.delete(t)}function Mt(){for(gt=!1;0<bt.length;){var e=bt[0];if(null!==e.blockedOn){null!==(e=_n(e.blockedOn))&&ht(e);break}var t=Gt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:bt.shift()}null!==wt&&jt(wt)&&(wt=null),null!==Et&&jt(Et)&&(Et=null),null!==kt&&jt(kt)&&(kt=null),xt.forEach(At),St.forEach(At)}function Rt(e,t){e.blockedOn===t&&(e.blockedOn=null,gt||(gt=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Mt)))}function Dt(e){function t(t){return Rt(t,e)}if(0<bt.length){Rt(bt[0],e);for(var n=1;n<bt.length;n++){var r=bt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==wt&&Rt(wt,e),null!==Et&&Rt(Et,e),null!==kt&&Rt(kt,e),xt.forEach(t),St.forEach(t),n=0;n<Ct.length;n++)(r=Ct[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ct.length&&null===(n=Ct[0]).blockedOn;)It(n),null===n.blockedOn&&Ct.shift()}var Lt={},Ft=new Map,zt=new Map,Ut=["abort","abort",qe,"animationEnd",$e,"animationIteration",Qe,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ye,"transitionEnd","waiting","waiting"];function Wt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1],o="on"+(a[0].toUpperCase()+a.slice(1));o={phasedRegistrationNames:{bubbled:o,captured:o+"Capture"},dependencies:[r],eventPriority:t},zt.set(r,t),Ft.set(r,o),Lt[a]=o}}Wt("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Wt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Wt(Ut,2);for(var Bt="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Kt=0;Kt<Bt.length;Kt++)zt.set(Bt[Kt],0);var Ht=o.unstable_UserBlockingPriority,Vt=o.unstable_runWithPriority,qt=!0;function $t(e,t){Qt(t,e,!1)}function Qt(e,t,n){var r=zt.get(t);switch(void 0===r?2:r){case 0:r=Yt.bind(null,t,1,e);break;case 1:r=Xt.bind(null,t,1,e);break;default:r=Zt.bind(null,t,1,e)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function Yt(e,t,n,r){F||D();var a=Zt,o=F;F=!0;try{R(a,e,t,n,r)}finally{(F=o)||U()}}function Xt(e,t,n,r){Vt(Ht,Zt.bind(null,e,t,n,r))}function Zt(e,t,n,r){if(qt)if(0<bt.length&&-1<Tt.indexOf(e))e=_t(null,e,t,n,r),bt.push(e);else{var a=Gt(e,t,n,r);if(null===a)Pt(e,r);else if(-1<Tt.indexOf(e))e=_t(a,e,t,n,r),bt.push(e);else if(!function(e,t,n,r,a){switch(t){case"focus":return wt=Nt(wt,e,t,n,r,a),!0;case"dragenter":return Et=Nt(Et,e,t,n,r,a),!0;case"mouseover":return kt=Nt(kt,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return xt.set(o,Nt(xt.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,St.set(o,Nt(St.get(o)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r)){Pt(e,r),e=dt(e,r,null,t);try{W(pt,e)}finally{ft(e)}}}}function Gt(e,t,n,r){if(null!==(n=On(n=ut(r)))){var a=Je(n);if(null===a)n=null;else{var o=a.tag;if(13===o){if(null!==(n=et(a)))return n;n=null}else if(3===o){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}e=dt(e,r,n,t);try{W(pt,e)}finally{ft(e)}return null}var Jt={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},en=["Webkit","ms","Moz","O"];function tn(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Jt.hasOwnProperty(e)&&Jt[e]?(""+t).trim():t+"px"}function nn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=tn(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(Jt).forEach((function(e){en.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jt[t]=Jt[e]}))}));var rn=a({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function an(e,t){if(t){if(rn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(i(62,""))}}function on(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ln=Me;function un(e,t){var n=Ge(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=C[t];for(var r=0;r<t.length;r++)mt(t[r],e,n)}function cn(){}function sn(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function fn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dn(e,t){var n,r=fn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fn(r)}}function pn(){for(var e=window,t=sn();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=sn((e=t.contentWindow).document)}return t}function mn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var hn=null,yn=null;function vn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function gn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var bn="function"==typeof setTimeout?setTimeout:void 0,wn="function"==typeof clearTimeout?clearTimeout:void 0;function En(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function kn(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var xn=Math.random().toString(36).slice(2),Sn="__reactInternalInstance$"+xn,Cn="__reactEventHandlers$"+xn,Tn="__reactContainere$"+xn;function On(e){var t=e[Sn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Tn]||n[Sn]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=kn(e);null!==e;){if(n=e[Sn])return n;e=kn(e)}return t}n=(e=n).parentNode}return null}function _n(e){return!(e=e[Sn]||e[Tn])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Pn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function Nn(e){return e[Cn]||null}function In(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function jn(e,t){var n=e.stateNode;if(!n)return null;var r=m(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(i(231,t,typeof n));return n}function An(e,t,n){(t=jn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function Mn(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=In(t);for(t=n.length;0<t--;)An(n[t],"captured",e);for(t=0;t<n.length;t++)An(n[t],"bubbled",e)}}function Rn(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=jn(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function Dn(e){e&&e.dispatchConfig.registrationName&&Rn(e._targetInst,null,e)}function Ln(e){at(e,Mn)}var Fn=null,zn=null,Un=null;function Wn(){if(Un)return Un;var e,t,n=zn,r=n.length,a="value"in Fn?Fn.value:Fn.textContent,o=a.length;for(e=0;e<r&&n[e]===a[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===a[o-t];t++);return Un=a.slice(e,1<t?1-t:void 0)}function Bn(){return!0}function Kn(){return!1}function Hn(e,t,n,r){for(var a in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(a)&&((t=e[a])?this[a]=t(n):"target"===a?this.target=r:this[a]=n[a]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Bn:Kn,this.isPropagationStopped=Kn,this}function Vn(e,t,n,r){if(this.eventPool.length){var a=this.eventPool.pop();return this.call(a,e,t,n,r),a}return new this(e,t,n,r)}function qn(e){if(!(e instanceof this))throw Error(i(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function $n(e){e.eventPool=[],e.getPooled=Vn,e.release=qn}a(Hn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Bn)},persist:function(){this.isPersistent=Bn},isPersistent:Kn,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Kn,this._dispatchInstances=this._dispatchListeners=null}}),Hn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Hn.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return a(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=a({},r.Interface,e),n.extend=r.extend,$n(n),n},$n(Hn);var Qn=Hn.extend({data:null}),Yn=Hn.extend({data:null}),Xn=[9,13,27,32],Zn=O&&"CompositionEvent"in window,Gn=null;O&&"documentMode"in document&&(Gn=document.documentMode);var Jn=O&&"TextEvent"in window&&!Gn,er=O&&(!Zn||Gn&&8<Gn&&11>=Gn),tr=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function ar(e,t){switch(e){case"keyup":return-1!==Xn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function or(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ir=!1;var lr={eventTypes:nr,extractEvents:function(e,t,n,r){var a;if(Zn)e:{switch(e){case"compositionstart":var o=nr.compositionStart;break e;case"compositionend":o=nr.compositionEnd;break e;case"compositionupdate":o=nr.compositionUpdate;break e}o=void 0}else ir?ar(e,n)&&(o=nr.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=nr.compositionStart);return o?(er&&"ko"!==n.locale&&(ir||o!==nr.compositionStart?o===nr.compositionEnd&&ir&&(a=Wn()):(zn="value"in(Fn=r)?Fn.value:Fn.textContent,ir=!0)),o=Qn.getPooled(o,t,n,r),a?o.data=a:null!==(a=or(n))&&(o.data=a),Ln(o),a=o):a=null,(e=Jn?function(e,t){switch(e){case"compositionend":return or(t);case"keypress":return 32!==t.which?null:(rr=!0,tr);case"textInput":return(e=t.data)===tr&&rr?null:e;default:return null}}(e,n):function(e,t){if(ir)return"compositionend"===e||!Zn&&ar(e,t)?(e=Wn(),Un=zn=Fn=null,ir=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return er&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=Yn.getPooled(nr.beforeInput,t,n,r)).data=e,Ln(t)):t=null,null===a?t:null===t?a:[a,t]}},ur={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ur[e.type]:"textarea"===t}var sr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function fr(e,t,n){return(e=Hn.getPooled(sr.change,e,t,n)).type="change",j(n),Ln(e),e}var dr=null,pr=null;function mr(e){lt(e)}function hr(e){if(Ee(Pn(e)))return e}function yr(e,t){if("change"===e)return t}var vr=!1;function gr(){dr&&(dr.detachEvent("onpropertychange",br),pr=dr=null)}function br(e){if("value"===e.propertyName&&hr(pr))if(e=fr(pr,e,ut(e)),F)lt(e);else{F=!0;try{M(mr,e)}finally{F=!1,U()}}}function wr(e,t,n){"focus"===e?(gr(),pr=n,(dr=t).attachEvent("onpropertychange",br)):"blur"===e&&gr()}function Er(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return hr(pr)}function kr(e,t){if("click"===e)return hr(t)}function xr(e,t){if("input"===e||"change"===e)return hr(t)}O&&(vr=ct("input")&&(!document.documentMode||9<document.documentMode));var Sr={eventTypes:sr,_isInputEventSupported:vr,extractEvents:function(e,t,n,r){var a=t?Pn(t):window,o=a.nodeName&&a.nodeName.toLowerCase();if("select"===o||"input"===o&&"file"===a.type)var i=yr;else if(cr(a))if(vr)i=xr;else{i=Er;var l=wr}else(o=a.nodeName)&&"input"===o.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(i=kr);if(i&&(i=i(e,t)))return fr(i,n,r);l&&l(e,a,t),"blur"===e&&(e=a._wrapperState)&&e.controlled&&"number"===a.type&&Oe(a,"number",a.value)}},Cr=Hn.extend({view:null,detail:null}),Tr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Or(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Tr[e])&&!!t[e]}function _r(){return Or}var Pr=0,Nr=0,Ir=!1,jr=!1,Ar=Cr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:_r,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Pr;return Pr=e.screenX,Ir?"mousemove"===e.type?e.screenX-t:0:(Ir=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Nr;return Nr=e.screenY,jr?"mousemove"===e.type?e.screenY-t:0:(jr=!0,0)}}),Mr=Ar.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Rr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Dr={eventTypes:Rr,extractEvents:function(e,t,n,r,a){var o="mouseover"===e||"pointerover"===e,i="mouseout"===e||"pointerout"===e;if(o&&0==(32&a)&&(n.relatedTarget||n.fromElement)||!i&&!o)return null;(o=r.window===r?r:(o=r.ownerDocument)?o.defaultView||o.parentWindow:window,i)?(i=t,null!==(t=(t=n.relatedTarget||n.toElement)?On(t):null)&&(t!==Je(t)||5!==t.tag&&6!==t.tag)&&(t=null)):i=null;if(i===t)return null;if("mouseout"===e||"mouseover"===e)var l=Ar,u=Rr.mouseLeave,c=Rr.mouseEnter,s="mouse";else"pointerout"!==e&&"pointerover"!==e||(l=Mr,u=Rr.pointerLeave,c=Rr.pointerEnter,s="pointer");if(e=null==i?o:Pn(i),o=null==t?o:Pn(t),(u=l.getPooled(u,i,n,r)).type=s+"leave",u.target=e,u.relatedTarget=o,(n=l.getPooled(c,t,n,r)).type=s+"enter",n.target=o,n.relatedTarget=e,s=t,(r=i)&&s)e:{for(c=s,i=0,e=l=r;e;e=In(e))i++;for(e=0,t=c;t;t=In(t))e++;for(;0<i-e;)l=In(l),i--;for(;0<e-i;)c=In(c),e--;for(;i--;){if(l===c||l===c.alternate)break e;l=In(l),c=In(c)}l=null}else l=null;for(c=l,l=[];r&&r!==c&&(null===(i=r.alternate)||i!==c);)l.push(r),r=In(r);for(r=[];s&&s!==c&&(null===(i=s.alternate)||i!==c);)r.push(s),s=In(s);for(s=0;s<l.length;s++)Rn(l[s],"bubbled",u);for(s=r.length;0<s--;)Rn(r[s],"captured",n);return 0==(64&a)?[u]:[u,n]}};var Lr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Fr=Object.prototype.hasOwnProperty;function zr(e,t){if(Lr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Fr.call(t,n[r])||!Lr(e[n[r]],t[n[r]]))return!1;return!0}var Ur=O&&"documentMode"in document&&11>=document.documentMode,Wr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Br=null,Kr=null,Hr=null,Vr=!1;function qr(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Vr||null==Br||Br!==sn(n)?null:("selectionStart"in(n=Br)&&mn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Hr&&zr(Hr,n)?null:(Hr=n,(e=Hn.getPooled(Wr.select,Kr,e,t)).type="select",e.target=Br,Ln(e),e))}var $r={eventTypes:Wr,extractEvents:function(e,t,n,r,a,o){if(!(o=!(a=o||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{a=Ge(a),o=C.onSelect;for(var i=0;i<o.length;i++)if(!a.has(o[i])){a=!1;break e}a=!0}o=!a}if(o)return null;switch(a=t?Pn(t):window,e){case"focus":(cr(a)||"true"===a.contentEditable)&&(Br=a,Kr=t,Hr=null);break;case"blur":Hr=Kr=Br=null;break;case"mousedown":Vr=!0;break;case"contextmenu":case"mouseup":case"dragend":return Vr=!1,qr(n,r);case"selectionchange":if(Ur)break;case"keydown":case"keyup":return qr(n,r)}return null}},Qr=Hn.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Yr=Hn.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xr=Cr.extend({relatedTarget:null});function Zr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Gr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ea=Cr.extend({key:function(e){if(e.key){var t=Gr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Zr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Jr[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:_r,charCode:function(e){return"keypress"===e.type?Zr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Zr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),ta=Ar.extend({dataTransfer:null}),na=Cr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:_r}),ra=Hn.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),aa=Ar.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),oa={eventTypes:Lt,extractEvents:function(e,t,n,r){var a=Ft.get(e);if(!a)return null;switch(e){case"keypress":if(0===Zr(n))return null;case"keydown":case"keyup":e=ea;break;case"blur":case"focus":e=Xr;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Ar;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=ta;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=na;break;case qe:case $e:case Qe:e=Qr;break;case Ye:e=ra;break;case"scroll":e=Cr;break;case"wheel":e=aa;break;case"copy":case"cut":case"paste":e=Yr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Mr;break;default:e=Hn}return Ln(t=e.getPooled(a,t,n,r)),t}};if(g)throw Error(i(101));g=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),w(),m=Nn,h=_n,y=Pn,T({SimpleEventPlugin:oa,EnterLeaveEventPlugin:Dr,ChangeEventPlugin:Sr,SelectEventPlugin:$r,BeforeInputEventPlugin:lr});var ia=[],la=-1;function ua(e){0>la||(e.current=ia[la],ia[la]=null,la--)}function ca(e,t){la++,ia[la]=e.current,e.current=t}var sa={},fa={current:sa},da={current:!1},pa=sa;function ma(e,t){var n=e.type.contextTypes;if(!n)return sa;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,o={};for(a in n)o[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ha(e){return null!=(e=e.childContextTypes)}function ya(){ua(da),ua(fa)}function va(e,t,n){if(fa.current!==sa)throw Error(i(168));ca(fa,t),ca(da,n)}function ga(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(i(108,ye(t)||"Unknown",o));return a({},n,{},r)}function ba(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sa,pa=fa.current,ca(fa,e),ca(da,da.current),!0}function wa(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=ga(e,t,pa),r.__reactInternalMemoizedMergedChildContext=e,ua(da),ua(fa),ca(fa,e)):ua(da),ca(da,n)}var Ea=o.unstable_runWithPriority,ka=o.unstable_scheduleCallback,xa=o.unstable_cancelCallback,Sa=o.unstable_requestPaint,Ca=o.unstable_now,Ta=o.unstable_getCurrentPriorityLevel,Oa=o.unstable_ImmediatePriority,_a=o.unstable_UserBlockingPriority,Pa=o.unstable_NormalPriority,Na=o.unstable_LowPriority,Ia=o.unstable_IdlePriority,ja={},Aa=o.unstable_shouldYield,Ma=void 0!==Sa?Sa:function(){},Ra=null,Da=null,La=!1,Fa=Ca(),za=1e4>Fa?Ca:function(){return Ca()-Fa};function Ua(){switch(Ta()){case Oa:return 99;case _a:return 98;case Pa:return 97;case Na:return 96;case Ia:return 95;default:throw Error(i(332))}}function Wa(e){switch(e){case 99:return Oa;case 98:return _a;case 97:return Pa;case 96:return Na;case 95:return Ia;default:throw Error(i(332))}}function Ba(e,t){return e=Wa(e),Ea(e,t)}function Ka(e,t,n){return e=Wa(e),ka(e,t,n)}function Ha(e){return null===Ra?(Ra=[e],Da=ka(Oa,qa)):Ra.push(e),ja}function Va(){if(null!==Da){var e=Da;Da=null,xa(e)}qa()}function qa(){if(!La&&null!==Ra){La=!0;var e=0;try{var t=Ra;Ba(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ra=null}catch(t){throw null!==Ra&&(Ra=Ra.slice(e+1)),ka(Oa,Va),t}finally{La=!1}}}function $a(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Qa(e,t){if(e&&e.defaultProps)for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Ya={current:null},Xa=null,Za=null,Ga=null;function Ja(){Ga=Za=Xa=null}function eo(e){var t=Ya.current;ua(Ya),e.type._context._currentValue=t}function to(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function no(e,t){Xa=e,Ga=Za=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(Ni=!0),e.firstContext=null)}function ro(e,t){if(Ga!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Ga=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Za){if(null===Xa)throw Error(i(308));Za=t,Xa.dependencies={expirationTime:0,firstContext:t,responders:null}}else Za=Za.next=t;return e._currentValue}var ao=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function io(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function lo(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function uo(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function co(e,t){var n=e.alternate;null!==n&&io(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function so(e,t,n,r){var o=e.updateQueue;ao=!1;var i=o.baseQueue,l=o.shared.pending;if(null!==l){if(null!==i){var u=i.next;i.next=l.next,l.next=u}i=l,o.shared.pending=null,null!==(u=e.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=l))}if(null!==i){u=i.next;var c=o.baseState,s=0,f=null,d=null,p=null;if(null!==u)for(var m=u;;){if((l=m.expirationTime)<r){var h={expirationTime:m.expirationTime,suspenseConfig:m.suspenseConfig,tag:m.tag,payload:m.payload,callback:m.callback,next:null};null===p?(d=p=h,f=c):p=p.next=h,l>s&&(s=l)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:m.suspenseConfig,tag:m.tag,payload:m.payload,callback:m.callback,next:null}),ou(l,m.suspenseConfig);e:{var y=e,v=m;switch(l=t,h=n,v.tag){case 1:if("function"==typeof(y=v.payload)){c=y.call(h,c,l);break e}c=y;break e;case 3:y.effectTag=-4097&y.effectTag|64;case 0:if(null==(l="function"==typeof(y=v.payload)?y.call(h,c,l):y))break e;c=a({},c,l);break e;case 2:ao=!0}}null!==m.callback&&(e.effectTag|=32,null===(l=o.effects)?o.effects=[m]:l.push(m))}if(null===(m=m.next)||m===u){if(null===(l=o.shared.pending))break;m=i.next=l.next,l.next=u,o.baseQueue=i=l,o.shared.pending=null}}null===p?f=c:p.next=d,o.baseState=f,o.baseQueue=p,iu(s),e.expirationTime=s,e.memoizedState=c}}function fo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=a,a=n,"function"!=typeof r)throw Error(i(191,r));r.call(a)}}}var po=X.ReactCurrentBatchConfig,mo=(new r.Component).refs;function ho(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:a({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var yo={isMounted:function(e){return!!(e=e._reactInternalFiber)&&Je(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=ql(),a=po.suspense;(a=lo(r=$l(r,e,a),a)).payload=t,null!=n&&(a.callback=n),uo(e,a),Ql(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=ql(),a=po.suspense;(a=lo(r=$l(r,e,a),a)).tag=1,a.payload=t,null!=n&&(a.callback=n),uo(e,a),Ql(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=ql(),r=po.suspense;(r=lo(n=$l(n,e,r),r)).tag=2,null!=t&&(r.callback=t),uo(e,r),Ql(e,n)}};function vo(e,t,n,r,a,o,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,i):!t.prototype||!t.prototype.isPureReactComponent||(!zr(n,r)||!zr(a,o))}function go(e,t,n){var r=!1,a=sa,o=t.contextType;return"object"==typeof o&&null!==o?o=ro(o):(a=ha(t)?pa:fa.current,o=(r=null!=(r=t.contextTypes))?ma(e,a):sa),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=yo,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=o),t}function bo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yo.enqueueReplaceState(t,t.state,null)}function wo(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs=mo,oo(e);var o=t.contextType;"object"==typeof o&&null!==o?a.context=ro(o):(o=ha(t)?pa:fa.current,a.context=ma(e,o)),so(e,n,a,r),a.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(ho(e,t,o,n),a.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(t=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&yo.enqueueReplaceState(a,a.state,null),so(e,n,a,r),a.state=e.memoizedState),"function"==typeof a.componentDidMount&&(e.effectTag|=4)}var Eo=Array.isArray;function ko(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:((t=function(e){var t=r.refs;t===mo&&(t=r.refs={}),null===e?delete t[a]:t[a]=e})._stringRef=a,t)}if("string"!=typeof e)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function xo(e,t){if("textarea"!==e.type)throw Error(i(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function So(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=Tu(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function l(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Pu(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=a(t,n.props)).ref=ko(e,t,n),r.return=e,r):((r=Ou(n.type,n.key,n.props,null,e.mode,r)).ref=ko(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Nu(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function f(e,t,n,r,o){return null===t||7!==t.tag?((t=_u(n,e.mode,r,o)).return=e,t):((t=a(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Pu(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ee:return(n=Ou(t.type,t.key,t.props,null,e.mode,n)).ref=ko(e,null,t),n.return=e,n;case te:return(t=Nu(t,e.mode,n)).return=e,t}if(Eo(t)||he(t))return(t=_u(t,e.mode,n,null)).return=e,t;xo(e,t)}return null}function p(e,t,n,r){var a=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==a?null:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ee:return n.key===a?n.type===ne?f(e,t,n.props.children,r,a):c(e,t,n,r):null;case te:return n.key===a?s(e,t,n,r):null}if(Eo(n)||he(n))return null!==a?null:f(e,t,n,r,null);xo(e,n)}return null}function m(e,t,n,r,a){if("string"==typeof r||"number"==typeof r)return u(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ee:return e=e.get(null===r.key?n:r.key)||null,r.type===ne?f(t,e,r.props.children,a,r.key):c(t,e,r,a);case te:return s(t,e=e.get(null===r.key?n:r.key)||null,r,a)}if(Eo(r)||he(r))return f(t,e=e.get(n)||null,r,a,null);xo(t,r)}return null}function h(a,i,l,u){for(var c=null,s=null,f=i,h=i=0,y=null;null!==f&&h<l.length;h++){f.index>h?(y=f,f=null):y=f.sibling;var v=p(a,f,l[h],u);if(null===v){null===f&&(f=y);break}e&&f&&null===v.alternate&&t(a,f),i=o(v,i,h),null===s?c=v:s.sibling=v,s=v,f=y}if(h===l.length)return n(a,f),c;if(null===f){for(;h<l.length;h++)null!==(f=d(a,l[h],u))&&(i=o(f,i,h),null===s?c=f:s.sibling=f,s=f);return c}for(f=r(a,f);h<l.length;h++)null!==(y=m(f,a,h,l[h],u))&&(e&&null!==y.alternate&&f.delete(null===y.key?h:y.key),i=o(y,i,h),null===s?c=y:s.sibling=y,s=y);return e&&f.forEach((function(e){return t(a,e)})),c}function y(a,l,u,c){var s=he(u);if("function"!=typeof s)throw Error(i(150));if(null==(u=s.call(u)))throw Error(i(151));for(var f=s=null,h=l,y=l=0,v=null,g=u.next();null!==h&&!g.done;y++,g=u.next()){h.index>y?(v=h,h=null):v=h.sibling;var b=p(a,h,g.value,c);if(null===b){null===h&&(h=v);break}e&&h&&null===b.alternate&&t(a,h),l=o(b,l,y),null===f?s=b:f.sibling=b,f=b,h=v}if(g.done)return n(a,h),s;if(null===h){for(;!g.done;y++,g=u.next())null!==(g=d(a,g.value,c))&&(l=o(g,l,y),null===f?s=g:f.sibling=g,f=g);return s}for(h=r(a,h);!g.done;y++,g=u.next())null!==(g=m(h,a,y,g.value,c))&&(e&&null!==g.alternate&&h.delete(null===g.key?y:g.key),l=o(g,l,y),null===f?s=g:f.sibling=g,f=g);return e&&h.forEach((function(e){return t(a,e)})),s}return function(e,r,o,u){var c="object"==typeof o&&null!==o&&o.type===ne&&null===o.key;c&&(o=o.props.children);var s="object"==typeof o&&null!==o;if(s)switch(o.$$typeof){case ee:e:{for(s=o.key,c=r;null!==c;){if(c.key===s){switch(c.tag){case 7:if(o.type===ne){n(e,c.sibling),(r=a(c,o.props.children)).return=e,e=r;break e}break;default:if(c.elementType===o.type){n(e,c.sibling),(r=a(c,o.props)).ref=ko(e,c,o),r.return=e,e=r;break e}}n(e,c);break}t(e,c),c=c.sibling}o.type===ne?((r=_u(o.props.children,e.mode,u,o.key)).return=e,e=r):((u=Ou(o.type,o.key,o.props,null,e.mode,u)).ref=ko(e,r,o),u.return=e,e=u)}return l(e);case te:e:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=a(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Nu(o,e.mode,u)).return=e,e=r}return l(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=a(r,o)).return=e,e=r):(n(e,r),(r=Pu(o,e.mode,u)).return=e,e=r),l(e);if(Eo(o))return h(e,r,o,u);if(he(o))return y(e,r,o,u);if(s&&xo(e,o),void 0===o&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(i(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Co=So(!0),To=So(!1),Oo={},_o={current:Oo},Po={current:Oo},No={current:Oo};function Io(e){if(e===Oo)throw Error(i(174));return e}function jo(e,t){switch(ca(No,t),ca(Po,e),ca(_o,Oo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Le(null,"");break;default:t=Le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ua(_o),ca(_o,t)}function Ao(){ua(_o),ua(Po),ua(No)}function Mo(e){Io(No.current);var t=Io(_o.current),n=Le(t,e.type);t!==n&&(ca(Po,e),ca(_o,n))}function Ro(e){Po.current===e&&(ua(_o),ua(Po))}var Do={current:0};function Lo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Fo(e,t){return{responder:e,props:t}}var zo=X.ReactCurrentDispatcher,Uo=X.ReactCurrentBatchConfig,Wo=0,Bo=null,Ko=null,Ho=null,Vo=!1;function qo(){throw Error(i(321))}function $o(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,a,o){if(Wo=o,Bo=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,zo.current=null===e||null===e.memoizedState?vi:gi,e=n(r,a),t.expirationTime===Wo){o=0;do{if(t.expirationTime=0,!(25>o))throw Error(i(301));o+=1,Ho=Ko=null,t.updateQueue=null,zo.current=bi,e=n(r,a)}while(t.expirationTime===Wo)}if(zo.current=yi,t=null!==Ko&&null!==Ko.next,Wo=0,Ho=Ko=Bo=null,Vo=!1,t)throw Error(i(300));return e}function Yo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ho?Bo.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function Xo(){if(null===Ko){var e=Bo.alternate;e=null!==e?e.memoizedState:null}else e=Ko.next;var t=null===Ho?Bo.memoizedState:Ho.next;if(null!==t)Ho=t,Ko=e;else{if(null===e)throw Error(i(310));e={memoizedState:(Ko=e).memoizedState,baseState:Ko.baseState,baseQueue:Ko.baseQueue,queue:Ko.queue,next:null},null===Ho?Bo.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function Zo(e,t){return"function"==typeof t?t(e):t}function Go(e){var t=Xo(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=Ko,a=r.baseQueue,o=n.pending;if(null!==o){if(null!==a){var l=a.next;a.next=o.next,o.next=l}r.baseQueue=a=o,n.pending=null}if(null!==a){a=a.next,r=r.baseState;var u=l=o=null,c=a;do{var s=c.expirationTime;if(s<Wo){var f={expirationTime:c.expirationTime,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(l=u=f,o=r):u=u.next=f,s>Bo.expirationTime&&(Bo.expirationTime=s,iu(s))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),ou(s,c.suspenseConfig),r=c.eagerReducer===e?c.eagerState:e(r,c.action);c=c.next}while(null!==c&&c!==a);null===u?o=r:u.next=l,Lr(r,t.memoizedState)||(Ni=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=u,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Jo(e){var t=Xo(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var l=a=a.next;do{o=e(o,l.action),l=l.next}while(l!==a);Lr(o,t.memoizedState)||(Ni=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ei(e){var t=Yo();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:e}).dispatch=hi.bind(null,Bo,e),[t.memoizedState,e]}function ti(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Bo.updateQueue)?(t={lastEffect:null},Bo.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ni(){return Xo().memoizedState}function ri(e,t,n,r){var a=Yo();Bo.effectTag|=e,a.memoizedState=ti(1|t,n,void 0,void 0===r?null:r)}function ai(e,t,n,r){var a=Xo();r=void 0===r?null:r;var o=void 0;if(null!==Ko){var i=Ko.memoizedState;if(o=i.destroy,null!==r&&$o(r,i.deps))return void ti(t,n,o,r)}Bo.effectTag|=e,a.memoizedState=ti(1|t,n,o,r)}function oi(e,t){return ri(516,4,e,t)}function ii(e,t){return ai(516,4,e,t)}function li(e,t){return ai(4,2,e,t)}function ui(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ci(e,t,n){return n=null!=n?n.concat([e]):null,ai(4,2,ui.bind(null,t,e),n)}function si(){}function fi(e,t){return Yo().memoizedState=[e,void 0===t?null:t],e}function di(e,t){var n=Xo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&$o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pi(e,t){var n=Xo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&$o(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function mi(e,t,n){var r=Ua();Ba(98>r?98:r,(function(){e(!0)})),Ba(97<r?97:r,(function(){var r=Uo.suspense;Uo.suspense=void 0===t?null:t;try{e(!1),n()}finally{Uo.suspense=r}}))}function hi(e,t,n){var r=ql(),a=po.suspense;a={expirationTime:r=$l(r,e,a),suspenseConfig:a,action:n,eagerReducer:null,eagerState:null,next:null};var o=t.pending;if(null===o?a.next=a:(a.next=o.next,o.next=a),t.pending=a,o=e.alternate,e===Bo||null!==o&&o===Bo)Vo=!0,a.expirationTime=Wo,Bo.expirationTime=Wo;else{if(0===e.expirationTime&&(null===o||0===o.expirationTime)&&null!==(o=t.lastRenderedReducer))try{var i=t.lastRenderedState,l=o(i,n);if(a.eagerReducer=o,a.eagerState=l,Lr(l,i))return}catch(e){}Ql(e,r)}}var yi={readContext:ro,useCallback:qo,useContext:qo,useEffect:qo,useImperativeHandle:qo,useLayoutEffect:qo,useMemo:qo,useReducer:qo,useRef:qo,useState:qo,useDebugValue:qo,useResponder:qo,useDeferredValue:qo,useTransition:qo},vi={readContext:ro,useCallback:fi,useContext:ro,useEffect:oi,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ri(4,2,ui.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ri(4,2,e,t)},useMemo:function(e,t){var n=Yo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=hi.bind(null,Bo,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Yo().memoizedState=e},useState:ei,useDebugValue:si,useResponder:Fo,useDeferredValue:function(e,t){var n=ei(e),r=n[0],a=n[1];return oi((function(){var n=Uo.suspense;Uo.suspense=void 0===t?null:t;try{a(e)}finally{Uo.suspense=n}}),[e,t]),r},useTransition:function(e){var t=ei(!1),n=t[0];return t=t[1],[fi(mi.bind(null,t,e),[t,e]),n]}},gi={readContext:ro,useCallback:di,useContext:ro,useEffect:ii,useImperativeHandle:ci,useLayoutEffect:li,useMemo:pi,useReducer:Go,useRef:ni,useState:function(){return Go(Zo)},useDebugValue:si,useResponder:Fo,useDeferredValue:function(e,t){var n=Go(Zo),r=n[0],a=n[1];return ii((function(){var n=Uo.suspense;Uo.suspense=void 0===t?null:t;try{a(e)}finally{Uo.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Go(Zo),n=t[0];return t=t[1],[di(mi.bind(null,t,e),[t,e]),n]}},bi={readContext:ro,useCallback:di,useContext:ro,useEffect:ii,useImperativeHandle:ci,useLayoutEffect:li,useMemo:pi,useReducer:Jo,useRef:ni,useState:function(){return Jo(Zo)},useDebugValue:si,useResponder:Fo,useDeferredValue:function(e,t){var n=Jo(Zo),r=n[0],a=n[1];return ii((function(){var n=Uo.suspense;Uo.suspense=void 0===t?null:t;try{a(e)}finally{Uo.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Jo(Zo),n=t[0];return t=t[1],[di(mi.bind(null,t,e),[t,e]),n]}},wi=null,Ei=null,ki=!1;function xi(e,t){var n=Su(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Si(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Ci(e){if(ki){var t=Ei;if(t){var n=t;if(!Si(e,t)){if(!(t=En(n.nextSibling))||!Si(e,t))return e.effectTag=-1025&e.effectTag|2,ki=!1,void(wi=e);xi(wi,n)}wi=e,Ei=En(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,ki=!1,wi=e}}function Ti(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;wi=e}function Oi(e){if(e!==wi)return!1;if(!ki)return Ti(e),ki=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!gn(t,e.memoizedProps))for(t=Ei;t;)xi(e,t),t=En(t.nextSibling);if(Ti(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Ei=En(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Ei=null}}else Ei=wi?En(e.stateNode.nextSibling):null;return!0}function _i(){Ei=wi=null,ki=!1}var Pi=X.ReactCurrentOwner,Ni=!1;function Ii(e,t,n,r){t.child=null===e?To(t,null,n,r):Co(t,e.child,n,r)}function ji(e,t,n,r,a){n=n.render;var o=t.ref;return no(t,a),r=Qo(e,t,n,r,o,a),null===e||Ni?(t.effectTag|=1,Ii(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=a&&(e.expirationTime=0),Qi(e,t,a))}function Ai(e,t,n,r,a,o){if(null===e){var i=n.type;return"function"!=typeof i||Cu(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ou(n.type,null,r,null,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Mi(e,t,i,r,a,o))}return i=e.child,a<o&&(a=i.memoizedProps,(n=null!==(n=n.compare)?n:zr)(a,r)&&e.ref===t.ref)?Qi(e,t,o):(t.effectTag|=1,(e=Tu(i,r)).ref=t.ref,e.return=t,t.child=e)}function Mi(e,t,n,r,a,o){return null!==e&&zr(e.memoizedProps,r)&&e.ref===t.ref&&(Ni=!1,a<o)?(t.expirationTime=e.expirationTime,Qi(e,t,o)):Di(e,t,n,r,o)}function Ri(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Di(e,t,n,r,a){var o=ha(n)?pa:fa.current;return o=ma(t,o),no(t,a),n=Qo(e,t,n,r,o,a),null===e||Ni?(t.effectTag|=1,Ii(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=a&&(e.expirationTime=0),Qi(e,t,a))}function Li(e,t,n,r,a){if(ha(n)){var o=!0;ba(t)}else o=!1;if(no(t,a),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),go(t,n,r),wo(t,n,r,a),r=!0;else if(null===e){var i=t.stateNode,l=t.memoizedProps;i.props=l;var u=i.context,c=n.contextType;"object"==typeof c&&null!==c?c=ro(c):c=ma(t,c=ha(n)?pa:fa.current);var s=n.getDerivedStateFromProps,f="function"==typeof s||"function"==typeof i.getSnapshotBeforeUpdate;f||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||u!==c)&&bo(t,i,r,c),ao=!1;var d=t.memoizedState;i.state=d,so(t,r,i,a),u=t.memoizedState,l!==r||d!==u||da.current||ao?("function"==typeof s&&(ho(t,n,s,r),u=t.memoizedState),(l=ao||vo(t,n,l,r,d,u,c))?(f||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.effectTag|=4)):("function"==typeof i.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=c,r=l):("function"==typeof i.componentDidMount&&(t.effectTag|=4),r=!1)}else i=t.stateNode,io(e,t),l=t.memoizedProps,i.props=t.type===t.elementType?l:Qa(t.type,l),u=i.context,"object"==typeof(c=n.contextType)&&null!==c?c=ro(c):c=ma(t,c=ha(n)?pa:fa.current),(f="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||u!==c)&&bo(t,i,r,c),ao=!1,u=t.memoizedState,i.state=u,so(t,r,i,a),d=t.memoizedState,l!==r||u!==d||da.current||ao?("function"==typeof s&&(ho(t,n,s,r),d=t.memoizedState),(s=ao||vo(t,n,l,r,u,d,c))?(f||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,d,c),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,d,c)),"function"==typeof i.componentDidUpdate&&(t.effectTag|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=d),i.props=r,i.state=d,i.context=c,r=s):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return Fi(e,t,n,r,o,a)}function Fi(e,t,n,r,a,o){Ri(e,t);var i=0!=(64&t.effectTag);if(!r&&!i)return a&&wa(t,n,!1),Qi(e,t,o);r=t.stateNode,Pi.current=t;var l=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&i?(t.child=Co(t,e.child,null,o),t.child=Co(t,null,l,o)):Ii(e,t,l,o),t.memoizedState=r.state,a&&wa(t,n,!0),t.child}function zi(e){var t=e.stateNode;t.pendingContext?va(0,t.pendingContext,t.pendingContext!==t.context):t.context&&va(0,t.context,!1),jo(e,t.containerInfo)}var Ui,Wi,Bi,Ki={dehydrated:null,retryTime:0};function Hi(e,t,n){var r,a=t.mode,o=t.pendingProps,i=Do.current,l=!1;if((r=0!=(64&t.effectTag))||(r=0!=(2&i)&&(null===e||null!==e.memoizedState)),r?(l=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===o.fallback||!0===o.unstable_avoidThisFallback||(i|=1),ca(Do,1&i),null===e){if(void 0!==o.fallback&&Ci(t),l){if(l=o.fallback,(o=_u(null,a,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,o.child=e;null!==e;)e.return=o,e=e.sibling;return(n=_u(l,a,n,null)).return=t,o.sibling=n,t.memoizedState=Ki,t.child=o,n}return a=o.children,t.memoizedState=null,t.child=To(t,null,a,n)}if(null!==e.memoizedState){if(a=(e=e.child).sibling,l){if(o=o.fallback,(n=Tu(e,e.pendingProps)).return=t,0==(2&t.mode)&&(l=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=l;null!==l;)l.return=n,l=l.sibling;return(a=Tu(a,o)).return=t,n.sibling=a,n.childExpirationTime=0,t.memoizedState=Ki,t.child=n,a}return n=Co(t,e.child,o.children,n),t.memoizedState=null,t.child=n}if(e=e.child,l){if(l=o.fallback,(o=_u(null,a,0,null)).return=t,o.child=e,null!==e&&(e.return=o),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,o.child=e;null!==e;)e.return=o,e=e.sibling;return(n=_u(l,a,n,null)).return=t,o.sibling=n,n.effectTag|=2,o.childExpirationTime=0,t.memoizedState=Ki,t.child=o,n}return t.memoizedState=null,t.child=Co(t,e,o.children,n)}function Vi(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),to(e.return,t)}function qi(e,t,n,r,a,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:a,lastEffect:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailExpiration=0,i.tailMode=a,i.lastEffect=o)}function $i(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;if(Ii(e,t,r.children,n),0!=(2&(r=Do.current)))r=1&r|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Vi(e,n);else if(19===e.tag)Vi(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ca(Do,r),0==(2&t.mode))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===Lo(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),qi(t,!1,a,n,o,t.lastEffect);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===Lo(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}qi(t,!0,n,null,o,t.lastEffect);break;case"together":qi(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Qi(e,t,n){null!==e&&(t.dependencies=e.dependencies);var r=t.expirationTime;if(0!==r&&iu(r),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Tu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Tu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Yi(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xi(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return ha(t.type)&&ya(),null;case 3:return Ao(),ua(da),ua(fa),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!Oi(t)||(t.effectTag|=4),null;case 5:Ro(t),n=Io(No.current);var o=t.type;if(null!==e&&null!=t.stateNode)Wi(e,t,o,r,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!r){if(null===t.stateNode)throw Error(i(166));return null}if(e=Io(_o.current),Oi(t)){r=t.stateNode,o=t.type;var l=t.memoizedProps;switch(r[Sn]=t,r[Cn]=l,o){case"iframe":case"object":case"embed":$t("load",r);break;case"video":case"audio":for(e=0;e<Xe.length;e++)$t(Xe[e],r);break;case"source":$t("error",r);break;case"img":case"image":case"link":$t("error",r),$t("load",r);break;case"form":$t("reset",r),$t("submit",r);break;case"details":$t("toggle",r);break;case"input":xe(r,l),$t("invalid",r),un(n,"onChange");break;case"select":r._wrapperState={wasMultiple:!!l.multiple},$t("invalid",r),un(n,"onChange");break;case"textarea":Ie(r,l),$t("invalid",r),un(n,"onChange")}for(var u in an(o,l),e=null,l)if(l.hasOwnProperty(u)){var c=l[u];"children"===u?"string"==typeof c?r.textContent!==c&&(e=["children",c]):"number"==typeof c&&r.textContent!==""+c&&(e=["children",""+c]):S.hasOwnProperty(u)&&null!=c&&un(n,u)}switch(o){case"input":we(r),Te(r,l,!0);break;case"textarea":we(r),Ae(r);break;case"select":case"option":break;default:"function"==typeof l.onClick&&(r.onclick=cn)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(u=9===n.nodeType?n:n.ownerDocument,e===ln&&(e=De(o)),e===ln?"script"===o?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(o,{is:r.is}):(e=u.createElement(o),"select"===o&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,o),e[Sn]=t,e[Cn]=r,Ui(e,t),t.stateNode=e,u=on(o,r),o){case"iframe":case"object":case"embed":$t("load",e),c=r;break;case"video":case"audio":for(c=0;c<Xe.length;c++)$t(Xe[c],e);c=r;break;case"source":$t("error",e),c=r;break;case"img":case"image":case"link":$t("error",e),$t("load",e),c=r;break;case"form":$t("reset",e),$t("submit",e),c=r;break;case"details":$t("toggle",e),c=r;break;case"input":xe(e,r),c=ke(e,r),$t("invalid",e),un(n,"onChange");break;case"option":c=_e(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},c=a({},r,{value:void 0}),$t("invalid",e),un(n,"onChange");break;case"textarea":Ie(e,r),c=Ne(e,r),$t("invalid",e),un(n,"onChange");break;default:c=r}an(o,c);var s=c;for(l in s)if(s.hasOwnProperty(l)){var f=s[l];"style"===l?nn(e,f):"dangerouslySetInnerHTML"===l?null!=(f=f?f.__html:void 0)&&ze(e,f):"children"===l?"string"==typeof f?("textarea"!==o||""!==f)&&Ue(e,f):"number"==typeof f&&Ue(e,""+f):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(S.hasOwnProperty(l)?null!=f&&un(n,l):null!=f&&Z(e,l,f,u))}switch(o){case"input":we(e),Te(e,r,!1);break;case"textarea":we(e),Ae(e);break;case"option":null!=r.value&&e.setAttribute("value",""+ge(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?Pe(e,!!r.multiple,n,!1):null!=r.defaultValue&&Pe(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof c.onClick&&(e.onclick=cn)}vn(o,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Bi(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));n=Io(No.current),Io(_o.current),Oi(t)?(n=t.stateNode,r=t.memoizedProps,n[Sn]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Sn]=t,t.stateNode=n)}return null;case 13:return ua(Do),r=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&Oi(t):(r=null!==(o=e.memoizedState),n||null===o||null!==(o=e.child.sibling)&&(null!==(l=t.firstEffect)?(t.firstEffect=o,o.nextEffect=l):(t.firstEffect=t.lastEffect=o,o.nextEffect=null),o.effectTag=8)),n&&!r&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Do.current)?Ol===wl&&(Ol=El):(Ol!==wl&&Ol!==El||(Ol=kl),0!==jl&&null!==Sl&&(Au(Sl,Tl),Mu(Sl,jl)))),(n||r)&&(t.effectTag|=4),null);case 4:return Ao(),null;case 10:return eo(t),null;case 17:return ha(t.type)&&ya(),null;case 19:if(ua(Do),null===(r=t.memoizedState))return null;if(o=0!=(64&t.effectTag),null===(l=r.rendering)){if(o)Yi(r,!1);else if(Ol!==wl||null!==e&&0!=(64&e.effectTag))for(l=t.child;null!==l;){if(null!==(e=Lo(l))){for(t.effectTag|=64,Yi(r,!1),null!==(o=e.updateQueue)&&(t.updateQueue=o,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)l=n,(o=r).effectTag&=2,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null,null===(e=o.alternate)?(o.childExpirationTime=0,o.expirationTime=l,o.child=null,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null):(o.childExpirationTime=e.childExpirationTime,o.expirationTime=e.expirationTime,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,l=e.dependencies,o.dependencies=null===l?null:{expirationTime:l.expirationTime,firstContext:l.firstContext,responders:l.responders}),r=r.sibling;return ca(Do,1&Do.current|2),t.child}l=l.sibling}}else{if(!o)if(null!==(e=Lo(l))){if(t.effectTag|=64,o=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Yi(r,!0),null===r.tail&&"hidden"===r.tailMode&&!l.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*za()-r.renderingStartTime>r.tailExpiration&&1<n&&(t.effectTag|=64,o=!0,Yi(r,!1),t.expirationTime=t.childExpirationTime=n-1);r.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=r.last)?n.sibling=l:t.child=l,r.last=l)}return null!==r.tail?(0===r.tailExpiration&&(r.tailExpiration=za()+500),n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=za(),n.sibling=null,t=Do.current,ca(Do,o?1&t|2:1&t),n):null}throw Error(i(156,t.tag))}function Zi(e){switch(e.tag){case 1:ha(e.type)&&ya();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(Ao(),ua(da),ua(fa),0!=(64&(t=e.effectTag)))throw Error(i(285));return e.effectTag=-4097&t|64,e;case 5:return Ro(e),null;case 13:return ua(Do),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return ua(Do),null;case 4:return Ao(),null;case 10:return eo(e),null;default:return null}}function Gi(e,t){return{value:e,source:t,stack:ve(t)}}Ui=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Wi=function(e,t,n,r,o){var i=e.memoizedProps;if(i!==r){var l,u,c=t.stateNode;switch(Io(_o.current),e=null,n){case"input":i=ke(c,i),r=ke(c,r),e=[];break;case"option":i=_e(c,i),r=_e(c,r),e=[];break;case"select":i=a({},i,{value:void 0}),r=a({},r,{value:void 0}),e=[];break;case"textarea":i=Ne(c,i),r=Ne(c,r),e=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(c.onclick=cn)}for(l in an(n,r),n=null,i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if("style"===l)for(u in c=i[l])c.hasOwnProperty(u)&&(n||(n={}),n[u]="");else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(S.hasOwnProperty(l)?e||(e=[]):(e=e||[]).push(l,null));for(l in r){var s=r[l];if(c=null!=i?i[l]:void 0,r.hasOwnProperty(l)&&s!==c&&(null!=s||null!=c))if("style"===l)if(c){for(u in c)!c.hasOwnProperty(u)||s&&s.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in s)s.hasOwnProperty(u)&&c[u]!==s[u]&&(n||(n={}),n[u]=s[u])}else n||(e||(e=[]),e.push(l,n)),n=s;else"dangerouslySetInnerHTML"===l?(s=s?s.__html:void 0,c=c?c.__html:void 0,null!=s&&c!==s&&(e=e||[]).push(l,s)):"children"===l?c===s||"string"!=typeof s&&"number"!=typeof s||(e=e||[]).push(l,""+s):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(S.hasOwnProperty(l)?(null!=s&&un(o,l),e||c===s||(e=[])):(e=e||[]).push(l,s))}n&&(e=e||[]).push("style",n),o=e,(t.updateQueue=o)&&(t.effectTag|=4)}},Bi=function(e,t,n,r){n!==r&&(t.effectTag|=4)};var Ji="function"==typeof WeakSet?WeakSet:Set;function el(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ve(n)),null!==n&&ye(n.type),t=t.value,null!==e&&1===e.tag&&ye(e.type);try{console.error(t)}catch(e){setTimeout((function(){throw e}))}}function tl(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){gu(e,t)}else t.current=null}function nl(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Qa(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(i(163))}function rl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function al(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ol(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void al(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var r=n.elementType===n.type?t.memoizedProps:Qa(n.type,t.memoizedProps);e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&fo(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}fo(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&vn(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Dt(n)))));case 19:case 17:case 20:case 21:return}throw Error(i(163))}function il(e,t,n){switch("function"==typeof ku&&ku(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e.next;Ba(97<n?97:n,(function(){var e=r;do{var n=e.destroy;if(void 0!==n){var a=t;try{n()}catch(e){gu(a,e)}}e=e.next}while(e!==r)}))}break;case 1:tl(t),"function"==typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){gu(e,t)}}(t,n);break;case 5:tl(t);break;case 4:sl(e,t,n)}}function ll(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&ll(t)}function ul(e){return 5===e.tag||3===e.tag||4===e.tag}function cl(e){e:{for(var t=e.return;null!==t;){if(ul(t)){var n=t;break e}t=t.return}throw Error(i(160))}switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(i(161))}16&n.effectTag&&(Ue(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ul(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}r?function e(t,n,r){var a=t.tag,o=5===a||6===a;if(o)t=o?t.stateNode:t.stateNode.instance,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode).insertBefore(t,r):(n=r).appendChild(t),null!==(r=r._reactRootContainer)&&void 0!==r||null!==n.onclick||(n.onclick=cn));else if(4!==a&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t):function e(t,n,r){var a=t.tag,o=5===a||6===a;if(o)t=o?t.stateNode:t.stateNode.instance,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==a&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t)}function sl(e,t,n){for(var r,a,o=t,l=!1;;){if(!l){l=o.return;e:for(;;){if(null===l)throw Error(i(160));switch(r=l.stateNode,l.tag){case 5:a=!1;break e;case 3:case 4:r=r.containerInfo,a=!0;break e}l=l.return}l=!0}if(5===o.tag||6===o.tag){e:for(var u=e,c=o,s=n,f=c;;)if(il(u,f,s),null!==f.child&&4!==f.tag)f.child.return=f,f=f.child;else{if(f===c)break e;for(;null===f.sibling;){if(null===f.return||f.return===c)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}a?(u=r,c=o.stateNode,8===u.nodeType?u.parentNode.removeChild(c):u.removeChild(c)):r.removeChild(o.stateNode)}else if(4===o.tag){if(null!==o.child){r=o.stateNode.containerInfo,a=!0,o.child.return=o,o=o.child;continue}}else if(il(e,o,n),null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;4===(o=o.return).tag&&(l=!1)}o.sibling.return=o.return,o=o.sibling}}function fl(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void rl(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,a=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[Cn]=r,"input"===e&&"radio"===r.type&&null!=r.name&&Se(n,r),on(e,a),t=on(e,r),a=0;a<o.length;a+=2){var l=o[a],u=o[a+1];"style"===l?nn(n,u):"dangerouslySetInnerHTML"===l?ze(n,u):"children"===l?Ue(n,u):Z(n,l,u,t)}switch(e){case"input":Ce(n,r);break;case"textarea":je(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?Pe(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?Pe(n,!!r.multiple,r.defaultValue,!0):Pe(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(i(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Dt(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?r=!1:(r=!0,n=t.child,Ml=za()),null!==n)e:for(e=n;;){if(5===e.tag)o=e.stateNode,r?"function"==typeof(o=o.style).setProperty?o.setProperty("display","none","important"):o.display="none":(o=e.stateNode,a=null!=(a=e.memoizedProps.style)&&a.hasOwnProperty("display")?a.display:null,o.style.display=tn("display",a));else if(6===e.tag)e.stateNode.nodeValue=r?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(o=e.child.sibling).return=e,e=o;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void dl(t);case 19:return void dl(t);case 17:return}throw Error(i(163))}function dl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ji),t.forEach((function(t){var r=wu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}var pl="function"==typeof WeakMap?WeakMap:Map;function ml(e,t,n){(n=lo(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Dl||(Dl=!0,Ll=r),el(e,t)},n}function hl(e,t,n){(n=lo(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var a=t.value;n.payload=function(){return el(e,t),r(a)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Fl?Fl=new Set([this]):Fl.add(this),el(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var yl,vl=Math.ceil,gl=X.ReactCurrentDispatcher,bl=X.ReactCurrentOwner,wl=0,El=3,kl=4,xl=0,Sl=null,Cl=null,Tl=0,Ol=wl,_l=null,Pl=1073741823,Nl=1073741823,Il=null,jl=0,Al=!1,Ml=0,Rl=null,Dl=!1,Ll=null,Fl=null,zl=!1,Ul=null,Wl=90,Bl=null,Kl=0,Hl=null,Vl=0;function ql(){return 0!=(48&xl)?1073741821-(za()/10|0):0!==Vl?Vl:Vl=1073741821-(za()/10|0)}function $l(e,t,n){if(0==(2&(t=t.mode)))return 1073741823;var r=Ua();if(0==(4&t))return 99===r?1073741823:1073741822;if(0!=(16&xl))return Tl;if(null!==n)e=$a(e,0|n.timeoutMs||5e3,250);else switch(r){case 99:e=1073741823;break;case 98:e=$a(e,150,100);break;case 97:case 96:e=$a(e,5e3,250);break;case 95:e=2;break;default:throw Error(i(326))}return null!==Sl&&e===Tl&&--e,e}function Ql(e,t){if(50<Kl)throw Kl=0,Hl=null,Error(i(185));if(null!==(e=Yl(e,t))){var n=Ua();1073741823===t?0!=(8&xl)&&0==(48&xl)?Jl(e):(Zl(e),0===xl&&Va()):Zl(e),0==(4&xl)||98!==n&&99!==n||(null===Bl?Bl=new Map([[e,t]]):(void 0===(n=Bl.get(e))||n>t)&&Bl.set(e,t))}}function Yl(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,a=null;if(null===r&&3===e.tag)a=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){a=r.stateNode;break}r=r.return}return null!==a&&(Sl===a&&(iu(t),Ol===kl&&Au(a,Tl)),Mu(a,t)),a}function Xl(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!ju(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Zl(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Ha(Jl.bind(null,e));else{var t=Xl(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=ql();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var a=e.callbackPriority;if(e.callbackExpirationTime===t&&a>=r)return;n!==ja&&xa(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?Ha(Jl.bind(null,e)):Ka(r,Gl.bind(null,e),{timeout:10*(1073741821-t)-za()}),e.callbackNode=t}}}function Gl(e,t){if(Vl=0,t)return Ru(e,t=ql()),Zl(e),null;var n=Xl(e);if(0!==n){if(t=e.callbackNode,0!=(48&xl))throw Error(i(327));if(hu(),e===Sl&&n===Tl||nu(e,n),null!==Cl){var r=xl;xl|=16;for(var a=au();;)try{uu();break}catch(t){ru(e,t)}if(Ja(),xl=r,gl.current=a,1===Ol)throw t=_l,nu(e,n),Au(e,n),Zl(e),t;if(null===Cl)switch(a=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=Ol,Sl=null,r){case wl:case 1:throw Error(i(345));case 2:Ru(e,2<n?2:n);break;case El:if(Au(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fu(a)),1073741823===Pl&&10<(a=Ml+500-za())){if(Al){var o=e.lastPingedTime;if(0===o||o>=n){e.lastPingedTime=n,nu(e,n);break}}if(0!==(o=Xl(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=bn(du.bind(null,e),a);break}du(e);break;case kl:if(Au(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fu(a)),Al&&(0===(a=e.lastPingedTime)||a>=n)){e.lastPingedTime=n,nu(e,n);break}if(0!==(a=Xl(e))&&a!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==Nl?r=10*(1073741821-Nl)-za():1073741823===Pl?r=0:(r=10*(1073741821-Pl)-5e3,0>(r=(a=za())-r)&&(r=0),(n=10*(1073741821-n)-a)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vl(r/1960))-r)&&(r=n)),10<r){e.timeoutHandle=bn(du.bind(null,e),r);break}du(e);break;case 5:if(1073741823!==Pl&&null!==Il){o=Pl;var l=Il;if(0>=(r=0|l.busyMinDurationMs)?r=0:(a=0|l.busyDelayMs,r=(o=za()-(10*(1073741821-o)-(0|l.timeoutMs||5e3)))<=a?0:a+r-o),10<r){Au(e,n),e.timeoutHandle=bn(du.bind(null,e),r);break}}du(e);break;default:throw Error(i(329))}if(Zl(e),e.callbackNode===t)return Gl.bind(null,e)}}return null}function Jl(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!=(48&xl))throw Error(i(327));if(hu(),e===Sl&&t===Tl||nu(e,t),null!==Cl){var n=xl;xl|=16;for(var r=au();;)try{lu();break}catch(t){ru(e,t)}if(Ja(),xl=n,gl.current=r,1===Ol)throw n=_l,nu(e,t),Au(e,t),Zl(e),n;if(null!==Cl)throw Error(i(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Sl=null,du(e),Zl(e)}return null}function eu(e,t){var n=xl;xl|=1;try{return e(t)}finally{0===(xl=n)&&Va()}}function tu(e,t){var n=xl;xl&=-2,xl|=8;try{return e(t)}finally{0===(xl=n)&&Va()}}function nu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,wn(n)),null!==Cl)for(n=Cl.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&ya();break;case 3:Ao(),ua(da),ua(fa);break;case 5:Ro(r);break;case 4:Ao();break;case 13:case 19:ua(Do);break;case 10:eo(r)}n=n.return}Sl=e,Cl=Tu(e.current,null),Tl=t,Ol=wl,_l=null,Nl=Pl=1073741823,Il=null,jl=0,Al=!1}function ru(e,t){for(;;){try{if(Ja(),zo.current=yi,Vo)for(var n=Bo.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(Wo=0,Ho=Ko=Bo=null,Vo=!1,null===Cl||null===Cl.return)return Ol=1,_l=t,Cl=null;e:{var a=e,o=Cl.return,i=Cl,l=t;if(t=Tl,i.effectTag|=2048,i.firstEffect=i.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l;if(0==(2&i.mode)){var c=i.alternate;c?(i.updateQueue=c.updateQueue,i.memoizedState=c.memoizedState,i.expirationTime=c.expirationTime):(i.updateQueue=null,i.memoizedState=null)}var s=0!=(1&Do.current),f=o;do{var d;if(d=13===f.tag){var p=f.memoizedState;if(null!==p)d=null!==p.dehydrated;else{var m=f.memoizedProps;d=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!s)}}if(d){var h=f.updateQueue;if(null===h){var y=new Set;y.add(u),f.updateQueue=y}else h.add(u);if(0==(2&f.mode)){if(f.effectTag|=64,i.effectTag&=-2981,1===i.tag)if(null===i.alternate)i.tag=17;else{var v=lo(1073741823,null);v.tag=2,uo(i,v)}i.expirationTime=1073741823;break e}l=void 0,i=t;var g=a.pingCache;if(null===g?(g=a.pingCache=new pl,l=new Set,g.set(u,l)):void 0===(l=g.get(u))&&(l=new Set,g.set(u,l)),!l.has(i)){l.add(i);var b=bu.bind(null,a,u,i);u.then(b,b)}f.effectTag|=4096,f.expirationTime=t;break e}f=f.return}while(null!==f);l=Error((ye(i.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ve(i))}5!==Ol&&(Ol=2),l=Gi(l,i),f=o;do{switch(f.tag){case 3:u=l,f.effectTag|=4096,f.expirationTime=t,co(f,ml(f,u,t));break e;case 1:u=l;var w=f.type,E=f.stateNode;if(0==(64&f.effectTag)&&("function"==typeof w.getDerivedStateFromError||null!==E&&"function"==typeof E.componentDidCatch&&(null===Fl||!Fl.has(E)))){f.effectTag|=4096,f.expirationTime=t,co(f,hl(f,u,t));break e}}f=f.return}while(null!==f)}Cl=su(Cl)}catch(e){t=e;continue}break}}function au(){var e=gl.current;return gl.current=yi,null===e?yi:e}function ou(e,t){e<Pl&&2<e&&(Pl=e),null!==t&&e<Nl&&2<e&&(Nl=e,Il=t)}function iu(e){e>jl&&(jl=e)}function lu(){for(;null!==Cl;)Cl=cu(Cl)}function uu(){for(;null!==Cl&&!Aa();)Cl=cu(Cl)}function cu(e){var t=yl(e.alternate,e,Tl);return e.memoizedProps=e.pendingProps,null===t&&(t=su(e)),bl.current=null,t}function su(e){Cl=e;do{var t=Cl.alternate;if(e=Cl.return,0==(2048&Cl.effectTag)){if(t=Xi(t,Cl,Tl),1===Tl||1!==Cl.childExpirationTime){for(var n=0,r=Cl.child;null!==r;){var a=r.expirationTime,o=r.childExpirationTime;a>n&&(n=a),o>n&&(n=o),r=r.sibling}Cl.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Cl.firstEffect),null!==Cl.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Cl.firstEffect),e.lastEffect=Cl.lastEffect),1<Cl.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Cl:e.firstEffect=Cl,e.lastEffect=Cl))}else{if(null!==(t=Zi(Cl)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=Cl.sibling))return t;Cl=e}while(null!==Cl);return Ol===wl&&(Ol=5),null}function fu(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function du(e){var t=Ua();return Ba(99,pu.bind(null,e,t)),null}function pu(e,t){do{hu()}while(null!==Ul);if(0!=(48&xl))throw Error(i(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var a=fu(n);if(e.firstPendingTime=a,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Sl&&(Cl=Sl=null,Tl=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,a=n.firstEffect):a=n:a=n.firstEffect,null!==a){var o=xl;xl|=32,bl.current=null,hn=qt;var l=pn();if(mn(l)){if("selectionStart"in l)var u={start:l.selectionStart,end:l.selectionEnd};else e:{var c=(u=(u=l.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(c&&0!==c.rangeCount){u=c.anchorNode;var s=c.anchorOffset,f=c.focusNode;c=c.focusOffset;try{u.nodeType,f.nodeType}catch(e){u=null;break e}var d=0,p=-1,m=-1,h=0,y=0,v=l,g=null;t:for(;;){for(var b;v!==u||0!==s&&3!==v.nodeType||(p=d+s),v!==f||0!==c&&3!==v.nodeType||(m=d+c),3===v.nodeType&&(d+=v.nodeValue.length),null!==(b=v.firstChild);)g=v,v=b;for(;;){if(v===l)break t;if(g===u&&++h===s&&(p=d),g===f&&++y===c&&(m=d),null!==(b=v.nextSibling))break;g=(v=g).parentNode}v=b}u=-1===p||-1===m?null:{start:p,end:m}}else u=null}u=u||{start:0,end:0}}else u=null;yn={activeElementDetached:null,focusedElem:l,selectionRange:u},qt=!1,Rl=a;do{try{mu()}catch(e){if(null===Rl)throw Error(i(330));gu(Rl,e),Rl=Rl.nextEffect}}while(null!==Rl);Rl=a;do{try{for(l=e,u=t;null!==Rl;){var w=Rl.effectTag;if(16&w&&Ue(Rl.stateNode,""),128&w){var E=Rl.alternate;if(null!==E){var k=E.ref;null!==k&&("function"==typeof k?k(null):k.current=null)}}switch(1038&w){case 2:cl(Rl),Rl.effectTag&=-3;break;case 6:cl(Rl),Rl.effectTag&=-3,fl(Rl.alternate,Rl);break;case 1024:Rl.effectTag&=-1025;break;case 1028:Rl.effectTag&=-1025,fl(Rl.alternate,Rl);break;case 4:fl(Rl.alternate,Rl);break;case 8:sl(l,s=Rl,u),ll(s)}Rl=Rl.nextEffect}}catch(e){if(null===Rl)throw Error(i(330));gu(Rl,e),Rl=Rl.nextEffect}}while(null!==Rl);if(k=yn,E=pn(),w=k.focusedElem,u=k.selectionRange,E!==w&&w&&w.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(w.ownerDocument.documentElement,w)){null!==u&&mn(w)&&(E=u.start,void 0===(k=u.end)&&(k=E),"selectionStart"in w?(w.selectionStart=E,w.selectionEnd=Math.min(k,w.value.length)):(k=(E=w.ownerDocument||document)&&E.defaultView||window).getSelection&&(k=k.getSelection(),s=w.textContent.length,l=Math.min(u.start,s),u=void 0===u.end?l:Math.min(u.end,s),!k.extend&&l>u&&(s=u,u=l,l=s),s=dn(w,l),f=dn(w,u),s&&f&&(1!==k.rangeCount||k.anchorNode!==s.node||k.anchorOffset!==s.offset||k.focusNode!==f.node||k.focusOffset!==f.offset)&&((E=E.createRange()).setStart(s.node,s.offset),k.removeAllRanges(),l>u?(k.addRange(E),k.extend(f.node,f.offset)):(E.setEnd(f.node,f.offset),k.addRange(E))))),E=[];for(k=w;k=k.parentNode;)1===k.nodeType&&E.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w<E.length;w++)(k=E[w]).element.scrollLeft=k.left,k.element.scrollTop=k.top}qt=!!hn,yn=hn=null,e.current=n,Rl=a;do{try{for(w=e;null!==Rl;){var x=Rl.effectTag;if(36&x&&ol(w,Rl.alternate,Rl),128&x){E=void 0;var S=Rl.ref;if(null!==S){var C=Rl.stateNode;switch(Rl.tag){case 5:E=C;break;default:E=C}"function"==typeof S?S(E):S.current=E}}Rl=Rl.nextEffect}}catch(e){if(null===Rl)throw Error(i(330));gu(Rl,e),Rl=Rl.nextEffect}}while(null!==Rl);Rl=null,Ma(),xl=o}else e.current=n;if(zl)zl=!1,Ul=e,Wl=t;else for(Rl=a;null!==Rl;)t=Rl.nextEffect,Rl.nextEffect=null,Rl=t;if(0===(t=e.firstPendingTime)&&(Fl=null),1073741823===t?e===Hl?Kl++:(Kl=0,Hl=e):Kl=0,"function"==typeof Eu&&Eu(n.stateNode,r),Zl(e),Dl)throw Dl=!1,e=Ll,Ll=null,e;return 0!=(8&xl)||Va(),null}function mu(){for(;null!==Rl;){var e=Rl.effectTag;0!=(256&e)&&nl(Rl.alternate,Rl),0==(512&e)||zl||(zl=!0,Ka(97,(function(){return hu(),null}))),Rl=Rl.nextEffect}}function hu(){if(90!==Wl){var e=97<Wl?97:Wl;return Wl=90,Ba(e,yu)}}function yu(){if(null===Ul)return!1;var e=Ul;if(Ul=null,0!=(48&xl))throw Error(i(331));var t=xl;for(xl|=32,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!=(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:rl(5,n),al(5,n)}}catch(t){if(null===e)throw Error(i(330));gu(e,t)}n=e.nextEffect,e.nextEffect=null,e=n}return xl=t,Va(),!0}function vu(e,t,n){uo(e,t=ml(e,t=Gi(n,t),1073741823)),null!==(e=Yl(e,1073741823))&&Zl(e)}function gu(e,t){if(3===e.tag)vu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){vu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Fl||!Fl.has(r))){uo(n,e=hl(n,e=Gi(t,e),1073741823)),null!==(n=Yl(n,1073741823))&&Zl(n);break}}n=n.return}}function bu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),Sl===e&&Tl===n?Ol===kl||Ol===El&&1073741823===Pl&&za()-Ml<500?nu(e,Tl):Al=!0:ju(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Zl(e)))}function wu(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=$l(t=ql(),e,null)),null!==(e=Yl(e,t))&&Zl(e)}yl=function(e,t,n){var r=t.expirationTime;if(null!==e){var a=t.pendingProps;if(e.memoizedProps!==a||da.current)Ni=!0;else{if(r<n){switch(Ni=!1,t.tag){case 3:zi(t),_i();break;case 5:if(Mo(t),4&t.mode&&1!==n&&a.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:ha(t.type)&&ba(t);break;case 4:jo(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value,a=t.type._context,ca(Ya,a._currentValue),a._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?Hi(e,t,n):(ca(Do,1&Do.current),null!==(t=Qi(e,t,n))?t.sibling:null);ca(Do,1&Do.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return $i(e,t,n);t.effectTag|=64}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null),ca(Do,Do.current),!r)return null}return Qi(e,t,n)}Ni=!1}}else Ni=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,a=ma(t,fa.current),no(t,n),a=Qo(null,t,r,e,a,n),t.effectTag|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ha(r)){var o=!0;ba(t)}else o=!1;t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,oo(t);var l=r.getDerivedStateFromProps;"function"==typeof l&&ho(t,r,l,e),a.updater=yo,t.stateNode=a,a._reactInternalFiber=t,wo(t,r,e,n),t=Fi(null,t,r,!0,o,n)}else t.tag=0,Ii(null,t,a,n),t=t.child;return t;case 16:e:{if(a=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(a),1!==a._status)throw a._result;switch(a=a._result,t.type=a,o=t.tag=function(e){if("function"==typeof e)return Cu(e)?1:0;if(null!=e){if((e=e.$$typeof)===ue)return 11;if(e===fe)return 14}return 2}(a),e=Qa(a,e),o){case 0:t=Di(null,t,a,e,n);break e;case 1:t=Li(null,t,a,e,n);break e;case 11:t=ji(null,t,a,e,n);break e;case 14:t=Ai(null,t,a,Qa(a.type,e),r,n);break e}throw Error(i(306,a,""))}return t;case 0:return r=t.type,a=t.pendingProps,Di(e,t,r,a=t.elementType===r?a:Qa(r,a),n);case 1:return r=t.type,a=t.pendingProps,Li(e,t,r,a=t.elementType===r?a:Qa(r,a),n);case 3:if(zi(t),r=t.updateQueue,null===e||null===r)throw Error(i(282));if(r=t.pendingProps,a=null!==(a=t.memoizedState)?a.element:null,io(e,t),so(t,r,null,n),(r=t.memoizedState.element)===a)_i(),t=Qi(e,t,n);else{if((a=t.stateNode.hydrate)&&(Ei=En(t.stateNode.containerInfo.firstChild),wi=t,a=ki=!0),a)for(n=To(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Ii(e,t,r,n),_i();t=t.child}return t;case 5:return Mo(t),null===e&&Ci(t),r=t.type,a=t.pendingProps,o=null!==e?e.memoizedProps:null,l=a.children,gn(r,a)?l=null:null!==o&&gn(r,o)&&(t.effectTag|=16),Ri(e,t),4&t.mode&&1!==n&&a.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Ii(e,t,l,n),t=t.child),t;case 6:return null===e&&Ci(t),null;case 13:return Hi(e,t,n);case 4:return jo(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Co(t,null,r,n):Ii(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,ji(e,t,r,a=t.elementType===r?a:Qa(r,a),n);case 7:return Ii(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ii(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,a=t.pendingProps,l=t.memoizedProps,o=a.value;var u=t.type._context;if(ca(Ya,u._currentValue),u._currentValue=o,null!==l)if(u=l.value,0===(o=Lr(u,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(u,o):1073741823))){if(l.children===a.children&&!da.current){t=Qi(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){l=u.child;for(var s=c.firstContext;null!==s;){if(s.context===r&&0!=(s.observedBits&o)){1===u.tag&&((s=lo(n,null)).tag=2,uo(u,s)),u.expirationTime<n&&(u.expirationTime=n),null!==(s=u.alternate)&&s.expirationTime<n&&(s.expirationTime=n),to(u.return,n),c.expirationTime<n&&(c.expirationTime=n);break}s=s.next}}else l=10===u.tag&&u.type===t.type?null:u.child;if(null!==l)l.return=u;else for(l=u;null!==l;){if(l===t){l=null;break}if(null!==(u=l.sibling)){u.return=l.return,l=u;break}l=l.return}u=l}Ii(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=(o=t.pendingProps).children,no(t,n),r=r(a=ro(a,o.unstable_observedBits)),t.effectTag|=1,Ii(e,t,r,n),t.child;case 14:return o=Qa(a=t.type,t.pendingProps),Ai(e,t,a,o=Qa(a.type,o),r,n);case 15:return Mi(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qa(r,a),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,ha(r)?(e=!0,ba(t)):e=!1,no(t,n),go(t,r,a),wo(t,r,a,n),Fi(null,t,r,!0,e,n);case 19:return $i(e,t,n)}throw Error(i(156,t.tag))};var Eu=null,ku=null;function xu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Su(e,t,n,r){return new xu(e,t,n,r)}function Cu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Tu(e,t){var n=e.alternate;return null===n?((n=Su(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ou(e,t,n,r,a,o){var l=2;if(r=e,"function"==typeof e)Cu(e)&&(l=1);else if("string"==typeof e)l=5;else e:switch(e){case ne:return _u(n.children,a,o,t);case le:l=8,a|=7;break;case re:l=8,a|=1;break;case ae:return(e=Su(12,n,t,8|a)).elementType=ae,e.type=ae,e.expirationTime=o,e;case ce:return(e=Su(13,n,t,a)).type=ce,e.elementType=ce,e.expirationTime=o,e;case se:return(e=Su(19,n,t,a)).elementType=se,e.expirationTime=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case oe:l=10;break e;case ie:l=9;break e;case ue:l=11;break e;case fe:l=14;break e;case de:l=16,r=null;break e;case pe:l=22;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=Su(l,n,t,a)).elementType=e,t.type=r,t.expirationTime=o,t}function _u(e,t,n,r){return(e=Su(7,e,r,t)).expirationTime=n,e}function Pu(e,t,n){return(e=Su(6,e,null,t)).expirationTime=n,e}function Nu(e,t,n){return(t=Su(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Iu(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function ju(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function Au(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(r>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Mu(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Ru(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Du(e,t,n,r){var a=t.current,o=ql(),l=po.suspense;o=$l(o,a,l);e:if(n){t:{if(Je(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(i(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(ha(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(i(171))}if(1===n.tag){var c=n.type;if(ha(c)){n=ga(n,c,u);break e}}n=u}else n=sa;return null===t.context?t.context=n:t.pendingContext=n,(t=lo(o,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),uo(a,t),Ql(a,o),o}function Lu(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Fu(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function zu(e,t){Fu(e,t),(e=e.alternate)&&Fu(e,t)}function Uu(e,t,n){var r=new Iu(e,t,n=null!=n&&!0===n.hydrate),a=Su(3,null,null,2===t?7:1===t?3:0);r.current=a,a.stateNode=r,oo(a),e[Tn]=r.current,n&&0!==t&&function(e,t){var n=Ge(t);Tt.forEach((function(e){mt(e,t,n)})),Ot.forEach((function(e){mt(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=r}function Wu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Bu(e,t,n,r,a){var o=n._reactRootContainer;if(o){var i=o._internalRoot;if("function"==typeof a){var l=a;a=function(){var e=Lu(i);l.call(e)}}Du(t,i,e,a)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Uu(e,0,t?{hydrate:!0}:void 0)}(n,r),i=o._internalRoot,"function"==typeof a){var u=a;a=function(){var e=Lu(i);u.call(e)}}tu((function(){Du(t,i,e,a)}))}return Lu(i)}function Ku(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:te,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Hu(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Wu(t))throw Error(i(200));return Ku(e,t,null,n)}Uu.prototype.render=function(e){Du(e,this._internalRoot,null,null)},Uu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Du(null,e,null,(function(){t[Tn]=null}))},ht=function(e){if(13===e.tag){var t=$a(ql(),150,100);Ql(e,t),zu(e,t)}},yt=function(e){13===e.tag&&(Ql(e,3),zu(e,3))},vt=function(e){if(13===e.tag){var t=ql();Ql(e,t=$l(t,e,null)),zu(e,t)}},_=function(e,t,n){switch(t){case"input":if(Ce(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=Nn(r);if(!a)throw Error(i(90));Ee(r),Ce(r,a)}}}break;case"textarea":je(e,n);break;case"select":null!=(t=n.value)&&Pe(e,!!n.multiple,t,!1)}},M=eu,R=function(e,t,n,r,a){var o=xl;xl|=4;try{return Ba(98,e.bind(null,t,n,r,a))}finally{0===(xl=o)&&Va()}},D=function(){0==(49&xl)&&(function(){if(null!==Bl){var e=Bl;Bl=null,e.forEach((function(e,t){Ru(t,e),Zl(t)})),Va()}}(),hu())},L=function(e,t){var n=xl;xl|=2;try{return e(t)}finally{0===(xl=n)&&Va()}};var Vu,qu,$u={Events:[_n,Pn,Nn,T,x,Ln,function(e){at(e,Dn)},j,A,Zt,lt,hu,{current:!1}]};qu=(Vu={findFiberByHostInstance:On,bundleType:0,version:"16.13.1",rendererPackageName:"react-dom"}).findFiberByHostInstance,function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Eu=function(e){try{t.onCommitFiberRoot(n,e,void 0,64==(64&e.current.effectTag))}catch(e){}},ku=function(e){try{t.onCommitFiberUnmount(n,e)}catch(e){}}}catch(e){}}(a({},Vu,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:X.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=nt(e))?null:e.stateNode},findFiberByHostInstance:function(e){return qu?qu(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null})),t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$u,t.createPortal=Hu,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw Error(i(268,Object.keys(e)))}return e=null===(e=nt(t))?null:e.stateNode},t.flushSync=function(e,t){if(0!=(48&xl))throw Error(i(187));var n=xl;xl|=1;try{return Ba(99,e.bind(null,t))}finally{xl=n,Va()}},t.hydrate=function(e,t,n){if(!Wu(t))throw Error(i(200));return Bu(null,e,t,!0,n)},t.render=function(e,t,n){if(!Wu(t))throw Error(i(200));return Bu(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Wu(e))throw Error(i(40));return!!e._reactRootContainer&&(tu((function(){Bu(null,null,e,!1,(function(){e._reactRootContainer=null,e[Tn]=null}))})),!0)},t.unstable_batchedUpdates=eu,t.unstable_createPortal=function(e,t){return Hu(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Wu(n))throw Error(i(200));if(null==e||void 0===e._reactInternalFiber)throw Error(i(38));return Bu(e,t,n,!1,r)},t.version="16.13.1"},function(e,t,n){"use strict";e.exports=n(42)},function(e,t,n){"use strict";
35
+ /** @license React v0.19.1
36
+ * scheduler.production.min.js
37
+ *
38
+ * Copyright (c) Facebook, Inc. and its affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var r,a,o,i,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,s=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(s,0))},a=function(e,t){c=setTimeout(e,t)},o=function(){clearTimeout(c)},i=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var y=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var v=p.now();t.unstable_now=function(){return p.now()-v}}var g=!1,b=null,w=-1,E=5,k=0;i=function(){return t.unstable_now()>=k},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):E=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,S=x.port2;x.port1.onmessage=function(){if(null!==b){var e=t.unstable_now();k=e+E;try{b(!0,e)?S.postMessage(null):(g=!1,b=null)}catch(e){throw S.postMessage(null),e}}else g=!1},r=function(e){b=e,g||(g=!0,S.postMessage(null))},a=function(e,n){w=m((function(){e(t.unstable_now())}),n)},o=function(){h(w),w=-1}}function C(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<_(a,t)))break e;e[r]=t,e[n]=a,n=r}}function T(e){return void 0===(e=e[0])?null:e}function O(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,u=e[l];if(void 0!==i&&0>_(i,n))void 0!==u&&0>_(u,i)?(e[r]=u,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==u&&0>_(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function _(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var P=[],N=[],I=1,j=null,A=3,M=!1,R=!1,D=!1;function L(e){for(var t=T(N);null!==t;){if(null===t.callback)O(N);else{if(!(t.startTime<=e))break;O(N),t.sortIndex=t.expirationTime,C(P,t)}t=T(N)}}function F(e){if(D=!1,L(e),!R)if(null!==T(P))R=!0,r(z);else{var t=T(N);null!==t&&a(F,t.startTime-e)}}function z(e,n){R=!1,D&&(D=!1,o()),M=!0;var r=A;try{for(L(n),j=T(P);null!==j&&(!(j.expirationTime>n)||e&&!i());){var l=j.callback;if(null!==l){j.callback=null,A=j.priorityLevel;var u=l(j.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?j.callback=u:j===T(P)&&O(P),L(n)}else O(P);j=T(P)}if(null!==j)var c=!0;else{var s=T(N);null!==s&&a(F,s.startTime-n),c=!1}return c}finally{j=null,A=r,M=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var W=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){R||M||(R=!0,r(z))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return T(P)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=W,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();if("object"==typeof i&&null!==i){var u=i.delay;u="number"==typeof u&&0<u?l+u:l,i="number"==typeof i.timeout?i.timeout:U(e)}else i=U(e),u=l;return e={id:I++,callback:n,priorityLevel:e,startTime:u,expirationTime:i=u+i,sortIndex:-1},u>l?(e.sortIndex=u,C(N,e),null===T(P)&&e===T(N)&&(D?o():D=!0,a(F,u-l))):(e.sortIndex=i,C(P,e),R||M||(R=!0,r(z))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();L(e);var n=T(P);return n!==j&&null!==j&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<j.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=m(o),l=m(n(12)),u=m(n(1)),c=m(n(46)),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(31)),f=n(21),d=m(f),p=n(53);function m(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var v=t.portalClassName="ReactModalPortal",g=t.bodyOpenClassName="ReactModal__Body--open",b=void 0!==l.default.createPortal,w=function(){return b?l.default.createPortal:l.default.unstable_renderSubtreeIntoContainer};function E(e){return e()}var k=function(e){function t(){var e,n,a;h(this,t);for(var o=arguments.length,u=Array(o),s=0;s<o;s++)u[s]=arguments[s];return n=a=y(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.removePortal=function(){!b&&l.default.unmountComponentAtNode(a.node);var e=E(a.props.parentSelector);e?e.removeChild(a.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},a.portalRef=function(e){a.portal=e},a.renderPortal=function(e){var n=w()(a,i.default.createElement(c.default,r({defaultStyles:t.defaultStyles},e)),a.node);a.portalRef(n)},y(a,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"componentDidMount",value:function(){f.canUseDOM&&(b||(this.node=document.createElement("div")),this.node.className=this.props.portalClassName,E(this.props.parentSelector).appendChild(this.node),!b&&this.renderPortal(this.props))}},{key:"getSnapshotBeforeUpdate",value:function(e){return{prevParent:E(e.parentSelector),nextParent:E(this.props.parentSelector)}}},{key:"componentDidUpdate",value:function(e,t,n){if(f.canUseDOM){var r=this.props,a=r.isOpen,o=r.portalClassName;e.portalClassName!==o&&(this.node.className=o);var i=n.prevParent,l=n.nextParent;l!==i&&(i.removeChild(this.node),l.appendChild(this.node)),(e.isOpen||a)&&!b&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(f.canUseDOM&&this.node&&this.portal){var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,n-t)):this.removePortal()}}},{key:"render",value:function(){return f.canUseDOM&&b?(!this.node&&b&&(this.node=document.createElement("div")),w()(i.default.createElement(c.default,r({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)):null}}],[{key:"setAppElement",value:function(e){s.setElement(e)}}]),t}(o.Component);k.propTypes={isOpen:u.default.bool.isRequired,style:u.default.shape({content:u.default.object,overlay:u.default.object}),portalClassName:u.default.string,bodyOpenClassName:u.default.string,htmlOpenClassName:u.default.string,className:u.default.oneOfType([u.default.string,u.default.shape({base:u.default.string.isRequired,afterOpen:u.default.string.isRequired,beforeClose:u.default.string.isRequired})]),overlayClassName:u.default.oneOfType([u.default.string,u.default.shape({base:u.default.string.isRequired,afterOpen:u.default.string.isRequired,beforeClose:u.default.string.isRequired})]),appElement:u.default.instanceOf(d.default),onAfterOpen:u.default.func,onRequestClose:u.default.func,closeTimeoutMS:u.default.number,ariaHideApp:u.default.bool,shouldFocusAfterRender:u.default.bool,shouldCloseOnOverlayClick:u.default.bool,shouldReturnFocusAfterClose:u.default.bool,parentSelector:u.default.func,aria:u.default.object,data:u.default.object,role:u.default.string,contentLabel:u.default.string,shouldCloseOnEsc:u.default.bool,overlayRef:u.default.func,contentRef:u.default.func},k.defaultProps={isOpen:!1,portalClassName:v,bodyOpenClassName:g,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,parentSelector:function(){return document.body}},k.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,p.polyfill)(k),t.default=k},function(e,t,n){"use strict";var r=n(45);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),l=y(i),u=y(n(1)),c=h(n(47)),s=y(n(48)),f=h(n(31)),d=h(n(51)),p=y(n(21)),m=y(n(32));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function y(e){return e&&e.__esModule?e:{default:e}}n(52);var v={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},g=0,b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setOverlayRef=function(e){n.overlay=e,n.props.overlayRef&&n.props.overlayRef(e)},n.setContentRef=function(e){n.content=e,n.props.contentRef&&n.props.contentRef(e)},n.afterClose=function(){var e=n.props,t=e.appElement,r=e.ariaHideApp,a=e.htmlOpenClassName,o=e.bodyOpenClassName;o&&d.remove(document.body,o),a&&d.remove(document.getElementsByTagName("html")[0],a),r&&g>0&&0===(g-=1)&&f.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(c.returnFocus(),c.teardownScopedFocus()):c.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),m.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(c.setupScopedFocus(n.node),c.markForFocusLater()),n.setState({isOpen:!0},(function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})})))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus()},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},(function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())}))},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){9===e.keyCode&&(0,s.default)(n.content,e),n.props.shouldCloseOnEsc&&27===e.keyCode&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var r="object"===(void 0===t?"undefined":a(t))?t:{base:v[e],afterOpen:v[e]+"--after-open",beforeClose:v[e]+"--before-close"},o=r.base;return n.state.afterOpen&&(o=o+" "+r.afterOpen),n.state.beforeClose&&(o=o+" "+r.beforeClose),"string"==typeof t&&t?o+" "+t:o},n.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,r){return n[e+"-"+r]=t[r],n}),{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,a=e.bodyOpenClassName;a&&d.add(document.body,a),r&&d.add(document.getElementsByTagName("html")[0],r),n&&(g+=1,f.hide(t)),m.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,a=e.overlayClassName,o=e.defaultStyles,i=n?{}:o.content,u=a?{}:o.overlay;return this.shouldBeClosed()?null:l.default.createElement("div",{ref:this.setOverlayRef,className:this.buildClassName("overlay",a),style:r({},u,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},l.default.createElement("div",r({id:t,ref:this.setContentRef,style:r({},i,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",this.props.aria||{}),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),this.props.children))}}]),t}(i.Component);b.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},b.propTypes={isOpen:u.default.bool.isRequired,defaultStyles:u.default.shape({content:u.default.object,overlay:u.default.object}),style:u.default.shape({content:u.default.object,overlay:u.default.object}),className:u.default.oneOfType([u.default.string,u.default.object]),overlayClassName:u.default.oneOfType([u.default.string,u.default.object]),bodyOpenClassName:u.default.string,htmlOpenClassName:u.default.string,ariaHideApp:u.default.bool,appElement:u.default.instanceOf(p.default),onAfterOpen:u.default.func,onAfterClose:u.default.func,onRequestClose:u.default.func,closeTimeoutMS:u.default.number,shouldFocusAfterRender:u.default.bool,shouldCloseOnOverlayClick:u.default.bool,shouldReturnFocusAfterClose:u.default.bool,role:u.default.string,contentLabel:u.default.string,aria:u.default.object,data:u.default.object,children:u.default.node,shouldCloseOnEsc:u.default.bool,overlayRef:u.default.func,contentRef:u.default.func,id:u.default.string,testId:u.default.string},t.default=b,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlur=c,t.handleFocus=s,t.markForFocusLater=function(){i.push(document.activeElement)},t.returnFocus=function(){var e=null;try{return void(0!==i.length&&(e=i.pop()).focus())}catch(t){console.warn(["You tried to return focus to",e,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){i.length>0&&i.pop()},t.setupScopedFocus=function(e){l=e,window.addEventListener?(window.addEventListener("blur",c,!1),document.addEventListener("focus",s,!0)):(window.attachEvent("onBlur",c),document.attachEvent("onFocus",s))},t.teardownScopedFocus=function(){l=null,window.addEventListener?(window.removeEventListener("blur",c),document.removeEventListener("focus",s)):(window.detachEvent("onBlur",c),document.detachEvent("onFocus",s))};var r,a=n(30),o=(r=a)&&r.__esModule?r:{default:r};var i=[],l=null,u=!1;function c(){u=!0}function s(){if(u){if(u=!1,!l)return;setTimeout((function(){l.contains(document.activeElement)||((0,o.default)(l)[0]||l).focus()}),0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e);if(!n.length)return void t.preventDefault();var r=void 0,a=t.shiftKey,i=n[0],l=n[n.length-1];if(e===document.activeElement){if(!a)return;r=l}l!==document.activeElement||a||(r=i);i===document.activeElement&&a&&(r=l);if(r)return t.preventDefault(),void r.focus();var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null==u||"Chrome"==u[1]||null!=/\biPod\b|\biPad\b/g.exec(navigator.userAgent))return;var c=n.indexOf(document.activeElement);c>-1&&(c+=a?-1:1);if(void 0===(r=n[c]))return t.preventDefault(),void(r=a?l:i).focus();t.preventDefault(),r.focus()};var r,a=n(30),o=(r=a)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){var r;
43
+ /*!
44
+ Copyright (c) 2015 Jed Watson.
45
+ Based on code that is Copyright 2013-2015, Facebook, Inc.
46
+ All rights reserved.
47
+ */!function(){"use strict";var a=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:a,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:a&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:a&&!!window.screen};void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dumpClassLists=function(){0};var r={},a={};t.add=function(e,t){return n=e.classList,o="html"==e.nodeName.toLowerCase()?r:a,void t.split(" ").forEach((function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(o,e),n.add(e)}));var n,o},t.remove=function(e,t){return n=e.classList,o="html"==e.nodeName.toLowerCase()?r:a,void t.split(" ").forEach((function(e){!function(e,t){e[t]&&(e[t]-=1)}(o,e),0===o[e]&&n.remove(e)}));var n,o}},function(e,t,n){"use strict";var r,a=n(32),o=(r=a)&&r.__esModule?r:{default:r};var i=void 0,l=void 0,u=[];function c(){0!==u.length&&u[u.length-1].focusContent()}o.default.subscribe((function(e,t){i&&l||((i=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),i.style.position="absolute",i.style.opacity="0",i.setAttribute("tabindex","0"),i.addEventListener("focus",c),(l=i.cloneNode()).addEventListener("focus",c)),(u=t).length>0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==l&&document.body.appendChild(l)):(i.parentElement&&i.parentElement.removeChild(i),l.parentElement&&l.parentElement.removeChild(l))}))},function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function a(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function o(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function i(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,i=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?i="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(i="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==i||null!==l){var u=e.displayName||e.name,c="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+u+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==i?"\n "+i:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=a),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=o;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",(function(){return i})),r.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t,n){"use strict";
48
+ /** @license React v16.13.1
49
+ * react-is.production.min.js
50
+ *
51
+ * Copyright (c) Facebook, Inc. and its affiliates.
52
+ *
53
+ * This source code is licensed under the MIT license found in the
54
+ * LICENSE file in the root directory of this source tree.
55
+ */var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case f:case d:case i:case u:case l:case m:return e;default:switch(e=e&&e.$$typeof){case s:case p:case v:case y:case c:return e;default:return t}}case o:return t}}}function x(e){return k(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=s,t.ContextProvider=c,t.Element=a,t.ForwardRef=p,t.Fragment=i,t.Lazy=v,t.Memo=y,t.Portal=o,t.Profiler=u,t.StrictMode=l,t.Suspense=m,t.isAsyncMode=function(e){return x(e)||k(e)===f},t.isConcurrentMode=x,t.isContextConsumer=function(e){return k(e)===s},t.isContextProvider=function(e){return k(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===i},t.isLazy=function(e){return k(e)===v},t.isMemo=function(e){return k(e)===y},t.isPortal=function(e){return k(e)===o},t.isProfiler=function(e){return k(e)===u},t.isStrictMode=function(e){return k(e)===l},t.isSuspense=function(e){return k(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===u||e===l||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===c||e.$$typeof===s||e.$$typeof===p||e.$$typeof===b||e.$$typeof===w||e.$$typeof===E||e.$$typeof===g)},t.typeOf=k},,,function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),o=n(12),i=n.n(o);function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var u=n(1),c=n.n(u);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e){return"/"===e.charAt(0)}function d(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var p=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],o=e&&f(e),i=t&&f(t),l=o||i;if(e&&f(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var u=a[a.length-1];n="."===u||".."===u||""===u}else n=!1;for(var c=0,s=a.length;s>=0;s--){var p=a[s];"."===p?d(a,s):".."===p?(d(a,s),c++):c&&(d(a,s),c--)}if(!l)for(;c--;c)a.unshift("..");!l||""===a[0]||a[0]&&f(a[0])||a.unshift("");var m=a.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function m(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var h=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=m(t),a=m(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var y=function(e,t){if(!e)throw new Error("Invariant failed")};function v(e){return"/"===e.charAt(0)?e:"/"+e}function g(e){return"/"===e.charAt(0)?e.substr(1):e}function b(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function w(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function E(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function k(e,t,n,r){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=s({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(a.key=n),r?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=p(a.pathname,r.pathname)):a.pathname=r.pathname:a.pathname||(a.pathname="/"),a}function x(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var S=!("undefined"==typeof window||!window.document||!window.document.createElement);function C(e,t){t(window.confirm(e))}function T(){try{return window.history.state||{}}catch(e){return{}}}function O(e){void 0===e&&(e={}),S||y(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,i=o.forceRefresh,l=void 0!==i&&i,u=o.getUserConfirmation,c=void 0===u?C:u,f=o.keyLength,d=void 0===f?6:f,p=e.basename?w(v(e.basename)):"";function m(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return p&&(o=b(o,p)),k(o,r,n)}function h(){return Math.random().toString(36).substr(2,d)}var g=x();function O(e){s(z,e),z.length=n.length,g.notifyListeners(z.location,z.action)}function _(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||I(m(e.state))}function P(){I(m(T()))}var N=!1;function I(e){if(N)N=!1,O();else{g.confirmTransitionTo(e,"POP",c,(function(t){t?O({action:"POP",location:e}):function(e){var t=z.location,n=A.indexOf(t.key);-1===n&&(n=0);var r=A.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(N=!0,R(a))}(e)}))}}var j=m(T()),A=[j.key];function M(e){return p+E(e)}function R(e){n.go(e)}var D=0;function L(e){1===(D+=e)&&1===e?(window.addEventListener("popstate",_),a&&window.addEventListener("hashchange",P)):0===D&&(window.removeEventListener("popstate",_),a&&window.removeEventListener("hashchange",P))}var F=!1;var z={length:n.length,action:"POP",location:j,createHref:M,push:function(e,t){var a=k(e,t,h(),z.location);g.confirmTransitionTo(a,"PUSH",c,(function(e){if(e){var t=M(a),o=a.key,i=a.state;if(r)if(n.pushState({key:o,state:i},null,t),l)window.location.href=t;else{var u=A.indexOf(z.location.key),c=A.slice(0,u+1);c.push(a.key),A=c,O({action:"PUSH",location:a})}else window.location.href=t}}))},replace:function(e,t){var a=k(e,t,h(),z.location);g.confirmTransitionTo(a,"REPLACE",c,(function(e){if(e){var t=M(a),o=a.key,i=a.state;if(r)if(n.replaceState({key:o,state:i},null,t),l)window.location.replace(t);else{var u=A.indexOf(z.location.key);-1!==u&&(A[u]=a.key),O({action:"REPLACE",location:a})}else window.location.replace(t)}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&(e=!1);var t=g.setPrompt(e);return F||(L(1),F=!0),function(){return F&&(F=!1,L(-1)),t()}},listen:function(e){var t=g.appendListener(e);return L(1),function(){L(-1),t()}}};return z}var _={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+g(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:g,decodePath:v},slash:{encodePath:v,decodePath:v}};function P(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function N(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function I(e){window.location.replace(P(window.location.href)+"#"+e)}function j(e){void 0===e&&(e={}),S||y(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,a=void 0===r?C:r,o=n.hashType,i=void 0===o?"slash":o,l=e.basename?w(v(e.basename)):"",u=_[i],c=u.encodePath,f=u.decodePath;function d(){var e=f(N());return l&&(e=b(e,l)),k(e)}var p=x();function m(e){s(z,e),z.length=t.length,p.notifyListeners(z.location,z.action)}var h=!1,g=null;function T(){var e,t,n=N(),r=c(n);if(n!==r)I(r);else{var o=d(),i=z.location;if(!h&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(g===E(o))return;g=null,function(e){if(h)h=!1,m();else{p.confirmTransitionTo(e,"POP",a,(function(t){t?m({action:"POP",location:e}):function(e){var t=z.location,n=M.lastIndexOf(E(t));-1===n&&(n=0);var r=M.lastIndexOf(E(e));-1===r&&(r=0);var a=n-r;a&&(h=!0,R(a))}(e)}))}}(o)}}var O=N(),j=c(O);O!==j&&I(j);var A=d(),M=[E(A)];function R(e){t.go(e)}var D=0;function L(e){1===(D+=e)&&1===e?window.addEventListener("hashchange",T):0===D&&window.removeEventListener("hashchange",T)}var F=!1;var z={length:t.length,action:"POP",location:A,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=P(window.location.href)),n+"#"+c(l+E(e))},push:function(e,t){var n=k(e,void 0,void 0,z.location);p.confirmTransitionTo(n,"PUSH",a,(function(e){if(e){var t=E(n),r=c(l+t);if(N()!==r){g=t,function(e){window.location.hash=e}(r);var a=M.lastIndexOf(E(z.location)),o=M.slice(0,a+1);o.push(t),M=o,m({action:"PUSH",location:n})}else m()}}))},replace:function(e,t){var n=k(e,void 0,void 0,z.location);p.confirmTransitionTo(n,"REPLACE",a,(function(e){if(e){var t=E(n),r=c(l+t);N()!==r&&(g=t,I(r));var a=M.indexOf(E(z.location));-1!==a&&(M[a]=t),m({action:"REPLACE",location:n})}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return F||(L(1),F=!0),function(){return F&&(F=!1,L(-1)),t()}},listen:function(e){var t=p.appendListener(e);return L(1),function(){L(-1),t()}}};return z}function A(e,t,n){return Math.min(Math.max(e,t),n)}function M(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,r=t.initialEntries,a=void 0===r?["/"]:r,o=t.initialIndex,i=void 0===o?0:o,l=t.keyLength,u=void 0===l?6:l,c=x();function f(e){s(v,e),v.length=v.entries.length,c.notifyListeners(v.location,v.action)}function d(){return Math.random().toString(36).substr(2,u)}var p=A(i,0,a.length-1),m=a.map((function(e){return k(e,void 0,"string"==typeof e?d():e.key||d())})),h=E;function y(e){var t=A(v.index+e,0,v.entries.length-1),r=v.entries[t];c.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var v={length:m.length,action:"POP",location:m[p],index:p,entries:m,createHref:h,push:function(e,t){var r=k(e,t,d(),v.location);c.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=v.index+1,n=v.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=k(e,t,d(),v.location);c.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(v.entries[v.index]=r,f({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=v.index+e;return t>=0&&t<v.entries.length},block:function(e){return void 0===e&&(e=!1),c.setPrompt(e)},listen:function(e){return c.appendListener(e)}};return v}var R=n(22),D=n.n(R),L=n(34),F=n.n(L);function z(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}var U=a.a.createContext||function(e,t){var n,a,o="__create-react-context-"+F()()+"__",i=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=z(t.props.value),t}D()(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[o]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,a=e.value;((o=r)===(i=a)?0!==o||1/o==1/i:o!=o&&i!=i)?n=0:(n="function"==typeof t?t(r,a):1073741823,0!==(n|=0)&&this.emitter.set(e.value,n))}var o,i},r.render=function(){return this.props.children},n}(r.Component);i.childContextTypes=((n={})[o]=c.a.object.isRequired,n);var l=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}D()(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?1073741823:t},r.componentDidMount=function(){this.context[o]&&this.context[o].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?1073741823:e},r.componentWillUnmount=function(){this.context[o]&&this.context[o].off(this.onUpdate)},r.getValue=function(){return this.context[o]?this.context[o].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(r.Component);return l.contextTypes=((a={})[o]=c.a.object,a),{Provider:i,Consumer:l}},W=n(23),B=n.n(W);n(33);function K(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var H=n(35),V=n.n(H),q=function(e){var t=U();return t.displayName=e,t}("Router"),$=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}l(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return a.a.createElement(q.Provider,{children:this.props.children||null,value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}})},t}(a.a.Component);var Q=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=M(t.props),t}return l(t,e),t.prototype.render=function(){return a.a.createElement($,{history:this.history,children:this.props.children})},t}(a.a.Component);var Y=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(a.a.Component);var X={},Z=0;function G(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(X[e])return X[e];var t=B.a.compile(e);return Z<1e4&&(X[e]=t,Z++),t}(e)(t,{pretty:!0})}function J(e){var t=e.computedMatch,n=e.to,r=e.push,o=void 0!==r&&r;return a.a.createElement(q.Consumer,null,(function(e){e||y(!1);var r=e.history,i=e.staticContext,l=o?r.push:r.replace,u=k(t?"string"==typeof n?G(n,t.params):s({},n,{pathname:G(n.pathname,t.params)}):n);return i?(l(u),null):a.a.createElement(Y,{onMount:function(){l(u)},onUpdate:function(e,t){var n,r,a=k(t.to);n=a,r=s({},u,{key:a.key}),n.pathname===r.pathname&&n.search===r.search&&n.hash===r.hash&&n.key===r.key&&h(n.state,r.state)||l(u)},to:n})}))}var ee={},te=0;function ne(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,u=n.sensitive,c=void 0!==u&&u;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=ee[n]||(ee[n]={});if(r[e])return r[e];var a=[],o={regexp:B()(e,a,t),keys:a};return te<1e4&&(r[e]=o,te++),o}(n,{end:o,strict:l,sensitive:c}),a=r.regexp,i=r.keys,u=a.exec(e);if(!u)return null;var s=u[0],f=u.slice(1),d=e===s;return o&&!d?null:{path:n,url:"/"===n&&""===s?"/":s,isExact:d,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var re=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(){var e=this;return a.a.createElement(q.Consumer,null,(function(t){t||y(!1);var n=e.props.location||t.location,r=s({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?ne(n.pathname,e.props):t.match}),o=e.props,i=o.children,l=o.component,u=o.render;return Array.isArray(i)&&0===i.length&&(i=null),a.a.createElement(q.Provider,{value:r},r.match?i?"function"==typeof i?i(r):i:l?a.a.createElement(l,r):u?u(r):null:"function"==typeof i?i(r):null)}))},t}(a.a.Component);function ae(e){return"/"===e.charAt(0)?e:"/"+e}function oe(e,t){if(!e)return t;var n=ae(e);return 0!==t.pathname.indexOf(n)?t:s({},t,{pathname:t.pathname.substr(n.length)})}function ie(e){return"string"==typeof e?e:E(e)}function le(e){return function(){y(!1)}}function ue(){}a.a.Component;var ce=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(){var e=this;return a.a.createElement(q.Consumer,null,(function(t){t||y(!1);var n,r,o=e.props.location||t.location;return a.a.Children.forEach(e.props.children,(function(e){if(null==r&&a.a.isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?ne(o.pathname,s({},e.props,{path:i})):t.match}})),r?a.a.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(a.a.Component);function se(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=K(t,["wrappedComponentRef"]);return a.a.createElement(q.Consumer,null,(function(t){return t||y(!1),a.a.createElement(e,s({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,V()(n,e)}var fe=a.a.useContext;function de(e){return e?ne(fe(q).location.pathname,e):fe(q).match}a.a.Component;var pe=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=j(t.props),t}return l(t,e),t.prototype.render=function(){return a.a.createElement($,{history:this.history,children:this.props.children})},t}(a.a.Component);var me=function(e,t){return"function"==typeof e?e(t):e},he=function(e,t){return"string"==typeof e?k(e,null,null,t):e},ye=function(e){return e},ve=a.a.forwardRef;void 0===ve&&(ve=ye);var ge=ve((function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=K(e,["innerRef","navigate","onClick"]),l=i.target,u=s({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||l&&"_self"!==l||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return u.ref=ye!==ve&&t||n,a.a.createElement("a",u)}));var be=ve((function(e,t){var n=e.component,r=void 0===n?ge:n,o=e.replace,i=e.to,l=e.innerRef,u=K(e,["component","replace","to","innerRef"]);return a.a.createElement(q.Consumer,null,(function(e){e||y(!1);var n=e.history,c=he(me(i,e.location),e.location),f=c?n.createHref(c):"",d=s({},u,{href:f,navigate:function(){var t=me(i,e.location);(o?n.replace:n.push)(t)}});return ye!==ve?d.ref=t||l:d.innerRef=l,a.a.createElement(r,d)}))})),we=function(e){return e},Ee=a.a.forwardRef;void 0===Ee&&(Ee=we);Ee((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,i=void 0===o?"active":o,l=e.activeStyle,u=e.className,c=e.exact,f=e.isActive,d=e.location,p=e.strict,m=e.style,h=e.to,v=e.innerRef,g=K(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","strict","style","to","innerRef"]);return a.a.createElement(q.Consumer,null,(function(e){e||y(!1);var n=d||e.location,o=he(me(h,n),n),b=o.pathname,w=b&&b.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),E=w?ne(n.pathname,{path:w,exact:c,strict:p}):null,k=!!(f?f(E,n):E),x=k?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(u,i):u,S=k?s({},m,{},l):m,C=s({"aria-current":k&&r||null,className:x,style:S,to:o},g);return we!==Ee?C.ref=t||v:C.innerRef=v,a.a.createElement(be,C)}))}));function ke(e){return function(e){if(Array.isArray(e))return Ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Se(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Se(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Se(e,t){if(e){if("string"==typeof e)return Ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Te=a.a.createContext({errors:[],addError:function(){},removeError:function(){}});function Oe(e){var t=e.children,n=xe(Object(r.useState)([]),2),o=n[0],i=n[1],l={errors:o,addError:Object(r.useCallback)((function(e,t,n){return function(e,t,n){i((function(r){return[].concat(ke(r),[{code:e,message:t,debug:n}])}))}(e,t,n)}),[]),removeError:Object(r.useCallback)((function(e){return t=e,void i((function(e){return e.filter((function(e){return e!==t}))}));var t}),[])};return a.a.createElement(Te.Provider,{value:l},t)}function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(n),!0).forEach((function(t){Ne(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return je(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ae=a.a.createContext({globalConfig:{},setConfigValue:function(){}});function Me(e){var t=e.children,n=e.config,o=void 0===n?{}:n,i=Ie(Object(r.useState)(Object.keys(o).length>0?o:window.template_kit_import),2),l=i[0],u=i[1],c={globalConfig:l,setConfigValue:Object(r.useCallback)((function(e,t){return function(e,t){u((function(n){return Pe(Pe({},n),{},Ne({},e,t))}))}(e,t)}),[])};return a.a.createElement(Ae.Provider,{value:c},t)}var Re=function(){var e=Object(r.useContext)(Te);return{errors:e.errors,addError:e.addError,removeError:e.removeError}},De=n(3),Le=n.n(De),Fe=n(16),ze=n.n(Fe);function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return We(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return We(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function We(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Be={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999},content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)",padding:"40px",borderRadius:"10px"}},Ke=function(e){var t=e.isOpen,n=e.onCloseCallback,o=void 0===n?null:n,i=e.children,l=Ue(a.a.useState(!1),2),u=l[0],c=l[1],s=function(){c(!1),o&&o()};return Object(r.useEffect)((function(){t&&c(!0)}),[t]),Object(r.useEffect)((function(){"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Le.a.setAppElement(window.templateKitImport.modalAppHolder)})),a.a.createElement(Le.a,{isOpen:u,onRequestClose:s,style:Be,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:ze.a.modalInner},a.a.createElement("button",{onClick:s,"data-testid":"modal-close-button",className:ze.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat(ze.a.dismissIcon)})),"function"==typeof i?i({closeModal:s}):i))},He=n(17),Ve=n.n(He),qe=function(e){var t=e.title,n=e.subtitle;return a.a.createElement("div",{className:Ve.a.wrapper},a.a.createElement("h1",{className:Ve.a.title},t),n?a.a.createElement("p",{className:Ve.a.subtitle},n):null)},$e=n(8),Qe=n.n($e),Ye=n(18),Xe=n.n(Ye),Ze=function(e){var t=e.label,n=e.icon,r=["dashicons",Ge[n],Xe.a.icon];return t&&r.push(Xe.a.iconWithLabel),a.a.createElement(a.a.Fragment,null,n?a.a.createElement("span",{className:r.join(" ")}):null,t)},Ge={arrow:"dashicons-arrow-right-alt2",tick:"dashicons-yes",info:"dashicons-info",eye:"dashicons-visibility",cross:"dashicons-dismiss",update:"dashicons-update",updateSpinning:"dashicons-update ".concat(Xe.a.iconSpinning),link:"dashicons-external",plus:"dashicons-plus-alt",trash:"dashicons-trash",download:"dashicons-download",expand:"dashicons-editor-expand"};Ze.propTypes={label:c.a.string,icon:c.a.oneOf(Object.keys(Ge))},Ze.defaultProps={label:null,icon:null};var Je=Ze,et=n(13),tt=n.n(et);function nt(){return(nt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function rt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var at=function(e){var t=e.type,n=e.dataTestId,r=e.element,o=e.children,i=rt(e,["type","dataTestId","element","children"]);return"button"===r?a.a.createElement("button",nt({className:tt.a[t],"data-testid":n},i),o):"Link"===r?a.a.createElement(be,nt({className:tt.a[t],"data-testid":n},i),o):"a"===r?a.a.createElement("a",nt({className:tt.a[t],"data-testid":n},i),o):"label"===r?a.a.createElement("label",nt({className:tt.a[t],"data-testid":n},i),o):void 0};at.propTypes={type:c.a.oneOf(["ghost","primary","secondary","warning","attention"]),dataTestId:c.a.string,element:c.a.oneOf(["button","a","Link","label"]).isRequired,children:c.a.node},at.defaultProps={type:"ghost",dataTestId:null,children:null};var ot=at,it=function(e){var t=e.type,n=e.label,r=e.icon,o=e.onClick,i=e.disabled,l=e.dataTestId;return a.a.createElement(ot,{element:"button",type:t,onClick:o,disabled:i,dataTestId:l},a.a.createElement(Je,{label:n,icon:r}))};it.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,onClick:c.a.func,disabled:c.a.bool,dataTestId:c.a.string},it.defaultProps={type:"ghost",label:null,icon:null,onClick:null,disabled:!1,dataTestId:null};var lt=it,ut=n(36),ct=n.n(ut),st=function(e){var t=e.children;return a.a.createElement("div",{className:ct.a.wrapper},t)};function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mt=function(e){var t=e.error,n=dt(Object(r.useState)(!1),2),o=n[0],i=n[1];return a.a.createElement("div",{className:Qe.a.debugWrapper},t.debug&&o?a.a.createElement("div",{className:Qe.a.debugInformation},a.a.createElement("textarea",{className:Qe.a.debugText,onClick:function(e){e.target.focus(),e.target.select()},defaultValue:"object"===ft(t.debug)?JSON.stringify(t.debug,null,"\t"):t.debug})):null,a.a.createElement("div",{className:Qe.a.debugActions},a.a.createElement(st,null,a.a.createElement(lt,{icon:"update",label:"Refresh Page",onClick:function(e){return e.preventDefault(),window.location.reload(),!1}}),t.debug?a.a.createElement(lt,{icon:"eye",label:o?"Hide Debug Details":"Show Debug Details",className:Qe.a.buttonDebug,onClick:function(){i(!o)}}):null),"If this error continues please contact ",a.a.createElement("a",{href:"mailto:extensions@envato.com"},"extensions@envato.com"),"."))},ht=function(){var e=Re(),t=e.errors,n=e.removeError;return t.length>0?a.a.createElement(a.a.Fragment,null,t.map((function(e){return"zip_failure"===e.code?a.a.createElement(Ke,{key:e.code,isOpen:!0,onCloseCallback:function(){n(e)}},a.a.createElement(qe,{title:"Template Kit Install Error"}),a.a.createElement("p",{className:Qe.a.copy},"There was an issue installing this template kit. Please try again."),e.message,a.a.createElement(mt,{error:e})):"generic_api_error"===e.code?a.a.createElement(Ke,{key:e.code,isOpen:!0,onCloseCallback:function(){n(e)}},a.a.createElement(qe,{title:"Unexpected Error"}),a.a.createElement("p",{className:Qe.a.copy},"Sorry there was an unexpected error from API call:"),e.message,a.a.createElement(mt,{error:e})):void 0}))):null},yt=n(4),vt=n.n(yt),gt=function(){return a.a.createElement("div",{className:vt.a.wrapper},a.a.createElement("div",{className:vt.a.logo},a.a.createElement(be,{to:"/",className:vt.a.logoLink},"Envato")),a.a.createElement("nav",{className:vt.a.menu},a.a.createElement("ul",{className:vt.a.menuInner},a.a.createElement("li",{className:vt.a.menuItem},a.a.createElement(be,{to:"/template-kits/installed-kits",className:"".concat(vt.a.menuLink," ").concat(de({path:"/template-kits"})?vt.a.menuLinkActive:"")},"Template Kits")))))};function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){Et(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kt=function(){var e=Object(r.useContext)(Ae),t=e.globalConfig,n=e.setConfigValue,a=function(e,r){var a=t[e]||[];n(e,wt(wt({},a),r))};return{getDownloadedItemId:function(e){return t.downloaded_items?t.downloaded_items[e]:null},addDownloadedItem:function(e){var t=e.humaneId,n=e.importedId;a("downloaded_items",Et({},t,n))},removeDownloadedItem:function(e){var n=e.importedId;Object.keys(t.downloaded_items).map((function(e){t.downloaded_items[e]===n&&delete t.downloaded_items[e]}))},subscriptionStatus:t.subscription_status,setSubscriptionStatus:function(e){n("subscription_status",e)},bannerHasBeenDismissed:function(e){a("dismissed_banners",Et({},e,!0))},isBannerDismissed:function(e){return t.dismissed_banners?t.dismissed_banners[e]:null},getConfigProjectName:function(){return t.project_name},setConfigProjectName:function(e){n("project_name",e)},getMagicButtonMode:function(){return t.magicButtonMode},setMagicButtonMode:function(e){n("magicButtonMode",e)},getElementsTokenUrl:function(){return t.elements_token_url},getApiUrl:function(){return t.api_url},getApiNonce:function(){return t.api_nonce}}};function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function St(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(n),!0).forEach((function(t){Ct(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tt(e,t,n,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,a)}function Ot(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Tt(o,r,a,i,l,"next",e)}function l(e){Tt(o,r,a,i,l,"throw",e)}i(void 0)}))}}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Nt=function(e){var t=e.endpoint,n=e.args,a=void 0===n?{}:n,o=e.allowLongRunning,i=void 0!==o&&o,l=kt(),u=l.getApiUrl,c=l.getApiNonce,s=_t(Object(r.useState)({loading:!0,data:null,error:null}),2),f=s[0],d=s[1],p=Re().addError,m=t+JSON.stringify(a);return Object(r.useEffect)((function(){var e=new AbortController,n=e.signal;function r(){return(r=Ot(regeneratorRuntime.mark((function e(){var r,o,i,l,s,f,m,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(l in d((function(e){return{loading:!0,error:null,data:e.data}})),r=u()+t,o=St(St({},a),{},{_wpnonce:c()}),i=new FormData,o)i.append(l,o[l]);return s=null,e.prev=6,e.next=9,fetch(r,{method:"post",body:i,signal:n});case 9:return f=e.sent,e.next=12,f.clone().text();case 12:return s=e.sent,e.next=15,f.json();case 15:if(m=e.sent,f.ok){e.next=20;break}return m&&m.error&&m.error.code&&p(m.error.code,m.error.message,m),d({loading:!1,error:!0,data:m}),e.abrupt("return");case 20:d({loading:!1,error:null,data:m}),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(6),"AbortError"!==e.t0.name&&(h="".concat(e.t0,". ").concat(s?s.slice(0,200):""),p("generic_api_error",h,s),d({loading:!1,error:!0,data:e.t0.message}));case 26:case"end":return e.stop()}}),e,null,[[6,23]])})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){i||e.abort()}}),[m]),f},It=n(2),jt=n.n(It);function At(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Mt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Rt=function(e){var t=e.requirement,n=e.completeCallback,o=function(e){var t={requirement:JSON.stringify(e)};return Nt({endpoint:"installRequirement",args:t})}(t),i=o.loading,l=o.data,u=o.error;return Object(r.useEffect)((function(){i||n(u)}),[i]),a.a.createElement(a.a.Fragment,null,i?"Installing..":null,u?a.a.createElement(a.a.Fragment,null,l&&l.error?a.a.createElement(a.a.Fragment,null,l.error.data&&l.error.data.url?a.a.createElement("a",{href:l.error.data.url,target:"_blank",rel:"noopener noreferrer"},l.error.message):l.error.message):"Error"):null,i||u?null:"Success!")},Dt=function(e){var t=e.plugins,n=e.settings,o=e.completeCallback,i=At(Object(r.useState)(!1),2),l=i[0],u=i[1],c=At(Object(r.useState)(null),2),s=c[0],f=c[1],d=function(){f((function(e){return e+1}))},p=[];t.forEach((function(e){"activated"!==e.status&&p.push({plugin:e})})),n.forEach((function(e){p.push({setting:e})}));var m=p.length;return 0===m?null:a.a.createElement(a.a.Fragment,null,l?a.a.createElement(Ke,{isOpen:!0,onCloseCallback:o},a.a.createElement("div",null,a.a.createElement(qe,{title:"Missing Requirements"}),a.a.createElement("p",{className:jt.a.notice},"Please install and activate these missing requirements for this Template Kit to work correctly."),a.a.createElement("ul",{className:jt.a.requirements},p.map((function(e,t){return a.a.createElement("li",{key:"requirement".concat(t),className:jt.a.requirement},a.a.createElement("div",{className:jt.a.icon},s>t?a.a.createElement("span",{className:"dashicons dashicons-yes-alt"}):a.a.createElement("span",{className:"dashicons dashicons-marker"})),a.a.createElement("div",{className:jt.a.text},e.theme?"Theme: ".concat(e.theme.name):null,e.plugin?"Plugin: ".concat(e.plugin.name):null,e.setting?"Setting: ".concat(e.setting.name):null),a.a.createElement("div",{className:jt.a.status},s===t||s>t?a.a.createElement(Rt,{key:"installRequirement".concat(t),requirement:e,completeCallback:d}):null))}))),a.a.createElement("div",{className:jt.a.footer},null===s?a.a.createElement(lt,{type:"primary",icon:"plus",label:"Install Requirements",onClick:function(){f(0)}}):a.a.createElement(a.a.Fragment,null,s>=m?a.a.createElement(a.a.Fragment,null,a.a.createElement("p",{className:jt.a.notice},"Once the above is completed you can close this window."),a.a.createElement(lt,{type:"primary",icon:"plus",label:"Close",onClick:o})):a.a.createElement("p",{className:jt.a.notice},"Installing..."))))):null,a.a.createElement("div",{className:jt.a.wrapper},a.a.createElement("div",{className:jt.a.textWrapper},a.a.createElement("strong",null,"Attention!")," There are ",m," requirements that need installing for this Template Kit to work correctly."),a.a.createElement("div",{className:jt.a.buttonWrapper},a.a.createElement(lt,{type:"attention",label:"Install Requirements",icon:"info",onClick:function(){u(!0)}}))))};Dt.propTypes={plugins:c.a.arrayOf(c.a.shape({author:c.a.string,file:c.a.string,name:c.a.string,slug:c.a.string,status:c.a.string,url:c.a.string,version:c.a.string})),settings:c.a.arrayOf(c.a.shape({name:c.a.string,setting_name:c.a.string})),completeCallback:c.a.func.isRequired},Dt.defaultProps={plugins:[],settings:[]};var Lt=Dt,Ft=n(24),zt=n.n(Ft),Ut=function(){return a.a.createElement("div",{className:zt.a.wrap},a.a.createElement("span",{className:zt.a.inner,"aria-label":"Loading"}))},Wt=function(e){return Nt({endpoint:"fetchInstalledTemplateKits",args:e})},Bt=n(5),Kt=n.n(Bt),Ht=function(e){var t=e.currentKitId,n=e.handleChangeKitId,r=Wt();return a.a.createElement(a.a.Fragment,null,!r.loading&&r.data&&r.data.length>1?a.a.createElement("div",{className:Kt.a.currentKit},a.a.createElement("div",{className:Kt.a.optionKitWrapper},a.a.createElement("div",{className:Kt.a.optionKit},a.a.createElement("button",{className:"".concat(Kt.a.optionKitLink," ").concat("all"===t?Kt.a.optionKitLinkCurrent:""),onClick:function(){n("all")}},"All Kits")),r.data.map((function(e){return a.a.createElement("div",{className:Kt.a.optionKit,key:e.id},a.a.createElement("button",{className:"".concat(Kt.a.optionKitLink," ").concat(t===e.id?Kt.a.optionKitLinkCurrent:""),onClick:function(){n(e.id)}},e.title))})))):null)};function Vt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $t=function(e){var t=e.actionHook,n=e.LoadingButton,r=e.SuccessButton,a=e.ErrorButton,o=e.errorCallback,i=e.completeCallback,l=t(),u=l.loading,c=l.data,s=l.error;return u||s?s?(setTimeout((function(){o(c)}),100),a):n:(setTimeout((function(){i(c)}),500),r)},Qt=function(e){var t=e.DefaultButton,n=e.CompletedButton,o=e.LoadingButton,i=e.ErrorButton,l=e.SuccessButton,u=e.actionHook,c=e.isAlreadyCompleted,s=void 0!==c&&c,f=e.completedCallback,d=void 0===f?null:f,p=e.errorCallback,m=void 0===p?null:p,h=e.actionConfirmationMessage,y=void 0===h?null:h,v=Vt(Object(r.useState)(!1),2),g=v[0],b=v[1],w=Vt(Object(r.useState)(s),2),E=w[0],k=w[1],x=Vt(Object(r.useState)(null),2),S=x[0],C=x[1];return Object(r.useEffect)((function(){E&&d&&!s&&d(E)}),[E]),Object(r.useEffect)((function(){S&&m&&m(S)}),[S]),Object(r.useEffect)((function(){k(s)}),[s]),E?n:g?a.a.createElement($t,{actionHook:u,LoadingButton:o,ErrorButton:i,SuccessButton:l,errorCallback:function(e){setTimeout((function(){b(!1)}),500),C(e)},completeCallback:function(e){b(!1),k(e)}}):a.a.cloneElement(t,{onClick:function(e){if(y&&!confirm(y))return e.preventDefault(),!1;b(!0)}})},Yt=function(e){var t=e.templateKitId,n=e.customActionHook,r=void 0===n?null:n,o=e.completeCallback,i=void 0===o?null:o,l=e.errorCallback,u=void 0===l?null:l;return a.a.createElement(Qt,{DefaultButton:a.a.createElement(lt,{type:"warning",label:"",icon:"trash"}),actionConfirmationMessage:"Really delete this Template Kit?",LoadingButton:a.a.createElement(lt,{type:"warning",label:"",icon:"trash",disabled:!0}),ErrorButton:a.a.createElement(lt,{type:"warning",label:"",icon:"trash",disabled:!0}),SuccessButton:a.a.createElement(lt,{type:"warning",label:"",icon:"trash",disabled:!0}),CompletedButton:a.a.createElement(lt,{type:"warning",label:"",icon:"trash"}),actionHook:function(){return r?r():Nt({endpoint:"deleteTemplateKit",args:{templateKitId:t},allowLongRunning:!0})},isAlreadyCompleted:!1,completedCallback:function(){i&&i()},errorCallback:u})},Xt=n(25),Zt=n.n(Xt),Gt=function(e){var t=e.message;return a.a.createElement("div",{className:Zt.a.message},a.a.createElement("p",{className:Zt.a.copy},t))};Gt.propTypes={message:c.a.string},Gt.defaultProps={message:"Sorry there was an error loading this data. Please try again."};var Jt=Gt,en=n(19),tn=n.n(en),nn=function(e){var t=e.children,n=e.includeLastItemSpacer,r=void 0!==n&&n;return a.a.createElement("div",{className:tn.a.wrapper},a.a.createElement("div",{className:tn.a.inner},t,r?a.a.createElement("div",{className:tn.a.cardSpacing}):null))},rn=n(6),an=n.n(rn);function on(){return(on=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ln(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var un=function(e){var t=e.colWidthPercentage,n=void 0===t?20:t,r=e.children,o=e.className,i=ln(e,["colWidthPercentage","children","className"]),l=[an.a.item];return 20===n&&l.push(an.a.widthTwenty),25===n&&l.push(an.a.widthTwentyFive),33===n&&l.push(an.a.widthThirtyThree),40===n&&l.push(an.a.widthFourty),50===n&&l.push(an.a.widthFifty),60===n&&l.push(an.a.widthSixty),100===n&&l.push(an.a.widthFull),o&&l.push(o),a.a.createElement("div",on({className:l.join(" ")},i),r)},cn=n(10),sn=n.n(cn),fn=function(e){var t=e.Images,n=e.Buttons,r=e.title,o=e.description;return a.a.createElement("div",{className:sn.a.wrapper},a.a.createElement("div",{className:sn.a.inner},a.a.createElement("div",{className:sn.a.images},t),a.a.createElement("div",{className:sn.a.meta},a.a.createElement("h4",{className:sn.a.cardTitle},r),a.a.createElement("p",{className:sn.a.cardDescription},o),n)))},dn=function(e){return Nt({endpoint:"importSingleTemplate",args:e,allowLongRunning:!0})},pn=function(e){var t=e.importedTemplateId;return"post.php?post=".concat(t,"&action=elementor")};function mn(){return(mn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var yn=function(e){var t=e.type,n=e.label,r=e.icon,o=e.href,i=e.openNewWindow,l=hn(e,["type","label","icon","href","openNewWindow"]),u=i?{target:"_blank",rel:"noopener noreferrer"}:null;return a.a.createElement(ot,mn({href:o,type:t,element:"a"},u,l),a.a.createElement(Je,{label:n,icon:r}))};yn.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,href:c.a.string.isRequired},yn.defaultProps={type:"ghost",label:null,icon:null};var vn=yn;function gn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var wn=function(e){var t=e.templateKitId,n=e.templateId,o=e.existingImports,i=e.customActionHook,l=void 0===i?null:i,u=e.completeCallback,c=void 0===u?null:u,s=e.errorCallback,f=void 0===s?null:s,d=gn(Object(r.useState)(o.length?o[0].imported_template_id:null),2),p=d[0],m=d[1];return a.a.createElement(Qt,{DefaultButton:a.a.createElement(lt,{type:"primary",label:"Import Template",icon:"plus"}),LoadingButton:a.a.createElement(lt,{type:"primary",label:"Importing",icon:"updateSpinning",disabled:!0}),ErrorButton:a.a.createElement(lt,{type:"warning",label:"Error",icon:"cross",disabled:!0}),SuccessButton:a.a.createElement(lt,{type:"primary",label:"Success!",icon:"tick",disabled:!0}),CompletedButton:a.a.createElement(vn,{href:pn({importedTemplateId:p}),type:"primary",label:"View Template",icon:"eye",openNewWindow:!0}),actionHook:function(){return l?l():dn({templateKitId:t,templateId:n})},isAlreadyCompleted:o.length,completedCallback:function(e){e&&e.imported_template_id&&(m(e.imported_template_id),c&&c(e))},errorCallback:f})},En=function(e){var t=e.templateKitId,n=e.templateId,r=(e.existingImports,e.customActionHook),o=void 0===r?null:r,i=e.completeCallback,l=void 0===i?null:i,u=e.errorCallback,c=void 0===u?null:u,s=a.a.createElement(lt,{type:"primary",label:"Inserting...",icon:"updateSpinning",disabled:!0});return a.a.createElement(Qt,{DefaultButton:a.a.createElement(lt,{type:"primary",label:"Insert Template",icon:"plus"}),LoadingButton:s,ErrorButton:a.a.createElement(lt,{type:"warning",label:"Error",icon:"cross",disabled:!0}),SuccessButton:s,CompletedButton:s,actionHook:function(){return o?o():dn({templateKitId:t,templateId:n,insertToPage:!0})},isAlreadyCompleted:!1,completedCallback:function(e){e&&e.imported_template_id&&l&&l(e)},errorCallback:c})},kn=n(26),xn=n.n(kn),Sn=function(){return a.a.createElement("div",{className:xn.a.svgWrapper},a.a.createElement("svg",{className:xn.a.svgEnvatoLogo,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 27 31"},a.a.createElement("path",{fill:"#fff",d:"M23.64 1.318C19.45-3.592 5.89 5.918 6 18.178a.58.58 0 01-.57.57.58.58 0 01-.49-.28 13.13 13.13 0 01-.52-9.65.53.53 0 00-.9-.52A13 13 0 000 17.188a13 13 0 0013.15 13.15c18.5-.42 14.23-24.64 10.49-29.02z"})))},Cn=n(9),Tn=n.n(Cn);function On(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _n(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Pn={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999},content:{background:"#f1f1f1",border:"0",top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",padding:"0",transform:"translate(-50%, -50%)",borderRadius:"4px"}},Nn=function(e){var t=e.isOpen,n=e.onCloseCallback,o=void 0===n?null:n,i=e.children,l=e.templatePreviewTitle,u=e.templateId,c=e.templateKitId,s=e.existingImports,f=On(a.a.useState(!1),2),d=f[0],p=f[1],m=function(){p(!1),o&&o()};Object(r.useEffect)((function(){t&&p(!0)}),[t]),"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Le.a.setAppElement(window.templateKitImport.modalAppHolder);var h=(0,kt().getMagicButtonMode)();return a.a.createElement(Le.a,{isOpen:d,onRequestClose:m,style:Pn,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:Tn.a.modalInner},a.a.createElement("div",{className:Tn.a.modalHeader},a.a.createElement("div",{className:Tn.a.modalLogo},a.a.createElement(Sn,null)),a.a.createElement("div",{className:Tn.a.headerTitle},l),a.a.createElement("div",{className:Tn.a.headerActions},h&&"elementorMagicButton"===h.mode?a.a.createElement(En,{templateKitId:c,templateId:u,completeCallback:function(e){h.insertCallback&&"function"==typeof h.insertCallback&&h.insertCallback(e)}}):a.a.createElement(wn,{templateKitId:c,templateId:u,existingImports:s}),a.a.createElement("button",{onClick:m,"data-testid":"modal-close-button",className:Tn.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat(Tn.a.dismissIcon)})))),a.a.createElement("div",null,"function"==typeof i?i({closeModal:m}):i)))},In=n(37),jn=n.n(In),An=function(e){var t=e.onCloseCallback,n=e.templateId,r=e.templateKitId,o=e.existingImports,i=e.templateScreenShotUrl,l=e.templatePreviewTitle;return a.a.createElement(Nn,{templateId:n,templateKitId:r,existingImports:o,templatePreviewTitle:l,isOpen:!0,onCloseCallback:t},a.a.createElement("img",{className:jn.a.previewTemplate,src:i,alt:l}))},Mn=n(14),Rn=n.n(Mn);function Dn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ln(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ln(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ln(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Fn=function(e){var t=e.template,n=Dn(Object(r.useState)(!1),2),o=n[0],i=n[1],l=Object(r.useRef)(null),u=t.id,c=t.template_kit_id,s=t.name,f=t.screenshot_url,d=t.imports,p=Dn(Object(r.useState)(t.unmet_requirements&&t.unmet_requirements.length>0),2),m=p[0],h=p[1],y=t.metadata.additional_template_information?t.metadata.additional_template_information.join(" "):"",v=(0,kt().getMagicButtonMode)();return a.a.createElement(un,{colWidthPercentage:33,key:u},a.a.createElement(fn,{Images:a.a.createElement("div",{className:Rn.a.imageWrapper},a.a.createElement("img",{src:f,alt:s,className:Rn.a.image}),a.a.createElement("div",{className:Rn.a.expandButton,ref:l,onClick:function(e){e.target===l.current&&i(!0)}},o?a.a.createElement(An,{templateScreenShotUrl:f,templatePreviewTitle:s,templateKitId:c,templateId:u,existingImports:d}):null,a.a.createElement(lt,{type:"ghost",icon:"expand",onClick:function(){i(!0)}}))),Buttons:a.a.createElement(a.a.Fragment,null,m?a.a.createElement(a.a.Fragment,null,a.a.createElement("p",{className:Rn.a.unmetRequirementsMessage},t.unmet_requirements.join(" ")),a.a.createElement(lt,{type:"warning",label:"Ignore Requirements",icon:"cross",onClick:function(){return h(!1)}})):a.a.createElement(st,null,v&&"elementorMagicButton"===v.mode?a.a.createElement(En,{templateKitId:c,templateId:u,completeCallback:function(e){v.insertCallback&&"function"==typeof v.insertCallback&&v.insertCallback(e)}}):a.a.createElement(wn,{templateKitId:c,templateId:u,existingImports:d}))),title:s,description:y}))},zn=function(e){var t=e.templates;return a.a.createElement(nn,{includeLastItemSpacer:!0},t.map((function(e){return a.a.createElement(Fn,{key:e.id,template:e})})))},Un=n(27),Wn=n.n(Un);function Bn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hn=se((function(e){var t,n=e.history,o=((t=fe(q).match)?t.params:{}).id,i=de().path,l=Bn(Object(r.useState)(null),2),u=l[0],c=l[1],s=Nt({endpoint:"fetchIndividualTemplates",args:{id:o,refresh:u}}),f=Bn(Object(r.useState)(!1),2),d=f[0],p=f[1];return a.a.createElement(a.a.Fragment,null,s.loading?a.a.createElement(Ut,null):null,s.error?a.a.createElement(Jt,null):null,d?a.a.createElement(J,{to:"/template-kits/installed-kits"}):null,s.loading||s.error||!s.data?null:a.a.createElement("div",null,s.data.requirements?a.a.createElement(Lt,{settings:s.data.requirements.settings,plugins:s.data.requirements.plugins,completeCallback:function(){c((new Date).getTime())}}):null,a.a.createElement("div",{className:Wn.a.headerWrapper},a.a.createElement(qe,{title:s.data.title}),a.a.createElement(Ht,{currentKitId:s.data.id,handleChangeKitId:function(e){n.push(i.replace(":id",e))}}),a.a.createElement("div",{className:Wn.a.deleteKitWrapper},a.a.createElement(Yt,{templateKitId:s.data.id,completeCallback:function(){p(!0)}}))),a.a.createElement(zn,{templates:s.data.templates})))})),Vn=function(e){var t=e.type,n=e.label,r=e.icon,o=e.href;return a.a.createElement(ot,{element:"Link",to:o,type:t},a.a.createElement(Je,{label:n,icon:r}))};Vn.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,href:c.a.string.isRequired},Vn.defaultProps={type:"ghost",label:null,icon:null};var qn=Vn,$n=n(15),Qn=n.n($n);function Yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Zn=function(e){var t=e.item,n=de().url,o=Yn(Object(r.useState)(!1),2),i=o[0],l=o[1];return i?null:a.a.createElement(un,{colWidthPercentage:33,className:Qn.a.itemCard},a.a.createElement(fn,{Images:a.a.createElement(be,{to:"".concat(n,"/kit/").concat(t.id),className:Qn.a.itemImageLink},a.a.createElement("img",{src:t.screenshot_url,alt:t.title,className:Qn.a.itemImage})),Buttons:a.a.createElement(st,null,a.a.createElement(qn,{type:"primary",label:"View Installed Kit",icon:"plus",href:"".concat(n,"/kit/").concat(t.id)}),a.a.createElement("div",{className:Qn.a.itemDelete},a.a.createElement(Yt,{templateKitId:t.id,completeCallback:function(){l(!0)}}))),title:t.title,description:"Contains ".concat(t.template_count," templates")}))},Gn=function(e){var t=e.href,n=e.text,r=void 0===n?"Link":n;return a.a.createElement("a",{href:t,target:"_blank",rel:"noopener noreferrer"},r)},Jn=n(11),er=n.n(Jn);n(38);var tr=function(e){var t,n,r=e.chosenFile,a=fe(q).history,o=Nt({endpoint:"uploadTemplateKitZipFile",args:{file:r}}),i=o.loading,l=o.data,u=o.error;return!i&&!u&&l&&l.templateKitId&&a.push((t={importedTemplateKitId:l.templateKitId},n=t.importedTemplateKitId,"/template-kits/installed-kits/kit/".concat(n))),null};function nr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ar=function(e){e.item;var t=nr(Object(r.useState)(null),2),n=t[0],o=t[1];return a.a.createElement(un,{colWidthPercentage:33},a.a.createElement("div",{className:er.a.uploadCard},a.a.createElement("label",{htmlFor:"upload-template-kit-zip-file",className:er.a.uploadCardButton},n?a.a.createElement(Ut,null):a.a.createElement("span",{className:er.a.icon}),a.a.createElement("div",{className:er.a.message},"Upload Template Kit ZIP File"),a.a.createElement("input",{type:"file",name:"upload-template-kit-zip-file",id:"upload-template-kit-zip-file",className:er.a.formInput,onChange:function(e){o(e.target.files[0])}})),n?a.a.createElement(tr,{chosenFile:n}):null))},or=function(){var e=Wt(),t=e.loading,n=e.data,r=e.error;return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",null,a.a.createElement(qe,{title:"Installed Template Kits",subtitle:"These are the Template Kits installed on this WordPress website."})),t?a.a.createElement(Ut,null):null,r?a.a.createElement(Jt,null):null,t||r||0!==n.length?null:a.a.createElement(Jt,{message:a.a.createElement(a.a.Fragment,null,"No installed Template Kits found. Please"," ",a.a.createElement(Gn,{href:"https://themeforest.net/category/template-kits?utm_source=extensions&utm_medium=referral&utm_campaign=template_kit_import_plugin",text:"click here to view available premium Template Kits"})," "," or upload a new Template Kit ZIP file below.")}),t||r?null:a.a.createElement(nn,{includeLastItemSpacer:!0},n.map((function(e){return a.a.createElement(Zn,{key:e.id,item:e})})),a.a.createElement(ar,null)))},ir=function(){var e=de().url;return a.a.createElement(ce,null,a.a.createElement(re,{path:"".concat(e,"/kit/:id"),children:a.a.createElement(Hn,null)}),a.a.createElement(re,{children:a.a.createElement(or,null)}))},lr=function(){var e=de().url;return a.a.createElement(a.a.Fragment,null,a.a.createElement(ce,null,a.a.createElement(re,{path:"".concat(e,"/installed-kits"),children:a.a.createElement(ir,null)}),a.a.createElement(re,null,a.a.createElement(J,{to:"/template-kits/installed-kits"}))))},ur=n(28),cr=n.n(ur),sr=se((function(e){var t=e.location.pathname;return Object(r.useEffect)((function(){if("undefined"!=typeof jQuery){var e=jQuery("li#toplevel_page_template-kit-import .wp-submenu");if(e.length){e.find(".current").removeClass("current");var n=t.split("/").slice(0,3).join("/");"/template-kits"===n&&(n="/template-kits/premium-kits");var r=e.find('[href*="'.concat(n,'"]'));r.length||(r=e.find("a").first()),r.addClass("current"),r.parent("li").first().addClass("current")}}}),[t]),null})),fr=function(){return a.a.createElement("div",{className:cr.a.wrapper},a.a.createElement(Me,null,a.a.createElement(Oe,null,a.a.createElement(pe,null,a.a.createElement(ht,null),a.a.createElement(gt,null),a.a.createElement(sr,null),a.a.createElement("div",{className:cr.a.container},a.a.createElement(ce,null,a.a.createElement(re,{exact:!0,path:"/"},a.a.createElement(J,{to:"/template-kits/installed-kits"})),a.a.createElement(re,{path:"/template-kits",children:a.a.createElement(lr,null)})))))))},dr=n(7),pr=n.n(dr);function mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var yr={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999},content:{background:"#f1f1f1",border:"0",top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",padding:"0",transform:"translate(-50%, -50%)",borderRadius:"4px"}},vr=function(e){e.photoId,e.photoTitle;var t=e.onCloseCallback,n=void 0===t?null:t,r=e.children,o=mr(a.a.useState(!0),2),i=o[0],l=o[1],u=function(){l(!1),n&&n()};return"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Le.a.setAppElement(window.templateKitImport.modalAppHolder),a.a.createElement(Le.a,{isOpen:i,onRequestClose:u,style:yr,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:pr.a.modalInner},a.a.createElement("div",{className:pr.a.modalHeader},a.a.createElement("div",{className:pr.a.modalLogo},a.a.createElement(Sn,null)),a.a.createElement("div",{className:pr.a.headerNav}),a.a.createElement("div",{className:pr.a.headerActions},a.a.createElement("button",{onClick:u,"data-testid":"modal-close-button",className:pr.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat(pr.a.dismissIcon)})))),a.a.createElement("div",{className:pr.a.magicModalInner},"function"==typeof r?r({closeModal:u}):r)))};function gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function br(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(n),!0).forEach((function(t){wr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Er=function(e){var t=e.onClose,n=e.magicButtonMode;return a.a.createElement(Me,{config:br(br({},window.template_kit_import),{},{magicButtonMode:n})},a.a.createElement(Oe,null,a.a.createElement(Q,null,a.a.createElement(ht,null),a.a.createElement(vr,{onCloseCallback:t},a.a.createElement(ce,null,a.a.createElement(re,{exact:!0,path:"/"},a.a.createElement(J,{to:"/template-kits/installed-kits"})),a.a.createElement(re,{path:"/template-kits",children:a.a.createElement(lr,null)}))))))};window.templateKitImport={modalAppHolder:null},window.templateKitImport.initBackend=function(e){window.templateKitImport.modalAppHolder=e,i.a.render(a.a.createElement(fr,null),e)},window.templateKitImport.initMagicButton=function(e,t){window.templateKitImport.modalAppHolder=e,i.a.render(a.a.createElement(Er,{magicButtonMode:t,onClose:function(){window.templateKitImport.closeMagicButton(e)}}),e)},window.templateKitImport.closeMagicButton=function(e){i.a.unmountComponentAtNode(e)}}]);
inc/api/class-api.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Options
4
+ *
5
+ * Making option management a bit easier for us.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\API;
12
+
13
+ use Template_Kit_Import\Utils\Base;
14
+
15
+ if ( ! defined( 'ABSPATH' ) ) {
16
+ exit; // Exit if accessed directly.
17
+ }
18
+
19
+
20
+ /**
21
+ * API base class
22
+ *
23
+ * @since 2.0.0
24
+ */
25
+ abstract class API extends Base {
26
+
27
+ public function __construct() {
28
+ $this->register_api_endpoints();
29
+ }
30
+
31
+ public function rest_permission_check( $request ) {
32
+ return current_user_can( 'edit_posts' );
33
+ }
34
+
35
+ public function register_endpoint( $endpoint, $callback ){
36
+ register_rest_route(
37
+ ENVATO_TEMPLATE_KIT_IMPORT_API_NAMESPACE,
38
+ $endpoint,
39
+ [
40
+ [
41
+ 'methods' => \WP_REST_Server::CREATABLE,
42
+ 'callback' => $callback,
43
+ 'permission_callback' => [ $this, 'rest_permission_check' ],
44
+ 'args' => [],
45
+ ],
46
+ ]
47
+ );
48
+ }
49
+
50
+ /**
51
+ * @param array $data
52
+ *
53
+ * @return \WP_REST_Response
54
+ */
55
+ public function format_success($data) {
56
+ return new \WP_REST_Response( $data, 200 );
57
+ }
58
+
59
+ /**
60
+ * @param $endpoint
61
+ * @param $error_code
62
+ * @param $error_message
63
+ * @param array $additional_data
64
+ *
65
+ * @return \WP_REST_Response
66
+ */
67
+ public function format_error($endpoint, $error_code, $error_message, $additional_data = []){
68
+ return new \WP_REST_Response( [
69
+ 'error' => [
70
+ 'context' => $endpoint,
71
+ 'code' => $error_code,
72
+ 'message' => $error_message,
73
+ 'data' => $additional_data,
74
+ ]
75
+ ], 500 );
76
+ }
77
+ }
inc/api/class-requirements.php ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Template Kits Import
4
+ *
5
+ * API for handling template kit imports
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\API;
12
+
13
+ use Template_Kit_Import\Backend\Template_Kits;
14
+
15
+ if ( ! defined( 'ABSPATH' ) ) {
16
+ exit; // Exit if accessed directly.
17
+ }
18
+
19
+
20
+ /**
21
+ * API for handling template kit imports
22
+ *
23
+ * @since 2.0.0
24
+ */
25
+ class Requirements extends API {
26
+
27
+ /**
28
+ * @return \WP_REST_Response
29
+ */
30
+ public function install_requirement( $request ) {
31
+
32
+ $requirement = json_decode( $request->get_param( 'requirement' ), true );
33
+ if ( ! empty( $requirement ) && ! empty( $requirement['setting'] ) ) {
34
+
35
+ // The front end has sent an API request to set any default settings.
36
+ if ( ! current_user_can( 'manage_options' ) ) {
37
+ return $this->format_error(
38
+ 'installRequirement',
39
+ 'install_failed',
40
+ 'Please contact your administrator to setup settings correctly.'
41
+ );
42
+ }
43
+
44
+ $settings_allowlist = [
45
+ 'elementor_disable_color_schemes' => 'yes',
46
+ 'elementor_disable_typography_schemes' => 'yes',
47
+ ];
48
+
49
+ $setting_name = $requirement['setting']['setting_name'];
50
+
51
+ // Check if our setting is in the allowlist
52
+ if ( isset( $settings_allowlist[ $setting_name ] ) ) {
53
+ // Set our setting to the permitted value in the allowlist
54
+ update_option( $setting_name, $settings_allowlist[ $setting_name ] );
55
+
56
+ // Tell our front end it worked:
57
+ return $this->format_success( [
58
+ 'success' => $setting_name
59
+ ] );
60
+ } else {
61
+ // If our front end tries to set a not allowed setting we return an error.
62
+ return $this->format_error(
63
+ 'installRequirement',
64
+ 'install_failed',
65
+ 'This setting is not allowed.'
66
+ );
67
+ }
68
+
69
+ }
70
+
71
+ if ( ! empty( $requirement ) && ! empty( $requirement['plugin'] ) ) {
72
+
73
+ if ( ! current_user_can( 'install_plugins' ) ) {
74
+ return $this->format_error(
75
+ 'installRequirement',
76
+ 'install_failed',
77
+ 'Please contact your administrator to install plugins.'
78
+ );
79
+ }
80
+
81
+ $plugin_slug = $requirement['plugin']['slug'];
82
+
83
+ if ( $plugin_slug === 'elementor-pro' ) {
84
+ return $this->format_error(
85
+ 'installRequirement',
86
+ 'install_failed',
87
+ 'Please purchase Elementor Pro from here first',
88
+ [
89
+ 'url' => 'https://envato.com/elements/template-kits/get-elementor-pro.html'
90
+ ]
91
+ );
92
+ }
93
+
94
+ $install_status = $this->install_plugin( $requirement['plugin'] );
95
+ if ( ! $install_status['success'] ) {
96
+ return $this->format_error(
97
+ 'installRequirement',
98
+ 'install_failed',
99
+ 'Plugin install failed: ' . $install_status['errorMessage']
100
+ );
101
+ }
102
+
103
+ return $this->format_success( [
104
+ 'success' => $plugin_slug
105
+ ] );
106
+ }
107
+
108
+ if ( ! empty( $requirement ) && ! empty( $requirement['theme'] ) ) {
109
+
110
+ if ( ! current_user_can( 'install_themes' ) ) {
111
+ return $this->format_error(
112
+ 'installRequirement',
113
+ 'install_failed',
114
+ 'Please contact your administrator to install themes.'
115
+ );
116
+ }
117
+
118
+ if ( is_multisite() ) {
119
+ return $this->format_error(
120
+ 'installRequirement',
121
+ 'install_failed',
122
+ 'Please contact your administrator to activate this theme in the global network settings.'
123
+ );
124
+ }
125
+
126
+ // current_user_can( 'switch_themes' )
127
+ $theme_slug = $requirement['theme']['slug'];
128
+ $theme = wp_get_theme( $theme_slug );
129
+ if ( ! $theme->exists() ) {
130
+ // install !
131
+ $install_status = $this->install_theme( $theme_slug );
132
+ if ( ! $install_status['success'] ) {
133
+ return $this->format_error(
134
+ 'installRequirement',
135
+ 'install_failed',
136
+ 'Theme install failed: ' . $install_status['errorMessage']
137
+ );
138
+ }
139
+ }
140
+
141
+ $theme = wp_get_theme( $theme_slug );
142
+ if ( ! $theme->exists() || ! $theme->is_allowed() ) {
143
+ return $this->format_error(
144
+ 'installRequirement',
145
+ 'install_failed',
146
+ 'Unable to activate this theme, please install manually.'
147
+ );
148
+ }
149
+
150
+ switch_theme( $theme->get_stylesheet() );
151
+
152
+
153
+ return $this->format_success( [
154
+ 'success' => 'theme'
155
+ ] );
156
+ }
157
+
158
+ return $this->format_error(
159
+ 'installRequirement',
160
+ 'generic_api_error',
161
+ 'Requirement installation failed'
162
+ );
163
+ }
164
+
165
+ private function install_plugin( $plugin_details ) {
166
+
167
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
168
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
169
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
170
+ include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
171
+
172
+ $all_plugins = get_plugins();
173
+
174
+ $is_plugin_already_installed = false;
175
+ foreach ( array_keys( $all_plugins ) as $plugin ) {
176
+ if ( strpos( $plugin, $plugin_details['file'] ) !== false ) {
177
+ $is_plugin_already_installed = true;
178
+ }
179
+ }
180
+
181
+ if ( $is_plugin_already_installed ) {
182
+ // just activate it:
183
+ $activate_status = $this->activate_plugin( $plugin_details['file'] );
184
+
185
+ } else {
186
+
187
+ $status = [
188
+ 'success' => false,
189
+ ];
190
+
191
+ $api = plugins_api(
192
+ 'plugin_information',
193
+ array(
194
+ 'slug' => sanitize_key( wp_unslash( $plugin_details['slug'] ) ),
195
+ 'fields' => array(
196
+ 'sections' => false,
197
+ ),
198
+ )
199
+ );
200
+
201
+ if ( is_wp_error( $api ) ) {
202
+ $status['errorMessage'] = $api->get_error_message();
203
+
204
+ return $status;
205
+ }
206
+
207
+ $status['pluginName'] = $api->name;
208
+
209
+ $skin = new \WP_Ajax_Upgrader_Skin();
210
+ $upgrader = new \Plugin_Upgrader( $skin );
211
+ $result = $upgrader->install( $api->download_link );
212
+
213
+ if ( is_wp_error( $result ) ) {
214
+ $status['errorCode'] = $result->get_error_code();
215
+ $status['errorMessage'] = $result->get_error_message();
216
+
217
+ return $status;
218
+ } elseif ( is_wp_error( $skin->result ) ) {
219
+ $status['errorCode'] = $skin->result->get_error_code();
220
+ $status['errorMessage'] = $skin->result->get_error_message();
221
+
222
+ return $status;
223
+ } elseif ( $skin->get_errors()->has_errors() ) {
224
+ $status['errorMessage'] = $skin->get_error_messages();
225
+
226
+ return $status;
227
+ } elseif ( is_null( $result ) ) {
228
+ global $wp_filesystem;
229
+
230
+ $status['errorCode'] = 'unable_to_connect_to_filesystem';
231
+ $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
232
+
233
+ // Pass through the error from WP_Filesystem if one was raised.
234
+ if ( $wp_filesystem instanceof \WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
235
+ $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
236
+ }
237
+
238
+ return $status;
239
+ }
240
+
241
+ $install_status = install_plugin_install_status( $api );
242
+
243
+ $activate_status = $this->activate_plugin( $install_status['file'] );
244
+ }
245
+
246
+ if ( $activate_status && ! is_wp_error( $activate_status ) ) {
247
+ $status['success'] = true;
248
+ }
249
+
250
+ return $status;
251
+ }
252
+
253
+ private function activate_plugin( $file ) {
254
+ if ( current_user_can( 'activate_plugin', $file ) && is_plugin_inactive( $file ) ) {
255
+ $result = activate_plugin( $file, false, false );
256
+ if ( is_wp_error( $result ) ) {
257
+ return $result;
258
+ } else {
259
+ return true;
260
+ }
261
+ }
262
+
263
+ return false;
264
+ }
265
+
266
+ private function install_theme( $slug ) {
267
+ $status = array(
268
+ 'success' => false,
269
+ );
270
+
271
+ if ( ! current_user_can( 'install_themes' ) ) {
272
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to install themes on this site.' );
273
+
274
+ return $status;
275
+ }
276
+
277
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
278
+ include_once( ABSPATH . 'wp-admin/includes/theme.php' );
279
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
280
+ include_once( ABSPATH . 'wp-admin/includes/theme-install.php' );
281
+
282
+ $api = themes_api(
283
+ 'theme_information',
284
+ array(
285
+ 'slug' => $slug,
286
+ 'fields' => array( 'sections' => false ),
287
+ )
288
+ );
289
+
290
+ if ( is_wp_error( $api ) ) {
291
+ $status['errorMessage'] = $api->get_error_message();
292
+
293
+ return $status;
294
+ }
295
+
296
+ $skin = new \WP_Ajax_Upgrader_Skin();
297
+ $upgrader = new \Theme_Upgrader( $skin );
298
+ $result = $upgrader->install( $api->download_link );
299
+
300
+ if ( is_wp_error( $result ) ) {
301
+ $status['errorCode'] = $result->get_error_code();
302
+ $status['errorMessage'] = $result->get_error_message();
303
+
304
+ return $status;
305
+ } elseif ( is_wp_error( $skin->result ) ) {
306
+ $status['errorCode'] = $skin->result->get_error_code();
307
+ $status['errorMessage'] = $skin->result->get_error_message();
308
+
309
+ return $status;
310
+ } elseif ( $skin->get_errors()->has_errors() ) {
311
+ $status['errorMessage'] = $skin->get_error_messages();
312
+
313
+ return $status;
314
+ } elseif ( is_null( $result ) ) {
315
+ global $wp_filesystem;
316
+
317
+ $status['errorCode'] = 'unable_to_connect_to_filesystem';
318
+ $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
319
+
320
+ // Pass through the error from WP_Filesystem if one was raised.
321
+ if ( $wp_filesystem instanceof \WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
322
+ $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
323
+ }
324
+
325
+ return $status;
326
+ }
327
+
328
+ $status['themeName'] = wp_get_theme( $slug )->get( 'Name' );
329
+
330
+ $status['success'] = true;
331
+
332
+ return $status;
333
+ }
334
+
335
+ public function register_api_endpoints() {
336
+ $this->register_endpoint( 'installRequirement', [ $this, 'install_requirement' ] );
337
+ }
338
+ }
inc/api/class-template-kit-import.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Template Kits Import
4
+ *
5
+ * API for handling template kit imports
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\API;
12
+
13
+ use Template_Kit_Import\Backend\Template_Kits;
14
+
15
+ if ( ! defined( 'ABSPATH' ) ) {
16
+ exit; // Exit if accessed directly.
17
+ }
18
+
19
+
20
+ /**
21
+ * API for handling template kit imports
22
+ *
23
+ * @since 2.0.0
24
+ */
25
+ class Template_Kit_Import extends API {
26
+
27
+ /**
28
+ * @return \WP_REST_Response
29
+ */
30
+ public function fetch_all_installed_template_kits() {
31
+
32
+ $installed_kits = Template_Kits::get_instance()->get_installed_template_kits();
33
+
34
+ return $this->format_success( $installed_kits );
35
+ }
36
+
37
+ /**
38
+ * @param $request \WP_REST_Request
39
+ *
40
+ * @return \WP_REST_Response
41
+ */
42
+ public function fetch_individual_templates( $request ) {
43
+
44
+ $template_kit_id = $request->get_param( 'id' );
45
+ if ( $template_kit_id === 'all' ) {
46
+ // User is requesting templates from all kits.
47
+ $all_template_data = [
48
+ 'id' => 'all',
49
+ 'title' => 'All Installed Kits',
50
+ 'requirements' => [],
51
+ 'templates' => [],
52
+ ];
53
+ $installed_kits = Template_Kits::get_instance()->get_installed_template_kits();
54
+ foreach ( $installed_kits as $installed_kit ) {
55
+ $installed_kit_data = Template_Kits::get_instance()->get_installed_template_kit( $installed_kit['id'] );
56
+ if ( $installed_kit_data && ! is_wp_error( $installed_kit_data ) ) {
57
+ $all_template_data['templates'] = $all_template_data['templates'] + $installed_kit_data['templates'];
58
+ }
59
+ }
60
+ } else {
61
+ $template_kit_id = (int) $template_kit_id;
62
+
63
+ $all_template_data = Template_Kits::get_instance()->get_installed_template_kit( $template_kit_id );
64
+ if ( is_wp_error( $all_template_data ) ) {
65
+ return $this->format_error(
66
+ 'fetchInstalledTemplateKit',
67
+ 'not_found',
68
+ 'Sorry this Template Kit was not found'
69
+ );
70
+ }
71
+ }
72
+
73
+ // Now we split the template data into groups.
74
+ // This list of templates come from the "Template Kit Export" plugin:
75
+ $template_types = [
76
+ 'single-page' => __( 'Single: Page', 'template-kit-export' ),
77
+ 'single-home' => __( 'Single: Home', 'template-kit-export' ),
78
+ 'single-post' => __( 'Single: Post', 'template-kit-export' ),
79
+ 'single-product' => __( 'Single: Product', 'template-kit-export' ),
80
+ 'single-404' => __( 'Single: 404', 'template-kit-export' ),
81
+ 'archive-blog' => __( 'Archive: Blog', 'template-kit-export' ),
82
+ 'archive-product' => __( 'Archive: Product', 'template-kit-export' ),
83
+ 'archive-search' => __( 'Archive: Search', 'template-kit-export' ),
84
+ 'archive-category' => __( 'Archive: Category', 'template-kit-export' ),
85
+ 'section-header' => __( 'Header', 'template-kit-export' ),
86
+ 'section-footer' => __( 'Footer', 'template-kit-export' ),
87
+ 'section-popup' => __( 'Popup', 'template-kit-export' ),
88
+ 'section-hero' => __( 'Hero', 'template-kit-export' ),
89
+ 'section-about' => __( 'About', 'template-kit-export' ),
90
+ 'section-faq' => __( 'FAQ', 'template-kit-export' ),
91
+ 'section-contact' => __( 'Contact', 'template-kit-export' ),
92
+ 'section-cta' => __( 'Call to Action', 'template-kit-export' ),
93
+ 'section-team' => __( 'Team', 'template-kit-export' ),
94
+ 'section-map' => __( 'Map', 'template-kit-export' ),
95
+ 'section-features' => __( 'Features', 'template-kit-export' ),
96
+ 'section-pricing' => __( 'Pricing', 'template-kit-export' ),
97
+ 'section-testimonial' => __( 'Testimonial', 'template-kit-export' ),
98
+ 'section-product' => __( 'Product', 'template-kit-export' ),
99
+ 'section-services' => __( 'Services', 'template-kit-export' ),
100
+ 'section-stats' => __( 'Stats', 'template-kit-export' ),
101
+ 'section-countdown' => __( 'Countdown', 'template-kit-export' ),
102
+ 'section-portfolio' => __( 'Portfolio', 'template-kit-export' ),
103
+ 'section-gallery' => __( 'Gallery', 'template-kit-export' ),
104
+ 'section-logo-grid' => __( 'Logo Grid', 'template-kit-export' ),
105
+ 'section-clients' => __( 'Clients', 'template-kit-export' ),
106
+ 'section-other' => __( 'Other', 'template-kit-export' ),
107
+ ];
108
+
109
+ $templates_grouped = [];
110
+ foreach ( $all_template_data['templates'] as $template_id => $template ) {
111
+ $template_group = ! empty( $template['metadata'] ) && ! empty( $template['metadata']['template_type'] ) && $template['metadata']['template_type'] !== 'global-styles' ? $template['metadata']['template_type'] : false;
112
+ if ( $template_group ) {
113
+ if ( ! isset( $templates_grouped[ $template_group ] ) ) {
114
+ $templates_grouped[ $template_group ] = [
115
+ 'title' => isset( $template_types[ $template_group ] ) ? $template_types[ $template_group ] : $template_group,
116
+ 'templates' => [],
117
+ ];
118
+ }
119
+ $templates_grouped[ $template_group ]['templates'][] = $template;
120
+ } else {
121
+ // If something doesn't have a valid template type, remove it from the list.
122
+ unset( $all_template_data['templates'][ $template_id ] );
123
+ }
124
+ }
125
+ $all_template_data['templates'] = array_values( $all_template_data['templates'] );
126
+ $all_template_data['templatesGrouped'] = array_values( $templates_grouped );
127
+
128
+ // We report any missing default settings that are required for template kits.
129
+ if ( ! isset( $all_template_data['requirements']['settings'] ) ) {
130
+ $all_template_data['requirements']['settings'] = [];
131
+ }
132
+ // Check Elementor default colors and fonts are set.
133
+ // Elementor stores the string 'yes' in the WordPress database if these options are active, and an empty string if these options are not active.
134
+ $is_elementor_color_schemes_disabled_already = get_option( 'elementor_disable_color_schemes' );
135
+ $is_elementor_typography_schemes_disabled_already = get_option( 'elementor_disable_typography_schemes' );
136
+ if ( $is_elementor_color_schemes_disabled_already !== 'yes' ) {
137
+ $all_template_data['requirements']['settings'][] = [
138
+ 'name' => 'Elementor default color schemes',
139
+ 'setting_name' => 'elementor_disable_color_schemes'
140
+ ];
141
+ }
142
+ if ( $is_elementor_typography_schemes_disabled_already !== 'yes' ) {
143
+ $all_template_data['requirements']['settings'][] = [
144
+ 'name' => 'Elementor default typography schemes',
145
+ 'setting_name' => 'elementor_disable_typography_schemes'
146
+ ];
147
+ }
148
+
149
+ return $this->format_success( $all_template_data );
150
+ }
151
+
152
+ /**
153
+ * @param $request \WP_REST_Request
154
+ *
155
+ * @return \WP_REST_Response
156
+ */
157
+ public function import_single_template( $request ) {
158
+
159
+ $template_kit_id = (int) $request->get_param( 'templateKitId' );
160
+ $template_id = (int) $request->get_param( 'templateId' );
161
+
162
+ try {
163
+ $imported_template_data = Template_Kits::get_instance()->import_single_template( $template_kit_id, $template_id );
164
+ if ( is_wp_error( $imported_template_data ) ) {
165
+ return $this->format_error(
166
+ 'importSingleTemplate',
167
+ 'generic_api_error',
168
+ $imported_template_data->get_error_message()
169
+ );
170
+ }
171
+
172
+ if ( $request->get_param( 'insertToPage' ) ) {
173
+ // we have to return additional JSON data so Elementor can insert these widgets on the page.
174
+ \Elementor\Plugin::$instance->editor->set_edit_mode( true );
175
+ $db = \Elementor\Plugin::$instance->db;
176
+ $content = $db->get_builder( $imported_template_data['imported_template_id'] );
177
+ if ( ! empty( $content ) ) {
178
+ $content = \Elementor\Plugin::$instance->db->iterate_data( $content, function ( $element ) {
179
+ $element['id'] = \Elementor\Utils::generate_random_string();
180
+
181
+ return $element;
182
+ } );
183
+ }
184
+ $imported_template_data['content'] = $content;
185
+ }
186
+
187
+ return $this->format_success( $imported_template_data );
188
+ } catch ( \Exception $e ) {
189
+ return $this->format_error(
190
+ 'importSingleTemplate',
191
+ 'generic_api_error',
192
+ $e->getMessage()
193
+ );
194
+ }
195
+ }
196
+
197
+ public function register_api_endpoints() {
198
+ $this->register_endpoint( 'fetchInstalledTemplateKits', [ $this, 'fetch_all_installed_template_kits' ] );
199
+ $this->register_endpoint( 'fetchIndividualTemplates', [ $this, 'fetch_individual_templates' ] );
200
+ $this->register_endpoint( 'importSingleTemplate', [ $this, 'import_single_template' ] );
201
+ }
202
+ }
inc/api/class-template-kit-install.php ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Template Kits installs
4
+ *
5
+ * API for handling template kit installs
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\API;
12
+
13
+ use Template_Kit_Import\Backend\Downloaded_Items;
14
+ use Template_Kit_Import\Backend\Options;
15
+ use Template_Kit_Import\Backend\Subscription;
16
+ use Template_Kit_Import\Backend\Template_Kits;
17
+ use Template_Kit_Import\Utils\Extensions_API;
18
+ use Template_Kit_Import\Utils\Content_API;
19
+
20
+ if ( ! defined( 'ABSPATH' ) ) {
21
+ exit; // Exit if accessed directly.
22
+ }
23
+
24
+
25
+ /**
26
+ * API for handling template kit installs
27
+ *
28
+ * @since 2.0.0
29
+ */
30
+ class Template_Kit_Install extends API {
31
+
32
+ /**
33
+ * @param $request \WP_REST_Request
34
+ *
35
+ * @return \WP_REST_Response
36
+ */
37
+ public function install_template_kit_from_elements( $request ) {
38
+
39
+ $template_kit_humane_id = $request->get_param( 'templateKitId' );
40
+
41
+ // If the user doesn't have a paid subscription we return an invalid subscription message
42
+ if ( Subscription::get_instance()->get_subscription_status() !== Subscription::SUBSCRIPTION_PAID ) {
43
+ return $this->format_error(
44
+ 'installTemplateKit',
45
+ 'invalid_subscription',
46
+ 'A valid subscription is required to install kits'
47
+ );
48
+ }
49
+
50
+ // Reach out to Extensions API for a download request of this item
51
+ $api_license_response = Extensions_API::get_instance()->api_call( '/extensions/item/' . $template_kit_humane_id . '/download', 'POST', [
52
+ 'project_name' => Options::get_instance()->get( 'project_name', get_bloginfo( 'name' ) ),
53
+ 'extension_type' => 'envato-wp',
54
+ ] );
55
+
56
+ if ( is_wp_error( $api_license_response ) ) {
57
+ $extensions_api_error_data = $api_license_response->get_error_data();
58
+ if ( $extensions_api_error_data && ! empty( $extensions_api_error_data['message'] ) ) {
59
+ // e.g :
60
+ /**
61
+ * [code] => invalid_token
62
+ * [message] => No token exists with the specified token code
63
+ */
64
+ return $this->format_error(
65
+ 'installTemplateKit',
66
+ 'zip_failure',
67
+ 'Failed to download item: ' . $extensions_api_error_data['message']
68
+ );
69
+ }
70
+
71
+ return $this->format_error(
72
+ 'installTemplateKit',
73
+ 'zip_failure',
74
+ 'Failed to download item: ' . $api_license_response->get_error_message()
75
+ );
76
+ }
77
+
78
+ // Check if we get a successful API response with a download URL we can work with:
79
+ if ( $api_license_response && ! is_wp_error( $api_license_response ) && ! empty( $api_license_response['download_urls']['original'] ) ) {
80
+
81
+ // Download our remote ZIP file to a local temporary file:
82
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
83
+ $temporary_zip_file_path = wp_tempnam( 'tk-' . $template_kit_humane_id );
84
+ $download_response = wp_safe_remote_get( $api_license_response['download_urls']['original'], array(
85
+ 'timeout' => 60,
86
+ 'stream' => true,
87
+ 'filename' => $temporary_zip_file_path
88
+ ) );
89
+
90
+ // If we failed to download return an error
91
+ if ( is_wp_error( $download_response ) ) {
92
+ return $this->format_error(
93
+ 'installTemplateKit',
94
+ 'zip_failure',
95
+ $download_response->get_error_message()
96
+ );
97
+ }
98
+
99
+ // Assume we downloaded successfully:
100
+ $error_or_template_kit_id = Template_Kits::get_instance()->process_zip_file( $temporary_zip_file_path );
101
+ unlink( $temporary_zip_file_path );
102
+
103
+ if ( is_wp_error( $error_or_template_kit_id ) ) {
104
+ return $this->format_error(
105
+ 'installTemplateKit',
106
+ 'zip_failure',
107
+ $error_or_template_kit_id->get_error_message()
108
+ );
109
+ }
110
+
111
+ // If we get here we've got a successful license event from Elements. Lets flag that in our database so
112
+ // we can update the UI on future page loads.
113
+ Downloaded_Items::get_instance()->record_download_event( $template_kit_humane_id, $error_or_template_kit_id );
114
+
115
+ $data = [
116
+ 'success' => true,
117
+ 'template_kit_id' => $error_or_template_kit_id,
118
+ ];
119
+
120
+ return $this->format_success( $data );
121
+ }
122
+
123
+ return $this->format_error(
124
+ 'installTemplateKit',
125
+ 'zip_failure',
126
+ 'Failed to download item, please try again.'
127
+ );
128
+
129
+ }
130
+
131
+ /**
132
+ * Installs free template kits from our s3 bucket.
133
+ *
134
+ * @param $request \WP_REST_Request
135
+ *
136
+ * @return \WP_REST_Response
137
+ */
138
+ public function install_free_template_kit( $request ) {
139
+
140
+ $template_kit_id = $request->get_param( 'templateKitId' );
141
+ $template_kit_zip_url = $request->get_param( 'zipUrl' );
142
+
143
+ $temporary_zip_file_path = Content_API::get_instance()->download_zip( $template_kit_zip_url );
144
+
145
+ // We didn't give the request a valid url so we will error.
146
+ if ( is_wp_error( $temporary_zip_file_path ) ) {
147
+ return $this->format_error(
148
+ 'installTemplateKit',
149
+ 'zip_failure',
150
+ $temporary_zip_file_path->get_error_message()
151
+ );
152
+ }
153
+
154
+ // Assume we downloaded successfully:
155
+ $error_or_template_kit_id = Template_Kits::get_instance()->process_zip_file( $temporary_zip_file_path );
156
+ unlink( $temporary_zip_file_path );
157
+
158
+ if ( is_wp_error( $error_or_template_kit_id ) ) {
159
+ return $this->format_error(
160
+ 'installTemplateKit',
161
+ 'zip_failure',
162
+ $error_or_template_kit_id->get_error_message()
163
+ );
164
+ }
165
+
166
+ // If we get here we've got a successful license event from Elements. Lets flag that in our database so
167
+ // we can update the UI on future page loads.
168
+ Downloaded_Items::get_instance()->record_download_event( $template_kit_id, $error_or_template_kit_id );
169
+
170
+ $data = [
171
+ 'success' => true,
172
+ 'template_kit_id' => $error_or_template_kit_id,
173
+ ];
174
+
175
+ return $this->format_success( $data );
176
+
177
+ // return $this->format_error(
178
+ // 'installTemplateKit',
179
+ // 'zip_failure',
180
+ // 'Failed to download item. ' . ( is_wp_error( $api_license_response ) ? $api_license_response->get_error_message() : '' )
181
+ // );
182
+ }
183
+
184
+ /**
185
+ * @param $request \WP_REST_Request
186
+ */
187
+ public function upload_template_kit_zip_file( $request ) {
188
+ $all_files = $request->get_file_params();
189
+ if ( $all_files && ! empty( $all_files['file'] ) ) {
190
+ if ( is_uploaded_file( $all_files['file']['tmp_name'] ) && ! $all_files['file']['error'] ) {
191
+ // We've got a successful file upload!
192
+ $temp_file_name = $all_files['file']['tmp_name'];
193
+ $error_or_template_kit_id = Template_Kits::get_instance()->process_zip_file( $temp_file_name );
194
+ unlink( $temp_file_name );
195
+
196
+ if ( is_wp_error( $error_or_template_kit_id ) ) {
197
+ return $this->format_error(
198
+ 'uploadTemplateKitZipFile',
199
+ 'zip_failure',
200
+ $error_or_template_kit_id->get_error_message()
201
+ );
202
+ }
203
+
204
+ // If we get here we assume the kit installed correctly.
205
+ return $this->format_success( [
206
+ 'templateKitId' => $error_or_template_kit_id,
207
+ 'message' => 'Zip installed successfully'
208
+ ] );
209
+ }
210
+ }
211
+
212
+ return $this->format_error(
213
+ 'uploadTemplateKitZipFile',
214
+ 'zip_failure',
215
+ 'Failed to process ZIP file, please ensure the selected file is the correct Template Kit format.'
216
+ );
217
+ }
218
+
219
+ /**
220
+ * Deletes the template kit.
221
+ *
222
+ * @param $request \WP_REST_Request
223
+ */
224
+ public function delete_template_kit( $request ) {
225
+ $template_kit_id = $request->get_param( 'templateKitId' );
226
+ Template_Kits::get_instance()->delete_template_kit( $template_kit_id );
227
+
228
+ return $this->format_success(
229
+ array(
230
+ 'message' => 'Kit deleted successfully',
231
+ )
232
+ );
233
+ }
234
+
235
+ public function register_api_endpoints() {
236
+ $this->register_endpoint( 'installPremiumTemplateKit', [ $this, 'install_template_kit_from_elements' ] );
237
+ $this->register_endpoint( 'installFreeTemplateKit', [ $this, 'install_free_template_kit' ] );
238
+ $this->register_endpoint( 'uploadTemplateKitZipFile', [ $this, 'upload_template_kit_zip_file' ] );
239
+ $this->register_endpoint( 'deleteTemplateKit', [ $this, 'delete_template_kit' ] );
240
+ }
241
+ }
inc/backend/class-elementor-modal.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * Elements Welcome Page UI.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\Backend;
12
+
13
+ use Template_Kit_Import\Utils\Base;
14
+
15
+ if ( ! defined( 'ABSPATH' ) ) {
16
+ exit; // Exit if accessed directly.
17
+ }
18
+
19
+
20
+ /**
21
+ * Modal that pops up when in the back end Elementor editor
22
+ *
23
+ * @since 2.0.0
24
+ */
25
+ class Elementor_Modal extends Base {
26
+
27
+ public function __construct() {
28
+
29
+ // This is for the outer Elementor editor, we need JS to add our magic button and register onclick events etc..
30
+ add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'enqueue_editor_scripts' ) );
31
+ // This is for the inner iframe, we only need CSS in this inner iframe:
32
+ add_action( 'elementor/preview/enqueue_styles', [ $this, 'enqueue_embedded_iframe_styles' ] );
33
+ }
34
+
35
+ /**
36
+ * Load JS for our custom Elementor modal.
37
+ */
38
+ public function enqueue_editor_scripts() {
39
+
40
+ // First load our main react bundle so we've got access to the modal code from within 'elementor_modal.js';
41
+ Welcome::get_instance()->admin_page_assets();
42
+ // Now load our custom elementor_modal.js code and css:
43
+ wp_enqueue_script( 'elements-elementor-modal', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/elementor_modal.js', array( 'jquery' ), ENVATO_TEMPLATE_KIT_IMPORT_VER );
44
+ }
45
+
46
+ public function enqueue_embedded_iframe_styles(){
47
+ wp_enqueue_style( 'template-kit-import-admin', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/main.css', [], filemtime( ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'assets/main.css' ) );
48
+ wp_enqueue_style( 'elements-elementor-modal', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/elementor_modal.css', [], ENVATO_TEMPLATE_KIT_IMPORT_VER );
49
+ }
50
+
51
+ }
inc/backend/class-options.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Options
4
+ *
5
+ * Making option management a bit easier for us.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\Backend;
12
+
13
+ use Template_Kit_Import\Utils\Base;
14
+ use Template_Kit_Import\Utils\Extensions_API;
15
+
16
+ if ( ! defined( 'ABSPATH' ) ) {
17
+ exit; // Exit if accessed directly.
18
+ }
19
+
20
+
21
+ /**
22
+ * Option saving / getting
23
+ *
24
+ * @since 2.0.0
25
+ */
26
+ class Options extends Base {
27
+
28
+ const OPTION_KEY = 'template_kit_import_options';
29
+
30
+ public function __construct() {
31
+ add_action( 'admin_head', array( $this, 'print_admin_env_vars' ) );
32
+ add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'print_admin_env_vars' ] );
33
+ add_action( 'elementor/preview/enqueue_styles', [ $this, 'print_admin_env_vars' ] );
34
+ }
35
+
36
+ /**
37
+ * Prints some variables we can access from within React
38
+ */
39
+ public function print_admin_env_vars() {
40
+ $admin_options = array(
41
+ 'api_nonce' => wp_create_nonce( 'wp_rest' ),
42
+ //'api_url' => admin_url( 'admin-ajax.php?action=template_kit_import&endpoint=' ),
43
+ 'api_url' => get_rest_url() . 'template-kit-import/v2/',
44
+ 'review_mode' => defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV,
45
+ );
46
+ ?>
47
+ <script>
48
+ var template_kit_import = <?php echo json_encode( $admin_options ); ?>;
49
+ </script>
50
+ <?php
51
+ }
52
+
53
+ /**
54
+ * @param bool $key
55
+ * @param bool $default
56
+ *
57
+ * @return array|bool|mixed|string|void
58
+ */
59
+ public function get( $key = false, $default = false ) {
60
+
61
+ $options = get_option( self::OPTION_KEY, array() );
62
+ if ( ! $options || ! is_array( $options ) ) {
63
+ $options = array();
64
+ }
65
+ $user_id = get_current_user_id();
66
+ if ( $user_id ) {
67
+ $user_options = isset( $options[ $user_id ] ) ? $options[ $user_id ] : array();
68
+ if ( $key !== false ) {
69
+ return isset( $user_options[ $key ] ) ? $user_options[ $key ] : $default;
70
+ }
71
+
72
+ return $user_options;
73
+ } else {
74
+ return $default;
75
+ }
76
+ }
77
+
78
+ public function set( $key, $value ) {
79
+ $options = get_option( self::OPTION_KEY, array() );
80
+ if ( ! is_array( $options ) ) {
81
+ $options = array();
82
+ }
83
+ $user_id = get_current_user_id();
84
+ if ( $user_id ) {
85
+ if ( ! isset( $options[ $user_id ] ) ) {
86
+ $options[ $user_id ] = array();
87
+ }
88
+ $options[ $user_id ][ $key ] = $value;
89
+ update_option( self::OPTION_KEY, $options );
90
+ }
91
+ }
92
+
93
+ public function reset_user() {
94
+ $options = get_option( self::OPTION_KEY, array() );
95
+ $user_id = get_current_user_id();
96
+ if ( $user_id ) {
97
+ $options[ $user_id ] = [];
98
+ update_option( self::OPTION_KEY, $options );
99
+ }
100
+ }
101
+
102
+ }
inc/backend/class-rest.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: REST API controller
4
+ *
5
+ * REST API controller.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Template_Kit_Import\Backend;
12
+
13
+ use Template_Kit_Import\API\Requirements;
14
+ use Template_Kit_Import\API\Template_Kit_Install;
15
+ use Template_Kit_Import\API\Template_Kit_Import;
16
+ use Template_Kit_Import\Utils\Base;
17
+
18
+ if ( ! defined( 'ABSPATH' ) ) {
19
+ exit; // Exit if accessed directly.
20
+ }
21
+
22
+
23
+ /**
24
+ * REST API controller.
25
+ *
26
+ * @since 0.0.2
27
+ */
28
+ class REST extends Base {
29
+
30
+
31
+ /**
32
+ * Initialize the plugin by setting localization and loading public scripts
33
+ * and styles.
34
+ *
35
+ * @since 0.0.2
36
+ */
37
+ public function __construct() {
38
+ add_action( 'rest_api_init', [ $this, 'register_routes' ] );
39
+ // We also add admin-ajax because the REST API is unsuitable for a lot of hosts.
40
+ add_action( 'wp_ajax_template_kit_import', [ $this, 'ajax_handler' ] );
41
+ }
42
+
43
+ /**
44
+ * Update: We want to use the old ajax endpoint because the REST API is unsuitable on a lot of hosts.
45
+ *
46
+ * Revisit the REST API after Gutenberg becomes stable because that will iron our REST API issues.
47
+ *
48
+ * @since 0.0.9
49
+ */
50
+ public function ajax_handler() {
51
+
52
+ $nonce = null;
53
+ if ( isset( $_REQUEST['_wpnonce'] ) ) {
54
+ $nonce = $_REQUEST['_wpnonce'];
55
+ } elseif ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) {
56
+ $nonce = $_SERVER['HTTP_X_WP_NONCE'];
57
+ }
58
+ if ( $nonce && wp_verify_nonce( $nonce, 'template_kit_import_rest_nonce' ) && isset( $_GET['endpoint'] ) ) {
59
+ $namespace = ENVATO_TEMPLATE_KIT_IMPORT_API_NAMESPACE;
60
+ $endpoint = $_GET['endpoint'];
61
+ $server = rest_get_server();
62
+ $routes = $server->get_routes();
63
+ $rest_key = '/' . $namespace . '/' . $endpoint;
64
+ if ( isset( $routes[ $rest_key ] ) && isset( $routes[ $rest_key ][0] ) ) {
65
+ $request = new \WP_REST_Request( 'PUT' );
66
+ $request->set_headers( $server->get_headers( wp_unslash( $_SERVER ) ) );
67
+ $request->set_body( $server->get_raw_data() );
68
+ $check_required = $request->has_valid_params();
69
+ if ( is_wp_error( $check_required ) ) {
70
+ wp_send_json_error( '-1' );
71
+ } else {
72
+ $check_sanitized = $request->sanitize_params();
73
+ if ( is_wp_error( $check_sanitized ) ) {
74
+ wp_send_json_error( '-2' );
75
+ }
76
+ }
77
+
78
+ if ( call_user_func( $routes[ $rest_key ][0]['permission_callback'], $request ) ) {
79
+ $rest_response = call_user_func( $routes[ $rest_key ][0]['callback'], $request );
80
+ if ( ! is_wp_error( $rest_response ) && ! empty( $rest_response->data ) ) {
81
+ wp_send_json( $rest_response->data );
82
+ wp_send_json( $rest_response->data, 500 ); // todo: errors
83
+ }
84
+ }
85
+ }
86
+ }
87
+ wp_die();
88
+ }
89
+
90
+ /**
91
+ * Register the routes for the objects of the controller.
92
+ */
93
+ public function register_routes() {
94
+ Template_Kit_Import::get_instance();
95
+ Template_Kit_Install::get_instance();
96
+ Requirements::get_instance();
97
+ }
98
+
99
+ }
100
+
inc/backend/class-template-kits.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Template Kit integration
4
+ *
5
+ * Template Kit.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\Backend;
12
+
13
+ use Template_Kit_Import\Utils\Base;
14
+
15
+ if ( ! defined( 'ABSPATH' ) ) {
16
+ exit; // Exit if accessed directly.
17
+ }
18
+
19
+
20
+ /**
21
+ * Handles the Template Kit integration.
22
+ * This is our interface to the "Template Kit Import" code.
23
+ *
24
+ * @since 2.0.0
25
+ */
26
+ class Template_Kits extends Base {
27
+
28
+ public function __construct() {
29
+ add_action( 'before_delete_post', array( $this, 'before_delete_post' ) );
30
+ $this->load_template_kit_library();
31
+ }
32
+
33
+ public function before_delete_post( $post_to_be_deleted ) {
34
+ $post = get_post( $post_to_be_deleted );
35
+ if ( $post && 'elementor_library' === $post->post_type ) {
36
+ // User may be deleting a template from an installed kit, reach into vendor code to handle that case:
37
+ $this->load_template_kit_library();
38
+ \Envato_Template_Kit_Import\Builder_Elementor::get_instance()->check_if_imported_template_is_getting_deleted( $post_to_be_deleted );
39
+ }
40
+ }
41
+
42
+ /**
43
+ * We bring in our Template Kit Import ZIP handling code.
44
+ */
45
+ private function load_template_kit_library() {
46
+ require_once ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'vendor/template-kit-import/template-kit-import.php';
47
+ }
48
+
49
+ public function process_zip_file( $zip_file ) {
50
+ $this->load_template_kit_library();
51
+
52
+ // Reach into our included Template Kit import plugin functions to do the actual import.
53
+ return \Envato_Template_Kit_Import\Importer::get_instance()->unpack_zip_file( $zip_file );
54
+ }
55
+
56
+ /**
57
+ * Delete an imported template kit
58
+ *
59
+ * @param $template_kit_id
60
+ *
61
+ * @return array|\WP_Error
62
+ */
63
+ public function delete_template_kit( $template_kit_id ) {
64
+ $this->load_template_kit_library();
65
+
66
+ // Reach into our included Template Kit import plugin functions to do the actual delete.
67
+ \Envato_Template_Kit_Import\Delete::get_instance()->delete_template_kit( $template_kit_id );
68
+
69
+ return true;
70
+ }
71
+
72
+ /**
73
+ * Returns an array of all installed template kits
74
+ *
75
+ * @return array
76
+ */
77
+ public function get_installed_template_kits() {
78
+ $this->load_template_kit_library();
79
+ // Reach into our included Template Kit import plugin functions to do the actual import.
80
+ $uploaded_kits = \Envato_Template_Kit_Import\CPT_Kits::get_instance()->get_all_uploaded_kits();
81
+ $installed_kits = [];
82
+ try {
83
+ foreach ( $uploaded_kits as $template_kit ) {
84
+ $template_kit_id = $template_kit->ID;
85
+ // Attempt to load this template kit to confirm it's a valid builder type, and get access to helper methods:
86
+ $template_kit_manager = \Envato_Template_Kit_Import\envato_template_kit_import_get_builder( $template_kit_id );
87
+ if ( $template_kit_manager ) {
88
+ // Grab a list of templates from this kit, so we can use the first one as a screenshot url:
89
+ $template_kit_templates = $template_kit_manager->get_available_templates();
90
+ $installed_kits[] = [
91
+ 'id' => $template_kit_id,
92
+ 'screenshot_url' => $template_kit_templates[0]['screenshot_url'],
93
+ 'title' => $template_kit->post_title,
94
+ 'template_count' => count( $template_kit_templates ),
95
+ 'uploaded' => date_i18n( 'F j, Y g:i:a', strtotime( $template_kit->post_date ) ),
96
+ ];
97
+ }
98
+ }
99
+ } catch ( \Exception $e ) {
100
+
101
+ }
102
+
103
+ return $installed_kits;
104
+ }
105
+
106
+ /**
107
+ * Get a single installed template kit by ID
108
+ *
109
+ * @param $template_kit_id
110
+ *
111
+ * @return array|\WP_Error
112
+ */
113
+ public function get_installed_template_kit( $template_kit_id ) {
114
+ $this->load_template_kit_library();
115
+
116
+ // Ask our vendored code for a reference to the installed template kit:
117
+ $template_kit = \Envato_Template_Kit_Import\envato_template_kit_import_get_builder( $template_kit_id );
118
+ if ( ! $template_kit ) {
119
+ return new \WP_Error( 'kit_not_found', 'Sorry this kit was not found' );
120
+ }
121
+
122
+ // Start building up template kit response
123
+ $template_kit_data = [
124
+ 'id' => $template_kit_id,
125
+ 'title' => $template_kit->get_name(),
126
+ 'requirements' => [
127
+ 'theme' => $template_kit->get_required_theme(),
128
+ 'plugins' => $template_kit->get_required_plugins(),
129
+ ],
130
+ 'templates' => [],
131
+ ];
132
+
133
+ // Loop over available templates and include any additional data we might need in the UI:
134
+ foreach ( $template_kit->get_available_templates() as $template_id => $template ) {
135
+ $template['id'] = $template_id;
136
+ $template['template_kit_id'] = $template_kit_id;
137
+ $template['unmet_requirements'] = $template_kit->get_list_of_unmet_requirements( $template );
138
+ $template_kit_data['templates'][] = $template;
139
+ }
140
+
141
+ return $template_kit_data;
142
+ }
143
+
144
+ /**
145
+ * Import a single template from an installed template kit
146
+ *
147
+ * @param $template_kit_id
148
+ * @param $template_id
149
+ *
150
+ * @return array|\WP_Error
151
+ */
152
+ public function import_single_template( $template_kit_id, $template_id ) {
153
+ $this->load_template_kit_library();
154
+
155
+ include_once( ABSPATH . 'wp-admin/includes/image.php' );
156
+
157
+ $template_kit = \Envato_Template_Kit_Import\envato_template_kit_import_get_builder( $template_kit_id );
158
+ if ( ! $template_kit ) {
159
+ return new \WP_Error( 'kit_not_found', 'Sorry this kit was not found' );
160
+ }
161
+
162
+ $template_kit_data = $this->get_installed_template_kit( $template_kit_id );
163
+
164
+ if ( ! empty( $template_kit_data['templates'] ) && ! empty( $template_kit_data['templates'][ $template_id ] ) ) {
165
+ // We've found a matching template for this template kit
166
+
167
+ // Check if we've already imported this template:
168
+ if ( ! empty( $template_kit_data['templates'][ $template_id ]['imports'] ) ) {
169
+ $latest_import = array_pop( $template_kit_data['templates'][ $template_id ]['imports'] );
170
+ if ( $latest_import && ! empty( $latest_import['imported_template_id'] ) ) {
171
+ $latest_import_post = get_post( $latest_import['imported_template_id'] );
172
+ if ( $latest_import_post && $latest_import_post->post_status === 'publish' ) {
173
+ // We've already imported this template, don't import it again.
174
+ return array(
175
+ 'imported_template_id' => $latest_import['imported_template_id'],
176
+ 'edit_url' => $template_kit->get_imported_template_edit_url( $latest_import['imported_template_id'] ),
177
+ );
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ $imported_template_id = \Envato_Template_Kit_Import\Importer::get_instance()->handle_template_import( $template_kit_id, $template_id );
184
+
185
+ if ( is_wp_error( $imported_template_id ) ) {
186
+ return $imported_template_id;
187
+ }
188
+
189
+
190
+ return array(
191
+ 'imported_template_id' => $imported_template_id,
192
+ 'edit_url' => $template_kit->get_imported_template_edit_url( $imported_template_id ),
193
+ );
194
+ }
195
+
196
+ }
inc/backend/class-welcome.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * Elements Welcome Page UI.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\Backend;
12
+
13
+ use Template_Kit_Import\Utils\Base;
14
+
15
+ if ( ! defined( 'ABSPATH' ) ) {
16
+ exit; // Exit if accessed directly.
17
+ }
18
+
19
+
20
+ /**
21
+ * Envato Elements Welcome Page UI.
22
+ *
23
+ * @since 2.0.0
24
+ */
25
+ class Welcome extends Base{
26
+
27
+ /**
28
+ * Registers our main "Elements" menu in the sidebar
29
+ */
30
+ public function admin_menu() {
31
+
32
+ $page = add_management_page(
33
+ __( 'Template Kit Import', 'template-kit-import' ),
34
+ 'Template Kit',
35
+ 'edit_posts',
36
+ ENVATO_TEMPLATE_KIT_IMPORT_SLUG,
37
+ array( $this, 'admin_page_open' )
38
+ );
39
+ add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_page_assets' ) );
40
+
41
+ if ( defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV ) {
42
+ $page = add_menu_page(
43
+ __( 'TK Review', 'template-kit-import' ),
44
+ __( 'TK Review', 'template-kit-import' ),
45
+ 'edit_posts',
46
+ 'template-kit-review',
47
+ array( $this, 'admin_page_review' ),
48
+ '',
49
+ 30
50
+ );
51
+ }
52
+
53
+ }
54
+
55
+ /**
56
+ * Called when the plugin page is opened.
57
+ */
58
+ public function admin_page_open(){
59
+ ?>
60
+ <div id="template-kit-import-app-holder"></div>
61
+ <script type="text/javascript">
62
+ jQuery(function(){
63
+ var appHolder = document.getElementById( 'template-kit-import-app-holder' );
64
+ if (appHolder && 'undefined' !== typeof window.templateKitImport) {
65
+ window.templateKitImport.initBackend( appHolder );
66
+ }
67
+ })
68
+ </script>
69
+ <?php
70
+ }
71
+
72
+ /**
73
+ * Called when the review page is opened.
74
+ */
75
+ public function admin_page_review(){
76
+
77
+ $template_kit_id = isset($_GET['template_kit_id'])? (int)$_GET['template_kit_id'] : null;
78
+ if($template_kit_id > 0) {
79
+ require_once ENVATO_TEMPLATE_KIT_IMPORT_DIR .'review/review.php';
80
+ }else{
81
+ wp_die('No template kit found to review');
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Assets required for the admin page to render correctly (i.e. all our react stuff)
87
+ */
88
+ public function admin_page_assets(){
89
+ wp_enqueue_style( 'template-kit-import-admin', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/main.css', [], filemtime( ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'assets/main.css' ) );
90
+ wp_enqueue_script( 'template-kit-import-admin', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/main.js', [], filemtime( ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'assets/main.js' ), true );
91
+ }
92
+
93
+ }
inc/bootstrap.php CHANGED
@@ -8,7 +8,7 @@
8
  * @since 0.0.2
9
  */
10
 
11
- namespace Envato_Template_Kit_Import;
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
  exit; // Exit if accessed directly.
@@ -23,21 +23,28 @@ spl_autoload_register(
23
  if ( strncmp( $prefix, $class, $len ) !== 0 || $class === $prefix ) {
24
  return;
25
  }
26
- $relative_class = strtolower( substr( $class, $len + 1 ) );
27
- $relative_class = 'class-' . $relative_class;
28
- $file = $base_dir . DIRECTORY_SEPARATOR . str_replace( array( '\\', '_' ), array( '/', '-' ), $relative_class ) . '.php';
 
 
 
 
 
 
 
 
 
29
  if ( file_exists( $file ) ) {
30
  require $file;
31
  } else {
32
- die( esc_html( basename( $file ) . ' missing.' ) );
33
  }
34
  }
35
  );
36
 
37
- require_once __DIR__ . '/helper.php';
38
-
39
  Plugin::get_instance();
40
- Importer::get_instance();
41
- Delete::get_instance();
42
- CPT_Kits::get_instance();
43
- Builder_Elementor::get_instance();
8
  * @since 0.0.2
9
  */
10
 
11
+ namespace Template_Kit_Import;
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
  exit; // Exit if accessed directly.
23
  if ( strncmp( $prefix, $class, $len ) !== 0 || $class === $prefix ) {
24
  return;
25
  }
26
+
27
+ $class = strtolower( $class );
28
+ $class = str_replace([ '\\', '_' ], [ '/', '-' ], $class );
29
+ $class_path = strtolower( substr( $class, $len + 1 ) );
30
+ $class_name = basename( $class_path );
31
+ $class_folder = dirname( $class_path );
32
+ if ( ! $class_folder || $class_folder === '.' ) {
33
+ $class_folder = '';
34
+ } else {
35
+ $class_folder .= DIRECTORY_SEPARATOR;
36
+ }
37
+ $file = $base_dir . DIRECTORY_SEPARATOR . $class_folder . 'class-' . $class_name . '.php';
38
  if ( file_exists( $file ) ) {
39
  require $file;
40
  } else {
41
+ die( esc_html( basename( $file ) . ' not found.' ) );
42
  }
43
  }
44
  );
45
 
 
 
46
  Plugin::get_instance();
47
+ Backend\Options::get_instance();
48
+ Backend\REST::get_instance();
49
+ Backend\Elementor_Modal::get_instance();
50
+ Backend\Template_Kits::get_instance();
inc/class-importer.php DELETED
@@ -1,164 +0,0 @@
1
- <?php
2
- /**
3
- * Template Kit Import:
4
- *
5
- * This starts things up. Registers the SPL and starts up some classes.
6
- *
7
- * @package Envato/Envato_Template_Kit_Import
8
- * @since 0.0.2
9
- */
10
-
11
- namespace Envato_Template_Kit_Import;
12
-
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit; // Exit if accessed directly.
15
- }
16
-
17
-
18
- /**
19
- * Importer registration and management.
20
- *
21
- * @since 0.0.2
22
- */
23
- class Importer extends Base {
24
-
25
- const PAGE_SLUG = 'template-kit-import';
26
-
27
- public function __construct() {
28
- parent::__construct();
29
-
30
- add_action( 'admin_action_envato_template_kit_import_upload', array( $this, 'handle_zip_upload' ) );
31
- add_action( 'wp_ajax_envato_template_kit_import_process', array( $this, 'handle_template_import' ) );
32
- add_action( 'init', array( $this, 'register_importer' ) );
33
- }
34
-
35
- /**
36
- * Called when the user wants to import a single template.
37
- */
38
- public function handle_template_import() {
39
-
40
- $template_kit_id = isset( $_POST['template_kit_id'] ) ? (int) $_POST['template_kit_id'] : -1;
41
- $template_index = isset( $_POST['template_index'] ) ? (int) $_POST['template_index'] : 0;
42
-
43
- check_ajax_referer( 'import_template_kit_' . $template_kit_id, 'nonce' );
44
-
45
- $template_kit = envato_template_kit_import_get_builder( $template_kit_id );
46
-
47
- if ( ! $template_kit ) {
48
- wp_send_json_error( 'Invalid Template Kit' );
49
- }
50
-
51
- $imported_template_id = $template_kit->import_template( $template_index );
52
-
53
- if ( is_wp_error( $imported_template_id ) ) {
54
- wp_send_json_error( $imported_template_id->get_error_message() );
55
- }
56
-
57
- wp_send_json_success(
58
- array(
59
- 'template_id' => $imported_template_id,
60
- 'edit_url' => $template_kit->get_imported_template_edit_url( $imported_template_id ),
61
- )
62
- );
63
-
64
- }
65
-
66
- /**
67
- * Called when the user uploads a zip file.
68
- */
69
- public function handle_zip_upload() {
70
- check_admin_referer( 'envato_template_kit_import' );
71
-
72
- try {
73
- if ( $_FILES && ! empty( $_FILES['template_kit'] ) && ! $_FILES['template_kit']['error'] && is_uploaded_file( $_FILES['template_kit']['tmp_name'] ) ) {
74
-
75
- $temporary_zip_file = $_FILES['template_kit']['tmp_name'];
76
-
77
- if ( class_exists( '\ZipArchive' ) ) {
78
- $wp_upload_dir = wp_upload_dir();
79
- $template_kit_base_path = $wp_upload_dir['basedir'] . '/template-kits/';
80
- $template_kit_random_folder = md5( time() . NONCE_SALT );
81
- $template_kit_extract_directory = $template_kit_base_path . $template_kit_random_folder;
82
- wp_mkdir_p( $template_kit_extract_directory );
83
- // Prevent directory indexing so people cannot find the random template kit ID folders:
84
- touch( $template_kit_base_path . 'index.php' );
85
-
86
- $zip = new \ZipArchive();
87
- $zip->open( $temporary_zip_file );
88
- $zip->extractTo( $template_kit_extract_directory );
89
- $zip->close();
90
-
91
- unlink( $temporary_zip_file );
92
-
93
- $extracted_zip_files = scandir( $template_kit_extract_directory );
94
- if ( $extracted_zip_files && is_array( $extracted_zip_files ) ) {
95
- $file_names = array_diff( $extracted_zip_files, array( '.', '..' ) );
96
- } else {
97
- $file_names = array();
98
- }
99
- if ( ! $file_names || ! in_array( 'manifest.json', $file_names, true ) ) {
100
- wp_die( 'Please upload a valid Template Kit zip file' );
101
- }
102
-
103
- // Here we assume we've got a valid template kit extracted to the users hosting account.
104
- // Time to throw it into the Custom Post Type so that we can proceed to the import step or do other fancy things.
105
-
106
- $manifest_data = json_decode( file_get_contents( $template_kit_extract_directory . '/manifest.json' ), true );
107
- // todo: validate manifest data structure.
108
-
109
- $post_data = array(
110
- 'post_title' => $manifest_data['title'],
111
- 'post_type' => CPT_Kits::get_instance()->cpt_slug,
112
- 'post_status' => 'publish',
113
- );
114
- $post_id = wp_insert_post( $post_data, true );
115
-
116
- if ( $post_id && ! is_wp_error( $post_id ) ) {
117
- // successfully stored this post. Add some metadata
118
- update_post_meta( $post_id, 'envato_tk_manifest', $manifest_data );
119
- update_post_meta( $post_id, 'envato_tk_folder_name', $template_kit_random_folder );
120
- update_post_meta( $post_id, 'envato_tk_builder', $manifest_data['page_builder'] );
121
-
122
- wp_safe_redirect( admin_url( 'tools.php?page=template-kit-import&step=1&imported_template_kit_id=' . $post_id ) );
123
- exit;
124
-
125
- }
126
- } else {
127
- // no zip source
128
- wp_die( 'Please enable ZIP extension on this hosting account.' );
129
- }
130
- }
131
- } catch ( \Exception $exception ) {
132
- wp_die( 'Failed to extract Template Kit zip file.' );
133
- }
134
-
135
- wp_die( 'Failed to process Template Kit' );
136
- }
137
-
138
-
139
- /**
140
- * Called when the user visits our main menu item.
141
- * Displays the welcome screen.
142
- */
143
- public function admin_menu_open() {
144
- $this->content = $this->render_template( 'importer/importer.php' );
145
- $this->header = $this->render_template( 'header.php' );
146
- echo $this->render_template( 'wrapper.php' ); // WPCS: XSS ok.
147
- }
148
-
149
- /**
150
- * Hooks into the WordPress importer area
151
- */
152
- public function register_importer() {
153
- require_once ABSPATH . '/wp-admin/includes/import.php';
154
- add_action(
155
- 'load-importer-envato_template_kit_import',
156
- function() {
157
- wp_safe_redirect( self::get_url() );
158
- exit;
159
- }
160
- );
161
- register_importer( 'envato_template_kit_import', __( 'Template Kit', 'template-kit-import' ), __( 'Import Template Kit for Page/Site Builders.', 'template-kit-import' ), array( $this, 'admin_menu_open' ) );
162
- }
163
-
164
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class-plugin.php CHANGED
@@ -4,11 +4,14 @@
4
  *
5
  * This starts things up. Registers the SPL and starts up some classes.
6
  *
7
- * @package Envato/Envato_Template_Kit_Import
8
  * @since 0.0.2
9
  */
10
 
11
- namespace Envato_Template_Kit_Import;
 
 
 
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
  exit; // Exit if accessed directly.
@@ -16,9 +19,9 @@ if ( ! defined( 'ABSPATH' ) ) {
16
 
17
 
18
  /**
19
- * Template Kit Import plugin.
20
  *
21
- * The main plugin handler class is responsible for initializing Template Kit Import. The
22
  * class registers and all the components required to run the plugin.
23
  *
24
  * @since 0.0.2
@@ -26,16 +29,15 @@ if ( ! defined( 'ABSPATH' ) ) {
26
  class Plugin extends Base {
27
 
28
  /**
29
- * Initializing Template Kit Import plugin.
30
  *
31
  * @since 0.0.2
32
  * @access private
33
  */
34
  public function __construct() {
35
- parent::__construct();
36
-
37
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
38
- add_action( 'plugins_loaded', array( $this, 'db_upgrade_check' ) );
39
  }
40
 
41
  /**
@@ -45,63 +47,28 @@ class Plugin extends Base {
45
  * @access public
46
  */
47
  public function admin_menu() {
48
-
49
- $page = add_management_page(
50
- __( 'Template Kit Import', 'template-kit-import' ),
51
- 'Template Kit',
52
- 'edit_posts',
53
- ENVATO_TEMPLATE_KIT_IMPORT_SLUG,
54
- array( Importer::get_instance(), 'admin_menu_open' )
55
- );
56
- add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_page_assets' ) );
57
-
58
- if ( defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV ) {
59
- $page = add_menu_page(
60
- __( 'Import', 'template-kit-import' ),
61
- 'Import',
62
- 'edit_posts',
63
- ENVATO_TEMPLATE_KIT_IMPORT_SLUG,
64
- array( Importer::get_instance(), 'admin_menu_open' ),
65
- '',
66
- 30
67
- );
68
- add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_page_assets' ) );
69
- }
70
  }
71
 
72
  /**
73
- * Load assets when the admin page is opened.
74
  *
75
  * @since 0.0.2
76
- * @access private
77
  */
78
- public function admin_page_assets() {
79
- wp_enqueue_style( 'template-kit-import-admin', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/css/main.min.css', array(), filemtime( ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'assets/css/main.min.css' ) );
80
- wp_enqueue_script( 'template-kit-import-importer', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/js/importer.min.js', array( 'jquery' ), filemtime( ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'assets/js/importer.min.js' ), true );
81
  }
82
 
83
- /**
84
- * Called on load to run certain tasks if the version has changed.
85
- *
86
- * @since 0.0.2
87
- * @access private
88
- */
89
  public function db_upgrade_check() {
90
- if ( get_option( 'envato_template_kit_import_version' ) !== ENVATO_TEMPLATE_KIT_IMPORT_VER ) {
91
  $this->activation();
92
  }
93
  }
94
 
95
- /**
96
- * Called on plugin activation.
97
- *
98
- * @since 0.0.2
99
- * @access private
100
- */
101
  public function activation() {
102
- update_option( 'envato_template_kit_import_version', ENVATO_TEMPLATE_KIT_IMPORT_VER );
103
- if ( ! get_option( 'envato_template_kit_import_install_time' ) ) {
104
- update_option( 'envato_template_kit_import_install_time', time() );
105
  }
106
  }
107
 
4
  *
5
  * This starts things up. Registers the SPL and starts up some classes.
6
  *
7
+ * @package Envato/Template_Kit_Import
8
  * @since 0.0.2
9
  */
10
 
11
+ namespace Template_Kit_Import;
12
+
13
+ use Template_Kit_Import\Backend\Welcome;
14
+ use Template_Kit_Import\Utils\Base;
15
 
16
  if ( ! defined( 'ABSPATH' ) ) {
17
  exit; // Exit if accessed directly.
19
 
20
 
21
  /**
22
+ * Envato Elements plugin.
23
  *
24
+ * The main plugin handler class is responsible for initializing Envato Elements. The
25
  * class registers and all the components required to run the plugin.
26
  *
27
  * @since 0.0.2
29
  class Plugin extends Base {
30
 
31
  /**
32
+ * Initializing Envato Elements plugin.
33
  *
34
  * @since 0.0.2
35
  * @access private
36
  */
37
  public function __construct() {
38
+ add_action( 'admin_menu', [ $this, 'admin_menu' ] );
39
+ add_action( 'admin_init', [ $this, 'admin_init' ] );
40
+ add_action( 'plugins_loaded', [ $this, 'db_upgrade_check' ] );
 
41
  }
42
 
43
  /**
47
  * @access public
48
  */
49
  public function admin_menu() {
50
+ Welcome::get_instance()->admin_menu();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
 
53
  /**
54
+ * Sets up the admin menu options.
55
  *
56
  * @since 0.0.2
57
+ * @access public
58
  */
59
+ public function admin_init() {
 
 
60
  }
61
 
 
 
 
 
 
 
62
  public function db_upgrade_check() {
63
+ if ( is_admin() && get_option( 'template_kit_import_version' ) !== ENVATO_TEMPLATE_KIT_IMPORT_VER ) {
64
  $this->activation();
65
  }
66
  }
67
 
 
 
 
 
 
 
68
  public function activation() {
69
+ update_option( 'template_kit_import_version', ENVATO_TEMPLATE_KIT_IMPORT_VER );
70
+ if ( ! get_option( 'template_kit_import_install_time' ) ) {
71
+ update_option( 'template_kit_import_install_time', time() );
72
  }
73
  }
74
 
inc/utils/class-base.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * Base class for extending our other classes upon.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Template_Kit_Import\Utils;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Envato Elements plugin.
20
+ *
21
+ * The main plugin handler class is responsible for initializing Envato Elements. The
22
+ * class registers and all the components required to run the plugin.
23
+ *
24
+ * @since 0.0.2
25
+ */
26
+ abstract class Base {
27
+
28
+ const PAGE_SLUG = ENVATO_TEMPLATE_KIT_IMPORT_SLUG;
29
+ /**
30
+ * Holds the plugin instance.
31
+ *
32
+ * @since 0.0.2
33
+ * @access protected
34
+ * @static
35
+ *
36
+ * @var Base
37
+ */
38
+ private static $instances = [];
39
+
40
+ /**
41
+ * Disable class cloning and throw an error on object clone.
42
+ *
43
+ * The whole idea of the singleton design pattern is that there is a single
44
+ * object. Therefore, we don't want the object to be cloned.
45
+ *
46
+ * @access public
47
+ * @since 0.0.2
48
+ */
49
+ public function __clone() {
50
+ // Cloning instances of the class is forbidden.
51
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'template-kit-import' ), '1.0.0' );
52
+ }
53
+
54
+ /**
55
+ * Disable unserializing of the class.
56
+ *
57
+ * @access public
58
+ * @since 0.0.2
59
+ */
60
+ public function __wakeup() {
61
+ // Unserializing instances of the class is forbidden.
62
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'template-kit-import' ), '1.0.0' );
63
+ }
64
+
65
+ /**
66
+ * Sets up a single instance of the plugin.
67
+ *
68
+ * @since 0.0.2
69
+ * @access public
70
+ * @static
71
+ *
72
+ * @return static An instance of the class.
73
+ */
74
+ public static function get_instance() {
75
+ $module = get_called_class();
76
+ if ( ! isset( self::$instances[ $module ] ) ) {
77
+ self::$instances[ $module ] = new $module();
78
+ }
79
+
80
+ return self::$instances[ $module ];
81
+ }
82
+
83
+ }
inc/utils/class-content-api.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Content API
4
+ *
5
+ * Content API
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\Utils;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Content API
20
+ *
21
+ * @since 2.0.0
22
+ */
23
+ class Content_API extends Base {
24
+
25
+ /**
26
+ * This is the API endpoint for all our static template kit data:
27
+ *
28
+ * @var string
29
+ *
30
+ * @since 2.0.0
31
+ */
32
+ private $api_endpoint = 'https://assets.wp.envatoextensions.com/template-kits/';
33
+
34
+ /**
35
+ * Fetch a file from our static endpoint:
36
+ *
37
+ * @param $file - the file to get
38
+ * @param bool $force - if we should skip local transient cache
39
+ *
40
+ * @return string|\WP_Error
41
+ */
42
+ public function fetch_file_content( $file, $force = false ) {
43
+ $url = $this->api_endpoint . $file;
44
+
45
+ $cache_key = 'template_kit_import_' . md5( $url );
46
+
47
+ if ( ! $force ) {
48
+ $cached_response = get_transient( $cache_key );
49
+ if ( $cached_response ) {
50
+ return $cached_response;
51
+ }
52
+ }
53
+
54
+ $response = wp_safe_remote_get(
55
+ $url, [
56
+ 'user-agent' => 'Mozilla/5.0 (Envato Elements ' . ENVATO_TEMPLATE_KIT_IMPORT_VER . ';) ' . home_url(),
57
+ 'timeout' => 10,
58
+ ]
59
+ );
60
+
61
+ if ( is_wp_error( $response ) ) {
62
+ return $response;
63
+ }
64
+
65
+ $response_code = wp_remote_retrieve_response_code( $response );
66
+ if ( 200 !== (int) $response_code ) {
67
+ return new \WP_Error( $response_code, 'Failed to fetch file' );
68
+ }
69
+
70
+ // Get the response string from our WP response object
71
+ $cached_response = wp_remote_retrieve_body( $response );
72
+
73
+ // Cache this response string in WordPress locally for an hour:
74
+ set_transient( $cache_key, $cached_response, 3600 );
75
+
76
+ return $cached_response;
77
+ }
78
+
79
+ /**
80
+ * Fetch our template listing, filter based on search parameters, and return an array.
81
+ *
82
+ * @param array $search
83
+ *
84
+ * @return array
85
+ */
86
+ public function get_free_template_kits( $search = [] ) {
87
+ $all_free_template_kits = json_decode( $this->fetch_file_content( 'manifest.json' ), true );
88
+
89
+ $all_available_industries = [];
90
+ foreach ( $all_free_template_kits as $free_template_kit_id => $free_template_kit ) {
91
+ if ( ! empty( $free_template_kit['industry'] ) && is_array( $free_template_kit['industry'] ) ) {
92
+ foreach ( $free_template_kit['industry'] as $industry_key => $industry_value ) {
93
+ // we fix up the &amp; encoding ready for display in the UI:
94
+ $fixed_industry_encoding = htmlspecialchars_decode( $industry_value );
95
+ $all_free_template_kits[ $free_template_kit_id ]['industry'][ $industry_key ] = $fixed_industry_encoding;
96
+
97
+ // Add this industry to the list of available industries
98
+ $all_available_industries[ $industry_key ] = [
99
+ 'key' => $industry_key,
100
+ 'value' => $fixed_industry_encoding,
101
+ ];
102
+ }
103
+ }
104
+ }
105
+
106
+ $page = ! empty( $search['page'] ) ? $search['page'] : 1;
107
+ $per_page = 12;
108
+
109
+ // Filter based on provided industry
110
+ $filter_by_industry = ! empty( $search['industry'] ) ? $search['industry'] : false;
111
+ if ( $filter_by_industry ) {
112
+ $all_free_template_kits = array_filter( $all_free_template_kits, function ( $free_template_kit ) use ( $filter_by_industry ) {
113
+ return isset( $free_template_kit['industry'][ $filter_by_industry ] );
114
+ } );
115
+ }
116
+
117
+ // Filter based on provided text string
118
+ $filter_by_text = ! empty( $search['text'] ) ? $search['text'] : false;
119
+ if ( $filter_by_text ) {
120
+ $all_free_template_kits = array_filter( $all_free_template_kits, function ( $free_template_kit ) use ( $filter_by_text ) {
121
+ $has_title_match = stripos( $free_template_kit['name'], $filter_by_text ) !== false;
122
+ $matching_categories = array_filter( $free_template_kit['industry'], function ( $industry ) use ( $filter_by_text ) {
123
+ return stripos( $industry, $filter_by_text ) !== false;
124
+ } );
125
+
126
+ return $has_title_match || $matching_categories;
127
+ } );
128
+ }
129
+
130
+ // We count the total of all nested 'thumbnail' entries as this gives us an indication of how many free templates are available.
131
+ $total_template_count = array_sum( array_map( "count", array_column( $all_free_template_kits, 'thumbnails' ) ) );
132
+
133
+ $items = array_slice( $all_free_template_kits, ( ( $page - 1 ) * $per_page ), $per_page );
134
+
135
+ $result = [
136
+ 'items' => $items,
137
+ 'meta' => [
138
+ 'industries' => array_values( $all_available_industries ), // so we can populate the drop down.
139
+ 'total_items' => count( $all_free_template_kits ), // for pagination buttons to work
140
+ 'per_page' => $per_page, // for pagination buttons to work
141
+ 'current_page' => $page, // for pagination buttons to work
142
+ 'total_template_count' => $total_template_count, // for our browse sub text
143
+ ],
144
+ ];
145
+
146
+ return $result;
147
+ }
148
+
149
+ /**
150
+ * @param $zip_url
151
+ *
152
+ * @return string|\WP_Error
153
+ */
154
+ public function download_zip( $zip_url ) {
155
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
156
+ $temporary_zip_file_path = wp_tempnam( 'content-api-dl' );
157
+ $download_response = wp_safe_remote_get( $zip_url, array(
158
+ 'timeout' => 60,
159
+ 'user-agent' => 'Mozilla/5.0 (Envato Elements ' . ENVATO_TEMPLATE_KIT_IMPORT_VER . ';) ' . home_url(),
160
+ 'stream' => true,
161
+ 'filename' => $temporary_zip_file_path
162
+ ) );
163
+ if ( is_wp_error( $download_response ) ) {
164
+ return $download_response;
165
+ }
166
+
167
+ // We successfully downloaded the zip file, return the path
168
+ return $temporary_zip_file_path;
169
+ }
170
+
171
+ }
inc/utils/class-extensions-api.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Extensions API
4
+ *
5
+ * Extensions API
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 2.0.0
9
+ */
10
+
11
+ namespace Template_Kit_Import\Utils;
12
+
13
+ use Template_Kit_Import\Backend\Subscription;
14
+ use Template_Kit_Import\Backend\Options;
15
+
16
+ if ( ! defined( 'ABSPATH' ) ) {
17
+ exit; // Exit if accessed directly.
18
+ }
19
+
20
+
21
+ /**
22
+ * Extensions API
23
+ *
24
+ * @since 2.0.0
25
+ */
26
+ class Extensions_API extends Base {
27
+
28
+ /**
29
+ * @var string
30
+ *
31
+ * @since 0.0.9
32
+ */
33
+ private $api_endpoint = 'https://api.extensions.envato.com';
34
+
35
+ /**
36
+ * @var string
37
+ *
38
+ * @since 0.0.9
39
+ */
40
+ private $token = '';
41
+
42
+ public function __construct() {
43
+ if ( defined( 'ELEMENTS_API_HOSTNAME' ) ) {
44
+ $this->api_endpoint = ELEMENTS_API_HOSTNAME;
45
+ }
46
+ }
47
+
48
+ public function set_token( $token = false ) {
49
+ if ( ! $token ) {
50
+ $elements_token = Options::get_instance()->get( Subscription::SUBSCRIPTION_TOKEN_OPTION );
51
+ if ( $elements_token && ! empty( $elements_token['token'] ) ) {
52
+ $token = $elements_token['token'];
53
+ }
54
+ }
55
+ $this->token = $token;
56
+ }
57
+
58
+ public function get_token() {
59
+ return $this->token;
60
+ }
61
+
62
+ public function get_extension_id() {
63
+ // Our legacy extension ID was the license code, check if we've got one prior to v2
64
+ $legacy_extension_id = Options::get_instance()->get( 'license_code' );
65
+ if($legacy_extension_id){
66
+ return $legacy_extension_id;
67
+ }
68
+ // Default to a hash of the site url for the extension ID
69
+ return md5(get_site_url());
70
+ }
71
+
72
+ private function encode_url_parameter( $parameter ) {
73
+ $parameter = html_entity_decode( $parameter, ENT_QUOTES | ENT_XML1, 'UTF-8' );
74
+ $parameter = str_replace( '#', '', $parameter );
75
+
76
+ return urlencode( $parameter );
77
+ }
78
+
79
+ public function get_token_url() {
80
+ $extension_description = trim( Options::get_instance()->get( 'project_name', get_bloginfo( 'name' ) ) );
81
+ if ( strlen( $extension_description ) > 0 ) {
82
+ $extension_description .= ' (' . get_home_url() . ')';
83
+ } else {
84
+ $extension_description = get_home_url();
85
+ }
86
+ $extension_description = substr( $extension_description, 0, 254 );
87
+
88
+ return $this->api_endpoint . "/extensions/begin_activation?extension_id=" . $this->get_extension_id() . "&extension_type=envato-wordpress&extension_description=" . $this->encode_url_parameter( $extension_description );
89
+ }
90
+
91
+ /**
92
+ *
93
+ * @param $endpoint
94
+ * @param string $method
95
+ * @param array $body_args
96
+ *
97
+ * @return \stdClass|\WP_Error
98
+ */
99
+ public function api_call( $endpoint, $method = 'GET', $body_args = [] ) {
100
+
101
+ if ( ! $this->token ) {
102
+ $this->set_token();
103
+ }
104
+ $http_args = [
105
+ 'user-agent' => 'Mozilla/5.0 (Envato Elements ' . ENVATO_TEMPLATE_KIT_IMPORT_VER . ';) ' . home_url(),
106
+ 'timeout' => 15,
107
+ 'headers' => [ 'Extensions-Extension-Id' => $this->get_extension_id() ]
108
+ ];
109
+ if ( $this->token ) {
110
+ $http_args['headers']['Extensions-Token'] = $this->token;
111
+ }
112
+
113
+ foreach ( [ true, false, ] as $sslverify ) {
114
+ // Unfortunately some hosts ONLY work with sslverify true, and some ONLY work with sslverify false.
115
+ // So we cannot just hard code it to false, we have to try both. SSL first, then broken SSL if that fails.
116
+ $http_args['sslverify'] = $sslverify;
117
+ if ( $method == 'GET' ) {
118
+ $response = wp_remote_get( $this->api_endpoint . $endpoint, $http_args );
119
+ } else {
120
+ $http_args['headers']['Content-Type'] = 'application/json';
121
+ $http_args['body'] = json_encode( $body_args );
122
+ $http_args['data_format'] = 'body';
123
+ $response = wp_remote_post( $this->api_endpoint . $endpoint, $http_args );
124
+ }
125
+ if ( $response && ! is_wp_error( $response ) ) {
126
+ break;
127
+ }
128
+ }
129
+
130
+ if ( is_wp_error( $response ) ) {
131
+ return $response;
132
+ }
133
+
134
+ $raw_response = wp_remote_retrieve_body( $response );
135
+ $data = json_decode( $raw_response, true );
136
+
137
+ $response_code = wp_remote_retrieve_response_code( $response );
138
+
139
+ // $response_code = 401;$data = [ 'error' => [ 'code'=>'token_expired', 'message'=>'errormsg' ] ];
140
+ // $response_code = 403;$data = [ 'error' => [ 'code'=>'download_forbidden', 'message'=>'errormsg' ] ];
141
+ // $response_code = 404;$data = [ 'error' => [ 'code'=>'item_not_found', 'message'=>'errormsg' ] ];
142
+ // $response_code = 503;$data = 'Unavailable';
143
+
144
+ $error_message_to_display = 'Unknown error';
145
+
146
+ if ( empty( $data ) || ! is_array( $data ) ) {
147
+ // Did the response contain HTML instead of json?
148
+ if ( strlen( $raw_response ) && ! $data ) {
149
+ // we failed to decode the response into JSON
150
+ $error_message_to_display = 'The API did not respond with valid JSON data.';
151
+ }
152
+
153
+ return new \WP_Error( 'no_json', $error_message_to_display, [
154
+ __( 'An error occurred, please try again', 'template-kit-import' ),
155
+ var_export( wp_remote_retrieve_body( $response ), true )
156
+ ] );
157
+ }
158
+
159
+ if ( 200 !== (int) $response_code && 201 !== (int) $response_code ) {
160
+ $error_message_to_display = $data && ! empty( $data['message'] ) ? $data['message'] : __( 'HTTP Error', 'template-kit-import' );
161
+
162
+ // format our error response data into something easier to parse
163
+ return new \WP_Error( $response_code, $error_message_to_display, $data && ! empty( $data['error'] ) ? $data['error'] : $data );
164
+ }
165
+
166
+ return $data;
167
+ }
168
+
169
+ }
languages/template-kit-import.pot CHANGED
@@ -6,9 +6,9 @@ msgstr ""
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
- "Language-Team: Envato <dave.baker@envato.com>\n"
10
- "Last-Translator: Dave Baker <dave.baker@envato.com>\n"
11
- "Report-Msgid-Bugs-To: https://envato.com/\n"
12
  "X-Poedit-Basepath: ..\n"
13
  "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
14
  "X-Poedit-SearchPath-0: .\n"
@@ -17,151 +17,39 @@ msgstr ""
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
  #. translators: %s: PHP version
20
- #: template-kit-import.php:74
21
- msgid "Template Kit Import requires PHP version %1$s+, plugin is currently NOT ACTIVE. Please contact the hosting provider. WordPress recommends version %2$s."
22
  msgstr ""
23
 
24
- #: template-kit-import.php:79
25
  msgid "7.2 or above"
26
  msgstr ""
27
 
28
  #. translators: %s: WordPress version
29
- #: template-kit-import.php:98
30
- msgid "Template Kit Import requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT ACTIVE."
31
  msgstr ""
32
 
33
- #: inc/class-base.php:51, inc/class-base.php:62
34
- msgid "Something went wrong."
35
- msgstr ""
36
-
37
- #: inc/class-builder-elementor.php:109
38
- msgid "Import into Elementor Library"
39
- msgstr ""
40
-
41
- #: inc/class-builder.php:207
42
- msgid "Import Template"
43
- msgstr ""
44
-
45
- #: inc/class-importer.php:161
46
- msgid "Template Kit"
47
- msgstr ""
48
-
49
- #: inc/class-importer.php:161
50
- msgid "Import Template Kit for Page/Site Builders."
51
- msgstr ""
52
-
53
- #: inc/class-plugin.php:50
54
  msgid "Template Kit Import"
55
  msgstr ""
56
 
57
- #: inc/class-plugin.php:60
58
- msgid "Import"
59
- msgstr ""
60
-
61
- #: views/importer/importer.php:40, views/importer/importer.php:58
62
- msgid "1. Upload"
63
- msgstr ""
64
-
65
- #: views/importer/importer.php:44, views/importer/importer.php:62, views/importer/step1.php:57
66
- msgid "REVIEW"
67
- msgstr ""
68
-
69
- #: views/importer/importer.php:49, views/importer/importer.php:67
70
- msgid "2. Install Requirements"
71
- msgstr ""
72
-
73
- #: views/importer/importer.php:53, views/importer/importer.php:71
74
- msgid "3. Select Templates"
75
- msgstr ""
76
-
77
- #: views/importer/step1-upload.php:14
78
- msgid "Upload Template Kit Zip File"
79
- msgstr ""
80
-
81
- #: views/importer/step1-upload.php:16, views/importer/step1.php:64, views/importer/step2.php:87
82
- msgid "Next"
83
- msgstr ""
84
-
85
- #. translators: %s: Template Kit Name
86
- #: views/importer/step1.php:39
87
- msgid "%s - Template Kit"
88
- msgstr ""
89
-
90
- #: views/importer/step1.php:45
91
- msgid "Uploaded Successfully"
92
- msgstr ""
93
-
94
- #. translators: %s: Template Kit Upload Date
95
- #: views/importer/step1.php:48
96
- msgid "Uploaded on %s"
97
- msgstr ""
98
-
99
- #: views/importer/step1.php:52
100
- msgid "Delete Template Kit"
101
- msgstr ""
102
-
103
- #: views/importer/step1.php:71
104
- msgid "Upload Another Template Kit"
105
- msgstr ""
106
-
107
- #. translators: %s Template kit name
108
- #: views/importer/step2.php:24
109
- msgid "The %s requires the following themes & plugins to work best, select the items you would like to install:"
110
- msgstr ""
111
-
112
- #: views/importer/step2.php:39
113
- msgid "Activate Theme"
114
- msgstr ""
115
-
116
- #: views/importer/step2.php:42
117
- msgid "Install Theme"
118
- msgstr ""
119
-
120
- #: views/importer/step2.php:45
121
- msgid "Theme Installed & Active"
122
- msgstr ""
123
-
124
- #: views/importer/step2.php:49
125
- msgid "Theme Error"
126
  msgstr ""
127
 
128
- #: views/importer/step2.php:66
129
- msgid "Activate Plugin"
130
- msgstr ""
131
-
132
- #: views/importer/step2.php:69
133
- msgid "Update Plugin"
134
- msgstr ""
135
-
136
- #: views/importer/step2.php:72
137
- msgid "Install Plugin"
138
- msgstr ""
139
-
140
- #: views/importer/step2.php:75
141
- msgid "Plugin Installed & Active"
142
- msgstr ""
143
-
144
- #: views/importer/step2.php:79
145
- msgid "Plugin Error"
146
- msgstr ""
147
-
148
- #. translators: %1$s: <strong> opening html tag, %2$s: </strong> closing html tag, %3$s: <a> opening html tag, %4$s: </a> closing html tag
149
- #: views/importer/step3.php:28
150
- msgid "%1$sWarning!%2$s There are plugins that need installing or activating for this Template Kit to work correctly. Go back to %3$sInstall Plugins%4$s."
151
- msgstr ""
152
-
153
- #: views/importer/step3.php:56
154
- msgid "Imported"
155
  msgstr ""
156
 
157
- #: views/importer/step3.php:73
158
- msgid "Edit"
159
  msgstr ""
160
 
161
- #: views/importer/step3.php:74
162
- msgid "Import Again"
163
  msgstr ""
164
 
165
- #: views/importer/step3.php:85
166
- msgid "Ignore Requirements"
167
  msgstr ""
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
+ "Language-Team: Envato <extensions@envato.com>\n"
10
+ "Last-Translator: Extensions <extensions@envato.com>\n"
11
+ "Report-Msgid-Bugs-To: https://envato.com//\n"
12
  "X-Poedit-Basepath: ..\n"
13
  "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
14
  "X-Poedit-SearchPath-0: .\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
  #. translators: %s: PHP version
20
+ #: template-kit-import.php:75
21
+ msgid "Template Kit Import plugin requires PHP version %s+, plugin is currently NOT ACTIVE. Please contact the hosting provider. WordPress recommends version %s."
22
  msgstr ""
23
 
24
+ #: template-kit-import.php:80
25
  msgid "7.2 or above"
26
  msgstr ""
27
 
28
  #. translators: %s: WordPress version
29
+ #: template-kit-import.php:99
30
+ msgid "Envato Elements requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT ACTIVE."
31
  msgstr ""
32
 
33
+ #: inc/backend/class-welcome.php:33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  msgid "Template Kit Import"
35
  msgstr ""
36
 
37
+ #: inc/backend/class-welcome.php:43, inc/backend/class-welcome.php:44
38
+ msgid "TK Review"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  msgstr ""
40
 
41
+ #: inc/utils/class-base.php:51, inc/utils/class-base.php:62, vendor/template-kit-import/inc/class-base.php:51, vendor/template-kit-import/inc/class-base.php:62
42
+ msgid "Something went wrong."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  msgstr ""
44
 
45
+ #: inc/utils/class-extensions-api.php:154
46
+ msgid "An error occurred, please try again"
47
  msgstr ""
48
 
49
+ #: vendor/template-kit-import/inc/class-builder-elementor.php:113
50
+ msgid "Import into Elementor Library"
51
  msgstr ""
52
 
53
+ #: vendor/template-kit-import/inc/class-builder.php:207
54
+ msgid "Import Template"
55
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: elementor, template, templates
4
  Requires at least: 5.3
5
  Tested up to: 5.4
6
  Requires PHP: 5.6
7
- Stable tag: 1.0.2
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -36,6 +36,9 @@ Create your own "Template Kit" for others with the "[Template Kit Export](https:
36
 
37
  == Changelog ==
38
 
 
 
 
39
  = 1.0.2 - 2020-03-24 =
40
  * Fix importing Elementor display conditions
41
 
4
  Requires at least: 5.3
5
  Tested up to: 5.4
6
  Requires PHP: 5.6
7
+ Stable tag: 1.0.3
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
36
 
37
  == Changelog ==
38
 
39
+ = 1.0.3 - 2020-04-29 =
40
+ * Fix certain import conditions so it runs smoother
41
+
42
  = 1.0.2 - 2020-03-24 =
43
  * Fix importing Elementor display conditions
44
 
views/importer/step8.php → review/review.php RENAMED
@@ -287,3 +287,44 @@ $templates = $template_kit->get_available_templates();
287
  </tbody>
288
  </table>
289
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  </tbody>
288
  </table>
289
  </div>
290
+ <div>
291
+ <h2>Item Page Markup:</h2>
292
+ <?php
293
+ // extract any envato elements images from all our images
294
+ function generate_item_page_markup( $all_images, $market ) {
295
+ $template_kit_import_images = array_filter(
296
+ $all_images,
297
+ function ( $image ) {
298
+ return ! empty( $image['image_source'] ) && ! empty( $image['image_urls'] ) && $image['image_source'] === 'template_kit_import';
299
+ }
300
+ );
301
+ if ( $template_kit_import_images ) {
302
+ $output = 'This Template Kit uses demo images from Envato Elements. You will need to license these images from Envato Elements to use them on your website, or you can substitute them with your own.';
303
+ $output .= ( $market === 'elements' ) ? "\n" : "<br/><br/>\n";
304
+ // Start a list item of images:
305
+ $output .= ( $market === 'elements' ) ? '' : "<ul>\n";
306
+ foreach ( $template_kit_import_images as $image ) {
307
+ $output .= ( $market === 'elements' ) ? '* ' : '<li>';
308
+ $output .= $image['image_urls'];
309
+ $output .= ( $market === 'elements' ) ? "\n" : "</li>\n";
310
+ }
311
+ // End the list:
312
+ $output .= ( $market === 'elements' ) ? "\n" : "</ul>\n";
313
+
314
+ return $output;
315
+ } else {
316
+ return '(no Envato Elements images found, not generating default markup)';
317
+ }
318
+ }
319
+ ?>
320
+ <p>
321
+ <strong>ThemeForest item page HTML:</strong>
322
+ <br/>
323
+ <textarea name="themeforest_markup" style="width: 100%" onclick="this.focus();this.select()" readonly="readonly"><?php echo esc_textarea( generate_item_page_markup( $manifest['images'], 'themeforest' ) ); ?></textarea>
324
+ </p>
325
+ <p>
326
+ <strong>Envato Elements item page markdown:</strong>
327
+ <br/>
328
+ <textarea name="elements_markup" style="width: 100%" onclick="this.focus();this.select()" readonly="readonly"><?php echo esc_textarea( generate_item_page_markup( $manifest['images'], 'elements' ) ); ?></textarea>
329
+ </p>
330
+ </div>
src/js/react/components/Actions/ButtonActionProvider.jsx ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState, useEffect } from 'react'
2
+
3
+ const ActionPerformer = ({ actionHook, LoadingButton, SuccessButton, ErrorButton, errorCallback, completeCallback }) => {
4
+ // Call our useFetch() hook to start performing our action (i.e. importing a template)
5
+ const { loading, data, error } = actionHook()
6
+
7
+ // Check if we've successfully completed out action:
8
+ if (!loading && !error) {
9
+ // We've successfully imported the template, bubble up a success call after a short timeout
10
+ // so we can show an "imported" state on the button briefly:
11
+ setTimeout(() => { completeCallback(data) }, 500)
12
+ return SuccessButton
13
+ }
14
+
15
+ // Check if we had an error performing the action:
16
+ if (error) {
17
+ setTimeout(() => { errorCallback(data) }, 100)
18
+ return ErrorButton
19
+ }
20
+
21
+ // The default state of this component is loading, so we show that loading button here..
22
+ return LoadingButton
23
+ }
24
+
25
+ /**
26
+ * Generic user action provider.
27
+ * Used for things like "Import Template" and "Import Photo" buttons
28
+ *
29
+ * @param DefaultButton
30
+ * @param CompletedButton
31
+ * @param ProcessingButton
32
+ * @param isAlreadyCompleted
33
+ * @param completedCallback
34
+ * @param actionConfirmationMessage
35
+ *
36
+ * @returns {*}
37
+ * @constructor
38
+ */
39
+ const ButtonActionProvider = ({ DefaultButton, CompletedButton, LoadingButton, ErrorButton, SuccessButton, actionHook, isAlreadyCompleted = false, completedCallback = null, errorCallback = null, actionConfirmationMessage = null }) => {
40
+ const [isProcessing, setIsProcessing] = useState(false)
41
+ const [isCompleted, setIsCompleted] = useState(isAlreadyCompleted)
42
+ const [error, setError] = useState(null)
43
+
44
+ useEffect(() => {
45
+ if (isCompleted && completedCallback && !isAlreadyCompleted) {
46
+ // We fire off an optional completed callback, if the component didn't start in the completed state.
47
+ completedCallback(isCompleted)
48
+ }
49
+ }, [isCompleted])
50
+
51
+ useEffect(() => {
52
+ if (error && errorCallback) {
53
+ // We fire off an optional error callback, with the error data set below
54
+ errorCallback(error)
55
+ }
56
+ }, [error])
57
+
58
+ useEffect(() => {
59
+ // If our parent component resets our completed status prop, we update our local state to reflect this:
60
+ setIsCompleted(isAlreadyCompleted)
61
+ }, [isAlreadyCompleted])
62
+
63
+ // Check if this action has been completed:
64
+ if (isCompleted) {
65
+ return CompletedButton
66
+ }
67
+
68
+ // Check if we're currently performing the action:
69
+ if (isProcessing) {
70
+ // As soon as this "Processing" component renders we expect the ajax action to start running.
71
+ // We provide a "completeCallback" that this "Processing" component can call once it's done it's thing.
72
+ return (
73
+ <ActionPerformer
74
+ actionHook={actionHook}
75
+ LoadingButton={LoadingButton}
76
+ ErrorButton={ErrorButton}
77
+ SuccessButton={SuccessButton}
78
+ errorCallback={(data) => {
79
+ // If our action returns an error, we swap back to our default state so the user can try again
80
+ setTimeout(() => { setIsProcessing(false) }, 500)
81
+ setError(data)
82
+ }}
83
+ completeCallback={(data) => {
84
+ setIsProcessing(false)
85
+ setIsCompleted(data)
86
+ }}
87
+ />
88
+ )
89
+ }
90
+
91
+ // Default state is not processing/completed, so we show a default button
92
+ return React.cloneElement(DefaultButton, {
93
+ onClick: (event) => {
94
+ if (actionConfirmationMessage) {
95
+ if (!confirm(actionConfirmationMessage)) {
96
+ // user has denied the confirmation dialog, prevent calling our processing action.
97
+ event.preventDefault()
98
+ return false
99
+ }
100
+ }
101
+ setIsProcessing(true)
102
+ }
103
+ })
104
+ }
105
+
106
+ export default ButtonActionProvider
src/js/react/components/Banners/MissingRequirements.jsx ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useEffect, useState } from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import styles from './MissingRequirements.module.scss'
4
+ import ModalWrapper from '../Modal/ModalWrapper'
5
+ import installRequirement from '../../api/installRequirement'
6
+ import MainHeading from '../Titles/MainHeading'
7
+ import Button from '../Buttons/Button'
8
+
9
+ const InstallRequirementInBackground = ({ requirement, completeCallback }) => {
10
+ const { loading, data, error } = installRequirement(requirement)
11
+
12
+ useEffect(() => {
13
+ if (!loading) {
14
+ // If we have finished loading (i.e. installing the requirement)
15
+ // we call our completeCallback but we don't care if we errored on this one
16
+ // just continue onto the next.
17
+ completeCallback(error)
18
+ }
19
+ }, [loading])
20
+
21
+ return (
22
+ <>
23
+ {loading ? 'Installing..' : null}
24
+ {error ? (
25
+ <>
26
+ {data && data.error ? (
27
+ <>
28
+ {data.error.data && data.error.data.url
29
+ ? <a href={data.error.data.url} target='_blank' rel='noopener noreferrer'>{data.error.message}</a> : data.error.message}
30
+ </>
31
+ ) : 'Error'}
32
+ </>
33
+ ) : null}
34
+ {!loading && !error ? 'Success!' : null}
35
+ </>
36
+ )
37
+ }
38
+
39
+ const MissingRequirements = ({ plugins, settings, completeCallback }) => {
40
+ const [openRequirementsModal, setOpenRequirementsModal] = useState(false)
41
+ const [installingIndex, setInstallingIndex] = useState(null)
42
+
43
+ const installNextRequirement = () => {
44
+ setInstallingIndex(oldStep => oldStep + 1)
45
+ }
46
+
47
+ const missingRequirements = []
48
+ /**
49
+ plugins is an array of objects that looks like this:
50
+
51
+ plugins = [
52
+ {
53
+ author: "Elementor.com"
54
+ file: "elementor/elementor.php"
55
+ name: "Elementor"
56
+ slug: "elementor"
57
+ status: "activated"
58
+ url: ""
59
+ version: "2.9.6"
60
+ }
61
+ ]
62
+ */
63
+ plugins.forEach(plugin => {
64
+ if (plugin.status !== 'activated') {
65
+ missingRequirements.push({
66
+ plugin
67
+ })
68
+ }
69
+ })
70
+
71
+ /**
72
+ settings is an array of objects that looks like this:
73
+
74
+ settings = [
75
+ {
76
+ name: "Elementor default color schemes"
77
+ setting_name: "elementor_disable_color_schemes"
78
+ }
79
+ ]
80
+ */
81
+ settings.forEach(setting => {
82
+ missingRequirements.push({
83
+ setting
84
+ })
85
+ })
86
+
87
+ const missingCount = missingRequirements.length
88
+
89
+ // If we don't have any missing requirements then we can skip rendering anything for this banner
90
+ if (missingCount === 0) {
91
+ return null
92
+ }
93
+
94
+ // We have some missing requirements, display a banner with a button that opens a modal:
95
+ return (
96
+ <>
97
+ {openRequirementsModal ? (
98
+ <ModalWrapper isOpen onCloseCallback={completeCallback}>
99
+ <div>
100
+ <MainHeading title='Missing Requirements' />
101
+ <p className={styles.notice}>Please install and activate these missing requirements for this Template Kit to work correctly.</p>
102
+ <ul className={styles.requirements}>
103
+ {missingRequirements.map((requirement, index) => {
104
+ return (
105
+ <li key={`requirement${index}`} className={styles.requirement}>
106
+ <div className={styles.icon}>
107
+ {installingIndex > index ? <span className='dashicons dashicons-yes-alt' /> : <span className='dashicons dashicons-marker' />}
108
+ </div>
109
+ <div className={styles.text}>
110
+ {requirement.theme ? `Theme: ${requirement.theme.name}` : null}
111
+ {requirement.plugin ? `Plugin: ${requirement.plugin.name}` : null}
112
+ {requirement.setting ? `Setting: ${requirement.setting.name}` : null}
113
+ </div>
114
+ <div className={styles.status}>
115
+ {installingIndex === index || installingIndex > index ? (
116
+ <InstallRequirementInBackground key={`installRequirement${index}`} requirement={requirement} completeCallback={installNextRequirement} />
117
+ ) : null}
118
+ </div>
119
+ </li>
120
+ )
121
+ })}
122
+ </ul>
123
+ <div className={styles.footer}>
124
+ {installingIndex === null ? (
125
+ <Button
126
+ type='primary' icon='plus' label='Install Requirements' onClick={() => {
127
+ setInstallingIndex(0)
128
+ }}
129
+ />
130
+ ) : (
131
+ <>
132
+ {installingIndex >= missingCount ? (
133
+ <>
134
+ <p className={styles.notice}>Once the above is completed you can close this window.</p>
135
+ <Button
136
+ type='primary' icon='plus' label='Close' onClick={completeCallback}
137
+ />
138
+ </>
139
+ ) : (
140
+ <p className={styles.notice}>
141
+ Installing...
142
+ </p>
143
+ )}
144
+ </>
145
+ )}
146
+ </div>
147
+ </div>
148
+ </ModalWrapper>
149
+ ) : null}
150
+ <div className={styles.wrapper}>
151
+ <div className={styles.textWrapper}>
152
+ <strong>Attention!</strong> There are {missingCount} requirements that need installing for this Template Kit to work correctly.
153
+ </div>
154
+ <div className={styles.buttonWrapper}>
155
+ <Button type='attention' label='Install Requirements' icon='info' onClick={() => { setOpenRequirementsModal(true) }} />
156
+ </div>
157
+ </div>
158
+ </>
159
+ )
160
+ }
161
+
162
+ MissingRequirements.propTypes = {
163
+ plugins: PropTypes.arrayOf(PropTypes.shape(
164
+ {
165
+ author: PropTypes.string,
166
+ file: PropTypes.string,
167
+ name: PropTypes.string,
168
+ slug: PropTypes.string,
169
+ status: PropTypes.string,
170
+ url: PropTypes.string,
171
+ version: PropTypes.string
172
+ }
173
+ )),
174
+ settings: PropTypes.arrayOf(PropTypes.shape({
175
+ name: PropTypes.string,
176
+ setting_name: PropTypes.string
177
+ })),
178
+ completeCallback: PropTypes.func.isRequired
179
+ }
180
+
181
+ MissingRequirements.defaultProps = {
182
+ plugins: [],
183
+ settings: []
184
+ }
185
+
186
+ export default MissingRequirements
src/js/react/components/Banners/MissingRequirements.module.scss ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .wrapper {
4
+ align-items: center;
5
+ background: #ffecdb;
6
+ box-shadow: 0 1px 0 rgba(239, 133, 57, 0.4);
7
+ color: #ef8539;
8
+ padding: 15px 20px;
9
+ margin: -20px -20px 20px;
10
+ display: flex;
11
+ justify-content: space-between;
12
+ }
13
+
14
+ .notice {
15
+ @include copy;
16
+ }
17
+
18
+ .requirements {
19
+ margin: 0 0 $gridSpacingNormal;
20
+ }
21
+
22
+ .requirement {
23
+ display: flex;
24
+ align-items: center;
25
+ }
26
+
27
+ .icon {
28
+ color: $colorGreen;
29
+ margin-right: 10px;
30
+ }
31
+
32
+ .text {
33
+ margin-right: 10px;
34
+ }
35
+
36
+ .status {
37
+ font-style: italic;
38
+ }
src/js/react/components/Buttons/Button.jsx ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import ButtonIconAndLabel from './ButtonIconAndLabel'
4
+ import ButtonElement from './ButtonElement'
5
+
6
+ const Button = ({ type, label, icon, onClick, disabled, dataTestId }) => {
7
+ return (
8
+ <ButtonElement element='button' type={type} onClick={onClick} disabled={disabled} dataTestId={dataTestId}>
9
+ <ButtonIconAndLabel label={label} icon={icon} />
10
+ </ButtonElement>
11
+ )
12
+ }
13
+
14
+ Button.propTypes = {
15
+ type: PropTypes.string,
16
+ label: PropTypes.string,
17
+ icon: PropTypes.string,
18
+ onClick: PropTypes.func,
19
+ disabled: PropTypes.bool,
20
+ dataTestId: PropTypes.string
21
+ }
22
+
23
+ Button.defaultProps = {
24
+ type: 'ghost',
25
+ label: null,
26
+ icon: null,
27
+ onClick: null,
28
+ disabled: false,
29
+ dataTestId: null
30
+ }
31
+
32
+ export default Button
src/js/react/components/Buttons/ButtonElement.jsx ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import { Link } from 'react-router-dom'
4
+ import styles from './ButtonElement.module.scss'
5
+
6
+ const ButtonElement = ({ type, dataTestId, element, children, ...additionalProps }) => {
7
+ if (element === 'button') {
8
+ return (
9
+ <button className={styles[type]} data-testid={dataTestId} {...additionalProps}>
10
+ {children}
11
+ </button>
12
+ )
13
+ }
14
+
15
+ if (element === 'Link') {
16
+ return (
17
+ <Link className={styles[type]} data-testid={dataTestId} {...additionalProps}>
18
+ {children}
19
+ </Link>
20
+ )
21
+ }
22
+
23
+ if (element === 'a') {
24
+ return (
25
+ <a className={styles[type]} data-testid={dataTestId} {...additionalProps}>
26
+ {children}
27
+ </a>
28
+ )
29
+ }
30
+
31
+ if (element === 'label') {
32
+ return (
33
+ <label className={styles[type]} data-testid={dataTestId} {...additionalProps}>
34
+ {children}
35
+ </label>
36
+ )
37
+ }
38
+ }
39
+
40
+ ButtonElement.propTypes = {
41
+ type: PropTypes.oneOf(['ghost', 'primary', 'secondary', 'warning', 'attention']),
42
+ dataTestId: PropTypes.string,
43
+ element: PropTypes.oneOf(['button', 'a', 'Link', 'label']).isRequired,
44
+ children: PropTypes.node
45
+ }
46
+
47
+ ButtonElement.defaultProps = {
48
+ type: 'ghost',
49
+ dataTestId: null,
50
+ children: null
51
+ }
52
+
53
+ export default ButtonElement
src/js/react/components/Buttons/ButtonElement.module.scss ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .button {
4
+ border-radius: 4px;
5
+ padding: 0 12px;
6
+ min-height: $buttonAndInputHeight;
7
+ font-size: 12px;
8
+ line-height: 20px;
9
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
10
+ font-weight: 400;
11
+ text-decoration: none;
12
+ cursor: pointer;
13
+ display: inline-flex;
14
+ align-items: center;
15
+ white-space: nowrap;
16
+
17
+ &[disabled] {
18
+ cursor: not-allowed;
19
+ }
20
+
21
+ @media screen and (min-width: 1280px) {
22
+ font-size: 14px;
23
+ padding: 0 16px;
24
+ }
25
+ }
26
+
27
+ .ghost {
28
+ @extend .button;
29
+ background: #fff;
30
+ border: 1px solid #81b441;
31
+ color: #81b441;
32
+
33
+ &:active,
34
+ &:focus,
35
+ &:hover {
36
+ background: #639623;
37
+ border-color: #639623;
38
+ color: #fff;
39
+ }
40
+ }
41
+
42
+ .primary {
43
+ @extend .button;
44
+ background: #81b441;
45
+ border: 1px solid #81b441;
46
+ color: #fff;
47
+
48
+ &:active,
49
+ &:focus,
50
+ &:hover {
51
+ background: #639623;
52
+ border-color: #639623;
53
+ color: #fff;
54
+ }
55
+ }
56
+
57
+ .secondary {
58
+ @extend .button;
59
+ background: #fff;
60
+ border: 1px solid #979797;
61
+ color: #979797;
62
+
63
+ &:active,
64
+ &:focus,
65
+ &:hover {
66
+ border-color: #23282d;
67
+ color: #23282d;
68
+ }
69
+ }
70
+
71
+ .warning {
72
+ @extend .button;
73
+ background: #fff;
74
+ border: 1px solid #ef3962;
75
+ color: #ef3962;
76
+
77
+ &:active,
78
+ &:focus,
79
+ &:hover {
80
+ background: #ef3962;
81
+ color: #fff;
82
+ }
83
+ }
84
+
85
+ .attention {
86
+ @extend .button;
87
+ background: #fff;
88
+ border: 1px solid #ef8539;
89
+ color: #ef8539;
90
+
91
+ &:active,
92
+ &:focus,
93
+ &:hover {
94
+ background: #ef8539;
95
+ color: #fff;
96
+ }
97
+ }
src/js/react/components/Buttons/ButtonIconAndLabel.jsx ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import styles from './ButtonIconAndLabel.module.scss'
4
+
5
+ const ButtonIconAndLabel = ({ label, icon }) => {
6
+ const iconClasses = ['dashicons', iconToDashIconMappings[icon], styles.icon]
7
+ if (label) {
8
+ iconClasses.push(styles.iconWithLabel)
9
+ }
10
+
11
+ return (
12
+ <>
13
+ {icon ? <span className={iconClasses.join(' ')} /> : null}
14
+ {label}
15
+ </>
16
+ )
17
+ }
18
+
19
+ const iconToDashIconMappings = {
20
+ arrow: 'dashicons-arrow-right-alt2',
21
+ tick: 'dashicons-yes',
22
+ info: 'dashicons-info',
23
+ eye: 'dashicons-visibility',
24
+ cross: 'dashicons-dismiss',
25
+ update: 'dashicons-update',
26
+ updateSpinning: `dashicons-update ${styles.iconSpinning}`,
27
+ link: 'dashicons-external',
28
+ plus: 'dashicons-plus-alt',
29
+ trash: 'dashicons-trash',
30
+ download: 'dashicons-download',
31
+ expand: 'dashicons-editor-expand'
32
+ }
33
+
34
+ ButtonIconAndLabel.propTypes = {
35
+ label: PropTypes.string,
36
+ icon: PropTypes.oneOf(Object.keys(iconToDashIconMappings))
37
+ }
38
+
39
+ ButtonIconAndLabel.defaultProps = {
40
+ label: null,
41
+ icon: null
42
+ }
43
+
44
+ export default ButtonIconAndLabel
src/js/react/components/Buttons/ButtonIconAndLabel.module.scss ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .icon {
2
+ font-size: 16px;
3
+ height: 16px;
4
+ transition: none;
5
+ }
6
+
7
+ .iconWithLabel {
8
+ margin-right: 4px;
9
+ }
10
+
11
+ @keyframes iconSpin {
12
+ 100% {
13
+ transform: rotate(360deg);
14
+ }
15
+ }
16
+
17
+ .iconSpinning {
18
+ animation: iconSpin 4s linear infinite;
19
+ }
src/js/react/components/Buttons/ButtonWrapper.jsx ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import styles from './ButtonWrapper.module.scss'
3
+
4
+ const ButtonWrapper = ({ children }) => (
5
+ <div className={styles.wrapper}>
6
+ {children}
7
+ </div>
8
+ )
9
+
10
+ export default ButtonWrapper
src/js/react/components/Buttons/ButtonWrapper.module.scss ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ .wrapper {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+
5
+ > * {
6
+ margin: 0 10px 5px 0;
7
+ }
8
+ }
src/js/react/components/Buttons/Buttons.stories.jsx ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import { MemoryRouter as Router } from 'react-router'
3
+ import Button from './Button'
4
+ import InternalLinkButton from './InternalLinkButton'
5
+ import ExternalLinkButton from './ExternalLinkButton'
6
+ import ButtonElement from './ButtonElement'
7
+ import ButtonIconAndLabel from './ButtonIconAndLabel'
8
+ import ExternalLink from './ExternalLink'
9
+ import InternalLink from './InternalLink'
10
+
11
+ export default { title: 'buttons' }
12
+
13
+ export const primaryButton = () => {
14
+ return (
15
+ <Button type='primary' label='Primary' icon='arrow' />
16
+ )
17
+ }
18
+
19
+ export const ghostyButton = () => {
20
+ return (
21
+ <Button type='ghost' label='Ghost' icon='eye' />
22
+ )
23
+ }
24
+
25
+ export const secondaryButton = () => {
26
+ return (
27
+ <Button type='secondary' label='Secondary' icon='tick' />
28
+ )
29
+ }
30
+
31
+ export const warningButton = () => {
32
+ return (
33
+ <Button type='warning' label='Warning' icon='cross' />
34
+ )
35
+ }
36
+
37
+ export const attentionButton = () => {
38
+ return (
39
+ <Button type='attention' label='Attention' icon='info' />
40
+ )
41
+ }
42
+
43
+ export const disabledButton = () => {
44
+ return (
45
+ <Button disabled label="Oh no you can't click me!" icon='cross' />
46
+ )
47
+ }
48
+
49
+ export const ghostyButtonWithLabelOnly = () => {
50
+ return (
51
+ <Button type='ghost' label='I have no icon' />
52
+ )
53
+ }
54
+
55
+ export const ghostyButtonWithIconOnly = () => {
56
+ return (
57
+ <Button type='ghost' icon='eye' />
58
+ )
59
+ }
60
+
61
+ export const internalLinkButton = () => {
62
+ return (
63
+ <Router>
64
+ <InternalLinkButton href='/some/page' type='secondary' label='Check it out' icon='plus' />
65
+ </Router>
66
+ )
67
+ }
68
+
69
+ export const externalLinkButton = () => {
70
+ return (
71
+ <ExternalLinkButton href='https://mixkit.co/' type='ghost' label='Very cool website' icon='link' openNewWindow />
72
+ )
73
+ }
74
+
75
+ export const buttonIconAndLabel = () => {
76
+ return (
77
+ <ButtonIconAndLabel icon='trash' label='Garbage' />
78
+ )
79
+ }
80
+
81
+ export const buttonElement = () => {
82
+ return (
83
+ <ButtonElement element='button' type='warning' onClick={() => { alert('ow!') }}>
84
+ Stuff goes here
85
+ </ButtonElement>
86
+ )
87
+ }
88
+
89
+ export const externalLink = () => {
90
+ return (
91
+ <Router>
92
+ <ExternalLink text='Open Demo' href='https://envato.com' />
93
+ </Router>
94
+ )
95
+ }
96
+
97
+ export const internalLink = () => {
98
+ return (
99
+ <Router>
100
+ <InternalLink text='View Item' href='/' />
101
+ </Router>
102
+ )
103
+ }
src/js/react/components/Buttons/Dashicons.stories.jsx ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+
3
+ export default { title: 'dashicons' }
4
+
5
+ export const testIcons = () => {
6
+ const icons = [
7
+ 'admin-links',
8
+ 'arrow-right-alt2',
9
+ 'yes',
10
+ 'info',
11
+ 'visibility',
12
+ 'dismiss',
13
+ 'update',
14
+ 'external',
15
+ 'plus-alt',
16
+ 'trash',
17
+ 'download',
18
+ 'editor-expand'
19
+
20
+ ]
21
+ return (
22
+ <>
23
+ {icons.map(icon => <div key={icon}>{icon}: <span className={`dashicons dashicons-${icon}`} /></div>)}
24
+ </>
25
+ )
26
+ }
src/js/react/components/Buttons/DeleteTemplateKit.jsx ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import deleteTemplateKit from '../../api/deleteTemplateKit'
3
+ import ButtonActionProvider from '../Actions/ButtonActionProvider'
4
+ import Button from './Button'
5
+
6
+ /**
7
+ * Helper to render a series of buttons to delete a template kit.
8
+ *
9
+ * @param templateKitId
10
+ * @param customActionHook
11
+ * @param completeCallback
12
+ * @param errorCallback
13
+ * @returns {*}
14
+ * @constructor
15
+ */
16
+ const DeleteTemplateKit = ({ templateKitId, customActionHook = null, completeCallback = null, errorCallback = null }) => {
17
+ return (
18
+ <ButtonActionProvider
19
+ DefaultButton={<Button type='warning' label='' icon='trash' />}
20
+ actionConfirmationMessage='Really delete this Template Kit?'
21
+ LoadingButton={<Button type='warning' label='' icon='trash' disabled />}
22
+ ErrorButton={<Button type='warning' label='' icon='trash' disabled />}
23
+ SuccessButton={<Button type='warning' label='' icon='trash' disabled />}
24
+ CompletedButton={<Button type='warning' label='' icon='trash' />}
25
+ actionHook={() => customActionHook ? customActionHook() : deleteTemplateKit({ templateKitId })}
26
+ isAlreadyCompleted={false}
27
+ completedCallback={() => {
28
+ if (completeCallback) {
29
+ completeCallback()
30
+ }
31
+ }}
32
+ errorCallback={errorCallback}
33
+ />
34
+ )
35
+ }
36
+
37
+ export default DeleteTemplateKit
src/js/react/components/Buttons/DismissBanner.jsx ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import dismissBanner from '../../api/dismissBanner'
3
+ import ButtonActionProvider from '../Actions/ButtonActionProvider'
4
+ import useGlobalConfig from '../Contexts/useGlobalConfig'
5
+ import styles from './DismissBanner.module.scss'
6
+
7
+ /**
8
+ * Figure out if a banner was already dismissed by the user.
9
+ *
10
+ * @param bannerId
11
+ * @returns {*}
12
+ */
13
+ export const isBannerAlreadyDismissed = (bannerId) => {
14
+ const { isBannerDismissed } = useGlobalConfig()
15
+ return isBannerDismissed(bannerId)
16
+ }
17
+
18
+ /**
19
+ * Render a close banner button
20
+ *
21
+ * @param bannerId
22
+ * @param completeCallback
23
+ * @returns {*}
24
+ * @constructor
25
+ */
26
+ const DismissBannerButton = ({ bannerId, completeCallback }) => {
27
+ const CloseButton = <button data-testid='modal-close-button'><span className={`dashicons dashicons-no-alt ${styles.dismissButton}`} /></button>
28
+ const { bannerHasBeenDismissed } = useGlobalConfig()
29
+
30
+ return (
31
+ <ButtonActionProvider
32
+ DefaultButton={CloseButton}
33
+ LoadingButton={CloseButton}
34
+ ErrorButton={CloseButton}
35
+ SuccessButton={CloseButton}
36
+ CompletedButton={CloseButton}
37
+ actionHook={() => dismissBanner({ bannerId })}
38
+ isAlreadyCompleted={false}
39
+ completedCallback={() => {
40
+ bannerHasBeenDismissed(bannerId)
41
+ if (completeCallback) {
42
+ completeCallback()
43
+ }
44
+ }}
45
+ />
46
+ )
47
+ }
48
+
49
+ export default DismissBannerButton
src/js/react/components/Buttons/DismissBanner.module.scss ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .dismissButton {
4
+ @include dismiss;
5
+ }
src/js/react/components/Buttons/ExternalLink.jsx ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+
3
+ const ExternalLink = ({ href, text = 'Link' }) => (
4
+ <a href={href} target='_blank' rel='noopener noreferrer'>{text}</a>
5
+ )
6
+
7
+ export default ExternalLink
src/js/react/components/Buttons/ExternalLinkButton.jsx ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import ButtonElement from './ButtonElement'
4
+ import ButtonIconAndLabel from './ButtonIconAndLabel'
5
+
6
+ const ExternalLinkButton = ({ type, label, icon, href, openNewWindow, ...additionalProps }) => {
7
+ const openNewWindowProps = openNewWindow ? { target: '_blank', rel: 'noopener noreferrer' } : null
8
+
9
+ return (
10
+ <ButtonElement href={href} type={type} element='a' {...openNewWindowProps} {...additionalProps}>
11
+ <ButtonIconAndLabel label={label} icon={icon} />
12
+ </ButtonElement>
13
+ )
14
+ }
15
+
16
+ ExternalLinkButton.propTypes = {
17
+ type: PropTypes.string,
18
+ label: PropTypes.string,
19
+ icon: PropTypes.string,
20
+ href: PropTypes.string.isRequired
21
+ }
22
+
23
+ ExternalLinkButton.defaultProps = {
24
+ type: 'ghost',
25
+ label: null,
26
+ icon: null
27
+ }
28
+
29
+ export default ExternalLinkButton
src/js/react/components/Buttons/ImportSingleTemplate.jsx ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from 'react'
2
+ import importSingleTemplate from '../../api/importSingleTemplate'
3
+ import ButtonActionProvider from '../Actions/ButtonActionProvider'
4
+ import { getImportedTemplateUrl } from '../../utils/linkGenerator'
5
+ import Button from '../Buttons/Button'
6
+ import ExternalLinkButton from '../Buttons/ExternalLinkButton'
7
+
8
+ /**
9
+ *
10
+ * @param templateKitId
11
+ * @param templateId
12
+ * @param existingImports
13
+ * @param customActionHook
14
+ * @param completeCallback
15
+ * @param errorCallback
16
+ * @returns {*}
17
+ * @constructor
18
+ */
19
+ const ImportSingleTemplate = ({ templateKitId, templateId, existingImports, customActionHook = null, completeCallback = null, errorCallback = null }) => {
20
+ // Here we store the ID number of the latest imported template.
21
+ // We use this ID further down to generate a URL to the installed template and show that in a button to the user
22
+ const [importedTemplateId, setImportedTemplateId] = useState(existingImports.length ? existingImports[0].imported_template_id : null)
23
+
24
+ return (
25
+ <ButtonActionProvider
26
+ DefaultButton={<Button type='primary' label='Import Template' icon='plus' />}
27
+ LoadingButton={<Button type='primary' label='Importing' icon='updateSpinning' disabled />}
28
+ ErrorButton={<Button type='warning' label='Error' icon='cross' disabled />}
29
+ SuccessButton={<Button type='primary' label='Success!' icon='tick' disabled />}
30
+ CompletedButton={<ExternalLinkButton href={getImportedTemplateUrl({ importedTemplateId })} type='primary' label='View Template' icon='eye' openNewWindow />}
31
+ actionHook={() => customActionHook ? customActionHook() : importSingleTemplate({ templateKitId, templateId })}
32
+ isAlreadyCompleted={existingImports.length}
33
+ completedCallback={(data) => {
34
+ if (data && data.imported_template_id) {
35
+ setImportedTemplateId(data.imported_template_id)
36
+ if (completeCallback) {
37
+ completeCallback(data)
38
+ }
39
+ }
40
+ }}
41
+ errorCallback={errorCallback}
42
+ />
43
+ )
44
+ }
45
+
46
+ export default ImportSingleTemplate
src/js/react/components/Buttons/ImportSingleTemplate.stories.jsx ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from 'react'
2
+ import { MemoryRouter as Router } from 'react-router'
3
+ import ImportSingleTemplate from './ImportSingleTemplate'
4
+
5
+ export default { title: 'import/Template' }
6
+
7
+ const SuccessfulImportHooked = () => {
8
+ const [errorMessage, setErrorMessage] = useState(null)
9
+ const defaultLoadingState = {
10
+ loading: true,
11
+ data: null,
12
+ error: null
13
+ }
14
+ const successErrorState = {
15
+ loading: false,
16
+ data: null,
17
+ error: false
18
+ }
19
+ const [fakeApiHookState, setFakeApiHookState] = useState(defaultLoadingState)
20
+ return (
21
+ <Router>
22
+ <ImportSingleTemplate
23
+ templateKitId={1} templateId={1} existingImports={[]} customActionHook={() => {
24
+ // After a little while we change to a success state:
25
+ setTimeout(() => { setFakeApiHookState(successErrorState) }, 500)
26
+ // Then reset back to a default state:
27
+ setTimeout(() => { setFakeApiHookState(defaultLoadingState) }, 1000)
28
+ return fakeApiHookState
29
+ }}
30
+ errorCallback={(data) => { setErrorMessage(data.error) }}
31
+ />
32
+ <div>
33
+ {errorMessage}
34
+ </div>
35
+ </Router>
36
+ )
37
+ }
38
+
39
+ export const successfulImport = () => <SuccessfulImportHooked />
40
+
41
+ const ImportWithErrorHooked = () => {
42
+ const [errorMessage, setErrorMessage] = useState(null)
43
+ const defaultLoadingState = {
44
+ loading: true,
45
+ data: null,
46
+ error: null
47
+ }
48
+ const errorLoadingState = {
49
+ loading: false,
50
+ data: {
51
+ error: 'Failed to find template with ID of 1'
52
+ },
53
+ error: true
54
+ }
55
+ const [fakeApiHookState, setFakeApiHookState] = useState(defaultLoadingState)
56
+ return (
57
+ <Router>
58
+ <ImportSingleTemplate
59
+ templateKitId={1} templateId={1} existingImports={[]} customActionHook={() => {
60
+ // After a little while we change to an error state:
61
+ setTimeout(() => { setFakeApiHookState(errorLoadingState) }, 500)
62
+ // Then reset back to a default state:
63
+ setTimeout(() => { setFakeApiHookState(defaultLoadingState) }, 1000)
64
+ return fakeApiHookState
65
+ }}
66
+ errorCallback={(data) => { setErrorMessage(data.error) }}
67
+ />
68
+ <div>
69
+ {errorMessage}
70
+ </div>
71
+ </Router>
72
+ )
73
+ }
74
+
75
+ export const failsWithError = () => <ImportWithErrorHooked />
76
+
77
+ export const alreadyImported = () => {
78
+ return (
79
+ <Router>
80
+ <ImportSingleTemplate
81
+ templateKitId={1} templateId={1} existingImports={[
82
+ {
83
+ imported_template_id: 123
84
+ }
85
+ ]}
86
+ />
87
+ </Router>
88
+ )
89
+ }
src/js/react/components/Buttons/InsertTemplateToPage.jsx ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import importSingleTemplate from '../../api/importSingleTemplate'
3
+ import ButtonActionProvider from '../Actions/ButtonActionProvider'
4
+ import Button from '../Buttons/Button'
5
+
6
+ /**
7
+ *
8
+ * @param templateKitId
9
+ * @param templateId
10
+ * @param existingImports
11
+ * @param customActionHook
12
+ * @param completeCallback
13
+ * @param errorCallback
14
+ * @returns {*}
15
+ * @constructor
16
+ */
17
+ const InsertTemplateToPage = ({ templateKitId, templateId, existingImports, customActionHook = null, completeCallback = null, errorCallback = null }) => {
18
+ const InsertingButton = <Button type='primary' label='Inserting...' icon='updateSpinning' disabled />
19
+ return (
20
+ <ButtonActionProvider
21
+ DefaultButton={<Button type='primary' label='Insert Template' icon='plus' />}
22
+ LoadingButton={InsertingButton}
23
+ ErrorButton={<Button type='warning' label='Error' icon='cross' disabled />}
24
+ SuccessButton={InsertingButton}
25
+ CompletedButton={InsertingButton}
26
+ actionHook={() => customActionHook ? customActionHook() : importSingleTemplate({ templateKitId, templateId, insertToPage: true })}
27
+ isAlreadyCompleted={false}
28
+ completedCallback={(data) => {
29
+ if (data && data.imported_template_id) {
30
+ if (completeCallback) {
31
+ completeCallback(data)
32
+ }
33
+ }
34
+ }}
35
+ errorCallback={errorCallback}
36
+ />
37
+ )
38
+ }
39
+
40
+ export default InsertTemplateToPage
src/js/react/components/Buttons/InstallFreeTemplateKitButton.jsx ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import installFreeTemplateKit from '../../api/installFreeTemplateKit'
3
+ import Button from './Button'
4
+ import InternalLinkButton from './InternalLinkButton'
5
+ import ButtonActionProvider from '../Actions/ButtonActionProvider'
6
+ import { getImportedKitUrl } from '../../utils/linkGenerator'
7
+ import useGlobalConfig from '../Contexts/useGlobalConfig'
8
+
9
+ /**
10
+ * Helper to render a series of buttons to install a template kit.
11
+ *
12
+ * @param templateKitId
13
+ * @param importedTemplateKitId
14
+ * @param customActionHook
15
+ * @param completeCallback
16
+ * @param errorCallback
17
+ * @returns {*}
18
+ * @constructor
19
+ */
20
+ const InstallFreeTemplateKitButton = ({ zipUrl, templateKitId, importedTemplateKitId, customActionHook = null, completeCallback = null, errorCallback = null }) => {
21
+ const { addDownloadedItem } = useGlobalConfig()
22
+ return (
23
+ <ButtonActionProvider
24
+ DefaultButton={<Button type='primary' label='Install Kit' icon='plus' />}
25
+ LoadingButton={<Button type='primary' label='Installing' icon='updateSpinning' disabled />}
26
+ ErrorButton={<Button type='warning' label='Error' icon='cross' disabled />}
27
+ SuccessButton={<Button type='primary' label='Success!' icon='plus' disabled />}
28
+ CompletedButton={<InternalLinkButton type='primary' label='View Kit' icon='eye' href={getImportedKitUrl({ importedTemplateKitId })} />}
29
+ actionHook={() => customActionHook ? customActionHook() : installFreeTemplateKit({ zipUrl, templateKitId })}
30
+ isAlreadyCompleted={!!importedTemplateKitId}
31
+ completedCallback={(data) => {
32
+ if (data && data.success && data.template_kit_id) {
33
+ addDownloadedItem({ humaneId: templateKitId, importedId: data.template_kit_id })
34
+ }
35
+ if (completeCallback) {
36
+ completeCallback(data)
37
+ }
38
+ }}
39
+ errorCallback={errorCallback}
40
+ />
41
+ )
42
+ }
43
+
44
+ export default InstallFreeTemplateKitButton
src/js/react/components/Buttons/InternalLink.jsx ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import { Link } from 'react-router-dom'
3
+
4
+ const InternalLink = ({ href, text = 'Link' }) => (
5
+ <Link to={href}>{text}</Link>
6
+ )
7
+
8
+ export default InternalLink
src/js/react/components/Buttons/InternalLinkButton.jsx ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import ButtonIconAndLabel from './ButtonIconAndLabel'
4
+ import ButtonElement from './ButtonElement'
5
+
6
+ const InternalLinkButton = ({ type, label, icon, href }) => {
7
+ return (
8
+ <ButtonElement element='Link' to={href} type={type}>
9
+ <ButtonIconAndLabel label={label} icon={icon} />
10
+ </ButtonElement>
11
+ )
12
+ }
13
+
14
+ InternalLinkButton.propTypes = {
15
+ type: PropTypes.string,
16
+ label: PropTypes.string,
17
+ icon: PropTypes.string,
18
+ href: PropTypes.string.isRequired
19
+ }
20
+
21
+ InternalLinkButton.defaultProps = {
22
+ type: 'ghost',
23
+ label: null,
24
+ icon: null
25
+ }
26
+
27
+ export default InternalLinkButton
src/js/react/components/Buttons/UploadTemplateKitButton.jsx ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from 'react'
2
+ import styles from './UploadTemplateKitButton.module.scss'
3
+ import uploadTemplateKitZipFile from '../../api/uploadTemplateKitZipFile'
4
+ import { useHistory } from 'react-router-dom'
5
+ import ButtonIconAndLabel from './ButtonIconAndLabel'
6
+ import ButtonElement from './ButtonElement'
7
+ import { getImportedKitUrl } from '../../utils/linkGenerator'
8
+
9
+ export const DoTheFileUpload = ({ chosenFile }) => {
10
+ const history = useHistory()
11
+ const { loading, data, error } = uploadTemplateKitZipFile({ file: chosenFile })
12
+
13
+ if (!loading && !error && data && data.templateKitId) {
14
+ history.push(getImportedKitUrl({ importedTemplateKitId: data.templateKitId }))
15
+ }
16
+
17
+ return null
18
+ }
19
+
20
+ const UploadTemplateKitButton = () => {
21
+ const [chosenFile, setChosenFile] = useState(null)
22
+
23
+ return (
24
+ <>
25
+ <ButtonElement element='label' htmlFor='upload-template-kit-zip-file'>
26
+ <ButtonIconAndLabel label={chosenFile ? 'Processing...' : 'Upload Template Kit (Zip File)'} icon='link' />
27
+ <input
28
+ type='file'
29
+ name='upload-template-kit-zip-file'
30
+ id='upload-template-kit-zip-file'
31
+ className={styles.formInput}
32
+ onChange={e => {
33
+ setChosenFile(e.target.files[0])
34
+ }}
35
+ />
36
+ </ButtonElement>
37
+ {chosenFile ? (
38
+ <DoTheFileUpload chosenFile={chosenFile} />
39
+ ) : null}
40
+ </>
41
+ )
42
+ }
43
+
44
+ export default UploadTemplateKitButton
src/js/react/components/Buttons/UploadTemplateKitButton.module.scss ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+
2
+ .formInput {
3
+ // We want to hide the input so it's not visible on the page.
4
+ // Clicking the surrounding label will be enough to trigger selecting this file input.
5
+ display: none;
6
+ }
src/js/react/components/Buttons/WordPressLink.jsx ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+
3
+ /**
4
+ * Link out to a page within WordPress outside of our react app (i.e. to an imported template)
5
+ *
6
+ * @param href
7
+ * @param text
8
+ * @returns {*}
9
+ * @constructor
10
+ */
11
+ const WordPressLink = ({ href, text = 'Link' }) => (
12
+ <a href={href}>{text}</a>
13
+ )
14
+
15
+ export default WordPressLink
src/js/react/components/Card/ImageCarousel.jsx ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import buildElementsImageUrl from '../../utils/buildElementsImageUrl'
3
+ import styles from './ImageCarousel.module.scss'
4
+ import Slider from 'react-slick'
5
+
6
+ import 'slick-carousel/slick/slick.css'
7
+ import 'slick-carousel/slick/slick-theme.css'
8
+
9
+ const NextArrow = ({ onClick }) => (
10
+ <button className={styles.nextArrow} onClick={onClick} type='button' aria-label='Next item'>
11
+ <div className={styles.nextArrowButton}>
12
+ <svg viewBox='0 0 16 31' className={styles.nextArrowIcon}>
13
+ <path d='M.188 27.588l2.232 2.474L15.813 15.22 2.42.375.188 2.849l11.16 12.37-11.16 12.37z' />
14
+ </svg>
15
+ </div>
16
+ </button>
17
+ )
18
+
19
+ const PrevArrow = ({ onClick }) => (
20
+ <button className={styles.prevArrow} onClick={onClick} type='button' aria-label='Previous item'>
21
+ <div className={styles.prevArrowButton}>
22
+ <svg viewBox='0 0 16 31' className={styles.prevArrowIcon}>
23
+ <path d='M15.813 2.849L13.58.375.187 15.219 13.58 30.063l2.232-2.474-11.16-12.37 11.16-12.37z' />
24
+ </svg>
25
+ </div>
26
+ </button>
27
+ )
28
+
29
+ const sliderSettings = {
30
+ dots: false,
31
+ lazyLoad: true,
32
+ infinite: true,
33
+ speed: 500,
34
+ slidesToShow: 1,
35
+ slidesToScroll: 1,
36
+ nextArrow: <NextArrow />,
37
+ prevArrow: <PrevArrow />
38
+ }
39
+
40
+ const ImageCarousel = ({ coverImage = null, imageUrls = [], galleryImages = [] }) => {
41
+ const imageGallery = []
42
+ if (coverImage) {
43
+ imageGallery.push(buildElementsImageUrl({ imageData: coverImage, sizes: ['w632', 'w900'] }))
44
+ }
45
+ if (imageUrls.length) {
46
+ imageGallery.push(...imageUrls)
47
+ }
48
+
49
+ if (galleryImages.length) {
50
+ galleryImages.map(image => {
51
+ imageGallery.push(buildElementsImageUrl({ imageData: image, sizes: ['w632', 'w900'] }))
52
+ })
53
+ }
54
+
55
+ return (
56
+ <>
57
+ <Slider {...sliderSettings}>
58
+ {imageGallery.map((image, index) => (
59
+ <div key={image} className={styles.slide}>
60
+ <img key={image} className={styles.image} src={image} />
61
+ </div>
62
+ ))}
63
+ </Slider>
64
+ </>
65
+ )
66
+ }
67
+
68
+ export default ImageCarousel
src/js/react/components/Card/ImageCarousel.module.scss ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ $prevNextButtonSize: 40px;
4
+
5
+ .slide {
6
+ padding-bottom: $cardResponsiveImagePadding;
7
+ overflow: hidden;
8
+ position: relative;
9
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
10
+ }
11
+
12
+ .image {
13
+ width: 100%;
14
+ position: absolute;
15
+ }
16
+
17
+ .nextArrow,
18
+ .prevArrow {
19
+ position: absolute;
20
+ top: -4px;
21
+ width: 30%;
22
+ height: 100%;
23
+ cursor: pointer;
24
+ border: 0;
25
+ outline: none;
26
+ background: transparent;
27
+ z-index: 1;
28
+ display: flex;
29
+ align-items: center;
30
+ min-width: $prevNextButtonSize;
31
+ padding: 0;
32
+ opacity: 0;
33
+ transition: opacity .5s ease-in-out;
34
+ }
35
+
36
+ .nextArrowButton,
37
+ .prevArrowButton {
38
+ display: none;
39
+ padding: 0;
40
+ margin: 0;
41
+ cursor: pointer;
42
+ border: 0;
43
+ outline: none;
44
+ background: transparent;
45
+ transition: color 0.3s linear, background-color 0.2s linear;
46
+ color: #fff;
47
+ width: $prevNextButtonSize;
48
+ height: $prevNextButtonSize;
49
+ border-radius: 50%;
50
+ }
51
+
52
+ .nextArrowIcon,
53
+ .prevArrowIcon {
54
+ width: 16px;
55
+ height: 31px;
56
+ margin-top: 5px;
57
+ fill: #fff;
58
+ transition: fill 0.3s linear;
59
+ }
60
+
61
+ .nextArrowIcon {
62
+ margin-left: 3px;
63
+ }
64
+
65
+ .prevArrowIcon {
66
+ margin-right: 3px;
67
+ }
68
+
69
+ .nextArrow {
70
+ right: 0;
71
+ justify-content: flex-end;
72
+
73
+ &:hover {
74
+ background: linear-gradient(to left, rgba(0, 0, 0, 0.3) 0%, rgba(189, 191, 192, 0) 100%);
75
+ opacity: 1;
76
+
77
+ .nextArrowButton {
78
+ display: block;
79
+ }
80
+ }
81
+ }
82
+
83
+ .prevArrow {
84
+ left: 0;
85
+ justify-content: flex-start;
86
+
87
+ &:hover {
88
+ background: linear-gradient(to right, rgba(0, 0, 0, 0.3) 0%, rgba(189, 191, 192, 0) 100%);
89
+ opacity: 1;
90
+
91
+ .prevArrowButton {
92
+ display: block;
93
+ }
94
+ }
95
+ }
96
+
97
+ .nextArrowButton {
98
+ margin-right: 10px;
99
+ }
100
+
101
+ .prevArrowButton {
102
+ margin-left: 10px;
103
+ }
src/js/react/components/Card/ItemCard.jsx ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import styles from './ItemCard.module.scss'
3
+
4
+ const ItemCard = ({ Images, Buttons, title, description }) => {
5
+ return (
6
+ <div className={styles.wrapper}>
7
+ <div className={styles.inner}>
8
+ <div className={styles.images}>
9
+ {Images}
10
+ </div>
11
+ <div className={styles.meta}>
12
+ <h4 className={styles.cardTitle}>{title}</h4>
13
+ <p className={styles.cardDescription}>{description}</p>
14
+ {Buttons}
15
+ </div>
16
+ </div>
17
+ </div>
18
+ )
19
+ }
20
+
21
+ export default ItemCard
src/js/react/components/Card/ItemCard.module.scss ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .wrapper {
4
+ border-radius: 4px;
5
+ height: 100%;
6
+ overflow: visible;
7
+ position: relative;
8
+
9
+ &:hover {
10
+ &::before {
11
+ opacity: .15;
12
+ }
13
+ }
14
+
15
+ &::before {
16
+ content: '';
17
+ position: absolute;
18
+ top: 0;
19
+ left: 0;
20
+ bottom: 0;
21
+ right: 0;
22
+ opacity: .07;
23
+ z-index: -1;
24
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 1);
25
+ transition: opacity .2s linear;
26
+ }
27
+ }
28
+
29
+ .inner {
30
+ height: 100%;
31
+ background: #fff;
32
+ background-position: center;
33
+ background-size: cover;
34
+ background-repeat: no-repeat;
35
+ border-radius: 4px;
36
+ display: flex;
37
+ flex-direction: column;
38
+ overflow: hidden;
39
+ }
40
+
41
+ .images {
42
+ position: relative;
43
+ display: block;
44
+ width: 100%;
45
+ }
46
+
47
+ .meta {
48
+ margin-top: auto;
49
+ padding: 13px 20px 10px;
50
+ }
51
+
52
+ .cardTitle {
53
+ color: $textColorDarkest;
54
+ font-size: 18px;
55
+ line-height: 22px;
56
+ margin: 10px 0 2px;
57
+ font-weight: 500;
58
+ overflow: hidden;
59
+ text-overflow: ellipsis;
60
+ white-space: nowrap;
61
+ }
62
+
63
+ .cardDescription {
64
+ @include copy;
65
+ margin: 0 0 13px;
66
+ }
src/js/react/components/Card/KitCard.jsx ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from 'react'
2
+ import { Link, useRouteMatch } from 'react-router-dom'
3
+ import ItemCard from './ItemCard'
4
+ import GridItem from '../Grid/GridItem'
5
+ import DeleteTemplateKit from '../Buttons/DeleteTemplateKit'
6
+ import ViewInstalledKitButton from '../Buttons/InternalLinkButton'
7
+ import ButtonWrapper from '../Buttons/ButtonWrapper'
8
+ import styles from './KitCard.module.scss'
9
+
10
+ const KitCard = ({ item }) => {
11
+ const { url } = useRouteMatch()
12
+ const [kitDeleted, setKitDeleted] = useState(false)
13
+
14
+ if (kitDeleted) {
15
+ return null
16
+ }
17
+
18
+ return (
19
+ <GridItem colWidthPercentage={33} className={styles.itemCard}>
20
+ <ItemCard
21
+ Images={(
22
+ <Link to={`${url}/kit/${item.id}`} className={styles.itemImageLink}>
23
+ <img src={item.screenshot_url} alt={item.title} className={styles.itemImage} />
24
+ </Link>
25
+ )}
26
+ Buttons={(
27
+ <ButtonWrapper>
28
+ <ViewInstalledKitButton type='primary' label='View Installed Kit' icon='plus' href={`${url}/kit/${item.id}`} />
29
+ <div className={styles.itemDelete}>
30
+ <DeleteTemplateKit
31
+ templateKitId={item.id}
32
+ completeCallback={() => {
33
+ setKitDeleted(true)
34
+ }}
35
+ />
36
+ </div>
37
+ </ButtonWrapper>
38
+ )}
39
+ title={item.title}
40
+ description={`Contains ${item.template_count} templates`}
41
+ />
42
+ </GridItem>
43
+ )
44
+ }
45
+
46
+ export default KitCard
src/js/react/components/Card/KitCard.module.scss ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .itemCard {
4
+ &:hover {
5
+ .itemDelete {
6
+ opacity: 1;
7
+ transition: opacity ease-in-out 0.4s;
8
+ }
9
+ }
10
+ }
11
+
12
+ .itemImageLink {
13
+ display: block;
14
+ padding-bottom: $cardResponsiveImagePadding;
15
+ overflow: hidden;
16
+ position: relative;
17
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
18
+ }
19
+
20
+ .itemImage {
21
+ position: absolute;
22
+ width: 100%;
23
+ }
24
+
25
+ .itemDelete {
26
+ opacity: 0;
27
+ margin: 0 0 0 auto;
28
+ }
src/js/react/components/Card/SettingsCard.jsx ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import MainHeading from '../Titles/MainHeading'
3
+
4
+ import styles from './SettingsCard.module.scss'
5
+
6
+ const SettingsCard = ({ title, children }) => (
7
+ <div className={styles.wrapper}>
8
+ <MainHeading title={title} />
9
+ {children}
10
+ </div>
11
+ )
12
+
13
+ export default SettingsCard
src/js/react/components/Card/SettingsCard.module.scss ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .wrapper {
4
+ background: #fff;
5
+ max-width: 620px;
6
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
7
+ border-radius: 4px;
8
+ margin-bottom: $gridSpacingNormal;
9
+ padding: $gridSpacingNormal;
10
+ }
src/js/react/components/Card/UploadKitCard.jsx ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from 'react'
2
+ import GridItem from '../Grid/GridItem'
3
+ import styles from './UploadKitCard.module.scss'
4
+ import { DoTheFileUpload } from '../Buttons/UploadTemplateKitButton'
5
+ import LoadingAnimation from '../Loading/LoadingAnimation'
6
+
7
+ const UploadKitCard = ({ item }) => {
8
+ const [chosenFile, setChosenFile] = useState(null)
9
+ return (
10
+ <GridItem colWidthPercentage={33}>
11
+ <div className={styles.uploadCard}>
12
+ <label htmlFor='upload-template-kit-zip-file' className={styles.uploadCardButton}>
13
+ {chosenFile
14
+ ? <LoadingAnimation />
15
+ : <span className={styles.icon} />}
16
+ <div className={styles.message}>
17
+ Upload Template Kit ZIP File
18
+ </div>
19
+ <input
20
+ type='file'
21
+ name='upload-template-kit-zip-file'
22
+ id='upload-template-kit-zip-file'
23
+ className={styles.formInput}
24
+ onChange={e => {
25
+ setChosenFile(e.target.files[0])
26
+ }}
27
+ />
28
+ </label>
29
+ {chosenFile ? (
30
+ <DoTheFileUpload chosenFile={chosenFile} />
31
+ ) : null}
32
+ </div>
33
+ </GridItem>
34
+ )
35
+ }
36
+
37
+ export default UploadKitCard
src/js/react/components/Card/UploadKitCard.module.scss ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .uploadCard {
4
+ position: relative;
5
+ padding-bottom: $cardResponsiveImagePadding; // This matches the other cards responsive "image area"
6
+ padding-top: 136px; // This matches the other cards "content area", we don't have this value hardcoded anywhere else unfortunately.
7
+ height: 100%; // This is so it matches up if the flex row grows larger than our values defined above.
8
+ }
9
+
10
+ .uploadCardButton {
11
+ position: absolute;
12
+ top: 0;
13
+ left: 0;
14
+ right: 0;
15
+ bottom: 0;
16
+ border: 5px dashed rgba(0, 0, 0, 0.1);
17
+ background: transparent;
18
+ display: flex;
19
+ align-items: center;
20
+ flex-direction: column;
21
+ justify-content: space-evenly;
22
+
23
+ &:hover {
24
+ background: #ddd;
25
+ }
26
+ }
27
+
28
+ .formInput {
29
+ display: none;
30
+ }
31
+
32
+ .icon {
33
+ width: 100px;
34
+ height: 100px;
35
+
36
+ &::before {
37
+ background: rgba(153, 153, 153, 0.1);
38
+ border-radius: 50%;
39
+ display: inline-block;
40
+ content: '\f132';
41
+ -webkit-font-smoothing: antialiased;
42
+ font: normal 74px/115px dashicons;
43
+ width: 100px;
44
+ height: 100px;
45
+ vertical-align: middle;
46
+ text-align: center;
47
+ color: rgb(153, 153, 153);
48
+ position: absolute;
49
+ padding: 0;
50
+ text-shadow: none;
51
+ z-index: 4;
52
+ text-indent: -4px;
53
+ }
54
+ }
55
+
56
+ .message {
57
+ font-size: 18px;
58
+ }
src/js/react/components/Contexts/GlobalConfigProvider.jsx ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState, useCallback } from 'react'
2
+
3
+ export const GlobalConfigContext = React.createContext({
4
+ globalConfig: {},
5
+ setConfigValue: () => {}
6
+ })
7
+
8
+ export default function GlobalConfigProvider ({ children, config = {} }) {
9
+ // We default our configuration object to the WordPress global config variable values:
10
+ const [globalConfig, setGlobalConfig] = useState(Object.keys(config).length > 0 ? config : window.template_kit_import)
11
+
12
+ // This function updates a particular key within the object:
13
+ const setConfigValue = (key, value) => {
14
+ setGlobalConfig(globalConfig => ({
15
+ ...globalConfig,
16
+ [key]: value
17
+ }))
18
+ }
19
+
20
+ const contextValue = {
21
+ globalConfig,
22
+ setConfigValue: useCallback((key, value) => setConfigValue(key, value), [])
23
+ }
24
+
25
+ return (
26
+ <GlobalConfigContext.Provider value={contextValue}>
27
+ {children}
28
+ </GlobalConfigContext.Provider>
29
+ )
30
+ }
src/js/react/components/Contexts/useGlobalConfig.js ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useContext } from 'react'
2
+ import { GlobalConfigContext } from './GlobalConfigProvider'
3
+
4
+ function useGlobalConfig () {
5
+ const { globalConfig, setConfigValue } = useContext(GlobalConfigContext)
6
+
7
+ const appendToGlobalConfig = (key, objectToAppend) => {
8
+ const existingItems = globalConfig[key] || []
9
+ setConfigValue(key, {
10
+ ...existingItems,
11
+ ...objectToAppend
12
+ })
13
+ }
14
+
15
+ // Downloaded items config managements:
16
+ const getDownloadedItemId = (humaneId) => {
17
+ return globalConfig.downloaded_items ? globalConfig.downloaded_items[humaneId] : null
18
+ }
19
+ const addDownloadedItem = ({ humaneId, importedId }) => {
20
+ appendToGlobalConfig('downloaded_items', { [humaneId]: importedId })
21
+ }
22
+ const removeDownloadedItem = ({ importedId }) => {
23
+ const downloadedHumanmeIds = Object.keys(globalConfig.downloaded_items)
24
+ downloadedHumanmeIds.map(humaneId => {
25
+ if (globalConfig.downloaded_items[humaneId] === importedId) {
26
+ delete (globalConfig.downloaded_items[humaneId])
27
+ }
28
+ })
29
+ }
30
+
31
+ // Subscription status config management
32
+ const subscriptionStatus = globalConfig.subscription_status
33
+ const setSubscriptionStatus = (status) => {
34
+ setConfigValue('subscription_status', status)
35
+ }
36
+
37
+ // Banner dismissal:
38
+ const bannerHasBeenDismissed = (bannerId) => {
39
+ appendToGlobalConfig('dismissed_banners', { [bannerId]: true })
40
+ }
41
+ const isBannerDismissed = (bannerId) => {
42
+ return globalConfig.dismissed_banners ? globalConfig.dismissed_banners[bannerId] : null
43
+ }
44
+
45
+ // Project names
46
+ const getConfigProjectName = () => {
47
+ return globalConfig.project_name
48
+ }
49
+ const setConfigProjectName = (projectName) => {
50
+ setConfigValue('project_name', projectName)
51
+ }
52
+
53
+ // Magic button inserting templates
54
+ const getMagicButtonMode = () => {
55
+ return globalConfig.magicButtonMode
56
+ }
57
+ const setMagicButtonMode = (mode) => {
58
+ setConfigValue('magicButtonMode', mode)
59
+ }
60
+
61
+ // This is for the token generation url
62
+ const getElementsTokenUrl = () => {
63
+ return globalConfig.elements_token_url
64
+ }
65
+
66
+ // API URL and Nonce values
67
+ const getApiUrl = () => {
68
+ return globalConfig.api_url
69
+ }
70
+ const getApiNonce = () => {
71
+ return globalConfig.api_nonce
72
+ }
73
+
74
+ return {
75
+ // downloads:
76
+ getDownloadedItemId,
77
+ addDownloadedItem,
78
+ removeDownloadedItem,
79
+ // subscriptions:
80
+ subscriptionStatus,
81
+ setSubscriptionStatus,
82
+ // banner management:
83
+ bannerHasBeenDismissed,
84
+ isBannerDismissed,
85
+ // project name
86
+ getConfigProjectName,
87
+ setConfigProjectName,
88
+ // magic button modes
89
+ getMagicButtonMode,
90
+ setMagicButtonMode,
91
+ // elements token url helper:
92
+ getElementsTokenUrl,
93
+ // api url and nonce
94
+ getApiUrl,
95
+ getApiNonce
96
+ }
97
+ }
98
+
99
+ export default useGlobalConfig
src/js/react/components/Errors/APIErrorMessage.jsx ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from 'react'
2
+ import useAPIError from './useAPIError'
3
+ import ModalWrapper from '../Modal/ModalWrapper'
4
+ import MainHeading from '../Titles/MainHeading'
5
+
6
+ import styles from './APIErrorMessage.module.scss'
7
+ import Button from '../Buttons/Button'
8
+ import ButtonWrapper from '../Buttons/ButtonWrapper'
9
+
10
+ const APIErrorDebugInformation = ({ error }) => {
11
+ const [showDebugInformation, setShowDebugInformation] = useState(false)
12
+
13
+ return (
14
+ <div className={styles.debugWrapper}>
15
+ {error.debug && showDebugInformation ? (
16
+ <div className={styles.debugInformation}>
17
+ <textarea
18
+ className={styles.debugText}
19
+ onClick={(e) => {
20
+ e.target.focus()
21
+ e.target.select()
22
+ }}
23
+ defaultValue={
24
+ typeof error.debug === 'object'
25
+ ? JSON.stringify(error.debug, null, '\t')
26
+ : error.debug
27
+ }
28
+ />
29
+ </div>
30
+ ) : null}
31
+ <div className={styles.debugActions}>
32
+ <ButtonWrapper>
33
+ <Button
34
+ icon='update'
35
+ label='Refresh Page'
36
+ onClick={(e) => {
37
+ e.preventDefault()
38
+ window.location.reload()
39
+ return false
40
+ }}
41
+ />
42
+ {error.debug ? (
43
+ <Button
44
+ icon='eye'
45
+ label={showDebugInformation ? 'Hide Debug Details' : 'Show Debug Details'}
46
+ className={styles.buttonDebug}
47
+ onClick={() => {
48
+ setShowDebugInformation(!showDebugInformation)
49
+ }}
50
+ />
51
+ ) : null}
52
+ </ButtonWrapper>
53
+ If this error continues please contact <a href='mailto:extensions@envato.com'>extensions@envato.com</a>.
54
+ </div>
55
+ </div>
56
+ )
57
+ }
58
+
59
+ const APIErrorMessage = () => {
60
+ const { errors, removeError } = useAPIError()
61
+
62
+ const shouldOpenErrorModal = errors.length > 0
63
+
64
+ if (!shouldOpenErrorModal) {
65
+ return null
66
+ }
67
+
68
+ return (
69
+ <>
70
+ {errors.map(error => {
71
+ if (error.code === 'zip_failure') {
72
+ return (
73
+ <ModalWrapper key={error.code} isOpen onCloseCallback={() => { removeError(error) }}>
74
+ <MainHeading title='Template Kit Install Error' />
75
+ <p className={styles.copy}>There was an issue installing this template kit. Please try again.</p>
76
+ {error.message}
77
+ <APIErrorDebugInformation error={error} />
78
+ </ModalWrapper>
79
+ )
80
+ }
81
+ if (error.code === 'generic_api_error') {
82
+ return (
83
+ <ModalWrapper key={error.code} isOpen onCloseCallback={() => { removeError(error) }}>
84
+ <MainHeading title='Unexpected Error' />
85
+ <p className={styles.copy}>Sorry there was an unexpected error from API call:</p>
86
+ {error.message}
87
+ <APIErrorDebugInformation error={error} />
88
+ </ModalWrapper>
89
+ )
90
+ }
91
+ })}
92
+ </>
93
+ )
94
+ }
95
+
96
+ export default APIErrorMessage
src/js/react/components/Errors/APIErrorMessage.module.scss ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .debugWrapper {
4
+
5
+ margin: 20px 0 0;
6
+ padding: 20px 0 0;
7
+ border-top: 1px solid #ddd;
8
+ }
9
+
10
+ .debugInformation {
11
+ padding: 0 10px 15px;
12
+ }
13
+
14
+ .debugText {
15
+ white-space: pre-wrap;
16
+ word-break: break-all;
17
+ user-select: all;
18
+ height: 100px;
19
+ width: 100%;
20
+ overflow: auto;
21
+ }
22
+
23
+ .copy {
24
+ @include copy;
25
+ }
src/js/react/components/Errors/APIErrorMessage.spec.jsx ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import { renderWithAPIError, act, fireEvent } from 'test-utils'
3
+ import APIErrorMessage from './APIErrorMessage'
4
+
5
+ it('should remove error when handleSubmit is pressed', async () => {
6
+ const { getByTestId, removeErrorSpy } = renderWithAPIError(
7
+ <APIErrorMessage />,
8
+ {
9
+ errors: [
10
+ {
11
+ code: 'generic_api_error',
12
+ message: 'Test error message'
13
+ }
14
+ ]
15
+ }
16
+ )
17
+
18
+ act(() => {
19
+ const closeModalButton = getByTestId('modal-close-button')
20
+ fireEvent.click(closeModalButton)
21
+ })
22
+
23
+ expect(removeErrorSpy).toHaveBeenCalled()
24
+ })
src/js/react/components/Errors/APIErrorMessage.stories.jsx ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import { MemoryRouter as Router } from 'react-router'
3
+ import useAPIError from './useAPIError'
4
+ import APIErrorProvider from './APIErrorProvider'
5
+ import APIErrorMessage from './APIErrorMessage'
6
+
7
+ export default { title: 'error/Global API Errors' }
8
+
9
+ const TestAPIErrorWrapper = ({ children }) => {
10
+ return (
11
+ <APIErrorProvider>
12
+ <Router>
13
+ <APIErrorMessage />
14
+ {children}
15
+ </Router>
16
+ </APIErrorProvider>
17
+ )
18
+ }
19
+
20
+ const SubscriptionError = () => {
21
+ const { addError } = useAPIError()
22
+ return (
23
+ <button onClick={() => { addError('invalid_subscription', 'Error Message Here') }}>Trigger "invalid_subscription"</button>
24
+ )
25
+ }
26
+
27
+ export const subscriptionError = () => (
28
+ <TestAPIErrorWrapper>
29
+ <SubscriptionError />
30
+ </TestAPIErrorWrapper>
31
+ )
src/js/react/components/Errors/APIErrorProvider.jsx ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState, useCallback } from 'react'
2
+
3
+ export const APIErrorContext = React.createContext({
4
+ errors: [],
5
+ addError: () => {},
6
+ removeError: () => {}
7
+ })
8
+
9
+ export default function APIErrorProvider ({ children }) {
10
+ const [errors, setErrors] = useState([])
11
+
12
+ const removeError = (errorToRemove) => {
13
+ setErrors(errors => errors.filter(error => error !== errorToRemove))
14
+ }
15
+
16
+ const addError = (code, message, debug) => {
17
+ setErrors(errors => ([...errors, { code, message, debug }]))
18
+ }
19
+
20
+ const contextValue = {
21
+ errors,
22
+ addError: useCallback((code, message, debug) => addError(code, message, debug), []),
23
+ removeError: useCallback((error) => removeError(error), [])
24
+ }
25
+
26
+ return (
27
+ <APIErrorContext.Provider value={contextValue}>
28
+ {children}
29
+ </APIErrorContext.Provider>
30
+ )
31
+ }
src/js/react/components/Errors/ErrorLoadingData.jsx ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import styles from './ErrorLoadingData.module.scss'
4
+
5
+ const ErrorLoadingData = ({ message }) => (
6
+ <div className={styles.message}><p className={styles.copy}>{message}</p></div>
7
+ )
8
+
9
+ ErrorLoadingData.propTypes = {
10
+ message: PropTypes.string
11
+ }
12
+
13
+ ErrorLoadingData.defaultProps = {
14
+ message: 'Sorry there was an error loading this data. Please try again.'
15
+ }
16
+ export default ErrorLoadingData
src/js/react/components/Errors/ErrorLoadingData.module.scss ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .message {
4
+ width: 100%;
5
+ height: 100px;
6
+ padding: 20px;
7
+ border-radius: 4px;
8
+ margin: 0 auto 40px;
9
+ background: #fff;
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
14
+ }
15
+
16
+ .copy {
17
+ @include copy;
18
+ }
src/js/react/components/Errors/useAPIError.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ import { useContext } from 'react'
2
+ import { APIErrorContext } from './APIErrorProvider'
3
+
4
+ function useAPIError () {
5
+ const { errors, addError, removeError } = useContext(APIErrorContext)
6
+ return { errors, addError, removeError }
7
+ }
8
+
9
+ export default useAPIError
src/js/react/components/Grid/GridItem.jsx ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import styles from './GridItem.module.scss'
3
+
4
+ const GridItem = ({ colWidthPercentage = 20, children, className, ...rest }) => {
5
+ const gridItemClasses = [styles.item]
6
+ if (colWidthPercentage === 20) {
7
+ gridItemClasses.push(styles.widthTwenty)
8
+ }
9
+ if (colWidthPercentage === 25) {
10
+ gridItemClasses.push(styles.widthTwentyFive)
11
+ }
12
+ if (colWidthPercentage === 33) {
13
+ gridItemClasses.push(styles.widthThirtyThree)
14
+ }
15
+ if (colWidthPercentage === 40) {
16
+ gridItemClasses.push(styles.widthFourty)
17
+ }
18
+ if (colWidthPercentage === 50) {
19
+ gridItemClasses.push(styles.widthFifty)
20
+ }
21
+ if (colWidthPercentage === 60) {
22
+ gridItemClasses.push(styles.widthSixty)
23
+ }
24
+ if (colWidthPercentage === 100) {
25
+ gridItemClasses.push(styles.widthFull)
26
+ }
27
+ if (className) {
28
+ gridItemClasses.push(className)
29
+ }
30
+ return (
31
+ <div className={gridItemClasses.join(' ')} {...rest}>
32
+ {children}
33
+ </div>
34
+ )
35
+ }
36
+
37
+ export default GridItem
src/js/react/components/Grid/GridItem.module.scss ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .item {
4
+ flex: 0 1 100%;
5
+ padding: 0 1% 2%;
6
+ margin: 0;
7
+ min-width: 0;
8
+
9
+ @include tabletOnly {
10
+ flex: 0 1 50%;
11
+ }
12
+
13
+ @include desktop {
14
+ &.widthTwenty {
15
+ flex: 0 1 20%;
16
+ }
17
+
18
+ &.widthTwentyFive {
19
+ flex: 0 1 25%;
20
+ }
21
+
22
+ &.widthThirtyThree {
23
+ flex: 0 1 33.3333333%;
24
+ }
25
+
26
+ &.widthFourty {
27
+ flex: 0 1 40%;
28
+ }
29
+
30
+ &.widthFifty {
31
+ flex: 0 1 50%;
32
+ }
33
+
34
+ &.widthSixty {
35
+ flex: 0 1 60%;
36
+ }
37
+
38
+ &.widthFull {
39
+ flex: 0 1 100%;
40
+ }
41
+ }
42
+ }
src/js/react/components/Grid/GridWrapper.jsx ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import styles from './GridWrapper.module.scss'
3
+
4
+ const GridWrapper = ({ children, includeLastItemSpacer = false }) => (
5
+ <div className={styles.wrapper}>
6
+ <div className={styles.inner}>
7
+ {children}
8
+ {includeLastItemSpacer ? <div className={styles.cardSpacing} /> : null}
9
+ </div>
10
+ </div>
11
+ )
12
+
13
+ export default GridWrapper
src/js/react/components/Grid/GridWrapper.module.scss ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wrapper {
2
+ width: 100%;
3
+ }
4
+
5
+ .inner {
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ margin: 0 -1%;
9
+ width: 102%;
10
+ padding: 0;
11
+ justify-content: space-between;
12
+ }
13
+
14
+ .cardSpacing {
15
+ flex: 1;
16
+ }
src/js/react/components/InstalledTemplateKits/TemplateItemCardWrapper.jsx ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useRef, useState } from 'react'
2
+ import GridItem from '../Grid/GridItem'
3
+ import ItemCard from '../Card/ItemCard'
4
+ import ButtonWrapper from '../Buttons/ButtonWrapper'
5
+ import Button from '../Buttons/Button'
6
+ import ImportSingleTemplate from '../Buttons/ImportSingleTemplate'
7
+ import InsertTemplateToPage from '../Buttons/InsertTemplateToPage'
8
+ import TemplatePreviewModal from '../Modal/TemplatePreviewModal'
9
+ import styles from './TemplateItemCardWrapper.module.scss'
10
+ import useGlobalConfig from '../Contexts/useGlobalConfig'
11
+
12
+ const TemplateItemCardWrapper = ({ template }) => {
13
+ const [isActivationModelOpen, setOpenActivationModal] = useState(false)
14
+ const cardRef = useRef(null)
15
+ const templateId = template.id
16
+ const templateKitId = template.template_kit_id
17
+ const templateName = template.name
18
+ const templateScreenShotUrl = template.screenshot_url
19
+ const templateExistingImports = template.imports
20
+
21
+ const [blockImport, setBlockImport] = useState(template.unmet_requirements && template.unmet_requirements.length > 0)
22
+
23
+ const description = template.metadata.additional_template_information ? template.metadata.additional_template_information.join(' ') : ''
24
+
25
+ // Determines what type of mode we're in, this changes the button we choose to render on each templates kit.
26
+ const { getMagicButtonMode } = useGlobalConfig()
27
+ const magicButtonMode = getMagicButtonMode()
28
+
29
+ return (
30
+ <GridItem colWidthPercentage={33} key={templateId}>
31
+ <ItemCard
32
+ Images={(
33
+ <div className={styles.imageWrapper}>
34
+ <img src={templateScreenShotUrl} alt={templateName} className={styles.image} />
35
+ <div
36
+ className={styles.expandButton}
37
+ ref={cardRef}
38
+ onClick={(e) => {
39
+ if (e.target === cardRef.current) {
40
+ setOpenActivationModal(true)
41
+ }
42
+ }}
43
+ >
44
+ {isActivationModelOpen ? (
45
+ <TemplatePreviewModal
46
+ templateScreenShotUrl={templateScreenShotUrl}
47
+ templatePreviewTitle={templateName}
48
+ templateKitId={templateKitId}
49
+ templateId={templateId}
50
+ existingImports={templateExistingImports}
51
+ />
52
+ ) : null}
53
+ <Button
54
+ type='ghost'
55
+ icon='expand'
56
+ onClick={() => {
57
+ setOpenActivationModal(true)
58
+ }}
59
+ />
60
+ </div>
61
+ </div>
62
+ )}
63
+ Buttons={(
64
+ <>
65
+ {blockImport ? (
66
+ <>
67
+ <p className={styles.unmetRequirementsMessage}>
68
+ {template.unmet_requirements.join(' ')}
69
+ </p>
70
+ <Button type='warning' label='Ignore Requirements' icon='cross' onClick={() => setBlockImport(false)} />
71
+ </>
72
+ ) : (
73
+ <ButtonWrapper>
74
+ {magicButtonMode && magicButtonMode.mode === 'elementorMagicButton' ? (
75
+ <InsertTemplateToPage
76
+ templateKitId={templateKitId}
77
+ templateId={templateId}
78
+ completeCallback={(data) => {
79
+ if (magicButtonMode.insertCallback && typeof magicButtonMode.insertCallback === 'function') {
80
+ magicButtonMode.insertCallback(data)
81
+ }
82
+ }}
83
+ />
84
+ ) : (
85
+ <ImportSingleTemplate
86
+ templateKitId={templateKitId}
87
+ templateId={templateId}
88
+ existingImports={templateExistingImports}
89
+ />
90
+ )}
91
+ </ButtonWrapper>
92
+ )}
93
+ </>
94
+ )}
95
+ title={templateName}
96
+ description={description}
97
+ />
98
+ </GridItem>
99
+ )
100
+ }
101
+
102
+ export default TemplateItemCardWrapper
src/js/react/components/InstalledTemplateKits/TemplateItemCardWrapper.module.scss ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .imageWrapper {
4
+ height: 200px;
5
+ overflow: hidden;
6
+ position: relative;
7
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
8
+ padding-bottom: $cardResponsiveImagePadding;
9
+
10
+ &:hover {
11
+ .expandButton {
12
+ opacity: 1;
13
+ }
14
+ }
15
+ }
16
+
17
+ .image {
18
+ @include image;
19
+ width: 100%;
20
+ }
21
+
22
+ .expandButton {
23
+ position: absolute;
24
+ bottom: 10px;
25
+ right: 10px;
26
+ opacity: 0;
27
+ transition: opacity 0.2s;
28
+ }
29
+
30
+ .unmetRequirementsMessage {
31
+ @include copy;
32
+ }
src/js/react/components/InstalledTemplateKits/TemplateKitSwitcher.jsx ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import fetchInstalledTemplateKits from '../../api/fetchInstalledTemplateKits'
3
+ import styles from './TemplateKitSwitcher.module.scss'
4
+
5
+ const TemplateKitSwitcher = ({ currentKitId, handleChangeKitId }) => {
6
+ const importedKits = fetchInstalledTemplateKits()
7
+ return (
8
+ <>
9
+ {!importedKits.loading && importedKits.data && importedKits.data.length > 1 ? (
10
+ <div className={styles.currentKit}>
11
+ <div className={styles.optionKitWrapper}>
12
+ <div className={styles.optionKit}>
13
+ <button
14
+ className={`${styles.optionKitLink} ${currentKitId === 'all' ? styles.optionKitLinkCurrent : ''}`} onClick={() => {
15
+ handleChangeKitId('all')
16
+ }}
17
+ >All Kits
18
+ </button>
19
+ </div>
20
+ {importedKits.data.map(item => (
21
+ <div className={styles.optionKit} key={item.id}>
22
+ <button
23
+ className={`${styles.optionKitLink} ${currentKitId === item.id ? styles.optionKitLinkCurrent : ''}`} onClick={() => {
24
+ handleChangeKitId(item.id)
25
+ }}
26
+ >
27
+ {item.title}
28
+ </button>
29
+ </div>
30
+ ))}
31
+ </div>
32
+ </div>
33
+ ) : null}
34
+ </>
35
+ )
36
+ }
37
+
38
+ export default TemplateKitSwitcher
src/js/react/components/InstalledTemplateKits/TemplateKitSwitcher.module.scss ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .currentKit {
4
+ height: 40px;
5
+ padding: 0 30px 0 0;
6
+ line-height: 40px;
7
+ color: #767676;
8
+ border-radius: 2px;
9
+ font-size: 13px;
10
+ cursor: pointer;
11
+ position: relative;
12
+
13
+ &::after {
14
+ content: '\f345';
15
+ opacity: 0.7;
16
+ margin-top: 0;
17
+ font-family: dashicons;
18
+ position: absolute;
19
+ right: 7px;
20
+ transform: rotate(0deg);
21
+ transform-origin: 50% 50%;
22
+ transition: transform 0.1s ease;
23
+ font-size: 16px;
24
+ }
25
+
26
+ &:hover {
27
+ &::after {
28
+ transform: rotate(90deg);
29
+ }
30
+
31
+ &::before {
32
+ // This is to prevent our drop down going away when we move our mouse down out of this div
33
+ content: '';
34
+ position: absolute;
35
+ display: block;
36
+ left: 0;
37
+ right: 0;
38
+ bottom: -40px;
39
+ top: 100%;
40
+ background: transparent;
41
+ }
42
+
43
+ .optionKitWrapper {
44
+ display: block;
45
+ }
46
+ }
47
+ }
48
+
49
+ .optionKitWrapper {
50
+ background: #fff;
51
+ border: 1px solid #e0e5e9;
52
+ border-radius: 4px;
53
+ box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
54
+ display: none;
55
+ line-height: 30px;
56
+ min-width: 170px;
57
+ padding: 20px;
58
+ position: absolute;
59
+ left: -20px;
60
+ top: 130%;
61
+ white-space: nowrap;
62
+ z-index: 8;
63
+
64
+ &::after,
65
+ &::before {
66
+ content: '';
67
+ display: block;
68
+ position: absolute;
69
+ bottom: 100%;
70
+ width: 0;
71
+ height: 0;
72
+ border-style: solid;
73
+ }
74
+
75
+ &::after {
76
+ left: 23px;
77
+ border-color: transparent transparent #fff;
78
+ border-width: 10px;
79
+ }
80
+
81
+ &::before {
82
+ left: 23px;
83
+ border-color: transparent transparent #e2e2e2;
84
+ border-width: 11px;
85
+ }
86
+ }
87
+
88
+ .optionKit {
89
+ padding: 0 30px;
90
+ }
91
+
92
+ .optionKitLink {
93
+ color: $textColorLight;
94
+ text-decoration: none;
95
+ border: 0;
96
+ background: transparent;
97
+ padding: 5px 0;
98
+ cursor: pointer;
99
+
100
+ &:hover {
101
+ color: $textColorDark;
102
+ }
103
+ }
104
+
105
+ .optionKitLinkCurrent {
106
+ text-decoration: underline;
107
+ }
src/js/react/components/InstalledTemplateKits/TemplateList.jsx ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import GridWrapper from '../Grid/GridWrapper'
3
+ import TemplateItemCardWrapper from './TemplateItemCardWrapper'
4
+
5
+ const TemplateList = ({ templates }) => {
6
+ return (
7
+ <GridWrapper includeLastItemSpacer>
8
+ {templates.map(template => (
9
+ <TemplateItemCardWrapper key={template.id} template={template} />
10
+ ))}
11
+ </GridWrapper>
12
+ )
13
+ }
14
+
15
+ export default TemplateList
src/js/react/components/Loading/LoadingAnimation.jsx ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+
3
+ import styles from './LoadingAnimation.module.scss'
4
+
5
+ const LoadingAnimation = () => (
6
+ <div className={styles.wrap}>
7
+ <span className={styles.inner} aria-label='Loading' />
8
+ </div>
9
+ )
10
+
11
+ export default LoadingAnimation
src/js/react/components/Loading/LoadingAnimation.module.scss ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @keyframes bounceDot {
2
+ 0% {
3
+ transform: translateY(0);
4
+ }
5
+
6
+ 20% {
7
+ transform: translateY(-100%);
8
+ }
9
+
10
+ 50% {
11
+ transform: translateY(0);
12
+ }
13
+ }
14
+
15
+ @keyframes fadein {
16
+ from {
17
+ opacity: 0;
18
+ }
19
+
20
+ to {
21
+ opacity: 1;
22
+ }
23
+ }
24
+
25
+ $dotSize: 16px;
26
+
27
+ .wrap {
28
+ width: 130px;
29
+ height: 50px;
30
+ position: relative;
31
+ margin: 100px auto;
32
+ animation: fadein 1s;
33
+ padding-top: $dotSize;
34
+
35
+ &::before {
36
+ content: '';
37
+ display: inline-block;
38
+ width: $dotSize;
39
+ height: $dotSize;
40
+ background-color: #523ee8;
41
+ border-radius: 50%;
42
+ margin: 0 7px;
43
+ animation: bounceDot 1.1s -0.6s linear infinite;
44
+ }
45
+
46
+ &::after {
47
+ content: '';
48
+ display: inline-block;
49
+ width: $dotSize;
50
+ height: $dotSize;
51
+ background-color: #f73859;
52
+ border-radius: 50%;
53
+ margin: 0 7px;
54
+ animation: bounceDot 1.1s 0s linear infinite;
55
+ }
56
+ }
57
+
58
+ .inner {
59
+ &::before {
60
+ content: '';
61
+ display: inline-block;
62
+ width: $dotSize;
63
+ height: $dotSize;
64
+ background-color: #6d47d9;
65
+ border-radius: 50%;
66
+ margin: 0 7px;
67
+ animation: bounceDot 1.1s -0.4s linear infinite;
68
+ }
69
+
70
+ &::after {
71
+ content: '';
72
+ display: inline-block;
73
+ width: $dotSize;
74
+ height: $dotSize;
75
+ background-color: #f7bc28;
76
+ border-radius: 50%;
77
+ margin: 0 7px;
78
+ animation: bounceDot 1.1s -0.2s linear infinite;
79
+ }
80
+ }
src/js/react/components/Loading/LoadingAnimation.stories.jsx ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import LoadingAnimation from './LoadingAnimation'
3
+
4
+ export default { title: 'loading' }
5
+
6
+ export const loadingAnimation = () => {
7
+ return (
8
+ <LoadingAnimation />
9
+ )
10
+ }
src/js/react/components/Modal/MagicModalWrapper.jsx ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import Modal from 'react-modal'
3
+ import ModalEnvatoIcon from './ModalEnvatoIcon'
4
+ import styles from './MagicModalWrapper.module.scss'
5
+ const customStyles = {
6
+ overlay: {
7
+ backgroundColor: 'rgba(32, 32, 32, 0.81)',
8
+ zIndex: 199999
9
+ },
10
+ content: {
11
+ background: '#f1f1f1',
12
+ border: '0',
13
+ top: '50%',
14
+ left: '50%',
15
+ right: 'auto',
16
+ bottom: 'auto',
17
+ marginRight: '-50%',
18
+ padding: '0',
19
+ transform: 'translate(-50%, -50%)',
20
+ borderRadius: '4px'
21
+ }
22
+ }
23
+
24
+ const MagicModalWrapper = ({ photoId, photoTitle, onCloseCallback = null, children }) => {
25
+ const [modalIsOpen, setModalIsOpen] = React.useState(true)
26
+ const closeModal = () => {
27
+ setModalIsOpen(false)
28
+ if (onCloseCallback) {
29
+ onCloseCallback()
30
+ }
31
+ }
32
+
33
+ // Make sure to bind modal to your appElement (http://reactcommunity.org/react-modal/accessibility/)
34
+ // We get window.templateKitImport.modalAppHolder from our initial render in main.jsx:
35
+ if (typeof window !== 'undefined' && window.templateKitImport && window.templateKitImport.modalAppHolder) {
36
+ Modal.setAppElement(window.templateKitImport.modalAppHolder)
37
+ }
38
+
39
+ return (
40
+ <Modal
41
+ isOpen={modalIsOpen}
42
+ onRequestClose={closeModal}
43
+ style={customStyles}
44
+ contentLabel='Envato Elements'
45
+ data-testid='modal-wrapper'
46
+ >
47
+ <div className={styles.modalInner}>
48
+ <div className={styles.modalHeader}>
49
+ <div className={styles.modalLogo}>
50
+ <ModalEnvatoIcon />
51
+ </div>
52
+ <div className={styles.headerNav} />
53
+ <div className={styles.headerActions}>
54
+ <button onClick={closeModal} data-testid='modal-close-button' className={styles.closeButton}>
55
+ <span className={`dashicons dashicons-no-alt ${styles.dismissIcon}`} />
56
+ </button>
57
+ </div>
58
+ </div>
59
+ <div className={styles.magicModalInner}>
60
+ {typeof children === 'function' ? children({ closeModal }) : children}
61
+ </div>
62
+ </div>
63
+ </Modal>
64
+ )
65
+ }
66
+
67
+ export default MagicModalWrapper
src/js/react/components/Modal/MagicModalWrapper.module.scss ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .modalInner {
4
+ width: 1200px;
5
+ max-width: 90vw;
6
+ min-height: 200px;
7
+ height: 80vh;
8
+ display: flex;
9
+ flex-direction: column;
10
+ color: $textColorLight;
11
+
12
+ p {
13
+ @include copy;
14
+ }
15
+ }
16
+
17
+ .modalHeader {
18
+ align-items: center;
19
+ background-color: #26292c;
20
+ display: flex;
21
+ flex-direction: row;
22
+ padding: 7px 13px;
23
+ }
24
+
25
+ $leftRightGutter: 240px;
26
+
27
+ .modalLogo {
28
+ flex: 0 0 $leftRightGutter;
29
+ }
30
+
31
+ .headerNav {
32
+ color: #fff;
33
+ display: flex;
34
+ font-size: 15px;
35
+ margin: auto;
36
+ text-align: center;
37
+ }
38
+
39
+ .headerActions {
40
+ display: flex;
41
+ justify-content: flex-end;
42
+ flex-direction: row;
43
+ flex: 0 0 $leftRightGutter;
44
+ }
45
+
46
+ .closeButton {
47
+ cursor: pointer;
48
+ color: #919191;
49
+ border: 0;
50
+ background: transparent;
51
+ margin-left: 12px;
52
+ padding-right: 6px;
53
+ display: flex;
54
+
55
+ &::before {
56
+ content: '';
57
+ display: inline-block;
58
+ border-left: 1px solid #a5afb7;
59
+ color: #fff;
60
+ margin-right: 10px;
61
+ height: 20px;
62
+ opacity: 0.3;
63
+ }
64
+ }
65
+
66
+ .dismissIcon {
67
+ @include dismiss;
68
+ }
69
+
70
+ .magicModalInner {
71
+ margin: auto 0;
72
+ height: 100%;
73
+ padding: 20px;
74
+ }
src/js/react/components/Modal/ModalEnvatoIcon.jsx ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import styles from './ModalEnvatoIcon.module.scss'
3
+
4
+ const ModalEnvatoIcon = () => {
5
+ return (
6
+ <div className={styles.svgWrapper}>
7
+ <svg
8
+ className={styles.svgEnvatoLogo}
9
+ xmlns='http://www.w3.org/2000/svg'
10
+ width='14'
11
+ height='14'
12
+ fill='none'
13
+ viewBox='0 0 27 31'
14
+ >
15
+ <path
16
+ fill='#fff'
17
+ d='M23.64 1.318C19.45-3.592 5.89 5.918 6 18.178a.58.58 0 01-.57.57.58.58 0 01-.49-.28 13.13 13.13 0 01-.52-9.65.53.53 0 00-.9-.52A13 13 0 000 17.188a13 13 0 0013.15 13.15c18.5-.42 14.23-24.64 10.49-29.02z'
18
+ />
19
+ </svg>
20
+ </div>
21
+ )
22
+ }
23
+
24
+ export default ModalEnvatoIcon
src/js/react/components/Modal/ModalEnvatoIcon.module.scss ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ .svgWrapper {
2
+ background: #81b441;
3
+ border-radius: 3px;
4
+ display: inline-block;
5
+ padding: 6px 7px;
6
+ }
7
+
8
+ .svgEnvatoLogo {
9
+ position: relative;
10
+ top: 2px;
11
+ }
src/js/react/components/Modal/ModalWrapper.jsx ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useEffect } from 'react'
2
+ import Modal from 'react-modal'
3
+ import styles from './ModalWrapper.module.scss'
4
+ const customStyles = {
5
+ overlay: {
6
+ backgroundColor: 'rgba(32, 32, 32, 0.81)',
7
+ zIndex: 199999
8
+ },
9
+ content: {
10
+ top: '50%',
11
+ left: '50%',
12
+ right: 'auto',
13
+ bottom: 'auto',
14
+ marginRight: '-50%',
15
+ transform: 'translate(-50%, -50%)',
16
+ padding: '40px',
17
+ borderRadius: '10px'
18
+ }
19
+ }
20
+
21
+ const ModalWrapper = ({ isOpen, onCloseCallback = null, children }) => {
22
+ const [modalIsOpen, setModalIsOpen] = React.useState(false)
23
+ const closeModal = () => {
24
+ setModalIsOpen(false)
25
+ if (onCloseCallback) {
26
+ onCloseCallback()
27
+ }
28
+ }
29
+ useEffect(() => {
30
+ // If our `isOpen` prop changes we set our local open state value respectively.
31
+ // This allows the user to dismiss our modal by only modifying local state.
32
+ if (isOpen) {
33
+ setModalIsOpen(true)
34
+ }
35
+ }, [isOpen])
36
+
37
+ useEffect(() => {
38
+ // Make sure to bind modal to your appElement (http://reactcommunity.org/react-modal/accessibility/)
39
+ // We get window.templateKitImport.modalAppHolder from our initial render in main.jsx:
40
+ if (typeof window !== 'undefined' && window.templateKitImport && window.templateKitImport.modalAppHolder) {
41
+ Modal.setAppElement(window.templateKitImport.modalAppHolder)
42
+ }
43
+ })
44
+
45
+ return (
46
+ <Modal
47
+ isOpen={modalIsOpen}
48
+ onRequestClose={closeModal}
49
+ style={customStyles}
50
+ contentLabel='Envato Elements'
51
+ data-testid='modal-wrapper'
52
+ >
53
+ <div className={styles.modalInner}>
54
+ <button onClick={closeModal} data-testid='modal-close-button' className={styles.closeButton}>
55
+ <span className={`dashicons dashicons-no-alt ${styles.dismissIcon}`} />
56
+ </button>
57
+ {typeof children === 'function' ? children({ closeModal }) : children}
58
+ </div>
59
+ </Modal>
60
+ )
61
+ }
62
+
63
+ export default ModalWrapper
src/js/react/components/Modal/ModalWrapper.module.scss ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .modalInner {
4
+ width: 650px;
5
+ min-height: 200px;
6
+ display: flex;
7
+ flex-direction: column;
8
+ color: $textColorLight;
9
+
10
+ p {
11
+ @include copy;
12
+ }
13
+ }
14
+
15
+ .closeButton {
16
+ position: absolute;
17
+ right: 10px;
18
+ top: 10px;
19
+ display: block;
20
+ padding: 0;
21
+ cursor: pointer;
22
+ color: #919191;
23
+ border: 0;
24
+ background: transparent;
25
+ }
26
+
27
+ .dismissIcon {
28
+ @include dismiss;
29
+ }
src/js/react/components/Modal/TemplateModalWrapper.jsx ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useEffect } from 'react'
2
+ import Modal from 'react-modal'
3
+ import ImportSingleTemplate from '../Buttons/ImportSingleTemplate'
4
+ import ModalEnvatoIcon from './ModalEnvatoIcon'
5
+ import useGlobalConfig from '../Contexts/useGlobalConfig'
6
+ import styles from './TemplateModalWrapper.module.scss'
7
+ import InsertTemplateToPage from '../Buttons/InsertTemplateToPage'
8
+
9
+ const customStyles = {
10
+ overlay: {
11
+ backgroundColor: 'rgba(32, 32, 32, 0.81)',
12
+ zIndex: 199999
13
+ },
14
+ content: {
15
+ background: '#f1f1f1',
16
+ border: '0',
17
+ top: '50%',
18
+ left: '50%',
19
+ right: 'auto',
20
+ bottom: 'auto',
21
+ marginRight: '-50%',
22
+ padding: '0',
23
+ transform: 'translate(-50%, -50%)',
24
+ borderRadius: '4px'
25
+ }
26
+ }
27
+
28
+ const TemplateModalWrapper = ({ isOpen, onCloseCallback = null, children, templatePreviewTitle, templateId, templateKitId, existingImports }) => {
29
+ const [modalIsOpen, setModalIsOpen] = React.useState(false)
30
+ const closeModal = () => {
31
+ setModalIsOpen(false)
32
+ if (onCloseCallback) {
33
+ onCloseCallback()
34
+ }
35
+ }
36
+ useEffect(() => {
37
+ // If our `isOpen` prop changes we set our local open state value respectively.
38
+ // This allows the user to dismiss our modal by only modifying local state.
39
+ if (isOpen) {
40
+ setModalIsOpen(true)
41
+ }
42
+ }, [isOpen])
43
+
44
+ // Make sure to bind modal to your appElement (http://reactcommunity.org/react-modal/accessibility/)
45
+ // We get window.templateKitImport.modalAppHolder from our initial render in main.jsx:
46
+ if (typeof window !== 'undefined' && window.templateKitImport && window.templateKitImport.modalAppHolder) {
47
+ Modal.setAppElement(window.templateKitImport.modalAppHolder)
48
+ }
49
+
50
+ // Determines what type of mode we're in, this changes the button we choose to render on each templates kit.
51
+ const { getMagicButtonMode } = useGlobalConfig()
52
+ const magicButtonMode = getMagicButtonMode()
53
+
54
+ return (
55
+ <Modal
56
+ isOpen={modalIsOpen}
57
+ onRequestClose={closeModal}
58
+ style={customStyles}
59
+ contentLabel='Envato Elements'
60
+ data-testid='modal-wrapper'
61
+ >
62
+ <div className={styles.modalInner}>
63
+ <div className={styles.modalHeader}>
64
+ <div className={styles.modalLogo}>
65
+ <ModalEnvatoIcon />
66
+ </div>
67
+ <div className={styles.headerTitle}>
68
+ {templatePreviewTitle}
69
+ </div>
70
+ <div className={styles.headerActions}>
71
+ {magicButtonMode && magicButtonMode.mode === 'elementorMagicButton' ? (
72
+ <InsertTemplateToPage
73
+ templateKitId={templateKitId}
74
+ templateId={templateId}
75
+ completeCallback={(data) => {
76
+ if (magicButtonMode.insertCallback && typeof magicButtonMode.insertCallback === 'function') {
77
+ magicButtonMode.insertCallback(data)
78
+ }
79
+ }}
80
+ />
81
+ ) : (
82
+ <ImportSingleTemplate
83
+ templateKitId={templateKitId}
84
+ templateId={templateId}
85
+ existingImports={existingImports}
86
+ />
87
+ )}
88
+ <button onClick={closeModal} data-testid='modal-close-button' className={styles.closeButton}>
89
+ <span className={`dashicons dashicons-no-alt ${styles.dismissIcon}`} />
90
+ </button>
91
+ </div>
92
+ </div>
93
+ <div>
94
+ {typeof children === 'function' ? children({ closeModal }) : children}
95
+ </div>
96
+ </div>
97
+ </Modal>
98
+ )
99
+ }
100
+
101
+ export default TemplateModalWrapper
src/js/react/components/Modal/TemplateModalWrapper.module.scss ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .modalInner {
4
+ width: 800px;
5
+ min-height: 200px;
6
+ height: 80vh;
7
+ display: flex;
8
+ flex-direction: column;
9
+ color: $textColorLight;
10
+
11
+ p {
12
+ @include copy;
13
+ }
14
+ }
15
+
16
+ .modalHeader {
17
+ align-items: center;
18
+ background-color: #26292c;
19
+ display: flex;
20
+ flex-direction: row;
21
+ padding: 7px 13px;
22
+ }
23
+
24
+ $leftRightGutter: 240px;
25
+
26
+ .modalLogo {
27
+ flex: 0 0 $leftRightGutter;
28
+ }
29
+
30
+ .headerTitle {
31
+ color: #fff;
32
+ font-size: 15px;
33
+ margin: auto;
34
+ text-align: center;
35
+ padding: 10px;
36
+ }
37
+
38
+ .headerActions {
39
+ display: flex;
40
+ justify-content: flex-end;
41
+ flex-direction: row;
42
+ flex: 0 0 $leftRightGutter;
43
+ }
44
+
45
+ .closeButton {
46
+ cursor: pointer;
47
+ color: #919191;
48
+ border: 0;
49
+ background: transparent;
50
+ margin-left: 12px;
51
+ padding-right: 6px;
52
+ display: flex;
53
+
54
+ &::before {
55
+ content: '';
56
+ display: inline-block;
57
+ border-left: 1px solid #a5afb7;
58
+ color: #fff;
59
+ margin-right: 10px;
60
+ height: 20px;
61
+ opacity: 0.3;
62
+ }
63
+ }
64
+
65
+ .dismissIcon {
66
+ @include dismiss;
67
+ }
src/js/react/components/Modal/TemplatePreviewModal.jsx ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import TemplateModalWrapper from './TemplateModalWrapper'
3
+ import styles from './TemplatePreviewModal.module.scss'
4
+
5
+ const TemplatePreviewModal = ({ onCloseCallback, templateId, templateKitId, existingImports, templateScreenShotUrl, templatePreviewTitle }) => {
6
+ return (
7
+ <TemplateModalWrapper templateId={templateId} templateKitId={templateKitId} existingImports={existingImports} templatePreviewTitle={templatePreviewTitle} isOpen onCloseCallback={onCloseCallback}>
8
+ <img className={styles.previewTemplate} src={templateScreenShotUrl} alt={templatePreviewTitle} />
9
+ </TemplateModalWrapper>
10
+ )
11
+ }
12
+
13
+ export default TemplatePreviewModal
src/js/react/components/Modal/TemplatePreviewModal.module.scss ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .previewTemplate {
2
+ width: 100%;
3
+ height: auto;
4
+ }
src/js/react/components/Navigation/NavigationBar.jsx ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import { Link, useRouteMatch } from 'react-router-dom'
3
+
4
+ import styles from './NavigationBar.module.scss'
5
+
6
+ const NavigationBar = () => {
7
+ return (
8
+ <div className={styles.wrapper}>
9
+ <div className={styles.logo}>
10
+ <Link to='/' className={styles.logoLink}>
11
+ Envato
12
+ </Link>
13
+ </div>
14
+
15
+ <nav className={styles.menu}>
16
+ <ul className={styles.menuInner}>
17
+ <li
18
+ className={styles.menuItem}
19
+ >
20
+ <Link
21
+ to='/template-kits/installed-kits'
22
+ className={`${styles.menuLink} ${useRouteMatch({ path: '/template-kits' }) ? styles.menuLinkActive : ''}`}
23
+ >
24
+ Template Kits
25
+ </Link>
26
+
27
+ </li>
28
+ </ul>
29
+ </nav>
30
+ </div>
31
+ )
32
+ }
33
+
34
+ export default NavigationBar
src/js/react/components/Navigation/NavigationBar.module.scss ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wrapper {
2
+ background-color: #fff;
3
+ display: flex;
4
+ border-bottom: 1px solid #e0e5e9;
5
+ z-index: 20; // above the detail open page.
6
+ }
7
+
8
+ .logo {
9
+ display: flex;
10
+ justify-content: center;
11
+ flex-direction: column;
12
+ padding: 0 10px 0 20px;
13
+ min-height: 54px;
14
+ max-width: 140px;
15
+
16
+ img {
17
+ height: 22px;
18
+ }
19
+
20
+ a {
21
+ &:active,
22
+ &:focus {
23
+ outline: 0;
24
+ border: 0;
25
+ box-shadow: none;
26
+ }
27
+ }
28
+
29
+ }
30
+
31
+ .logoLink {
32
+ background-image: url('../../../../images/template-kit-import.svg');
33
+ background-repeat: no-repeat;
34
+ background-position: left center;
35
+ background-size: contain;
36
+ height: 22px;
37
+ width: 130px;
38
+ overflow: hidden;
39
+ cursor: pointer;
40
+ text-indent: -9999px;
41
+ }
42
+
43
+ .menu {
44
+ display: flex;
45
+ flex-direction: row;
46
+ justify-content: space-between;
47
+ border-left: 1px solid #f1f1f1;
48
+ flex: 1;
49
+ }
50
+
51
+ .menuInner {
52
+ display: flex;
53
+ flex-direction: row;
54
+ justify-content: left;
55
+ margin: 0;
56
+ padding: 0;
57
+
58
+ @media screen and (max-width: 782px) {
59
+ flex: 1;
60
+ flex-wrap: wrap;
61
+ }
62
+ }
63
+
64
+ .menuItem {
65
+ padding: 0;
66
+ margin: 0;
67
+ border-right: 1px solid #f1f1f1;
68
+ position: relative;
69
+ display: flex;
70
+ align-items: center;
71
+
72
+ &:hover {
73
+ > .menuLink::after {
74
+ transform: rotate(90deg);
75
+ }
76
+ }
77
+ }
78
+
79
+ .menuItemHasChild {
80
+ > .menuLink {
81
+ padding: 0 40px 0 30px;
82
+
83
+ &::after {
84
+ content: '\f345';
85
+ opacity: 0.7;
86
+ top: 50%;
87
+ margin-top: -7px;
88
+ font-family: dashicons;
89
+ position: absolute;
90
+ right: 14px;
91
+ transform: rotate(0deg);
92
+ transform-origin: 50% 50%;
93
+ transition: transform 0.1s ease;
94
+ }
95
+ }
96
+
97
+ &:hover {
98
+ .subNavWrap {
99
+ transform: scale(1);
100
+ transition-delay: 0.1s;
101
+ overflow: visible;
102
+ opacity: 1;
103
+ max-height: 200px;
104
+ }
105
+
106
+ .subNavWrapNotifications {
107
+ max-height: 400px;
108
+ overflow-y: auto;
109
+ width: 300px;
110
+ right: 0;
111
+ left: auto;
112
+
113
+ &::-webkit-scrollbar {
114
+ -webkit-appearance: none;
115
+ width: 7px;
116
+ }
117
+
118
+ &::-webkit-scrollbar-thumb {
119
+ border-radius: 4px;
120
+ background-color: rgba(0, 0, 0, .5);
121
+ -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ .menuLink {
128
+ display: flex;
129
+ align-items: center;
130
+ font-weight: 500;
131
+ text-align: center;
132
+ justify-content: center;
133
+ font-size: 13px;
134
+ text-decoration: none;
135
+ color: #555d66;
136
+ height: 55px;
137
+ padding: 0 30px;
138
+ cursor: pointer;
139
+
140
+ &:hover {
141
+ color: #222;
142
+ background: #f0f2f4;
143
+ }
144
+
145
+ &:active,
146
+ &:focus {
147
+ outline: 0;
148
+ border: 0;
149
+ box-shadow: none;
150
+ }
151
+ }
152
+
153
+ .menuLinkActive,
154
+ .menuLinkActive:active,
155
+ .menuLinkActive:focus {
156
+ background-color: #f0f2f4;
157
+ box-shadow: inset 0 -1px 0 0 #81b440;
158
+
159
+ .subNavWrap & {
160
+ box-shadow: none;
161
+ }
162
+ }
163
+
164
+ .menuLinkNew::before {
165
+ content: 'NEW';
166
+ display: block;
167
+ position: absolute;
168
+ right: -14px;
169
+ top: 4px;
170
+ background: #81b440;
171
+ font-size: 10px;
172
+ padding: 1px 7px 0;
173
+ text-transform: uppercase;
174
+ color: #fff;
175
+ font-weight: normal;
176
+ border-radius: 9px;
177
+ z-index: 9;
178
+ line-height: 14px;
179
+ }
180
+
181
+ .subNavWrap {
182
+ position: absolute;
183
+ z-index: 999;
184
+ box-shadow: 0 6px 18px 2px rgba(0, 0, 0, 0.09);
185
+ width: 200px;
186
+ top: 100%;
187
+ left: -1px;
188
+ display: flex;
189
+ flex-direction: column;
190
+ justify-content: left;
191
+ margin: 0;
192
+ padding: 0;
193
+ background: #fff;
194
+ border-top: 1px solid #f1f1f1;
195
+ border-left: 1px solid #f1f1f1;
196
+ border-right: 1px solid #f1f1f1;
197
+ overflow: hidden;
198
+ max-height: 0;
199
+ opacity: 0;
200
+ transform: scale(0.4);
201
+ transform-origin: 60% top;
202
+ transition: 0s max-height 0s linear,
203
+ 0.2s opacity cubic-bezier(0.39, 0.575, 0.565, 1),
204
+ 0.15s transform cubic-bezier(0.1, 1.26, 0.83, 1);
205
+
206
+ .menuLink {
207
+ justify-content: left;
208
+ height: 45px;
209
+ }
210
+ }
211
+
212
+ .subNavItem {
213
+ margin: 0;
214
+ padding: 0;
215
+ border-bottom: 1px solid #f1f1f1;
216
+ }
217
+
218
+ .menuRight {
219
+ display: none;
220
+ @media (min-width: 900px) {
221
+ display: flex;
222
+
223
+ .menuItem {
224
+ border-right: 0;
225
+ margin-left: 10px;
226
+ }
227
+ }
228
+ }
229
+
230
+ .menuCountLabel {
231
+ position: absolute;
232
+ display: block;
233
+ font-size: 10px;
234
+ top: 21px;
235
+ right: 13px;
236
+ border-radius: 5px;
237
+ padding: 0 4px;
238
+ line-height: 15px;
239
+ background-color: #ca4a1f;
240
+ color: #fff;
241
+ }
242
+
243
+ .dropDownInner {
244
+ padding: 20px;
245
+ }
246
+
247
+ .notification {
248
+ color: #363b3f;
249
+ position: relative;
250
+ padding: 5px 0 10px 20px;
251
+ margin-bottom: 0;
252
+ }
253
+
254
+
255
+ .date {
256
+ opacity: 0.5;
257
+ font-size: 9px;
258
+ text-transform: uppercase;
259
+ margin-bottom: 5px;
260
+ }
261
+
262
+ .title {
263
+ font-size: 14px;
264
+ font-weight: bold;
265
+ padding: 4px 0 0;
266
+ }
267
+
268
+ .content {
269
+ font-size: 12px;
270
+ word-break: break-word;
271
+
272
+ p {
273
+ margin: 7px 0;
274
+
275
+ a {
276
+ text-decoration: underline;
277
+ color: #0073aa;
278
+ }
279
+ }
280
+ }
src/js/react/components/Titles/MainHeading.jsx ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import styles from './MainHeading.module.scss'
3
+
4
+ const MainHeading = ({ title, subtitle }) => (
5
+ <div className={styles.wrapper}>
6
+ <h1 className={styles.title}>{title}</h1>
7
+ {subtitle ? <p className={styles.subtitle}>{subtitle}</p> : null}
8
+ </div>
9
+ )
10
+
11
+ export default MainHeading
src/js/react/components/Titles/MainHeading.module.scss ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../scss/mixins';
2
+
3
+ .wrapper {
4
+ margin: 0 0 $gridSpacingNormal;
5
+ }
6
+
7
+ .title {
8
+ @include heading;
9
+ }
10
+
11
+ .subtitle {
12
+ @include copy;
13
+ margin: 8px 0 0;
14
+ }
src/js/react/components/Titles/Titles.stories.jsx ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import MainHeading from './MainHeading'
3
+
4
+ export default { title: 'titles' }
5
+
6
+ export const mainHeading = () => <MainHeading title='Premium Template Kits' />
7
+ export const mainHeadingWithSubtitle = () => <MainHeading title='Premium Template Kits' subtitle='Browse our 100,000 Premium Template Kits' />
src/scss/admin/_global.scss DELETED
@@ -1,29 +0,0 @@
1
- .envato-template-kit-import__wrapper {
2
- display: flex;
3
- margin: 0;
4
- min-height: 85vh;
5
- flex-direction: column;
6
- color: #555d66;
7
- background: #f1f1f1;
8
- margin: 0 0 0 -20px;
9
-
10
- .dashicons {
11
- vertical-align: bottom;
12
- }
13
- }
14
-
15
- .envato-template-kit-import__header {
16
- background-color: #FFFFFF;
17
- border-bottom: 1px solid #e0e5e9;
18
- padding: 30px;
19
-
20
- p {
21
- margin-bottom: 0;
22
- }
23
- }
24
-
25
- .envato-template-kit-import__header-logo {
26
- position: absolute;
27
- right: 26px;
28
- top: 15px;
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/scss/admin/_plugins.scss DELETED
@@ -1,92 +0,0 @@
1
- .envato-template-kit-import{
2
- &__requirements {
3
- background: #FFFFFF;
4
- border: 1px solid $gray-mouse;
5
- margin: 40px auto 40px;
6
- padding: 20px;
7
- display: flex;
8
- flex-wrap: wrap;
9
- }
10
-
11
- &__requirement-list-wrapper {
12
- flex: 0 0 690px;
13
- }
14
-
15
- &__requirement-list {
16
- padding-top: 10px;
17
- padding-left: 10px;
18
- }
19
-
20
- &__requirement {
21
- border-bottom: 1px solid $gray-mouse;
22
- padding: 10px 0;
23
- display: flex;
24
- align-items: center;
25
- width: 100%;
26
- }
27
-
28
- &__requirement-title {
29
- flex: 1;
30
- }
31
-
32
- &__requirement-status {
33
- flex: 0 0 200px;
34
- &--deactivated {
35
- @include button($wp-primary, #fff, $buttonSmall);
36
- [data-theme-status="deactivated"],
37
- [data-plugin-status="deactivated"] {
38
- display: flex;
39
- }
40
- }
41
- &--update {
42
- @include button($wp-primary, #fff, $buttonSmall);
43
- [data-theme-status="update"],
44
- [data-plugin-status="update"] {
45
- display: flex;
46
- }
47
- }
48
- &--install {
49
- @include button($wp-primary, #fff, $buttonSmall);
50
- [data-theme-status="install"],
51
- [data-plugin-status="install"] {
52
- display: flex;
53
- }
54
- }
55
- &--activated {
56
- @include button(#D0D0D0, #030303, $buttonSmall);
57
- [data-theme-status="activated"],
58
- [data-plugin-status="activated"] {
59
- display: flex;
60
- .dashicons-yes {
61
- color: $green;
62
- }
63
- }
64
- }
65
- &--error {
66
- @include button($gray, #fff, $buttonSmall);
67
- [data-theme-status="error"],
68
- [data-plugin-status="error"] {
69
- display: flex;
70
- }
71
- }
72
- }
73
-
74
- &__requirement-status-text {
75
- display: none;
76
- align-items: center;
77
- justify-content: space-between;
78
- }
79
-
80
- &__requirement-list-next {
81
- flex: 1;
82
- display: flex;
83
- justify-content: flex-end;
84
- align-items: center;
85
- padding: 60px;
86
- }
87
-
88
- &__requirement-list-next-button {
89
- @include button($wp-primary);
90
- }
91
-
92
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/scss/admin/_section.scss DELETED
@@ -1,88 +0,0 @@
1
- // .envato-template-kit-import__topnav-wrapper {
2
- // margin-left: auto;
3
- // margin-right: 6px;
4
- // display: flex;
5
- // align-items: center;
6
- // justify-content: center;
7
-
8
- // @media screen and (max-width: 782px) {
9
- // display: none;
10
- // }
11
- // }
12
-
13
- // .envato-template-kit-import__topnav-section-link {
14
- // text-decoration: none;
15
- // padding: 10px;
16
- // color: #555d66;
17
- // }
18
-
19
- // .envato-template-kit-import__section {
20
- // display: flex;
21
- // justify-content: center;
22
- // align-items: stretch;
23
- // margin: auto;
24
- // }
25
-
26
- // .envato-template-kit-import__section-inner {
27
- // align-items: center;
28
- // max-width: 1000px;
29
- // margin: 40px auto;
30
- // border: 1px solid #E0E5E9;
31
- // background-color: #FFFFFF;
32
- // text-align: center;
33
- // //padding:0px;
34
- // h2 {
35
- // font-weight: 300;
36
- // font-size: 20px;
37
- // color: #777;
38
- // margin: 0;
39
- // padding: 0;
40
- // line-height: 1.1;
41
- // }
42
-
43
- // p {
44
- // font-size: 14px;
45
- // }
46
-
47
- // .button-primary {
48
- // padding: 2px 40px;
49
- // font-size: 1.1em;
50
- // height: auto;
51
- // margin-top: 15px;
52
- // }
53
- // }
54
-
55
- // .envato-template-kit-import__section-banner {
56
- // display: block;
57
- // padding: 20px 40px 30px;
58
- // border-radius: 4px;
59
- // margin-top: 30px;
60
- // text-align: center;
61
- // margin-bottom: 5px;
62
-
63
- // p {
64
- // color: #464646 !important;
65
- // font-size: 16px;
66
- // }
67
-
68
- // a.button-primary {
69
- // padding: 10px 40px;
70
- // background: #7aac41;
71
- // border: 1px solid #65913b;
72
- // text-shadow: none;
73
- // box-shadow: none;
74
- // &:hover{
75
- // background: #65913b;
76
- // }
77
- // }
78
- // }
79
-
80
- // .envato-template-kit-import__photos-logo {
81
- // width: 220px;
82
- // margin-bottom: 20px;
83
- // }
84
-
85
- // .envato-template-kit-import__photos-promo {
86
- // max-width: 100%;
87
- // height: auto;
88
- // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/scss/admin/_tabs.scss DELETED
@@ -1,38 +0,0 @@
1
- .envato-template-kit-import {
2
- // Tabs
3
- &__tabset {
4
- background: #f9f9f9;
5
- border-top: 1px solid #f1f1f1;
6
- display: flex;
7
-
8
- }
9
-
10
- &__tab {
11
- border-right: 1px solid #e0e5e9;
12
- color: #000;
13
- cursor: pointer;
14
- font-weight: bold;
15
- padding: 17px 30px 14px;
16
- text-decoration: none;
17
-
18
- &:focus,
19
- &:active {
20
- outline: none;
21
- box-shadow: none;
22
- }
23
-
24
- &--current {
25
- border-bottom: 2px solid #837E7E;
26
- }
27
- }
28
-
29
- &__tab-panel {
30
- background: #f1f1f1;
31
- border-top: 1px solid #e0e5e9;
32
- color: #000;
33
- padding: 20px 30px;
34
- overflow: hidden;
35
-
36
- }
37
- }
38
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/scss/admin/_templates.scss DELETED
@@ -1,141 +0,0 @@
1
- @keyframes templateImportSpin { 100% { transform:rotate(360deg); } }
2
-
3
- .envato-template-kit-import{
4
- &__plugin-warning {
5
- background-color: #f2dede;
6
- border: 1px solid #ebcccc;
7
- color: #a94442;
8
-
9
- padding: .75rem 1.25rem;
10
- margin-top: 20px;
11
- border-radius: .25rem;
12
- }
13
- &__templates {
14
- display: flex;
15
- flex-wrap: wrap;
16
- width: 100%;
17
- margin: 40px auto 40px;
18
- }
19
-
20
- &__template {
21
- flex: 0 0 30%;
22
- margin-right: 3%;
23
- margin-bottom: 3%;
24
- background: #FFFFFF;
25
- border: 1px solid $gray-mouse;
26
- }
27
-
28
- &__imported-flag {
29
- display: none;
30
- }
31
-
32
- &__template-screenshot-wrapper {
33
- height: 300px;
34
- overflow: hidden;
35
- }
36
-
37
- &__template-screenshot {
38
- max-width: 100%;
39
- height: auto;
40
- }
41
-
42
- &__template-title {
43
- text-align: center;
44
- padding: 20px 0 0;
45
- font-size: 16px;
46
- }
47
-
48
- &__template-information {
49
- border-radius: 3px;
50
- padding: 10px;
51
- border: 1px solid #efefef;
52
- margin: 14px 20px 0;
53
-
54
- p {
55
- margin: 0;
56
- padding: 0;
57
- }
58
- }
59
-
60
- &__template-import-options {
61
- text-align: center;
62
- padding: 20px 0;
63
- }
64
-
65
- &__template-import-option--imported,
66
- &__template-import-option--unmet-requirements {
67
- display: none;
68
- }
69
- &__template--imported {
70
- position: relative;
71
- overflow: hidden;
72
- .envato-template-kit-import__template-import-option--fresh {
73
- display: none;
74
- }
75
- .envato-template-kit-import__template-import-option--imported {
76
- display: block;
77
- }
78
- .envato-template-kit-import__imported-flag {
79
- width: 200px;
80
- display: block;
81
- background: $wp-primary;
82
- position: absolute;
83
- top: 21px;
84
- text-align: center;
85
- line-height: 30px;
86
- letter-spacing: 1px;
87
- color: #fff;
88
- transform: rotate(45deg);
89
- right: -65px;
90
- }
91
- }
92
- &__template--importing {
93
- .envato-template-kit-import__button-import-again,
94
- .envato-template-kit-import__button-import {
95
- padding-right: 40px;
96
- position: relative;
97
-
98
- &:after {
99
- content: "\f463";
100
- font-family: dashicons;
101
- display: block;
102
- line-height: 1;
103
- font-weight: 400;
104
- font-style: normal;
105
- speak: none;
106
- text-decoration: inherit;
107
- position: absolute;
108
- font-size: 27px;
109
- right: 6px;
110
- top: 10px;
111
- color: #fff;
112
- animation: templateImportSpin 4s linear infinite;
113
- }
114
- }
115
- }
116
- &__template--unmet-requirements {
117
- .envato-template-kit-import__template-import-option--fresh,
118
- .envato-template-kit-import__template-import-option--imported {
119
- display: none;
120
- }
121
- .envato-template-kit-import__template-import-option--unmet-requirements {
122
- display: block;
123
- }
124
- }
125
-
126
- &__button-import {
127
- @include button($wp-primary);
128
- }
129
- &__button-edit {
130
- @include button($wp-primary);
131
- }
132
- &__button-import-again {
133
- @include button($gray);
134
- }
135
- &__button-upload-new {
136
- @include button($gray);
137
- }
138
- &__button-ignore-requirements {
139
- @include button($danger, #fff, $buttonSmall);
140
- }
141
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/scss/admin/_upload.scss DELETED
@@ -1,116 +0,0 @@
1
- .envato-template-kit-import {
2
- // Step 1 - List of Template Kits
3
- &__template-kit {
4
- background-color: #fff;
5
- border: 1px solid #e0e5e9;
6
- align-items: center;
7
- display: flex;
8
- flex-direction: row;
9
- margin-bottom: 40px;
10
- padding: 20px;
11
-
12
- &:hover {
13
- .envato-template-kit-import__btn-delete {
14
- left: 0;
15
- }
16
- }
17
- }
18
-
19
- &__template-kit--imported {
20
- .envato-template-kit-import__template-meta {
21
- &:before {
22
- content: "\f147";
23
- font-family: dashicons;
24
- display: block;
25
- line-height: 1;
26
- font-weight: 400;
27
- font-style: normal;
28
- speak: none;
29
- text-decoration: inherit;
30
- position: absolute;
31
- font-size: 60px;
32
- color: #82b541;
33
- }
34
- }
35
-
36
- .envato-template-kit-import__title,
37
- .envato-template-kit-import__message {
38
- margin: 0 0 10px 70px;
39
- }
40
- }
41
-
42
- &__title {
43
- font-weight: bold;
44
- text-transform: capitalize;
45
- }
46
-
47
- &__screenshot {
48
- margin-right: 25px;
49
- max-width: 300px;
50
- height: 200px;
51
- overflow: hidden;
52
-
53
- img {
54
- width: 100%;
55
- height: auto;
56
- }
57
- }
58
-
59
- &__btn-delete {
60
- background: transparent;
61
- border: none;
62
- color: #a00;
63
- font-size: 13px;
64
- position: relative;
65
- left: -9999em;
66
-
67
- &:hover {
68
- color: #dc3232;
69
- }
70
- }
71
-
72
- &__next {
73
- margin-left: auto;
74
- }
75
-
76
- // Step 1 - Form
77
- &__upload {
78
- background-color: #fff;
79
- border: 1px solid #e0e5e9;
80
- margin-right: auto;
81
- margin-left: auto;
82
- padding: 50px 25px;
83
- max-width: 900px;
84
-
85
- &-form {
86
- display: flex;
87
- align-items: center;
88
- justify-content: space-between;
89
- }
90
-
91
- &-btn {
92
- background: #F7F7F7;
93
- border: 1px solid #CCCCCC;
94
- border-radius: 3px;
95
- padding: 16px;
96
-
97
- &-next {
98
- @include button($wp-primary);
99
- }
100
- &-next-input {
101
- @include button($wp-primary);
102
- width: 200px;
103
- }
104
- &-next-link {
105
- @include button($wp-primary);
106
- padding-right: 87px;
107
- padding-left: 87px;
108
- }
109
- }
110
-
111
- &-hidden {
112
- display: none;
113
- }
114
-
115
- }
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
template-kit-import.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: Import Template Kits to WordPress
5
  * Author: Envato
6
  * Author URI: https://envato.com
7
- * Version: 1.0.2
8
  * License: GPLv3 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  *
@@ -28,18 +28,19 @@ if ( ! defined( 'ABSPATH' ) ) {
28
  }
29
 
30
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_SLUG', 'template-kit-import' );
31
- define( 'ENVATO_TEMPLATE_KIT_IMPORT_VER', '1.0.2' );
32
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_FILE', __FILE__ );
33
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_DIR', plugin_dir_path( ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
34
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_URI', plugins_url( '/', ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
35
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION', '5.6' );
 
36
 
37
- add_action( 'plugins_loaded', 'envato_template_kit_import_load_plugin_textdomain' );
38
 
39
  if ( ! version_compare( PHP_VERSION, ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION, '>=' ) ) {
40
- add_action( 'admin_notices', 'envato_template_kit_import_fail_php_version' );
41
  } elseif ( ! version_compare( get_bloginfo( 'version' ), '4.6', '>=' ) ) {
42
- add_action( 'admin_notices', 'envato_template_kit_import_fail_wp_version' );
43
  } else {
44
  require ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'inc/bootstrap.php';
45
  }
@@ -54,7 +55,7 @@ if ( ! version_compare( PHP_VERSION, ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION, '>=
54
  *
55
  * @return void
56
  */
57
- function envato_template_kit_import_load_plugin_textdomain() {
58
  load_plugin_textdomain( 'template-kit-import' );
59
  }
60
 
@@ -68,11 +69,11 @@ function envato_template_kit_import_load_plugin_textdomain() {
68
  *
69
  * @return void
70
  */
71
- function envato_template_kit_import_fail_php_version() {
72
  $message = sprintf(
73
  /* translators: %s: PHP version */
74
- esc_html__( 'Template Kit Import requires PHP version %1$s+, plugin is currently NOT ACTIVE. Please contact the hosting provider. WordPress recommends version %2$s.', 'template-kit-import' ),
75
- ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION,
76
  sprintf(
77
  '<a href="%s" target="_blank">%s</a>',
78
  esc_url( 'https://wordpress.org/about/requirements/' ),
@@ -93,9 +94,9 @@ function envato_template_kit_import_fail_php_version() {
93
  *
94
  * @return void
95
  */
96
- function envato_template_kit_import_fail_wp_version() {
97
  /* translators: %s: WordPress version */
98
- $message = sprintf( esc_html__( 'Template Kit Import requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT ACTIVE.', 'template-kit-import' ), '4.6' );
99
  $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
100
  echo wp_kses_post( $html_message );
101
  }
4
  * Description: Import Template Kits to WordPress
5
  * Author: Envato
6
  * Author URI: https://envato.com
7
+ * Version: 1.0.3
8
  * License: GPLv3 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  *
28
  }
29
 
30
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_SLUG', 'template-kit-import' );
31
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_VER', '1.0.3' );
32
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_FILE', __FILE__ );
33
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_DIR', plugin_dir_path( ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
34
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_URI', plugins_url( '/', ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
35
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION', '5.6' );
36
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_API_NAMESPACE', ENVATO_TEMPLATE_KIT_IMPORT_SLUG . '/v2' );
37
 
38
+ add_action( 'plugins_loaded', 'template_kit_import_load_plugin_textdomain' );
39
 
40
  if ( ! version_compare( PHP_VERSION, ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION, '>=' ) ) {
41
+ add_action( 'admin_notices', 'template_kit_import_fail_php_version' );
42
  } elseif ( ! version_compare( get_bloginfo( 'version' ), '4.6', '>=' ) ) {
43
+ add_action( 'admin_notices', 'template_kit_import_fail_wp_version' );
44
  } else {
45
  require ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'inc/bootstrap.php';
46
  }
55
  *
56
  * @return void
57
  */
58
+ function template_kit_import_load_plugin_textdomain() {
59
  load_plugin_textdomain( 'template-kit-import' );
60
  }
61
 
69
  *
70
  * @return void
71
  */
72
+ function template_kit_import_fail_php_version() {
73
  $message = sprintf(
74
  /* translators: %s: PHP version */
75
+ esc_html__( 'Template Kit Import plugin requires PHP version %s+, plugin is currently NOT ACTIVE. Please contact the hosting provider. WordPress recommends version %s.', 'template-kit-import' ),
76
+ TEMPLATE_KIT_IMPORT_PHP_VERSION,
77
  sprintf(
78
  '<a href="%s" target="_blank">%s</a>',
79
  esc_url( 'https://wordpress.org/about/requirements/' ),
94
  *
95
  * @return void
96
  */
97
+ function template_kit_import_fail_wp_version() {
98
  /* translators: %s: WordPress version */
99
+ $message = sprintf( esc_html__( 'Envato Elements requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT ACTIVE.', 'template-kit-import' ), '4.6' );
100
  $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
101
  echo wp_kses_post( $html_message );
102
  }
uninstall.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If uninstall not called from WordPress exit
3
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
+ exit();
5
+ }
6
+
7
+ delete_option( 'template_kit_import_tracker_notice' );
8
+ delete_option( 'template_kit_import_version' );
9
+ delete_option( 'template_kit_import_install_time' );
10
+ delete_option( '_template_kit_import_installed_time' );
11
+ delete_option( 'template_kit_import_license_code' );
12
+ delete_option( 'template_kit_import_options' );
13
+ delete_option( 'template_kit_import_photo_imports' );
14
+
15
+ // Remove the scheduled task.
16
+ wp_clear_scheduled_hook( 'template_kit_import_cron' );
vendor/template-kit-import/inc/bootstrap.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Bootstrap File
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ spl_autoload_register(
19
+ function ( $class ) {
20
+ $prefix = __NAMESPACE__;
21
+ $base_dir = __DIR__;
22
+ $len = strlen( $prefix );
23
+ if ( strncmp( $prefix, $class, $len ) !== 0 || $class === $prefix ) {
24
+ return;
25
+ }
26
+ $relative_class = strtolower( substr( $class, $len + 1 ) );
27
+ $relative_class = 'class-' . $relative_class;
28
+ $file = $base_dir . DIRECTORY_SEPARATOR . str_replace( array( '\\', '_' ), array( '/', '-' ), $relative_class ) . '.php';
29
+ if ( file_exists( $file ) ) {
30
+ require $file;
31
+ } else {
32
+ die( esc_html( basename( $file ) . ' missing.' ) );
33
+ }
34
+ }
35
+ );
36
+
37
+ require_once __DIR__ . '/helper.php';
38
+
39
+ Delete::get_instance();
40
+ CPT_Kits::get_instance();
41
+ Builder_Elementor::get_instance();
{inc → vendor/template-kit-import/inc}/class-base.php RENAMED
File without changes
{inc → vendor/template-kit-import/inc}/class-builder-elementor.php RENAMED
@@ -44,7 +44,11 @@ class Builder_Elementor extends Builder {
44
  public function import_template( $template_index ) {
45
 
46
  if ( ! $this->kit_id ) {
47
- return new \WP_Error( 'Failed to load kit' );
 
 
 
 
48
  }
49
 
50
  // We pipe off here to handle a special case for Global Styles.
@@ -77,7 +81,7 @@ class Builder_Elementor extends Builder {
77
  $result = $source->import_template( basename( $template_json_file ), $template_json_file );
78
 
79
  if ( is_wp_error( $result ) ) {
80
- return new \WP_Error( 'Failed to import template: ' . esc_html( $result->get_error_message() ) );
81
  }
82
 
83
  if ( $result[0] && $result[0]['template_id'] ) {
@@ -97,7 +101,7 @@ class Builder_Elementor extends Builder {
97
  return $imported_template_id;
98
  }
99
 
100
- return new \WP_Error( 'Unknown import error' );
101
  }
102
 
103
  /**
@@ -285,10 +289,10 @@ class Builder_Elementor extends Builder {
285
  $theme_status = $is_hello_active ? 'activated' : ( $is_hello_installed ? 'deactivated' : 'install' );
286
  if ( 'install' === $theme_status ) {
287
  // We want the user to install this theme
288
- $theme_action_url = wp_nonce_url( 'update.php?action=install-theme&theme=' . $required_theme['slug'], 'install-theme_' . $required_theme['slug'] );
289
  } elseif ( 'deactivated' === $theme_status ) {
290
  // We want the user to activate this theme
291
- $theme_action_url = wp_nonce_url( 'themes.php?action=activate&stylesheet=' . $required_theme['slug'], 'switch-theme_' . $required_theme['slug'] );
292
  }
293
  $required_theme['status'] = $theme_status;
294
  $required_theme['url'] = $theme_action_url;
44
  public function import_template( $template_index ) {
45
 
46
  if ( ! $this->kit_id ) {
47
+ return new \WP_Error( 'kit_error', 'Failed to load kit' );
48
+ }
49
+
50
+ if ( ! class_exists( '\Elementor\Plugin' ) ) {
51
+ return new \WP_Error( 'plugin_error', 'Missing required plugin: Elementor' );
52
  }
53
 
54
  // We pipe off here to handle a special case for Global Styles.
81
  $result = $source->import_template( basename( $template_json_file ), $template_json_file );
82
 
83
  if ( is_wp_error( $result ) ) {
84
+ return new \WP_Error( 'import_error', 'Failed to import template: ' . esc_html( $result->get_error_message() ) );
85
  }
86
 
87
  if ( $result[0] && $result[0]['template_id'] ) {
101
  return $imported_template_id;
102
  }
103
 
104
+ return new \WP_Error( 'import_error', 'Unknown import error' );
105
  }
106
 
107
  /**
289
  $theme_status = $is_hello_active ? 'activated' : ( $is_hello_installed ? 'deactivated' : 'install' );
290
  if ( 'install' === $theme_status ) {
291
  // We want the user to install this theme
292
+ $theme_action_url = add_query_arg( '_wpnonce', wp_create_nonce( 'install-theme_' . $required_theme['slug'] ), admin_url( 'update.php?action=install-theme&theme=' . $required_theme['slug'] ) );
293
  } elseif ( 'deactivated' === $theme_status ) {
294
  // We want the user to activate this theme
295
+ $theme_action_url = add_query_arg( '_wpnonce', wp_create_nonce( 'switch-theme_' . $required_theme['slug'] ), admin_url( 'themes.php?action=activate&stylesheet=' . $required_theme['slug'] ) );
296
  }
297
  $required_theme['status'] = $theme_status;
298
  $required_theme['url'] = $theme_action_url;
{inc → vendor/template-kit-import/inc}/class-builder-gutenberg.php RENAMED
File without changes
{inc → vendor/template-kit-import/inc}/class-builder.php RENAMED
File without changes
{inc → vendor/template-kit-import/inc}/class-cpt-kits.php RENAMED
@@ -40,6 +40,7 @@ class CPT_Kits extends CPT {
40
  parent::__construct();
41
 
42
  add_filter( 'wpseo_sitemap_exclude_post_type', array( $this, 'wpseo_sitemap_exclude_post_type' ), 10, 2 );
 
43
  }
44
 
45
  /**
@@ -63,10 +64,18 @@ class CPT_Kits extends CPT {
63
  public function get_all_uploaded_kits() {
64
  return get_posts(
65
  array(
66
- 'post_per_page' => -1,
67
- 'post_type' => $this->cpt_slug,
68
  )
69
  );
70
  }
71
 
 
 
 
 
 
 
 
 
72
  }
40
  parent::__construct();
41
 
42
  add_filter( 'wpseo_sitemap_exclude_post_type', array( $this, 'wpseo_sitemap_exclude_post_type' ), 10, 2 );
43
+ add_filter( 'page_row_actions', [ $this, 'custom_cpt_links' ], 10, 2 );
44
  }
45
 
46
  /**
64
  public function get_all_uploaded_kits() {
65
  return get_posts(
66
  array(
67
+ 'posts_per_page' => - 1,
68
+ 'post_type' => $this->cpt_slug,
69
  )
70
  );
71
  }
72
 
73
+ public function custom_cpt_links( $actions, $post ) {
74
+ if ( $post->post_type === $this->cpt_slug ) {
75
+ $actions['review'] = '<a href="' . esc_url( admin_url( 'admin.php?page=template-kit-review&template_kit_id=' . $post->ID ) ) . '">Review</a>';
76
+ }
77
+
78
+ return $actions;
79
+ }
80
+
81
  }
{inc → vendor/template-kit-import/inc}/class-cpt.php RENAMED
File without changes
{inc → vendor/template-kit-import/inc}/class-delete.php RENAMED
@@ -25,7 +25,6 @@ class Delete extends Base {
25
  public function __construct() {
26
  parent::__construct();
27
  add_action( 'before_delete_post', array( $this, 'cleanup_template_delete' ) );
28
- add_action( 'wp_ajax_envato_template_kit_delete_process', array( $this, 'handle_template_delete' ) );
29
  }
30
 
31
  /**
@@ -33,11 +32,8 @@ class Delete extends Base {
33
  *
34
  * @since 1.0.1
35
  */
36
- public function handle_template_delete() {
37
- $template_kit_id = isset( $_POST['template_kit_id'] ) ? (int) $_POST['template_kit_id'] : -1;
38
- check_ajax_referer( 'delete_template_kit_' . $template_kit_id, 'nonce' );
39
  wp_delete_post( $template_kit_id, true );
40
- wp_send_json_success();
41
  }
42
 
43
  /**
25
  public function __construct() {
26
  parent::__construct();
27
  add_action( 'before_delete_post', array( $this, 'cleanup_template_delete' ) );
 
28
  }
29
 
30
  /**
32
  *
33
  * @since 1.0.1
34
  */
35
+ public function delete_template_kit($template_kit_id) {
 
 
36
  wp_delete_post( $template_kit_id, true );
 
37
  }
38
 
39
  /**
vendor/template-kit-import/inc/class-importer.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Importer registration and management.
20
+ *
21
+ * @since 0.0.2
22
+ */
23
+ class Importer extends Base {
24
+
25
+ /**
26
+ * Called when the user wants to import a single template.
27
+ *
28
+ * @param $template_kit_id
29
+ * @param $template_index
30
+ *
31
+ * @return array|\WP_Error
32
+ */
33
+ public function handle_template_import( $template_kit_id, $template_index ) {
34
+
35
+ $template_kit = envato_template_kit_import_get_builder( $template_kit_id );
36
+
37
+ if ( ! $template_kit ) {
38
+ return new \WP_Error( 'import_error', 'Invalid Template Kit' );
39
+ }
40
+
41
+ return $template_kit->import_template( $template_index );
42
+ }
43
+
44
+ /**
45
+ * Called when we want to unpack a ZIP file and install the various parts into WordPress
46
+ * Returns either the imported Kit ID in the WP database, or a WP Error if something went wrong.
47
+ *
48
+ * @param $temporary_zip_file
49
+ *
50
+ * @return int|\WP_Error
51
+ */
52
+ public function unpack_zip_file( $temporary_zip_file ) {
53
+ if ( class_exists( '\ZipArchive' ) ) {
54
+ $wp_upload_dir = wp_upload_dir();
55
+ $template_kit_base_path = $wp_upload_dir['basedir'] . '/template-kits/';
56
+ $template_kit_random_folder = md5( time() . NONCE_SALT );
57
+ $template_kit_extract_directory = $template_kit_base_path . $template_kit_random_folder;
58
+ wp_mkdir_p( $template_kit_extract_directory );
59
+ // Prevent directory indexing so people cannot find the random template kit ID folders:
60
+ touch( $template_kit_base_path . 'index.php' );
61
+
62
+ $zip = new \ZipArchive();
63
+ $open_result = $zip->open( $temporary_zip_file );
64
+ if ( $open_result !== true ) {
65
+ return new \WP_Error( 'zip_error', 'Failed to open zip file' );
66
+ }
67
+ $zip->extractTo( $template_kit_extract_directory );
68
+ $zip->close();
69
+
70
+ $extracted_zip_files = scandir( $template_kit_extract_directory );
71
+ if ( $extracted_zip_files && is_array( $extracted_zip_files ) ) {
72
+ $file_names = array_diff( $extracted_zip_files, array( '.', '..' ) );
73
+ } else {
74
+ $file_names = array();
75
+ }
76
+ if ( ! $file_names || ! in_array( 'manifest.json', $file_names, true ) ) {
77
+ return new \WP_Error( 'zip_error', 'Please upload a valid Template Kit zip file' );
78
+ }
79
+
80
+ // Here we assume we've got a valid template kit extracted to the users hosting account.
81
+ // Time to throw it into the Custom Post Type so that we can proceed to the import step or do other fancy things.
82
+
83
+ $manifest_data = json_decode( file_get_contents( $template_kit_extract_directory . '/manifest.json' ), true );
84
+ // todo: validate manifest data structure.
85
+
86
+ $post_data = array(
87
+ 'post_title' => $manifest_data['title'],
88
+ 'post_type' => CPT_Kits::get_instance()->cpt_slug,
89
+ 'post_status' => 'publish',
90
+ );
91
+ $post_id = wp_insert_post( $post_data, true );
92
+
93
+ if ( $post_id && ! is_wp_error( $post_id ) ) {
94
+ // successfully stored this post. Add some metadata
95
+ update_post_meta( $post_id, 'envato_tk_manifest', $manifest_data );
96
+ update_post_meta( $post_id, 'envato_tk_folder_name', $template_kit_random_folder );
97
+ update_post_meta( $post_id, 'envato_tk_builder', $manifest_data['page_builder'] );
98
+
99
+ return $post_id;
100
+ }
101
+ } else {
102
+ // no zip source
103
+ return new \WP_Error( 'zip_error', 'Please enable ZIP extension on this hosting account.' );
104
+ }
105
+ return new \WP_Error( 'zip_error', 'Failed to extract ZIP file' );
106
+ }
107
+
108
+
109
+
110
+ }
{inc → vendor/template-kit-import/inc}/class-required-plugin.php RENAMED
File without changes
{inc → vendor/template-kit-import/inc}/helper.php RENAMED
File without changes
vendor/template-kit-import/template-kit-import.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Imported from "Template Kit Import" Version: 1.0.2
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ }
9
+
10
+
11
+ require plugin_dir_path( __FILE__ ) . 'inc/bootstrap.php';
views/importer/importer.php DELETED
@@ -1,81 +0,0 @@
1
- <?php
2
-
3
- namespace Envato_Template_Kit_Import;
4
-
5
- if ( ! defined( 'ABSPATH' ) ) {
6
- exit; // Exit if accessed directly.
7
- }
8
-
9
- $current_active_step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 1;
10
- $template_kit_id = isset( $_GET['template_kit_id'] ) ? (int) $_GET['template_kit_id'] : 0;
11
-
12
- $step1_url = Importer::get_instance()->get_url();
13
- $step2_url = add_query_arg(
14
- array(
15
- 'step' => 2,
16
- 'template_kit_id' => $template_kit_id,
17
- ),
18
- Importer::get_instance()->get_url()
19
- );
20
- $step3_url = add_query_arg(
21
- array(
22
- 'step' => 3,
23
- 'template_kit_id' => $template_kit_id,
24
- ),
25
- Importer::get_instance()->get_url()
26
- );
27
- $review_url = add_query_arg(
28
- array(
29
- 'step' => 8,
30
- 'template_kit_id' => $template_kit_id,
31
- ),
32
- Importer::get_instance()->get_url()
33
- );
34
- ?>
35
-
36
- <div class="envato-template-kit-import__tabset">
37
- <?php if ( $template_kit_id > 0 ) { ?>
38
- <!-- Tab 1 -->
39
- <a href="<?php echo esc_url( $step1_url ); ?>" class="envato-template-kit-import__tab<?php echo 1 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
40
- <?php esc_html_e( '1. Upload', 'template-kit-import' ); ?>
41
- </a>
42
- <?php if ( defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV ) { ?>
43
- <a href="<?php echo esc_url( $review_url ); ?>" class="envato-template-kit-import__tab<?php echo 8 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
44
- <?php esc_html_e( 'REVIEW', 'template-kit-import' ); ?>
45
- </a>
46
- <?php } ?>
47
- <!-- Tab 2 -->
48
- <a href="<?php echo esc_url( $step2_url ); ?>" class="envato-template-kit-import__tab<?php echo 2 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
49
- <?php esc_html_e( '2. Install Requirements', 'template-kit-import' ); ?>
50
- </a>
51
- <!-- Tab 3 -->
52
- <a href="<?php echo esc_url( $step3_url ); ?>" class="envato-template-kit-import__tab<?php echo 3 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
53
- <?php esc_html_e( '3. Select Templates', 'template-kit-import' ); ?>
54
- </a>
55
- <?php } else { ?>
56
- <!-- Tab 1 -->
57
- <a href="<?php echo esc_url( $step1_url ); ?>" class="envato-template-kit-import__tab<?php echo 1 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
58
- <?php esc_html_e( '1. Upload', 'template-kit-import' ); ?>
59
- </a>
60
- <?php if ( defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV ) { ?>
61
- <span class="envato-template-kit-import__tab">
62
- <?php esc_html_e( 'REVIEW', 'template-kit-import' ); ?>
63
- </span>
64
- <?php } ?>
65
- <!-- Tab 2 -->
66
- <span class="envato-template-kit-import__tab">
67
- <?php esc_html_e( '2. Install Requirements', 'template-kit-import' ); ?>
68
- </span>
69
- <!-- Tab 3 -->
70
- <span class="envato-template-kit-import__tab">
71
- <?php esc_html_e( '3. Select Templates', 'template-kit-import' ); ?>
72
- </span>
73
- <?php } ?>
74
- </div>
75
- <section class="envato-template-kit-import__tab-panel">
76
- <?php
77
- if ( 1 === $current_active_step || 2 === $current_active_step || 3 === $current_active_step || 8 === $current_active_step ) {
78
- require __DIR__ . '/step' . $current_active_step . '.php';
79
- }
80
- ?>
81
- </section>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/importer/step1-upload.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
-
3
- namespace Envato_Template_Kit_Import;
4
-
5
- if ( ! defined( 'ABSPATH' ) ) {
6
- exit; // Exit if accessed directly.
7
- }
8
-
9
- ?>
10
-
11
- <div class="envato-template-kit-import__upload">
12
- <form class="envato-template-kit-import__upload-form" action="<?php echo esc_url( admin_url( 'admin.php?action=envato_template_kit_import_upload' ) ); ?>" method="POST" enctype="multipart/form-data">
13
- <?php wp_nonce_field( 'envato_template_kit_import' ); ?>
14
- <label for="file" class="envato-template-kit-import__upload-btn"><span class="dashicons dashicons-upload"></span> <?php esc_attr_e( 'Upload Template Kit Zip File', 'template-kit-import' ); ?></label>
15
- <input id="file" class="envato-template-kit-import__upload-hidden" type="file" name="template_kit" />
16
- <input type="submit" name="sign_up" id="sign_up" class="envato-template-kit-import__upload-btn-next-input" data-cy="submit_button" value="<?php esc_attr_e( 'Next', 'template-kit-import' ); ?>"/>
17
- </form>
18
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/importer/step1.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
-
3
- namespace Envato_Template_Kit_Import;
4
-
5
- if ( ! defined( 'ABSPATH' ) ) {
6
- exit; // Exit if accessed directly.
7
- }
8
-
9
- $existing_kits = CPT_Kits::get_instance()->get_all_uploaded_kits();
10
-
11
- if ( ! $existing_kits || isset( $_GET['upload'] ) ) {
12
- require __DIR__ . '/step1-upload.php';
13
- } else {
14
-
15
- // If the user just imports a template kit then we have access to it's ID as a query string.
16
- // Only show the 'successfully uploaded' message for these kits.
17
- $imported_template_kit_id = isset( $_GET['imported_template_kit_id'] ) ? (int) $_GET['imported_template_kit_id'] : -1;
18
-
19
- foreach ( $existing_kits as $template_kit ) {
20
- // Get template kit id
21
- $template_kit_id = $template_kit->ID;
22
- // Attempt to load this template kit to confirm it's a valid builder type, and get access to helper methods:
23
- $template_kit_manager = envato_template_kit_import_get_builder( $template_kit_id );
24
- if ( $template_kit_manager ) {
25
- // Grab a list of templates from this kit, so we can use the first one as a screenshot url:
26
- $template_kit_templates = $template_kit_manager->get_available_templates();
27
- $freshly_imported = $imported_template_kit_id && $imported_template_kit_id === $template_kit_id;
28
- ?>
29
- <div class="envato-template-kit-import__template-kit<?php echo $freshly_imported ? ' envato-template-kit-import__template-kit--imported' : ''; ?> js-template-kit-id-<?php echo esc_attr( $template_kit_id ); ?>">
30
- <div class="envato-template-kit-import__screenshot">
31
- <a href="<?php echo esc_url( Importer::get_instance()->get_url() ); ?>&step=2&template_kit_id=<?php echo (int) $template_kit_id; ?>">
32
- <img src="<?php echo esc_url( $template_kit_templates[0]['screenshot_url'] ); ?>" alt="<?php echo esc_attr( $template_kit->post_title ); ?>" />
33
- </a>
34
- </div>
35
- <div class="envato-template-kit-import__template-meta">
36
- <p class="envato-template-kit-import__title">
37
- <?php
38
- /* translators: %s: Template Kit Name */
39
- printf( esc_html__( '%s - Template Kit', 'template-kit-import' ), esc_html( $template_kit->post_title ) );
40
- ?>
41
- </p>
42
- <p class="envato-template-kit-import__message">
43
- <?php
44
- if ( $freshly_imported ) {
45
- esc_html_e( 'Uploaded Successfully', 'template-kit-import' );
46
- } else {
47
- /* translators: %s: Template Kit Upload Date */
48
- printf( esc_html__( 'Uploaded on %s', 'template-kit-import' ), date_i18n( 'F j, Y g:i:a', strtotime( $template_kit->post_date ) ) );
49
- }
50
- ?>
51
- </p>
52
- <p><button class="envato-template-kit-import__btn-delete js-template-kit-delete" data-nonce="<?php echo wp_create_nonce( 'delete_template_kit_' . $template_kit_id ); ?>" data-template-kit-id="<?php echo (int) $template_kit_id; ?>"><?php echo esc_html_e( 'Delete Template Kit', 'template-kit-import' ); ?></button></p>
53
- </div>
54
- <div class="envato-template-kit-import__next">
55
- <?php if ( defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV ) { ?>
56
- <a class="envato-template-kit-import__upload-btn-next-link"
57
- href="<?php echo esc_url( Importer::get_instance()->get_url() ); ?>&step=8&template_kit_id=<?php echo (int) $template_kit_id; ?>"><?php esc_html_e( 'REVIEW', 'template-kit-import' ); ?></a>
58
- <br />
59
- <br />
60
- <br />
61
- <br />
62
- <?php } ?>
63
- <a class="envato-template-kit-import__upload-btn-next-link"
64
- href="<?php echo esc_url( Importer::get_instance()->get_url() ); ?>&step=2&template_kit_id=<?php echo (int) $template_kit_id; ?>"><?php esc_html_e( 'Next', 'template-kit-import' ); ?></a>
65
- </div>
66
- </div>
67
- <?php
68
- }
69
- }
70
- ?>
71
- <a class="envato-template-kit-import__button-upload-new" href="<?php echo esc_url( Importer::get_instance()->get_url() ); ?>&upload"><?php esc_html_e( 'Upload Another Template Kit', 'template-kit-import' ); ?></a>
72
- <?php
73
- }
74
- ?>
75
- <script>
76
- jQuery( function () {
77
- window.TemplateKitImport && window.TemplateKitImport().initImportPage();
78
- } );
79
- </script>
80
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/importer/step2.php DELETED
@@ -1,98 +0,0 @@
1
- <?php
2
-
3
- namespace Envato_Template_Kit_Import;
4
-
5
- if ( ! defined( 'ABSPATH' ) || ! isset( $template_kit_id ) ) {
6
- exit; // Exit if accessed directly.
7
- }
8
-
9
- $template_kit = envato_template_kit_import_get_builder( $template_kit_id );
10
-
11
- if ( ! $template_kit ) {
12
- wp_die( 'Invalid Template Kit ID' );
13
- }
14
-
15
- $required_theme = $template_kit->get_required_theme();
16
- $required_plugins = $template_kit->get_required_plugins();
17
- ?>
18
-
19
- <div class="envato-template-kit-import__requirements">
20
- <div class="envato-template-kit-import__requirement-list-wrapper">
21
- <p>
22
- <?php
23
- /* Translators: %s Template kit name */
24
- printf( esc_html__( 'The %s requires the following themes & plugins to work best, select the items you would like to install:', 'template-kit-import' ), '<strong>' . esc_html( $template_kit->get_name() ) . ' - Template Kit</strong>' );
25
- ?>
26
- </p>
27
- <div class="envato-template-kit-import__requirement-list">
28
- <?php if ( $required_theme ) { ?>
29
- <div class="envato-template-kit-import__requirement">
30
- <span class="envato-template-kit-import__requirement-title">
31
- <?php echo esc_html( $required_theme['name'] ); ?>
32
- </span>
33
- <span
34
- class="envato-template-kit-import__requirement-status envato-template-kit-import__requirement-status--btn-small envato-template-kit-import__requirement-status--<?php echo esc_attr( $required_theme['status'] ); ?> js-template-kit-theme"
35
- data-theme-status="<?php echo esc_attr( $required_theme['status'] ); ?>"
36
- data-theme-slug="<?php echo esc_attr( $required_theme['slug'] ); ?>"
37
- data-theme-url="<?php echo esc_attr( $required_theme['url'] ); ?>">
38
- <span class="envato-template-kit-import__requirement-status-text" data-theme-status="deactivated">
39
- <?php esc_html_e( 'Activate Theme', 'template-kit-import' ); ?>
40
- </span>
41
- <span class="envato-template-kit-import__requirement-status-text" data-theme-status="install">
42
- <?php esc_html_e( 'Install Theme', 'template-kit-import' ); ?>
43
- </span>
44
- <span class="envato-template-kit-import__requirement-status-text" data-theme-status="activated">
45
- <?php esc_html_e( 'Theme Installed & Active', 'template-kit-import' ); ?>
46
- <span class="dashicons dashicons-yes"></span>
47
- </span>
48
- <span class="envato-template-kit-import__requirement-status-text" data-theme-status="error">
49
- <?php esc_html_e( 'Theme Error', 'template-kit-import' ); ?>
50
- </span>
51
- </span>
52
- </div>
53
- <?php } ?>
54
- <?php foreach ( $required_plugins as $required_plugin ) { ?>
55
- <div class="envato-template-kit-import__requirement">
56
- <span class="envato-template-kit-import__requirement-title">
57
- <?php echo esc_html( $required_plugin['name'] ); ?>
58
- </span>
59
- <span
60
- class="envato-template-kit-import__requirement-status envato-template-kit-import__requirement-status--btn-small envato-template-kit-import__requirement-status--<?php echo esc_attr( $required_plugin['status'] ); ?> js-template-kit-plugin"
61
- data-plugin-status="<?php echo esc_attr( $required_plugin['status'] ); ?>"
62
- data-plugin-file="<?php echo esc_attr( $required_plugin['file'] ); ?>"
63
- data-plugin-slug="<?php echo esc_attr( $required_plugin['slug'] ); ?>"
64
- data-plugin-url="<?php echo esc_attr( $required_plugin['url'] ); ?>">
65
- <span class="envato-template-kit-import__requirement-status-text" data-plugin-status="deactivated">
66
- <?php esc_html_e( 'Activate Plugin', 'template-kit-import' ); ?>
67
- </span>
68
- <span class="envato-template-kit-import__requirement-status-text" data-plugin-status="update">
69
- <?php esc_html_e( 'Update Plugin', 'template-kit-import' ); ?>
70
- </span>
71
- <span class="envato-template-kit-import__requirement-status-text" data-plugin-status="install">
72
- <?php esc_html_e( 'Install Plugin', 'template-kit-import' ); ?>
73
- </span>
74
- <span class="envato-template-kit-import__requirement-status-text" data-plugin-status="activated">
75
- <?php esc_html_e( 'Plugin Installed & Active', 'template-kit-import' ); ?>
76
- <span class="dashicons dashicons-yes"></span>
77
- </span>
78
- <span class="envato-template-kit-import__requirement-status-text" data-plugin-status="error">
79
- <?php esc_html_e( 'Plugin Error', 'template-kit-import' ); ?>
80
- </span>
81
- </span>
82
- </div>
83
- <?php } ?>
84
- </div>
85
- </div>
86
- <div class="envato-template-kit-import__requirement-list-next">
87
- <a class="envato-template-kit-import__requirement-list-next-button js-template-kit-plugin-next" href="<?php echo esc_url( Importer::get_instance()->get_url() ); ?>&step=3&template_kit_id=<?php echo (int) $template_kit_id; ?>"><?php esc_html_e( 'Next', 'template-kit-import' ); ?></a>
88
- </div>
89
- </div>
90
-
91
-
92
- <script>
93
- jQuery( function () {
94
- window.TemplateKitImport && window.TemplateKitImport().initPluginPage();
95
- } );
96
- </script>
97
-
98
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/importer/step3.php DELETED
@@ -1,96 +0,0 @@
1
- <?php
2
-
3
- namespace Envato_Template_Kit_Import;
4
-
5
- if ( ! defined( 'ABSPATH' ) || ! isset( $template_kit_id ) ) {
6
- exit; // Exit if accessed directly.
7
- }
8
-
9
- $template_kit = envato_template_kit_import_get_builder( $template_kit_id );
10
-
11
- if ( ! $template_kit ) {
12
- wp_die( 'Invalid Template Kit ID' );
13
- }
14
-
15
- // We flag if the user has missed some plugin requirements from the previous step.
16
- $has_pending_plugin_requirements = false;
17
- $required_plugins = $template_kit->get_required_plugins();
18
- foreach ( $required_plugins as $required_plugin ) {
19
- if ( 'activated' !== $required_plugin['status'] && 'update' !== $required_plugin['status'] ) {
20
- $has_pending_plugin_requirements = true;
21
- }
22
- }
23
- if ( $has_pending_plugin_requirements ) {
24
- ?>
25
- <div class="envato-template-kit-import__plugin-warning">
26
- <?php
27
- /* translators: %1$s: <strong> opening html tag, %2$s: </strong> closing html tag, %3$s: <a> opening html tag, %4$s: </a> closing html tag */
28
- printf( esc_html__( '%1$sWarning!%2$s There are plugins that need installing or activating for this Template Kit to work correctly. Go back to %3$sInstall Plugins%4$s.', 'template-kit-import' ), '<strong>', '</strong>', '<a href="' . esc_url( $step2_url ) . '">', '</a>' );
29
- ?>
30
- </div>
31
- <?php
32
- }
33
-
34
- $templates = $template_kit->get_available_templates();
35
- ?>
36
- <div class="envato-template-kit-import__templates">
37
- <?php
38
- foreach ( $templates as $template_index => $template ) {
39
- $classes = array(
40
- 'js-single-template',
41
- 'envato-template-kit-import__template',
42
- );
43
- if ( $template['imports'] ) {
44
- // This template has been imported before, flag it so:
45
- $classes[] = 'envato-template-kit-import__template--imported';
46
- } else {
47
- $unmet_requirements = $template_kit->get_list_of_unmet_requirements( $template );
48
- if ( $unmet_requirements ) {
49
- // This template needs Elementor Pro, but the user doesn't have it active.
50
- $classes[] = 'envato-template-kit-import__template--unmet-requirements';
51
- }
52
- }
53
- ?>
54
- <div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>" data-template-index="<?php echo (int) $template_index; ?>">
55
- <div class="envato-template-kit-import__imported-flag">
56
- <?php esc_html_e( 'Imported', 'template-kit-import' ); ?>
57
- </div>
58
- <div class="envato-template-kit-import__template-screenshot-wrapper">
59
- <img src="<?php echo esc_url( $template['screenshot_url'] ); ?>" alt="<?php echo esc_attr( $template['name'] ); ?>" class="envato-template-kit-import__template-screenshot" />
60
- </div>
61
- <div class="envato-template-kit-import__template-title">
62
- <?php echo esc_html( $template['name'] ); ?>
63
- </div>
64
- <?php if ( ! empty( $template['metadata'] ) && ! empty( $template['metadata']['additional_template_information'] ) ) { ?>
65
- <div class="envato-template-kit-import__template-information">
66
- <?php foreach ( $template['metadata']['additional_template_information'] as $additional_information ) { ?>
67
- <p><?php echo wp_kses_post( $additional_information ); ?></p>
68
- <?php } ?>
69
- </div>
70
- <?php } ?>
71
- <div class="envato-template-kit-import__template-import-options">
72
- <div class="envato-template-kit-import__template-import-option--imported">
73
- <a href="<?php echo esc_url( $template_kit->get_imported_template_edit_url( $template['imports'] ? $template['imports'][0]['imported_template_id'] : 0 ) ); ?>" target="_blank" class="envato-template-kit-import__button-edit js-edit-template"><?php esc_html_e( 'Edit', 'template-kit-import' ); ?></a>
74
- <button class="envato-template-kit-import__button-import-again js-template-kit-import" data-nonce="<?php echo esc_attr( wp_create_nonce( 'import_template_kit_' . $template_kit_id ) ); ?>" data-template-kit-id="<?php echo (int) $template_kit_id; ?>" data-template-index="<?php echo (int) $template_index; ?>"><?php echo esc_html_e( 'Import Again', 'template-kit-import' ); ?></button>
75
- </div>
76
- <div class="envato-template-kit-import__template-import-option--fresh">
77
- <button class="envato-template-kit-import__button-import js-template-kit-import" data-nonce="<?php echo esc_attr( wp_create_nonce( 'import_template_kit_' . $template_kit_id ) ); ?>" data-template-kit-id="<?php echo (int) $template_kit_id; ?>" data-template-index="<?php echo (int) $template_index; ?>"><?php echo esc_html( $template_kit->get_import_button_text() ); ?></button>
78
- </div>
79
- <div class="envato-template-kit-import__template-import-option--unmet-requirements">
80
- <ul>
81
- <?php foreach ( $unmet_requirements as $unmet_requirement ) { ?>
82
- <li><?php echo esc_html( $unmet_requirement ); ?></li>
83
- <?php } ?>
84
- </ul>
85
- <button class="envato-template-kit-import__button-ignore-requirements js-template-kit-ignore-requirements" data-template-index="<?php echo (int) $template_index; ?>"><?php echo esc_html_e( 'Ignore Requirements', 'template-kit-import' ); ?></button>
86
- </div>
87
- </div>
88
- </div>
89
- <?php } ?>
90
- </div>
91
-
92
- <script>
93
- jQuery( function () {
94
- window.TemplateKitImport && window.TemplateKitImport().initTemplatePage();
95
- } );
96
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/wrapper.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- /**
3
- * Provide a admin area view for the plugin
4
- *
5
- * This file is used to markup the admin-facing aspects of the plugin.
6
- *
7
- * @link -
8
- * @since 1.0.0
9
- *
10
- * @package Template_Kit_Import
11
- * @subpackage Template_Kit_Import/views
12
- */
13
-
14
- if ( ! defined( 'ABSPATH' ) ) {
15
- exit; // Exit if accessed directly.
16
- }
17
-
18
- ?>
19
-
20
- <div class="envato-template-kit-import__wrapper">
21
- <div class="envato-template-kit-import__header">
22
- <h1>Template Kit - Import
23
- <?php
24
- if ( defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV ) {
25
- echo ' (Reviewer Mode)';
26
- }
27
- ?>
28
- </h1>
29
- <p>Use this plugin to Import a Template Kit.</p>
30
- <div class="envato-template-kit-import__header-logo">
31
- <svg width="27" height="31" viewBox="0 0 27 31" fill="none" xmlns="http://www.w3.org/2000/svg">
32
- <g opacity="0.1">
33
- <path d="M23.6409 1.31841C19.4509 -3.59159 5.89088 5.91841 6.00088 18.1784C5.9983 18.3288 5.93743 18.4723 5.83108 18.5786C5.72474 18.685 5.58125 18.7458 5.43088 18.7484C5.33212 18.7473 5.23527 18.721 5.14952 18.672C5.06377 18.623 4.99195 18.5529 4.94088 18.4684C3.54702 15.4348 3.36108 11.9842 4.42088 8.81841C4.46018 8.70236 4.45806 8.57627 4.41488 8.46161C4.3717 8.34694 4.29012 8.25078 4.18403 8.18948C4.07794 8.12819 3.95389 8.10554 3.83298 8.1254C3.71208 8.14526 3.60179 8.2064 3.52088 8.29841C1.26081 10.707 0.00226874 13.8855 0.000875618 17.1884C-0.0192324 18.9209 0.30717 20.6399 0.960899 22.2444C1.61463 23.8489 2.58249 25.3066 3.80761 26.5317C5.03273 27.7568 6.49038 28.7247 8.0949 29.3784C9.69941 30.0321 11.4184 30.3585 13.1509 30.3384C31.6509 29.9184 27.3809 5.69841 23.6409 1.31841Z" fill="#555555"/>
34
- </g>
35
- </svg>
36
- </div>
37
- </div>
38
-
39
- <div class="envato-template-kit-import__content">
40
- <?php echo $this->content; // WPCS: xss ok ?>
41
- </div>
42
- </div>