diff --git a/brain/api/v1/ImagesAPI.php b/brain/api/v1/ImagesAPI.php index 4329969..03896b8 100644 --- a/brain/api/v1/ImagesAPI.php +++ b/brain/api/v1/ImagesAPI.php @@ -4,6 +4,7 @@ namespace brain\api\v1; use brain\data\Member; use brain\data\Settings; +use brain\utility\FileUploader; class ImagesAPI { diff --git a/brain/controller/DashControl.php b/brain/controller/DashControl.php index c75a724..6f2d3a6 100644 --- a/brain/controller/DashControl.php +++ b/brain/controller/DashControl.php @@ -158,9 +158,9 @@ class DashControl $page = $book->findPageById($uuid); $pageOptions = Sorting::page($page); $preview = - $settings['global']['theme']. - '/'. - $page['layout']. + $settings['global']['theme'] . + '/' . + $page['layout'] . '.twig'; $html = $display->render($preview, $pageOptions); $response->getBody()->write($html); diff --git a/brain/init/App.php b/brain/init/App.php index f3fbc03..6674ddd 100644 --- a/brain/init/App.php +++ b/brain/init/App.php @@ -5,7 +5,6 @@ namespace brain\init; use brain\utility\HandleCors; use Slim\Factory\AppFactory; use Slim\Views\Twig; -// Fipamo Core Classes use Slim\Views\TwigMiddleware; class App diff --git a/brain/utility/Sorting.php b/brain/utility/Sorting.php index 23d96c4..3c69224 100644 --- a/brain/utility/Sorting.php +++ b/brain/utility/Sorting.php @@ -129,22 +129,22 @@ class Sorting } $meta = [ - 'who' => $page['author'], - 'when' => $page['created'], - 'tags' => $tags, + 'who' => $page['author'], + 'when' => $page['created'], + 'tags' => $tags, ]; // render markdown content and clean it $parser = new Parser(); $rendered = $parser->parse($page['content']); $sanitizer = \HtmlSanitizer\Sanitizer::create([ - 'extensions' => ['basic', 'image', 'list', 'code'], - 'tags' => [ - 'img' => [ - 'allowed_attributes' => ['src', 'alt', 'title', 'class'], - 'allowed_hosts' => null, - ], - ], + 'extensions' => ['basic', 'image', 'list', 'code'], + 'tags' => [ + 'img' => [ + 'allowed_attributes' => ['src', 'alt', 'title', 'class'], + 'allowed_hosts' => null, + ], + ], ]); $preclean = $sanitizer->sanitize($rendered->getContent()); diff --git a/brain/views/dash/_frame.twig b/brain/views/dash/_frame.twig index 46f6f18..9e7f5bb 100644 --- a/brain/views/dash/_frame.twig +++ b/brain/views/dash/_frame.twig @@ -1,65 +1,66 @@ - - - - {% block title %} - {{ title }} - {% endblock %} - - {% block stylesheets %}{% endblock %} - - -
-
-
- -
-
- -
-
- -
- -
-
-

MESSAGE TEXT

-
- -
-
-
-
- {% if status %} - - {% endif %} - {% apply spaceless %} - {% block mainContent %}{% endblock %} - {% endapply %} - -
+ + + + + {% block title %} + {{ title }} + {% endblock %} + + {% block stylesheets %}{% endblock %} + + +
+
+
+ +
+
+ +
+
+ +
+
+
+

MESSAGE TEXT

+
-
+
+
+
+
+ {% if status %} + + {% endif %} + {% apply spaceless %} + {% block mainContent %}{% endblock %} + {% endapply %} + +
+ + +
+ + + {% block javascripts %}{% endblock %} + + diff --git a/brain/views/dash/page-edit.twig b/brain/views/dash/page-edit.twig index d6a0a7e..9298e34 100644 --- a/brain/views/dash/page-edit.twig +++ b/brain/views/dash/page-edit.twig @@ -4,178 +4,178 @@ if not, just make them empty #} {% if mode == 'edit' %} - {% set id = page['id'] %} - {% set uuid = page['uuid'] %} - {% set slug = page['slug'] %} - {% set layout = page['layout'] %} - {% set feature = page['feature'] %} - {% set _title = page['title'] %} - {% set tags = page['tags'] %} - {% set content = page['content'] %} - {% set date = page['created'] %} - {% set updated = page['updated'] %} - {% set media = page['media'] %} - {% set files = page['docs'] %} + {% set id = page['id'] %} + {% set uuid = page['uuid'] %} + {% set slug = page['slug'] %} + {% set layout = page['layout'] %} + {% set feature = page['feature'] %} + {% set _title = page['title'] %} + {% set tags = page['tags'] %} + {% set content = page['content'] %} + {% set date = page['created'] %} + {% set updated = page['updated'] %} + {% set media = page['media'] %} + {% set files = page['docs'] %} {% else %} - {% set id = '' %} - {% set uuid = '' %} - {% set slug = '' %} - {% set layout = 'page' %} - {% set feature = '' %} - {% set title = '' %} - {% set tags = '' %} - {% set content = '' %} - {% set date = '' %} - {% set updated = '' %} - {% set media = '' %} - {% set files = '' %} + {% set id = '' %} + {% set uuid = '' %} + {% set slug = '' %} + {% set layout = 'page' %} + {% set feature = '' %} + {% set title = '' %} + {% set tags = '' %} + {% set content = '' %} + {% set date = '' %} + {% set updated = '' %} + {% set media = '' %} + {% set files = '' %} {% endif %} {% block title %} - {{ title }} + {{ title }} {% endblock %} {% block stylesheets %} - - {% endblock %} + +{% endblock %} - {% block mainContent %} -
-
-
- {% if page['feature'] == null %} -
-
-
- -
- IMAGES AND VIDEO -
- FILES -
-
- -
- {% else %} -
-
-
- -
- IMAGES AND VIDEO -
- {% if media|length > 1 %} - {% for item in media %} - {% if item.type == "mp4"%} -
- {% else %} -
- {% endif %} - {% endfor %} - {% else %} - {% if media[0] != '' %} - {% if media[0].type == "mp4"%} -
- {% else %} -
- {% endif %} - {% else %} - {% endif %} - {% endif %} - -
- FILES -
- {% if files|length > 1 %} - {% for item in files %} - {% if item.type == "mp3"%} -
- {% else %} -
- {% endif %} - {% endfor %} - {% else %} - {% if files[0] != '' %} - {% if files[0].type == "mp3"%} -
- {% else %} -
- {% endif %} +{% block mainContent %} +
+
+
+ {% if page['feature'] == null %} +
+
+
+ +
+ IMAGES AND VIDEO +
+ FILES +
+
+ +
+ {% else %} +
+
+
+ +
+ IMAGES AND VIDEO +
+ {% if media|length > 1 %} + {% for item in media %} + {% if item.type == "mp4"%} +
+ {% else %} +
+ {% endif %} + {% endfor %} + {% else %} + {% if media[0] != '' %} + {% if media[0].type == "mp4"%} +
+ {% else %} +
+ {% endif %} + {% else %} + {% endif %} + {% endif %} + +
+ FILES +
+ {% if files|length > 1 %} + {% for item in files %} + {% if item.type == "mp3"%} +
+ {% else %} +
+ {% endif %} + {% endfor %} + {% else %} + {% if files[0] != '' %} + {% if files[0].type == "mp3"%} +
+ {% else %} +
+ {% endif %} + + {% else %} - {% else %} + {% endif %} + {% endif %} - {% endif %} - {% endif %} +
+
-
-
- -
- {% endif %} +
+ {% endif %} -
-
-
-
- - - -
- - -
- - - {{ date }} - -
-
- - - - {% apply spaceless %} - {{ include("dash/partials/options.twig") }} - {% endapply %} - - - {{ updated }} - - - - -
-
-
-
- {% apply spaceless %} - {{ include("dash/partials/editor.twig") }} - {% endapply %} -
- -
+			
+
+
+
+ + + +
+ + +
+ + + {{ date }} + +
+
+ + + + {% apply spaceless %} + {{ include("dash/partials/options.twig") }} + {% endapply %} + + + {{ updated }} + + + + +
+
+
+
+ {% apply spaceless %} + {{ include("dash/partials/editor.twig") }} + {% endapply %} +
+ +
                 
                   
                 
               
-
-
-
-
- {% endblock %} +
+
+
+
+{% endblock %} - {% block javascripts %} - - {% endblock %} \ No newline at end of file +{% block javascripts %} + +{% endblock %} diff --git a/brain/views/dash/start.twig b/brain/views/dash/start.twig index 9c79bdc..c5d48d6 100644 --- a/brain/views/dash/start.twig +++ b/brain/views/dash/start.twig @@ -1,27 +1,27 @@ {% extends "dash/_frame.twig" %} {% block title %} - {{ title }} + {{ title }} {% endblock %} {% block stylesheets %} - - {% endblock %} + + {% endblock %} - {% block mainContent %} -
-
- {% if status %} - {% apply spaceless %} - {{ include("dash/partials/index.twig") }} - {% endapply %} - {% else %} - {{ include("dash/forms/login.twig") }} - {% endif %} -
-
- {% endblock %} + {% block mainContent %} +
+
+ {% if status %} + {% apply spaceless %} + {{ include("dash/partials/index.twig") }} + {% endapply %} + {% else %} + {{ include("dash/forms/login.twig") }} + {% endif %} +
+
+ {% endblock %} - {% block javascripts %} - - {% endblock %} \ No newline at end of file + {% block javascripts %} + + {% endblock %} diff --git a/content/themes/fipamo-default/frame.twig b/content/themes/fipamo-default/frame.twig index 45bcf68..d38ce9e 100644 --- a/content/themes/fipamo-default/frame.twig +++ b/content/themes/fipamo-default/frame.twig @@ -13,100 +13,100 @@ {{ title }} {% endblock %} - - - - - - - + + + + + + + +
+ -->
{% if media|length > 1 %} - {% for item in media %} - {% if item.type == "mp4"%} -
- +
+ {% else %} +
+ {% endif %} + {% else %} + {% endif %} + {% endif %}
{% apply spaceless %} - {% block mainContent %}{% endblock %} + {% block mainContent %}{% endblock %} {% endapply %} - +
- \ No newline at end of file + diff --git a/content/themes/fipamo-default/page.twig b/content/themes/fipamo-default/page.twig index e3f3d53..896e694 100644 --- a/content/themes/fipamo-default/page.twig +++ b/content/themes/fipamo-default/page.twig @@ -4,56 +4,59 @@ {{ title }} {% endblock %} - {% block mainContent %} -
-
- {{title}} -
-
-
-
-

{{content | raw}}

-
-
-
+{% block mainContent %} +
+
+ {{title}} +
+
+
+
+

{{content | raw}}

+
+
+
Files
- {% for doc in files %} - {% if doc.type != "mp3" %} - {% set path = doc.file|split('/') %} - {{path[6]}} - - {% endif %} - {% endfor %} -
-
+ {% for doc in files %} + {% if doc.type != "mp3" %} + {% set path = doc.file|split('/') %} + {{path[6]}} + + {% endif %} + {% endfor %} +
+
Sounds
- {% for doc in files %} + {% for doc in files %} {% if doc.type == "mp3" %} + {% endif %} - {% endfor %} -
- + {% endfor %}
-
- {{meta['who']}} dropped this {{ meta['when'] }}
- tags: - {% for tag in meta['tags'] %} - {% if dynamicRender is defined %} - {% if dynamicRender == 'true' %} - {{ tag.label }} - {% else %} - {{ tag.label }} - {% endif %} + +
+
+ {{meta['who']}} + dropped this + {{ meta['when'] }}
+ tags: + + {% for tag in meta['tags'] %} + {% if dynamicRender is defined %} + {% if dynamicRender == 'true' %} + {{ tag.label }} {% else %} - {{ tag.label }} + {{ tag.label }} {% endif %} - {% endfor %} - -
+ {% else %} + {{ tag.label }} + {% endif %} + {% endfor %} +
-
- {% endblock %} \ No newline at end of file + + +{% endblock %} diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..15ba3a9 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,156 @@ + + + The coding standard for PHP_CodeSniffer itself. + + autoload.php + bin + scripts + src + tests + + */src/Standards/*/Tests/*\.(inc|css|js)$ + */tests/Core/*/*\.(inc|css|js)$ + + + + + + + + + error + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + error + + + + + error + + + + + tests/bootstrap\.php + + + + + tests/Core/Tokenizer/StableCommentWhitespaceWinTest\.php + + + \ No newline at end of file diff --git a/public/assets/scripts/Start.js b/public/assets/scripts/Start.js index e8d3beb..1df543b 100644 --- a/public/assets/scripts/Start.js +++ b/public/assets/scripts/Start.js @@ -1,8 +1,8531 @@ -(()=>{function e(e){return e&&e.__esModule?e.default:e}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};const n="POST",r="json",a="x-www-form-urlencoded",i="/api/v1/status",o="/api/v1/settings/publish",s="/api/v1/mailer",l="/api/v1/login",u="writeSettings",c="publishSite",d="createNewPage",g="editPage",p="deletePage",h="syncNav",m="getSiteSettings",f="getMemberInfo";class v{constructor(e=null,t=null){this.percentComplete=0,this.baseURL=null,this.progressBar=t,this.status=!1,e&&(this.baseURL=e),this._request(this.baseURL?this.baseURL+i:i).then((e=>{"apiUseAuthorized"===e.type&&(this.token=e.token)}))}login(e){return new Promise(((t,a)=>{this.baseURL?e.remote=!0:e.remote=!1,this.key?e.key=this.key:e.key=null,this._request(this.baseURL?this.baseURL+l:l,"getAuthStatus",n,r,e).then((e=>{t(e)})).catch((e=>{a(e)}))}))}sync(e,t){return new Promise(((a,i)=>{let o="";switch(e){case"syncSite":o="/api/v1/settings/sync";break;case"syncNav":o="/api/v1/settings/nav-sync"}this._request(this.baseURL?this.baseURL+o:o,u,n,r,t).then((e=>{a(e)})).catch((e=>{i(e)}))}))}publish(e){return new Promise(((t,a)=>{this._request(this.baseURL?this.baseURL+o:o,c,n,r,e).then((e=>{t(e)})).catch((e=>{a(e)}))}))}pageActions(e,t){let r,i,o;switch(e){case d:r="/api/v1/page/create",i=d,o=a;break;case g:r="/api/v1/page/write",i=g,o=a;break;case p:r="/api/v1/page/delete",i=p,o=a}return this.baseURL?t.remote=!0:t.remote=!1,new Promise(((e,a)=>{this._request(this.baseURL?this.baseURL+r:r,i,n,o,t).then((t=>{e(t)})).catch((e=>{a(e)}))}))}sendMail(e){return new Promise(((t,a)=>{this._request(this.baseURL?this.baseURL+s:s,"sendMail",n,r,e).then((e=>{t(e)})).catch((e=>{a(e)}))}))}getInfo(e){let t,n;return"site"==e?(t="/api/v1/settings/site",n=m):(t="/api/v1/settings/member",n=f),new Promise(((e,r)=>{this._request(this.baseURL?this.baseURL+t:t,n).then((t=>{e(t)})).catch((e=>{r(e)}))}))}_request(e,t,i="GET",o="json",s=null){var l=this;return new Promise((function(h,v){var b=new XMLHttpRequest;if(b.upload.addEventListener("progress",(e=>l.handleLoadProgress(e,l.progressBar))),b.open(i,e,!0),b.onload=()=>{if(200==b.status){let e=JSON.parse(b.response);h(e)}else{let e=JSON.parse(b.response);v(e)}},"PUT"==i||i==n)switch(t!==u&&t!==g&&t!==d&&t!==p&&t!==c&&"reIndexPages"!==t||b.setRequestHeader("fipamo-access-token",l.token),o){case r:b.setRequestHeader("Content-type","application/"+o),b.send(JSON.stringify(s));break;case a:b.send(s)}else t!==m&&t!==f||b.setRequestHeader("fipamo-access-token",l.token),b.send()}))}handleLoadProgress(e,t){let n=Math.ceil(e.loaded/e.total*100);null!=t&&(t.style.width=n+"%")}}const b="POST",y="json",E="x-www-form-urlencoded",w="/api/v1/status",k="uploadFiles";class I{constructor(e=null,t=null,n=null){this.percentComplete=0,this.token=null,this.baseURL=null,this.progressBar=n,this.key=null,t&&(this.key=t),e&&(this.baseURL=e),this._request(this.baseURL?this.baseURL+w+"?key="+this.key:"/api/v1/status?key="+this.key).then((e=>{"apiUseAuthorized"===e.type&&(this.token=e.token)}))}create(e){return new Promise(((t,n)=>{this._request("/api/v1/init","blogInit",b,y,e).then((e=>{t(e)})).catch((e=>{n(e)}))}))}restore(e){return new Promise(((t,n)=>{var r;r=new FormData(e),this._request("/api/v1/restore","restoreBackup","POST","x-www-form-urlencoded",r).then((e=>{t(e)})).catch((e=>{n(e)}))}))}backup(){return new Promise(((e,t)=>{var n;n={task:"create_backup"},this._request("/api/v1/backup","createBackup","POST","json",n).then((t=>{e(t)})).catch((e=>{t(e)}))}))}secret(e){return new Promise(((t,n)=>{this._request("/api/v1/get-secret","retrieveSecret",b,y,e).then((e=>{t(e)})).catch((e=>{n(e)}))}))}newPass(e){return new Promise(((t,n)=>{this._request("/api/v1/reset-password","resetPassword",b,y,e).then((e=>{t(e)})).catch((e=>{n(e)}))}))}imageUpload(e,t){return new Promise(((n,r)=>{let a="";switch(e){case"avatar-upload":a="/api/v1/settings/add-avatar";break;case"background-upload":a="/api/v1/settings/add-feature-background";break;default:a="/api/v1/page/add-entry-image"}var i=new FormData;this.baseURL?(i.append("key",this.key),i.append("remote",!0)):i.append("remote",!1);for(var o=0;o{n(e)})).catch((e=>{r(e)}))}))}_request(e,t,n="GET",r="json",a=null){var i=this;return new Promise((function(o,s){var l=new XMLHttpRequest;if(l.upload.addEventListener("progress",(e=>i.handleLoadProgress(e,i.progressBar))),l.open(n,e,!0),l.onload=()=>{if(200==l.status){let e=JSON.parse(l.response);o(e)}else{let e=JSON.parse(l.response);s(e)}},"PUT"==n||n==b)switch(t===k&&l.setRequestHeader("fipamo-access-token",i.token),r){case y:l.setRequestHeader("Content-type","application/"+r),l.send(JSON.stringify(a));break;case E:l.send(a)}else l.send()}))}handleLoadProgress(e,t){let n=Math.ceil(e.loaded/e.total*100);null!=t&&(t.style.width=n+"%")}}class S{constructor(){}imgLoad(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){200===r.status?t(r.response):n(new Error("Image didn't load successfully; error code:"+r.statusText))},r.onerror=function(){n(new Error("There was a network error."))},r.send()}))}loadImage(e){let t=this;return new Promise((function(n,r){(new Image).crossOrigin="",t.imgLoad(e).then((function(e){var t=window.URL.createObjectURL(e);n(t)}),(function(e){r(e)}))}))}formDataToJSON(e){let t={};return new FormData(e).forEach(((e,n)=>{t.hasOwnProperty(n)?(Array.isArray(t[n])||(t[n]=[t[n]]),t[n].push(e)):t[n]=e})),t}}const x="requestLame",P="postUpdated";new class{};var T=class{constructor(){}cleanString(e){return e.replace(/(^\-+|[^a-zA-Z0-9\/_| -]+|\-+$)/g,"").toLowerCase().replace(/[\/_| -]+/g,"-")}decodeHTML(e,t){var n=0,r=0,a=!1;void 0===t&&(t=2),e=e.toString().replace(/</g,"<").replace(/>/g,">");var i={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===t&&(a=!0),"number"!=typeof t){for(t=[].concat(t),r=0;r{let r=new FormData,a=document.createElement("textarea");a.innerHTML=document.getElementById("highlight-content").innerHTML;let i=a.value;if(i=i.replace(/<\/?span[^>]*>/g,""),i=i.replace(/<\/?br[^>]*>/g,"\n"),r.append("id",document.getElementById("post-edit-index").getAttribute("data-index")),r.append("uuid",document.getElementById("post-edit-index").getAttribute("data-uuid")),r.append("layout",document.getElementById("post-edit-index").getAttribute("data-layout")),r.append("current_title",document.getElementById("post-edit-index").getAttribute("data-slug")),r.append("content",i),r.append("title",document.getElementById("post_title").value),r.append("created",document.getElementById("post-date").getAttribute("data-raw")),r.append("slug",(new T).cleanString(document.getElementById("post_title").value)),r.append("tags",document.getElementById("post_tags").value),r.append("menu",document.getElementById("option-menu-pin").getAttribute("data-active")),r.append("featured",document.getElementById("option-feature").getAttribute("data-active")),r.append("published",document.getElementById("option-published").getAttribute("data-active")),r.append("layout",document.getElementById("page-templates").value),r.append("form_token",document.getElementById("form_token").value),e.length>0&&null!=e)for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=e.customPos,n=e.iframe,r=e.noShadowCaret;return n?{iframe:n,window:n.contentWindow,document:n.contentDocument||n.contentWindow.document,noShadowCaret:r,customPos:t}:{window:window,document:document,noShadowCaret:r,customPos:t}},R=function(e){return"object"===M(e)&&null!==e},F=function(e,t){var n=function(){return e.selectionStart},r=function(r){var a=function(e){return e.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"
")};(t.customPos||0===t.customPos)&&(r=t.customPos);var i=void 0===r?n():r,o=e.value.slice(0,i),s=e.value.slice(i),l=''.concat(a(o),"");l+='|',l+=''.concat(a(s),"");var u=O(e,l).rect();return u.pos=n(),u};return{getPos:n,setPos:function(t){return e.setSelectionRange(t,t),e},getOffset:function(n){var a=function(e,t){var n=t&&t.window||window,r=t&&t.document||document,a=e.getBoundingClientRect(),i=r.documentElement,o=n.pageXOffset||i.scrollLeft,s=n.pageYOffset||i.scrollTop;return{top:a.top+s,left:a.left+o}}(e),i=r(n);return{top:a.top+i.top+t.document.body.scrollTop,left:a.left+i.left+t.document.body.scrollLeft,height:i.height}},getPosition:r}},U=function(e,t){return function(e){return!!(e.contentEditable?"true"===e.contentEditable:"true"===e.getAttribute("contenteditable"))}(e)?function(e,t){var n=function(){var n=r(),a={height:0,left:0,right:0};if(!n)return a;var i=t.customPos||0===t.customPos;if(n.endOffset-1>0&&n.endContainer!==e||i){var o=n.cloneRange(),s=i?t.customPos:n.endOffset;o.setStart(n.endContainer,s-1<0?0:s-1),o.setEnd(n.endContainer,s);var l=o.getBoundingClientRect();a={height:l.height,left:l.left+l.width,top:l.top},o.detach()}if((!a||a&&0===a.height)&&!t.noShadowCaret){var u=n.cloneRange(),c=t.document.createTextNode("|");u.insertNode(c),u.selectNode(c);var d=u.getBoundingClientRect();a={height:d.height,left:d.left,top:d.top},c.parentNode.removeChild(c),u.detach()}if(a){var g=t.document.documentElement;a.top+=t.window.pageYOffset-(g.clientTop||0),a.left+=t.window.pageXOffset-(g.clientLeft||0)}return a},r=function(){if(t.window.getSelection){var e=t.window.getSelection();return e.rangeCount>0?e.getRangeAt(0):null}},a=function(){var t=r(),n=t.cloneRange();n.selectNodeContents(e),n.setEnd(t.endContainer,t.endOffset);var a=n.toString().length;return n.detach(),a};return{getPos:a,setPos:function(n){var r=t.window.getSelection();if(r){var a=0,i=!1;!function e(o,s){for(var l=0;l=o){i=!0;var c=t.document.createRange();c.setStart(u,o-a),r.removeAllRanges(),r.addRange(c);break}a+=u.length}else e(n,u)}}(n,e)}return e},getPosition:function(){var r=n(),i=a(),o=e.getBoundingClientRect(),s=o.top+t.document.body.scrollTop,l=o.left+t.document.body.scrollLeft;return r.left-=l,r.top-=s,r.pos=i,r},getOffset:n,getRange:r}}(e,t):F(e,t)};var H=class{constructor(){this.listeners=new Map}addListener(e,t){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t)}removeListener(e,t){var n,r=this.listeners.get(e);return!!(r&&r.length&&(n=r.reduce(((e,n,r)=>"function"==typeof n&&n===t?e=r:e),-1))>-1)&&(r.splice(n,1),this.listeners.set(e,r),!0)}emitEvent(e,...t){var n=this.listeners.get(e);return!(!n||!n.length)&&(n.forEach((e=>{e(...t)})),!0)}},q={},X=function(e){var t=/\blang(?:uage)?-([\w-]+)\b/i,n=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);I+=k.value.length,k=k.next){var S=k.value;if(t.length>e.length)return;if(!(S instanceof i)){var x,P=1;if(b){if(!(x=o(w,I,e,v)))break;var T=x.index,A=x.index+x[0].length,_=I;for(_+=k.value.length;T>=_;)_+=(k=k.next).value.length;if(I=_-=k.value.length,k.value instanceof i)continue;for(var D=k;D!==t.tail&&(_d.reach&&(d.reach=O);var M=k.prev;if(L&&(M=u(t,M,L),I+=L.length),c(t,M,P),k=u(t,M,new i(g,f?a.tokenize(B,f):B,y,B)),C&&u(t,k,C),P>1){var N={cause:g+","+h,reach:O};s(e,t,n,k.prev,I,N),d&&N.reach>d.reach&&(d.reach=N.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function c(e,t,n){for(var r=t.next,a=0;a"+i.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,o=n.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),o&&e.close()}),!1),a):a;var d=a.util.currentScript();function g(){a.manual||a.highlightAll()}if(d&&(a.filename=d.src,d.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",g):window.requestAnimationFrame?window.requestAnimationFrame(g):window.setTimeout(g,16)}return a}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});q&&(q=X),void 0!==t&&(t.Prism=X),Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var a={};a[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"font-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+i+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+i+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism);var j=class extends H{constructor(t,n){super(),document.getElementById("edit").addEventListener("input",(n=>{let r=document.querySelector("#highlight-content");this.textEditor=t;let a=n.target.value;r.innerHTML=a.replace(new RegExp("&","g"),"&").replace(new RegExp("<","g"),"<");let i=document.getElementById("highlight").offsetHeight;document.getElementById("edit-post-wrapper").style.height=i+"px",n.target.style.height=i+30+"px",e(q).highlightElement(r)})),document.getElementById("edit").addEventListener("scroll",(e=>{let t=document.querySelector("#highlight");t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft})),document.getElementById("edit").dispatchEvent(new Event("input")),this.setInputs(),window.addEventListener("scroll",(()=>{var e=n;window.pageYOffset+5>=e?document.getElementById("edit-control").style.position="fixed":document.getElementById("edit-control").style.position="relative"}))}setInputs(){for(var e=document.querySelectorAll(".editor-button"),t=0,n=e.length;tthis.handleEditorOption(e)),!1)}notify(e,t){switch(e){case P:document.getElementById("submit-update").classList.add("icon-hide"),document.getElementById("submit-good").classList.remove("icon-hide"),document.getElementById("edit-update").classList.remove("submit-start"),document.getElementById("edit-update").classList.add("submit-cool"),setTimeout((()=>{document.getElementById("submit-update").classList.remove("icon-hide"),document.getElementById("submit-good").classList.add("icon-hide"),document.getElementById("edit-update").classList.add("submit-start"),document.getElementById("edit-update").classList.remove("submit-cool")}),2e3);break;case"postAdded":break;case D:{let e=this.textEditor.value.length,n=this.textEditor.selectionStart,r=this.textEditor.selectionEnd,a="![image alt text]("+t+")";this.textEditor.value=this.textEditor.value.substring(0,n)+a+this.textEditor.value.substring(r,e),document.getElementById("edit").dispatchEvent(new Event("input"));break}}}handleEditorOption(e){e.preventDefault();let t=this.textEditor.value.length,n=this.textEditor.selectionStart,r=this.textEditor.selectionEnd,a=this.textEditor.value.substring(n,r),i="";switch(e.target.id){case"edit-bold":i="**"+a+"**",this.textEditor.value=this.textEditor.value.substring(0,n)+i+this.textEditor.value.substring(r,t);break;case"edit-italic":i="*"+a+"*",this.textEditor.value=this.textEditor.value.substring(0,n)+i+this.textEditor.value.substring(r,t);break;case"edit-strikethrough":i="~~"+a+"~~",this.textEditor.value=this.textEditor.value.substring(0,n)+i+this.textEditor.value.substring(r,t);break;case"edit-header1":i="# "+a+"\n",this.textEditor.value=this.textEditor.value.substring(0,n)+i+this.textEditor.value.substring(r,t);break;case"edit-header2":i="## "+a+"\n",this.textEditor.value=this.textEditor.value.substring(0,n)+i+this.textEditor.value.substring(r,t);break;case"edit-header3":i="### "+a+"\n",this.textEditor.value=this.textEditor.value.substring(0,n)+i+this.textEditor.value.substring(r,t);break;case"edit-link":i="["+a+"]("+prompt("Let's get that url, boss").toLowerCase()+")",this.textEditor.value=this.textEditor.value.substring(0,n)+i+this.textEditor.value.substring(r,t);break;case"edit-image":this.caretPos=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(t)&&(n=t,t=null);var r=N(n),a=U(e,r);return t||0===t?a.setPos(t):a.getPosition()}(this.textEditor).pos,this.emitEvent(D);break;case"submit-save":case"edit-save":this.emitEvent(B);break;case"submit-update":case"edit-update":this.emitEvent(L);break;case"edit-delete":this.emitEvent(_)}document.getElementById("edit").dispatchEvent(new Event("input"))}},Y={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},W={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},$=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],z={CSS:{},springs:{}};function G(e,t,n){return Math.min(Math.max(e,t),n)}function Q(e,t){return e.indexOf(t)>-1}function V(e,t){return e.apply(null,t)}var J={arr:function(e){return Array.isArray(e)},obj:function(e){return Q(Object.prototype.toString.call(e),"Object")},pth:function(e){return J.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return e.nodeType||J.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},nil:function(e){return J.und(e)||null===e},hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},rgb:function(e){return/^rgb/.test(e)},hsl:function(e){return/^hsl/.test(e)},col:function(e){return J.hex(e)||J.rgb(e)||J.hsl(e)},key:function(e){return!Y.hasOwnProperty(e)&&!W.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function Z(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function K(e,t){var n=Z(e),r=G(J.und(n[0])?1:n[0],.1,100),a=G(J.und(n[1])?100:n[1],.1,100),i=G(J.und(n[2])?10:n[2],.1,100),o=G(J.und(n[3])?0:n[3],.1,100),s=Math.sqrt(a/r),l=i/(2*Math.sqrt(a*r)),u=l<1?s*Math.sqrt(1-l*l):0,c=l<1?(l*s-o)/u:-o+s;function d(e){var n=t?t*e/1e3:e;return n=l<1?Math.exp(-n*l*s)*(1*Math.cos(u*n)+c*Math.sin(u*n)):(1+c*n)*Math.exp(-n*s),0===e||1===e?e:1-n}return t?d:function(){var t=z.springs[e];if(t)return t;for(var n=1/6,r=0,a=0;;)if(1===d(r+=n)){if(++a>=16)break}else a=0;var i=r*n*1e3;return z.springs[e]=i,i}}function ee(e){return void 0===e&&(e=10),function(t){return Math.ceil(G(t,1e-6,1)*e)*(1/e)}}var te,ne,re=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function r(e){return 3*e}function a(e,a,i){return((t(a,i)*e+n(a,i))*e+r(a))*e}function i(e,a,i){return 3*t(a,i)*e*e+2*n(a,i)*e+r(a)}return function(t,n,r,o){if(0<=t&&t<=1&&0<=r&&r<=1){var s=new Float32Array(11);if(t!==n||r!==o)for(var l=0;l<11;++l)s[l]=a(l*e,t,r);return function(e){return t===n&&r===o||0===e||1===e?e:a(u(e),n,o)}}function u(n){for(var o=0,l=1;10!==l&&s[l]<=n;++l)o+=e;--l;var u=o+(n-s[l])/(s[l+1]-s[l])*e,c=i(u,t,r);return c>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var s=i(t,n,r);if(0===s)return t;t-=(a(t,n,r)-e)/s}return t}(n,u,t,r):0===c?u:function(e,t,n,r,i){var o,s,l=0;do{(o=a(s=t+(n-t)/2,r,i)-e)>0?n=s:t=s}while(Math.abs(o)>1e-7&&++l<10);return s}(n,o,o+e,t,r)}}}(),ae=(te={linear:function(){return function(e){return e}}},ne={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},Circ:function(){return function(e){return 1-Math.sqrt(1-e*e)}},Back:function(){return function(e){return e*e*(3*e-2)}},Bounce:function(){return function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}},Elastic:function(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var n=G(e,1,10),r=G(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(e,t){ne[e]=function(){return function(e){return Math.pow(e,t+2)}}})),Object.keys(ne).forEach((function(e){var t=ne[e];te["easeIn"+e]=t,te["easeOut"+e]=function(e,n){return function(r){return 1-t(e,n)(1-r)}},te["easeInOut"+e]=function(e,n){return function(r){return r<.5?t(e,n)(2*r)/2:1-t(e,n)(-2*r+2)/2}},te["easeOutIn"+e]=function(e,n){return function(r){return r<.5?(1-t(e,n)(1-2*r))/2:(t(e,n)(2*r-1)+1)/2}}})),te);function ie(e,t){if(J.fnc(e))return e;var n=e.split("(")[0],r=ae[n],a=Z(e);switch(n){case"spring":return K(e,t);case"cubicBezier":return V(re,a);case"steps":return V(ee,a);default:return V(r,a)}}function oe(e){try{return document.querySelectorAll(e)}catch(e){return}}function se(e,t){for(var n=e.length,r=arguments.length>=2?arguments[1]:void 0,a=[],i=0;i1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==o)t=n=r=s;else{var c=s<.5?s*(1+o):s+o-s*o,d=2*s-c;t=u(d,c,i+1/3),n=u(d,c,i),r=u(d,c,i-1/3)}return"rgba("+255*t+","+255*n+","+255*r+","+l+")"}(e):void 0;var t,n}function me(e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(e);if(t)return t[1]}function fe(e,t){return J.fnc(e)?e(t.target,t.id,t.total):e}function ve(e,t){return e.getAttribute(t)}function be(e,t,n){if(ce([n,"deg","rad","turn"],me(t)))return t;var r=z.CSS[t+n];if(!J.und(r))return r;var a=document.createElement(e.tagName),i=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;i.appendChild(a),a.style.position="absolute",a.style.width=100+n;var o=100/a.offsetWidth;i.removeChild(a);var s=o*parseFloat(t);return z.CSS[t+n]=s,s}function ye(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?be(e,a,n):a}}function Ee(e,t){return J.dom(e)&&!J.inp(e)&&(!J.nil(ve(e,t))||J.svg(e)&&e[t])?"attribute":J.dom(e)&&ce($,t)?"transform":J.dom(e)&&"transform"!==t&&ye(e,t)?"css":null!=e[t]?"object":void 0}function we(e){if(J.dom(e)){for(var t,n=e.style.transform||"",r=/(\w+)\(([^)]*)\)/g,a=new Map;t=r.exec(n);)a.set(t[1],t[2]);return a}}function ke(e,t,n,r){var a=Q(t,"scale")?1:0+function(e){return Q(e,"translate")||"perspective"===e?"px":Q(e,"rotate")||Q(e,"skew")?"deg":void 0}(t),i=we(e).get(t)||a;return n&&(n.transforms.list.set(t,i),n.transforms.last=t),r?be(e,i,r):i}function Ie(e,t,n,r){switch(Ee(e,t)){case"transform":return ke(e,t,r,n);case"css":return ye(e,t,n);case"attribute":return ve(e,t);default:return e[t]||0}}function Se(e,t){var n=/^(\*=|\+=|-=)/.exec(e);if(!n)return e;var r=me(e)||0,a=parseFloat(t),i=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return a+i+r;case"-":return a-i+r;case"*":return a*i+r}}function xe(e,t){if(J.col(e))return he(e);if(/\s/g.test(e))return e;var n=me(e),r=n?e.substr(0,e.length-n.length):e;return t?r+t:r}function Pe(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Te(e){for(var t,n=e.points,r=0,a=0;a0&&(r+=Pe(t,i)),t=i}return r}function Ae(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*ve(e,"r")}(e);case"rect":return function(e){return 2*ve(e,"width")+2*ve(e,"height")}(e);case"line":return function(e){return Pe({x:ve(e,"x1"),y:ve(e,"y1")},{x:ve(e,"x2"),y:ve(e,"y2")})}(e);case"polyline":return Te(e);case"polygon":return function(e){var t=e.points;return Te(e)+Pe(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function _e(e,t){var n=t||{},r=n.el||function(e){for(var t=e.parentNode;J.svg(t)&&J.svg(t.parentNode);)t=t.parentNode;return t}(e),a=r.getBoundingClientRect(),i=ve(r,"viewBox"),o=a.width,s=a.height,l=n.viewBox||(i?i.split(" "):[0,0,o,s]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:o,h:s,vW:l[2],vH:l[3]}}function De(e,t,n){function r(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var a=_e(e.el,e.svg),i=r(),o=r(-1),s=r(1),l=n?1:a.w/a.vW,u=n?1:a.h/a.vH;switch(e.property){case"x":return(i.x-a.x)*l;case"y":return(i.y-a.y)*u;case"angle":return 180*Math.atan2(s.y-o.y,s.x-o.x)/Math.PI}}function Be(e,t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=xe(J.pth(e)?e.totalLength:e,t)+"";return{original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:J.str(e)||t?r.split(n):[]}}function Le(e){return se(e?le(J.arr(e)?e.map(ue):ue(e)):[],(function(e,t,n){return n.indexOf(e)===t}))}function Ce(e){var t=Le(e);return t.map((function(e,n){return{target:e,id:n,total:t.length,transforms:{list:we(e)}}}))}function Oe(e,t){var n=de(t);if(/^spring/.test(n.easing)&&(n.duration=K(n.easing)),J.arr(e)){var r=e.length;2===r&&!J.obj(e[0])?e={value:e}:J.fnc(t.duration)||(n.duration=t.duration/r)}var a=J.arr(e)?e:[e];return a.map((function(e,n){var r=J.obj(e)&&!J.pth(e)?e:{value:e};return J.und(r.delay)&&(r.delay=n?0:t.delay),J.und(r.endDelay)&&(r.endDelay=n===a.length-1?t.endDelay:0),r})).map((function(e){return pe(e,n)}))}function Me(e,t){var n=[],r=t.keyframes;for(var a in r&&(t=pe(function(e){for(var t=se(le(e.map((function(e){return Object.keys(e)}))),(function(e){return J.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),n={},r=function(r){var a=t[r];n[a]=e.map((function(e){var t={};for(var n in e)J.key(n)?n==a&&(t.value=e[n]):t[n]=e[n];return t}))},a=0;a0?requestAnimationFrame(t):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){We.suspendWhenDocumentHidden&&(Ye()?e=cancelAnimationFrame(e):(Xe.forEach((function(e){return e._onDocumentVisibility()})),je()))})),function(){e||Ye()&&We.suspendWhenDocumentHidden||!(Xe.length>0)||(e=requestAnimationFrame(t))}}();function Ye(){return!!document&&document.hidden}function We(e){void 0===e&&(e={});var t,n=0,r=0,a=0,i=0,o=null;function s(e){var t=window.Promise&&new Promise((function(e){return o=e}));return e.finished=t,t}var l=function(e){var t=ge(Y,e),n=ge(W,e),r=Me(n,e),a=Ce(e.targets),i=Ue(a,r),o=He(i,n),s=qe;return qe++,pe(t,{id:s,children:[],animatables:a,animations:i,duration:o.duration,delay:o.delay,endDelay:o.endDelay})}(e);s(l);function u(){var e=l.direction;"alternate"!==e&&(l.direction="normal"!==e?"normal":"reverse"),l.reversed=!l.reversed,t.forEach((function(e){return e.reversed=l.reversed}))}function c(e){return l.reversed?l.duration-e:e}function d(){n=0,r=c(l.currentTime)*(1/We.speed)}function g(e,t){t&&t.seek(e-t.timelineOffset)}function p(e){for(var t=0,n=l.animations,r=n.length;t2||(b=Math.round(b*p)/p)),h.push(b)}var w=g.length;if(w){f=g[0];for(var k=0;k0&&(l.began=!0,h("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,h("loopBegin")),v<=m&&0!==l.currentTime&&p(0),(v>=f&&l.currentTime!==d||!d)&&p(d),v>m&&v=d&&(r=0,l.remaining&&!0!==l.remaining&&l.remaining--,l.remaining?(n=a,h("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&u()):(l.paused=!0,l.completed||(l.completed=!0,h("loopComplete"),h("complete"),!l.passThrough&&"Promise"in window&&(o(),s(l)))))}return l.reset=function(){var e=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===e,l.remaining=l.loop,t=l.children;for(var n=i=t.length;n--;)l.children[n].reset();(l.reversed&&!0!==l.loop||"alternate"===e&&1===l.loop)&&l.remaining++,p(l.reversed?l.duration:0)},l._onDocumentVisibility=d,l.set=function(e,t){return Fe(e,t),l},l.tick=function(e){a=e,n||(n=a),m((a+(r-n))*We.speed)},l.seek=function(e){m(c(e))},l.pause=function(){l.paused=!0,d()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,Xe.push(l),d(),je())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.remove=function(e){ze(Le(e),l)},l.reset(),l.autoplay&&l.play(),l}function $e(e,t){for(var n=t.length;n--;)ce(e,t[n].animatable.target)&&t.splice(n,1)}function ze(e,t){var n=t.animations,r=t.children;$e(e,n);for(var a=r.length;a--;){var i=r[a],o=i.animations;$e(e,o),o.length||i.children.length||r.splice(a,1)}n.length||r.length||t.pause()}We.version="3.2.1",We.speed=1,We.suspendWhenDocumentHidden=!0,We.running=Xe,We.remove=function(e){for(var t=Le(e),n=Xe.length;n--;){ze(t,Xe[n])}},We.get=Ie,We.set=Fe,We.convertPx=be,We.path=function(e,t){var n=J.str(e)?oe(e)[0]:e,r=t||100;return function(e){return{property:e,el:n,svg:_e(n),totalLength:Ae(n)*(r/100)}}},We.setDashoffset=function(e){var t=Ae(e);return e.setAttribute("stroke-dasharray",t),t},We.stagger=function(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?ie(t.easing):null,a=t.grid,i=t.axis,o=t.from||0,s="first"===o,l="center"===o,u="last"===o,c=J.arr(e),d=c?parseFloat(e[0]):parseFloat(e),g=c?parseFloat(e[1]):0,p=me(c?e[1]:e)||0,h=t.start||0+(c?d:0),m=[],f=0;return function(e,t,v){if(s&&(o=0),l&&(o=(v-1)/2),u&&(o=v-1),!m.length){for(var b=0;b-1&&Xe.splice(a,1);for(var s=0;s{Ge({targets:Ve,rotateX:"0",easing:"easeInOutQuint",duration:700}),Ge({targets:Ze,backgroundColor:n,easing:"easeInOutQuint",duration:700,complete:()=>{setTimeout((()=>{null!==t&&Ge({targets:Ve,rotateX:"-120",easing:"easeInOutQuint",duration:700,complete:()=>{Ge({targets:Qe,marginTop:"-55",easing:"easeInOutQuint",delay:700,duration:50})}})}),1e3)}})}})}} +// modules are defined as an array +// [ module function, map of requires ] +// +// map of requires is short require name -> numeric require +// +// anything defined in a previous bundle is accessed via the +// orig method which is the require for previous bundles + +(function (modules, entry, mainEntry, parcelRequireName, globalName) { + /* eslint-disable no-undef */ + var globalObject = + typeof globalThis !== 'undefined' + ? globalThis + : typeof self !== 'undefined' + ? self + : typeof window !== 'undefined' + ? window + : typeof global !== 'undefined' + ? global + : {}; + /* eslint-enable no-undef */ + + // Save the require from previous bundle to this closure if any + var previousRequire = + typeof globalObject[parcelRequireName] === 'function' && + globalObject[parcelRequireName]; + + var cache = previousRequire.cache || {}; + // Do not use `require` to prevent Webpack from trying to bundle this call + var nodeRequire = + typeof module !== 'undefined' && + typeof module.require === 'function' && + module.require.bind(module); + + function newRequire(name, jumped) { + if (!cache[name]) { + if (!modules[name]) { + // if we cannot find the module within our internal map or + // cache jump to the current global require ie. the last bundle + // that was added to the page. + var currentRequire = + typeof globalObject[parcelRequireName] === 'function' && + globalObject[parcelRequireName]; + if (!jumped && currentRequire) { + return currentRequire(name, true); + } + + // If there are other bundles on this page the require from the + // previous one is saved to 'previousRequire'. Repeat this as + // many times as there are bundles until the module is found or + // we exhaust the require chain. + if (previousRequire) { + return previousRequire(name, true); + } + + // Try the node require function if it exists. + if (nodeRequire && typeof name === 'string') { + return nodeRequire(name); + } + + var err = new Error("Cannot find module '" + name + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + } + + localRequire.resolve = resolve; + localRequire.cache = {}; + + var module = (cache[name] = new newRequire.Module(name)); + + modules[name][0].call( + module.exports, + localRequire, + module, + module.exports, + this + ); + } + + return cache[name].exports; + + function localRequire(x) { + return newRequire(localRequire.resolve(x)); + } + + function resolve(x) { + return modules[name][1][x] || x; + } + } + + function Module(moduleName) { + this.id = moduleName; + this.bundle = newRequire; + this.exports = {}; + } + + newRequire.isParcelRequire = true; + newRequire.Module = Module; + newRequire.modules = modules; + newRequire.cache = cache; + newRequire.parent = previousRequire; + newRequire.register = function (id, exports) { + modules[id] = [ + function (require, module) { + module.exports = exports; + }, + {}, + ]; + }; + + Object.defineProperty(newRequire, 'root', { + get: function () { + return globalObject[parcelRequireName]; + }, + }); + + globalObject[parcelRequireName] = newRequire; + + for (var i = 0; i < entry.length; i++) { + newRequire(entry[i]); + } + + if (mainEntry) { + // Expose entry point to Node, AMD or browser globals + // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js + var mainExports = newRequire(mainEntry); + + // CommonJS + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = mainExports; + + // RequireJS + } else if (typeof define === 'function' && define.amd) { + define(function () { + return mainExports; + }); + + //