From b5e07ea14f72da659eb7db407413da0cd348a530 Mon Sep 17 00:00:00 2001 From: Joxit Date: Thu, 10 May 2018 23:36:39 +0200 Subject: [PATCH] [feat #35] Better error message for http registries on https sites --- .gitignore | 1 + dist/scripts/script-static.js | 2 +- dist/scripts/script.js | 2 +- dist/scripts/tags-static.js | 2 +- dist/scripts/tags.js | 2 +- dist/scripts/vendor.js | 4 ++-- package.json | 4 ++-- src/scripts/http.js | 11 +++++++++++ src/tags/catalog.tag | 2 +- src/tags/taglist.tag | 2 +- 10 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index f239ee0..6d6a4c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .project node_modules +package-lock.json diff --git a/dist/scripts/script-static.js b/dist/scripts/script-static.js index 9e945f7..147074c 100644 --- a/dist/scripts/script-static.js +++ b/dist/scripts/script-static.js @@ -15,4 +15,4 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -function Http(){this.oReq=new XMLHttpRequest,this.oReq.hasHeader=Http.hasHeader,this._events={},this._headers={}}Http.prototype.addEventListener=function(e,t){this._events[e]=t;var s=this;switch(e){case"loadend":s.oReq.addEventListener("loadend",function(){if(401==this.status){var e=new XMLHttpRequest;e.open(s._method,s._url);for(key in s._events)e.addEventListener(key,s._events[key]);for(key in s._headers)e.setRequestHeader(key,s._headers[key]);e.withCredentials=!0,e.hasHeader=Http.hasHeader,e.send()}else t.bind(this)()});break;case"load":s.oReq.addEventListener("load",function(){401!==this.status&&t.bind(this)()});break;default:s.oReq.addEventListener(e,function(){t.bind(this)()})}},Http.prototype.setRequestHeader=function(e,t){this.oReq.setRequestHeader(e,t),this._headers[e]=t},Http.prototype.open=function(e,t){this._method=e,this._url=t,this.oReq.open(e,t)},Http.prototype.send=function(){this.oReq.send()},Http.hasHeader=function(e){return this.getAllResponseHeaders().split("\n").some(function(t){return new RegExp("^"+e+":","i").test(t)})};var registryUI={};registryUI.url=function(){return"${URL}"},registryUI.name=function(){return"${REGISTRY_TITLE}"},registryUI.isImageRemoveActivated=!0,registryUI.catalog={},registryUI.taglist={},riot.mount("catalog"),riot.mount("taglist"),riot.mount("app"); \ No newline at end of file +function Http(){this.oReq=new XMLHttpRequest,this.oReq.hasHeader=Http.hasHeader,this.oReq.getErrorMessage=Http.getErrorMessage,this._events={},this._headers={}}Http.prototype.addEventListener=function(e,t){this._events[e]=t;var r=this;switch(e){case"loadend":r.oReq.addEventListener("loadend",function(){if(401==this.status){var e=new XMLHttpRequest;e.open(r._method,r._url);for(key in r._events)e.addEventListener(key,r._events[key]);for(key in r._headers)e.setRequestHeader(key,r._headers[key]);e.withCredentials=!0,e.hasHeader=Http.hasHeader,e.getErrorMessage=Http.getErrorMessage,e.send()}else t.bind(this)()});break;case"load":r.oReq.addEventListener("load",function(){401!==this.status&&t.bind(this)()});break;default:r.oReq.addEventListener(e,function(){t.bind(this)()})}},Http.prototype.setRequestHeader=function(e,t){this.oReq.setRequestHeader(e,t),this._headers[e]=t},Http.prototype.open=function(e,t){this._method=e,this._url=t,this.oReq.open(e,t)},Http.prototype.send=function(){this.oReq.send()},Http.hasHeader=function(e){return this.getAllResponseHeaders().split("\n").some(function(t){return new RegExp("^"+e+":","i").test(t)})},Http.getErrorMessage=function(){return registryUI.url()&®istryUI.url().match("^http://")&&"https:"===window.location.protocol?"Mixed Content: The page at `"+window.location.origin+"` was loaded over HTTPS, but requested an insecure server endpoint `"+registryUI.url()+"`. This request has been blocked; the content must be served over HTTPS.":registryUI.url()?"An error occured":"Incorrect server endpoint."};var registryUI={};registryUI.url=function(){return"${URL}"},registryUI.name=function(){return"${REGISTRY_TITLE}"},registryUI.isImageRemoveActivated=!0,registryUI.catalog={},registryUI.taglist={},riot.mount("catalog"),riot.mount("taglist"),riot.mount("app"); \ No newline at end of file diff --git a/dist/scripts/script.js b/dist/scripts/script.js index d81b51d..e09e03b 100644 --- a/dist/scripts/script.js +++ b/dist/scripts/script.js @@ -15,4 +15,4 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -function Http(){this.oReq=new XMLHttpRequest,this.oReq.hasHeader=Http.hasHeader,this._events={},this._headers={}}Http.prototype.addEventListener=function(e,t){this._events[e]=t;var r=this;switch(e){case"loadend":r.oReq.addEventListener("loadend",function(){if(401==this.status){var e=new XMLHttpRequest;e.open(r._method,r._url);for(key in r._events)e.addEventListener(key,r._events[key]);for(key in r._headers)e.setRequestHeader(key,r._headers[key]);e.withCredentials=!0,e.hasHeader=Http.hasHeader,e.send()}else t.bind(this)()});break;case"load":r.oReq.addEventListener("load",function(){401!==this.status&&t.bind(this)()});break;default:r.oReq.addEventListener(e,function(){t.bind(this)()})}},Http.prototype.setRequestHeader=function(e,t){this.oReq.setRequestHeader(e,t),this._headers[e]=t},Http.prototype.open=function(e,t){this._method=e,this._url=t,this.oReq.open(e,t)},Http.prototype.send=function(){this.oReq.send()},Http.hasHeader=function(e){return this.getAllResponseHeaders().split("\n").some(function(t){return new RegExp("^"+e+":","i").test(t)})};var registryUI={};registryUI.URL_QUERY_PARAM_REGEX=/[&?]url=/,registryUI.URL_PARAM_REGEX=/^url=/,registryUI.name=registryUI.url=function(e){if(!registryUI._url){var t=registryUI.getUrlQueryParam();if(t)try{return registryUI._url=registryUI.decodeURI(t),registryUI._url}catch(e){console.log(e)}registryUI._url=registryUI.getRegistryServer(0)}return registryUI._url},registryUI.getRegistryServer=function(e){try{var t=JSON.parse(localStorage.getItem("registryServer"));if(t instanceof Array)return isNaN(e)?t.map(function(e){return e.trim().replace(/\/*$/,"")}):t[e]}catch(e){}return isNaN(e)?[]:""},registryUI.addServer=function(e){var t=registryUI.getRegistryServer();e=e.trim().replace(/\/*$/,"");var r=t.indexOf(e);r==-1&&(t.push(e),registryUI._url||registryUI.updateHistory(e),localStorage.setItem("registryServer",JSON.stringify(t)))},registryUI.changeServer=function(e){var t=registryUI.getRegistryServer();e=e.trim().replace(/\/*$/,"");var r=t.indexOf(e);r!=-1&&(t.splice(r,1),t=[e].concat(t),registryUI.updateHistory(e),localStorage.setItem("registryServer",JSON.stringify(t)))},registryUI.removeServer=function(e){var t=registryUI.getRegistryServer();e=e.trim().replace(/\/*$/,"");var r=t.indexOf(e);r!=-1&&(t.splice(r,1),localStorage.setItem("registryServer",JSON.stringify(t)),e==registryUI.url()&&(registryUI.updateHistory(registryUI.getRegistryServer(0)),route("")))},registryUI.updateHistory=function(e){history.pushState(null,"",(e?"?url="+registryUI.encodeURI(e):"?")+window.location.hash),registryUI._url=e},registryUI.getUrlQueryParam=function(){var e=window.location.search;if(registryUI.URL_QUERY_PARAM_REGEX.test(e)){var t=e.split(/^\?|&/).find(function(e){return e&®istryUI.URL_PARAM_REGEX.test(e)});return t?t.replace(registryUI.URL_PARAM_REGEX,""):t}},registryUI.encodeURI=function(e){return e.indexOf("&")<0?window.encodeURIComponent(e):btoa(e)},registryUI.decodeURI=function(e){return e.startsWith("http")?window.decodeURIComponent(e):atob(e)},registryUI.isImageRemoveActivated=!0,registryUI.catalog={},registryUI.taglist={},riot.mount("*"); \ No newline at end of file +function Http(){this.oReq=new XMLHttpRequest,this.oReq.hasHeader=Http.hasHeader,this.oReq.getErrorMessage=Http.getErrorMessage,this._events={},this._headers={}}Http.prototype.addEventListener=function(e,r){this._events[e]=r;var t=this;switch(e){case"loadend":t.oReq.addEventListener("loadend",function(){if(401==this.status){var e=new XMLHttpRequest;e.open(t._method,t._url);for(key in t._events)e.addEventListener(key,t._events[key]);for(key in t._headers)e.setRequestHeader(key,t._headers[key]);e.withCredentials=!0,e.hasHeader=Http.hasHeader,e.getErrorMessage=Http.getErrorMessage,e.send()}else r.bind(this)()});break;case"load":t.oReq.addEventListener("load",function(){401!==this.status&&r.bind(this)()});break;default:t.oReq.addEventListener(e,function(){r.bind(this)()})}},Http.prototype.setRequestHeader=function(e,r){this.oReq.setRequestHeader(e,r),this._headers[e]=r},Http.prototype.open=function(e,r){this._method=e,this._url=r,this.oReq.open(e,r)},Http.prototype.send=function(){this.oReq.send()},Http.hasHeader=function(e){return this.getAllResponseHeaders().split("\n").some(function(r){return new RegExp("^"+e+":","i").test(r)})},Http.getErrorMessage=function(){return registryUI.url()&®istryUI.url().match("^http://")&&"https:"===window.location.protocol?"Mixed Content: The page at `"+window.location.origin+"` was loaded over HTTPS, but requested an insecure server endpoint `"+registryUI.url()+"`. This request has been blocked; the content must be served over HTTPS.":registryUI.url()?"An error occured":"Incorrect server endpoint."};var registryUI={};registryUI.URL_QUERY_PARAM_REGEX=/[&?]url=/,registryUI.URL_PARAM_REGEX=/^url=/,registryUI.name=registryUI.url=function(e){if(!registryUI._url){var r=registryUI.getUrlQueryParam();if(r)try{return registryUI._url=registryUI.decodeURI(r),registryUI._url}catch(e){console.log(e)}registryUI._url=registryUI.getRegistryServer(0)}return registryUI._url},registryUI.getRegistryServer=function(e){try{var r=JSON.parse(localStorage.getItem("registryServer"));if(r instanceof Array)return isNaN(e)?r.map(function(e){return e.trim().replace(/\/*$/,"")}):r[e]}catch(e){}return isNaN(e)?[]:""},registryUI.addServer=function(e){var r=registryUI.getRegistryServer();e=e.trim().replace(/\/*$/,"");var t=r.indexOf(e);t==-1&&(r.push(e),registryUI._url||registryUI.updateHistory(e),localStorage.setItem("registryServer",JSON.stringify(r)))},registryUI.changeServer=function(e){var r=registryUI.getRegistryServer();e=e.trim().replace(/\/*$/,"");var t=r.indexOf(e);t!=-1&&(r.splice(t,1),r=[e].concat(r),registryUI.updateHistory(e),localStorage.setItem("registryServer",JSON.stringify(r)))},registryUI.removeServer=function(e){var r=registryUI.getRegistryServer();e=e.trim().replace(/\/*$/,"");var t=r.indexOf(e);t!=-1&&(r.splice(t,1),localStorage.setItem("registryServer",JSON.stringify(r)),e==registryUI.url()&&(registryUI.updateHistory(registryUI.getRegistryServer(0)),route("")))},registryUI.updateHistory=function(e){history.pushState(null,"",(e?"?url="+registryUI.encodeURI(e):"?")+window.location.hash),registryUI._url=e},registryUI.getUrlQueryParam=function(){var e=window.location.search;if(registryUI.URL_QUERY_PARAM_REGEX.test(e)){var r=e.split(/^\?|&/).find(function(e){return e&®istryUI.URL_PARAM_REGEX.test(e)});return r?r.replace(registryUI.URL_PARAM_REGEX,""):r}},registryUI.encodeURI=function(e){return e.indexOf("&")<0?window.encodeURIComponent(e):btoa(e)},registryUI.decodeURI=function(e){return e.startsWith("http")?window.decodeURIComponent(e):atob(e)},registryUI.isImageRemoveActivated=!0,registryUI.catalog={},registryUI.taglist={},riot.mount("*"); \ No newline at end of file diff --git a/dist/scripts/tags-static.js b/dist/scripts/tags-static.js index a4a96b7..795026b 100644 --- a/dist/scripts/tags-static.js +++ b/dist/scripts/tags-static.js @@ -15,4 +15,4 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -riot.tag2("catalog",'

Repositories of {registryUI.name()}

  • send {item}
',"","",function(t){registryUI.catalog.instance=this,registryUI.catalog.display=function(){registryUI.catalog.repositories=[];var t=new Http;t.addEventListener("load",function(){registryUI.catalog.repositories=[],200==this.status?(registryUI.catalog.repositories=JSON.parse(this.responseText).repositories||[],registryUI.catalog.repositories.sort()):404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText)}),t.addEventListener("error",function(){registryUI.snackbar("An error occured",!0),registryUI.catalog.repositories=[]}),t.addEventListener("loadend",function(){registryUI.catalog.loadend=!0,registryUI.catalog.instance.update()}),t.open("GET",registryUI.url()+"/v2/_catalog"),t.send()},registryUI.catalog.go=function(t){route("taglist/"+t)},registryUI.catalog.display()}),riot.tag2("app",'
',"","",function(t){registryUI.appTag=this,route.base("#!"),route("",function(){route.routeName="home",registryUI.catalog.display&&(registryUI.catalog.loadend=!1,registryUI.catalog.display()),registryUI.appTag.update()}),route("/taglist/*",function(t){route.routeName="taglist",registryUI.taglist.name=t,registryUI.taglist.display&&(registryUI.taglist.loadend=!1,registryUI.taglist.display()),registryUI.appTag.update()}),registryUI.home=function(){"home"==route.routeName?registryUI.catalog.display():route("")},registryUI.snackbar=function(t,e){registryUI.appTag.tags["material-snackbar"].addToast({message:t,isError:e})},registryUI.errorSnackbar=function(t){return registryUI.snackbar(t,!0)},route.parser(null,function(t,e){const r=e.replace(/\?/g,"\\?").replace(/\*/g,"([^?#]+?)").replace(/\.\./,".*"),a=new RegExp("^"+r+"$"),s=t.match(a);if(s)return s.slice(1)}),route.start(!0)}),riot.tag2("taglist",'
arrow_back

Tags of {registryUI.name() + \'/\' + registryUI.taglist.name}

Repository Size Tag
{registryUI.taglist.name} {item}
',"","",function(t){registryUI.taglist.instance=this,registryUI.taglist.display=function(){if(registryUI.taglist.tags=[],"taglist"==route.routeName){var t=new Http;registryUI.taglist.instance.update(),t.addEventListener("load",function(){registryUI.taglist.tags=[],200==this.status?(registryUI.taglist.tags=JSON.parse(this.responseText).tags||[],registryUI.taglist.tags.sort()):404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText,!0)}),t.addEventListener("error",function(){registryUI.snackbar("An error occured",!0),registryUI.taglist.tags=[]}),t.addEventListener("loadend",function(){registryUI.taglist.loadend=!0,registryUI.taglist.instance.update()}),t.open("GET",registryUI.url()+"/v2/"+registryUI.taglist.name+"/tags/list"),t.send(),registryUI.taglist.asc=!0}},registryUI.taglist.display(),registryUI.taglist.instance.update(),registryUI.taglist.reverse=function(){registryUI.taglist.asc?(registryUI.taglist.tags.reverse(),registryUI.taglist.asc=!1):(registryUI.taglist.tags.sort(),registryUI.taglist.asc=!0),registryUI.taglist.instance.update()},registryUI.taglist.refresh=function(){route(registryUI.taglist.name)}}),riot.tag2("remove-image",' delete ',"","",function(t){registryUI.removeImage=registryUI.removeImage||{},registryUI.removeImage.update=this.update,registryUI.removeImage.remove=function(t,e){var r=new Http;r.addEventListener("loadend",function(){if(registryUI.taglist.refresh(),200==this.status){if(!this.hasHeader("Docker-Content-Digest"))return void registryUI.errorSnackbar("You need to add Access-Control-Expose-Headers: ['Docker-Content-Digest'] in your server configuration.");var r=this.getResponseHeader("Docker-Content-Digest"),a=new Http;a.addEventListener("loadend",function(){200==this.status||202==this.status?(registryUI.taglist.refresh(),registryUI.snackbar("Deleting "+t+":"+e+" image. Run `registry garbage-collect config.yml` on your registry")):404==this.status?registryUI.errorSnackbar("Digest not found"):registryUI.snackbar(this.responseText)}),a.open("DELETE",registryUI.url()+"/v2/"+t+"/manifests/"+r),a.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),a.addEventListener("error",function(){registryUI.errorSnackbar("An error occurred when deleting image. Check if your server accept DELETE methods Access-Control-Allow-Methods: ['DELETE'].")}),a.send()}else 404==this.status?registryUI.errorSnackbar("Manifest for "+t+":"+e+" not found"):registryUI.snackbar(this.responseText)}),r.open("HEAD",registryUI.url()+"/v2/"+t+"/manifests/"+e),r.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),r.send()}}),riot.tag2("image-size","
{this.bytesToSize(this.size)}
","","",function(t){var e=this;this.bytesToSize=function(t){var e=["Bytes","KB","MB","GB","TB"];if(void 0==t||isNaN(t))return"?";if(0==t)return"0 Byte";var r=parseInt(Math.floor(Math.log(t)/Math.log(1024)));return Math.ceil(t/Math.pow(1024,r))+" "+e[r]};var r=new Http;r.addEventListener("loadend",function(){200==this.status||202==this.status?(e.size=JSON.parse(this.responseText).layers.reduce(function(t,e){return t+e.size},0),e.update()):404==this.status?registryUI.errorSnackbar("Manifest for "+t.name+":"+t.tag+" not found"):registryUI.snackbar(this.responseText)}),r.open("GET",registryUI.url()+"/v2/"+t.name+"/manifests/"+t.tag),r.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),r.send()}); \ No newline at end of file +riot.tag2("catalog",'

Repositories of {registryUI.name()}

  • send {item}
',"","",function(t){registryUI.catalog.instance=this,registryUI.catalog.display=function(){registryUI.catalog.repositories=[];var t=new Http;t.addEventListener("load",function(){registryUI.catalog.repositories=[],200==this.status?(registryUI.catalog.repositories=JSON.parse(this.responseText).repositories||[],registryUI.catalog.repositories.sort()):404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText)}),t.addEventListener("error",function(){registryUI.snackbar(this.getErrorMessage(),!0),registryUI.catalog.repositories=[]}),t.addEventListener("loadend",function(){registryUI.catalog.loadend=!0,registryUI.catalog.instance.update()}),t.open("GET",registryUI.url()+"/v2/_catalog"),t.send()},registryUI.catalog.go=function(t){route("taglist/"+t)},registryUI.catalog.display()}),riot.tag2("app",'
',"","",function(t){registryUI.appTag=this,route.base("#!"),route("",function(){route.routeName="home",registryUI.catalog.display&&(registryUI.catalog.loadend=!1,registryUI.catalog.display()),registryUI.appTag.update()}),route("/taglist/*",function(t){route.routeName="taglist",registryUI.taglist.name=t,registryUI.taglist.display&&(registryUI.taglist.loadend=!1,registryUI.taglist.display()),registryUI.appTag.update()}),registryUI.home=function(){"home"==route.routeName?registryUI.catalog.display():route("")},registryUI.snackbar=function(t,e){registryUI.appTag.tags["material-snackbar"].addToast({message:t,isError:e})},registryUI.errorSnackbar=function(t){return registryUI.snackbar(t,!0)},route.parser(null,function(t,e){const r=e.replace(/\?/g,"\\?").replace(/\*/g,"([^?#]+?)").replace(/\.\./,".*"),a=new RegExp("^"+r+"$"),s=t.match(a);if(s)return s.slice(1)}),route.start(!0)}),riot.tag2("taglist",'
arrow_back

Tags of {registryUI.name() + \'/\' + registryUI.taglist.name}

Repository Size Tag
{registryUI.taglist.name} {item}
',"","",function(t){registryUI.taglist.instance=this,registryUI.taglist.display=function(){if(registryUI.taglist.tags=[],"taglist"==route.routeName){var t=new Http;registryUI.taglist.instance.update(),t.addEventListener("load",function(){registryUI.taglist.tags=[],200==this.status?(registryUI.taglist.tags=JSON.parse(this.responseText).tags||[],registryUI.taglist.tags.sort()):404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText,!0)}),t.addEventListener("error",function(){registryUI.snackbar(this.getErrorMessage(),!0),registryUI.taglist.tags=[]}),t.addEventListener("loadend",function(){registryUI.taglist.loadend=!0,registryUI.taglist.instance.update()}),t.open("GET",registryUI.url()+"/v2/"+registryUI.taglist.name+"/tags/list"),t.send(),registryUI.taglist.asc=!0}},registryUI.taglist.display(),registryUI.taglist.instance.update(),registryUI.taglist.reverse=function(){registryUI.taglist.asc?(registryUI.taglist.tags.reverse(),registryUI.taglist.asc=!1):(registryUI.taglist.tags.sort(),registryUI.taglist.asc=!0),registryUI.taglist.instance.update()},registryUI.taglist.refresh=function(){route(registryUI.taglist.name)}}),riot.tag2("remove-image",' delete ',"","",function(t){registryUI.removeImage=registryUI.removeImage||{},registryUI.removeImage.update=this.update,registryUI.removeImage.remove=function(t,e){var r=new Http;r.addEventListener("loadend",function(){if(registryUI.taglist.refresh(),200==this.status){if(!this.hasHeader("Docker-Content-Digest"))return void registryUI.errorSnackbar("You need to add Access-Control-Expose-Headers: ['Docker-Content-Digest'] in your server configuration.");var r=this.getResponseHeader("Docker-Content-Digest"),a=new Http;a.addEventListener("loadend",function(){200==this.status||202==this.status?(registryUI.taglist.refresh(),registryUI.snackbar("Deleting "+t+":"+e+" image. Run `registry garbage-collect config.yml` on your registry")):404==this.status?registryUI.errorSnackbar("Digest not found"):registryUI.snackbar(this.responseText)}),a.open("DELETE",registryUI.url()+"/v2/"+t+"/manifests/"+r),a.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),a.addEventListener("error",function(){registryUI.errorSnackbar("An error occurred when deleting image. Check if your server accept DELETE methods Access-Control-Allow-Methods: ['DELETE'].")}),a.send()}else 404==this.status?registryUI.errorSnackbar("Manifest for "+t+":"+e+" not found"):registryUI.snackbar(this.responseText)}),r.open("HEAD",registryUI.url()+"/v2/"+t+"/manifests/"+e),r.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),r.send()}}),riot.tag2("image-size","
{this.bytesToSize(this.size)}
","","",function(t){var e=this;this.bytesToSize=function(t){var e=["Bytes","KB","MB","GB","TB"];if(void 0==t||isNaN(t))return"?";if(0==t)return"0 Byte";var r=parseInt(Math.floor(Math.log(t)/Math.log(1024)));return Math.ceil(t/Math.pow(1024,r))+" "+e[r]};var r=new Http;r.addEventListener("loadend",function(){200==this.status||202==this.status?(e.size=JSON.parse(this.responseText).layers.reduce(function(t,e){return t+e.size},0),e.update()):404==this.status?registryUI.errorSnackbar("Manifest for "+t.name+":"+t.tag+" not found"):registryUI.snackbar(this.responseText)}),r.open("GET",registryUI.url()+"/v2/"+t.name+"/manifests/"+t.tag),r.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),r.send()}); \ No newline at end of file diff --git a/dist/scripts/tags.js b/dist/scripts/tags.js index cc21bf8..ca6687b 100644 --- a/dist/scripts/tags.js +++ b/dist/scripts/tags.js @@ -15,4 +15,4 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -riot.tag2("add",'
Add your Server ?
Write your URL without /v2
Add Cancel
',"","",function(e){registryUI.addTag=registryUI.addTag||{},this.one("mount",function(){registryUI.addTag.dialog=this.tags["material-popup"],registryUI.addTag.dialog.getAddServer=function(){return this.tags["material-input"]?this.tags["material-input"].value:""}}),registryUI.addTag.onkeyup=function(e){13==e.keyCode&®istryUI.addTag.add()},registryUI.addTag.show=function(){registryUI.addTag.dialog.open()},registryUI.addTag.add=function(){registryUI.addTag.dialog.getAddServer().length>0&®istryUI.addServer(registryUI.addTag.dialog.getAddServer()),registryUI.home(),registryUI.addTag.close()},registryUI.addTag.close=function(){registryUI.addTag.dialog.tags["material-input"].value="",registryUI.addTag.dialog.close()}}),riot.tag2("app",'
',"","",function(e){registryUI.appTag=this,route.base("#!"),route("",function(){route.routeName="home",registryUI.catalog.display&&(registryUI.catalog.loadend=!1,registryUI.catalog.display()),registryUI.appTag.update()}),route("/taglist/*",function(e){route.routeName="taglist",registryUI.taglist.name=e,registryUI.taglist.display&&(registryUI.taglist.loadend=!1,registryUI.taglist.display()),registryUI.appTag.update()}),registryUI.home=function(){"home"==route.routeName?registryUI.catalog.display():route("")},registryUI.snackbar=function(e,t){registryUI.appTag.tags["material-snackbar"].addToast({message:e,isError:t})},registryUI.errorSnackbar=function(e){return registryUI.snackbar(e,!0)},route.parser(null,function(e,t){const r=t.replace(/\?/g,"\\?").replace(/\*/g,"([^?#]+?)").replace(/\.\./,".*"),a=new RegExp("^"+r+"$"),i=e.match(a);if(i)return i.slice(1)}),route.start(!0)}),riot.tag2("catalog",'

Repositories of {registryUI.name()}

  • send {item}
',"","",function(e){registryUI.catalog.instance=this,registryUI.catalog.display=function(){registryUI.catalog.repositories=[];var e=new Http;e.addEventListener("load",function(){registryUI.catalog.repositories=[],200==this.status?(registryUI.catalog.repositories=JSON.parse(this.responseText).repositories||[],registryUI.catalog.repositories.sort()):404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText)}),e.addEventListener("error",function(){registryUI.snackbar("An error occured",!0),registryUI.catalog.repositories=[]}),e.addEventListener("loadend",function(){registryUI.catalog.loadend=!0,registryUI.catalog.instance.update()}),e.open("GET",registryUI.url()+"/v2/_catalog"),e.send()},registryUI.catalog.go=function(e){route("taglist/"+e)},registryUI.catalog.display()}),riot.tag2("change",'
Change your Server ?
Change Cancel
',"","",function(e){registryUI.changeTag=registryUI.changeTag||{},this.one("mount",function(){registryUI.changeTag.dialog=this.tags["material-popup"],registryUI.changeTag.dialog.getServerUrl=function(){return this.refs["server-list"]?this.refs["server-list"].value:""},registryUI.changeTag.dialog.on("updated",function(){this.refs["server-list"]&&(this.refs["server-list"].value=registryUI.url())})}),registryUI.changeTag.show=function(){registryUI.changeTag.dialog.open()},registryUI.changeTag.change=function(){registryUI.changeTag.dialog.getServerUrl().length>0&®istryUI.changeServer(registryUI.changeTag.dialog.getServerUrl()),registryUI.home(),registryUI.changeTag.dialog.close()},registryUI.changeTag.close=function(){registryUI.changeTag.dialog.close()}}),riot.tag2("image-size","
{this.bytesToSize(this.size)}
","","",function(e){var t=this;this.bytesToSize=function(e){var t=["Bytes","KB","MB","GB","TB"];if(void 0==e||isNaN(e))return"?";if(0==e)return"0 Byte";var r=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.ceil(e/Math.pow(1024,r))+" "+t[r]};var r=new Http;r.addEventListener("loadend",function(){200==this.status||202==this.status?(t.size=JSON.parse(this.responseText).layers.reduce(function(e,t){return e+t.size},0),t.update()):404==this.status?registryUI.errorSnackbar("Manifest for "+e.name+":"+e.tag+" not found"):registryUI.snackbar(this.responseText)}),r.open("GET",registryUI.url()+"/v2/"+e.name+"/manifests/"+e.tag),r.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),r.send()}),riot.tag2("menu",' more_vert

Add URL

Change URL

Remove URL

',"","",function(e){registryUI.menuTag=registryUI.menuTag||{},registryUI.menuTag.update=this.update,this.one("mount",function(e){var t=this;registryUI.menuTag.close=function(){t.tags["material-dropdown"].close(),t.update()},registryUI.menuTag.isOpen=function(){return t.tags["material-dropdown"].opened},registryUI.menuTag.toggle=function(){t.tags["material-dropdown"].opened?t.tags["material-dropdown"].close():t.tags["material-dropdown"].open(),t.update()}})}),riot.tag2("remove-image",' delete ',"","",function(e){registryUI.removeImage=registryUI.removeImage||{},registryUI.removeImage.update=this.update,registryUI.removeImage.remove=function(e,t){var r=new Http;r.addEventListener("loadend",function(){if(registryUI.taglist.refresh(),200==this.status){if(!this.hasHeader("Docker-Content-Digest"))return void registryUI.errorSnackbar("You need to add Access-Control-Expose-Headers: ['Docker-Content-Digest'] in your server configuration.");var r=this.getResponseHeader("Docker-Content-Digest"),a=new Http;a.addEventListener("loadend",function(){200==this.status||202==this.status?(registryUI.taglist.refresh(),registryUI.snackbar("Deleting "+e+":"+t+" image. Run `registry garbage-collect config.yml` on your registry")):404==this.status?registryUI.errorSnackbar("Digest not found"):registryUI.snackbar(this.responseText)}),a.open("DELETE",registryUI.url()+"/v2/"+e+"/manifests/"+r),a.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),a.addEventListener("error",function(){registryUI.errorSnackbar("An error occurred when deleting image. Check if your server accept DELETE methods Access-Control-Allow-Methods: ['DELETE'].")}),a.send()}else 404==this.status?registryUI.errorSnackbar("Manifest for "+e+":"+t+" not found"):registryUI.snackbar(this.responseText)}),r.open("HEAD",registryUI.url()+"/v2/"+e+"/manifests/"+t),r.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),r.send()}}),riot.tag2("remove",'
Remove your Registry Server ?
Close
',"","",function(e){registryUI.removeTag=registryUI.removeTag||{},registryUI.removeTag.update=this.update,registryUI.removeTag.removeUrl=function(e){registryUI.removeServer(e),registryUI.removeTag.close()},registryUI.removeTag.close=function(){registryUI.removeTag.dialog.close(),registryUI.removeTag.update()},registryUI.removeTag.show=function(){registryUI.removeTag.dialog.open()},this.one("mount",function(){registryUI.removeTag.dialog=this.tags["material-popup"]})}),riot.tag2("taglist",'
arrow_back

Tags of {registryUI.name() + \'/\' + registryUI.taglist.name}

Repository Size Tag
{registryUI.taglist.name} {item}
',"","",function(e){registryUI.taglist.instance=this,registryUI.taglist.display=function(){if(registryUI.taglist.tags=[],"taglist"==route.routeName){var e=new Http;registryUI.taglist.instance.update(),e.addEventListener("load",function(){registryUI.taglist.tags=[],200==this.status?(registryUI.taglist.tags=JSON.parse(this.responseText).tags||[],registryUI.taglist.tags.sort()):404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText,!0)}),e.addEventListener("error",function(){registryUI.snackbar("An error occured",!0),registryUI.taglist.tags=[]}),e.addEventListener("loadend",function(){registryUI.taglist.loadend=!0,registryUI.taglist.instance.update()}),e.open("GET",registryUI.url()+"/v2/"+registryUI.taglist.name+"/tags/list"),e.send(),registryUI.taglist.asc=!0}},registryUI.taglist.display(),registryUI.taglist.instance.update(),registryUI.taglist.reverse=function(){registryUI.taglist.asc?(registryUI.taglist.tags.reverse(),registryUI.taglist.asc=!1):(registryUI.taglist.tags.sort(),registryUI.taglist.asc=!0),registryUI.taglist.instance.update()},registryUI.taglist.refresh=function(){route(registryUI.taglist.name)}}); \ No newline at end of file +riot.tag2("add",'
Add your Server ?
Write your URL without /v2
Add Cancel
',"","",function(e){registryUI.addTag=registryUI.addTag||{},this.one("mount",function(){registryUI.addTag.dialog=this.tags["material-popup"],registryUI.addTag.dialog.getAddServer=function(){return this.tags["material-input"]?this.tags["material-input"].value:""}}),registryUI.addTag.onkeyup=function(e){13==e.keyCode&®istryUI.addTag.add()},registryUI.addTag.show=function(){registryUI.addTag.dialog.open()},registryUI.addTag.add=function(){registryUI.addTag.dialog.getAddServer().length>0&®istryUI.addServer(registryUI.addTag.dialog.getAddServer()),registryUI.home(),registryUI.addTag.close()},registryUI.addTag.close=function(){registryUI.addTag.dialog.tags["material-input"].value="",registryUI.addTag.dialog.close()}}),riot.tag2("app",'
',"","",function(e){registryUI.appTag=this,route.base("#!"),route("",function(){route.routeName="home",registryUI.catalog.display&&(registryUI.catalog.loadend=!1,registryUI.catalog.display()),registryUI.appTag.update()}),route("/taglist/*",function(e){route.routeName="taglist",registryUI.taglist.name=e,registryUI.taglist.display&&(registryUI.taglist.loadend=!1,registryUI.taglist.display()),registryUI.appTag.update()}),registryUI.home=function(){"home"==route.routeName?registryUI.catalog.display():route("")},registryUI.snackbar=function(e,t){registryUI.appTag.tags["material-snackbar"].addToast({message:e,isError:t})},registryUI.errorSnackbar=function(e){return registryUI.snackbar(e,!0)},route.parser(null,function(e,t){const r=t.replace(/\?/g,"\\?").replace(/\*/g,"([^?#]+?)").replace(/\.\./,".*"),a=new RegExp("^"+r+"$"),i=e.match(a);if(i)return i.slice(1)}),route.start(!0)}),riot.tag2("catalog",'

Repositories of {registryUI.name()}

  • send {item}
',"","",function(e){registryUI.catalog.instance=this,registryUI.catalog.display=function(){registryUI.catalog.repositories=[];var e=new Http;e.addEventListener("load",function(){registryUI.catalog.repositories=[],200==this.status?(registryUI.catalog.repositories=JSON.parse(this.responseText).repositories||[],registryUI.catalog.repositories.sort()):404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText)}),e.addEventListener("error",function(){registryUI.snackbar(this.getErrorMessage(),!0),registryUI.catalog.repositories=[]}),e.addEventListener("loadend",function(){registryUI.catalog.loadend=!0,registryUI.catalog.instance.update()}),e.open("GET",registryUI.url()+"/v2/_catalog"),e.send()},registryUI.catalog.go=function(e){route("taglist/"+e)},registryUI.catalog.display()}),riot.tag2("change",'
Change your Server ?
Change Cancel
',"","",function(e){registryUI.changeTag=registryUI.changeTag||{},this.one("mount",function(){registryUI.changeTag.dialog=this.tags["material-popup"],registryUI.changeTag.dialog.getServerUrl=function(){return this.refs["server-list"]?this.refs["server-list"].value:""},registryUI.changeTag.dialog.on("updated",function(){this.refs["server-list"]&&(this.refs["server-list"].value=registryUI.url())})}),registryUI.changeTag.show=function(){registryUI.changeTag.dialog.open()},registryUI.changeTag.change=function(){registryUI.changeTag.dialog.getServerUrl().length>0&®istryUI.changeServer(registryUI.changeTag.dialog.getServerUrl()),registryUI.home(),registryUI.changeTag.dialog.close()},registryUI.changeTag.close=function(){registryUI.changeTag.dialog.close()}}),riot.tag2("image-size","
{this.bytesToSize(this.size)}
","","",function(e){var t=this;this.bytesToSize=function(e){var t=["Bytes","KB","MB","GB","TB"];if(void 0==e||isNaN(e))return"?";if(0==e)return"0 Byte";var r=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.ceil(e/Math.pow(1024,r))+" "+t[r]};var r=new Http;r.addEventListener("loadend",function(){200==this.status||202==this.status?(t.size=JSON.parse(this.responseText).layers.reduce(function(e,t){return e+t.size},0),t.update()):404==this.status?registryUI.errorSnackbar("Manifest for "+e.name+":"+e.tag+" not found"):registryUI.snackbar(this.responseText)}),r.open("GET",registryUI.url()+"/v2/"+e.name+"/manifests/"+e.tag),r.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),r.send()}),riot.tag2("menu",' more_vert

Add URL

Change URL

Remove URL

',"","",function(e){registryUI.menuTag=registryUI.menuTag||{},registryUI.menuTag.update=this.update,this.one("mount",function(e){var t=this;registryUI.menuTag.close=function(){t.tags["material-dropdown"].close(),t.update()},registryUI.menuTag.isOpen=function(){return t.tags["material-dropdown"].opened},registryUI.menuTag.toggle=function(){t.tags["material-dropdown"].opened?t.tags["material-dropdown"].close():t.tags["material-dropdown"].open(),t.update()}})}),riot.tag2("remove-image",' delete ',"","",function(e){registryUI.removeImage=registryUI.removeImage||{},registryUI.removeImage.update=this.update,registryUI.removeImage.remove=function(e,t){var r=new Http;r.addEventListener("loadend",function(){if(registryUI.taglist.refresh(),200==this.status){if(!this.hasHeader("Docker-Content-Digest"))return void registryUI.errorSnackbar("You need to add Access-Control-Expose-Headers: ['Docker-Content-Digest'] in your server configuration.");var r=this.getResponseHeader("Docker-Content-Digest"),a=new Http;a.addEventListener("loadend",function(){200==this.status||202==this.status?(registryUI.taglist.refresh(),registryUI.snackbar("Deleting "+e+":"+t+" image. Run `registry garbage-collect config.yml` on your registry")):404==this.status?registryUI.errorSnackbar("Digest not found"):registryUI.snackbar(this.responseText)}),a.open("DELETE",registryUI.url()+"/v2/"+e+"/manifests/"+r),a.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),a.addEventListener("error",function(){registryUI.errorSnackbar("An error occurred when deleting image. Check if your server accept DELETE methods Access-Control-Allow-Methods: ['DELETE'].")}),a.send()}else 404==this.status?registryUI.errorSnackbar("Manifest for "+e+":"+t+" not found"):registryUI.snackbar(this.responseText)}),r.open("HEAD",registryUI.url()+"/v2/"+e+"/manifests/"+t),r.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json"),r.send()}}),riot.tag2("remove",'
Remove your Registry Server ?
Close
',"","",function(e){registryUI.removeTag=registryUI.removeTag||{},registryUI.removeTag.update=this.update,registryUI.removeTag.removeUrl=function(e){registryUI.removeServer(e),registryUI.removeTag.close()},registryUI.removeTag.close=function(){registryUI.removeTag.dialog.close(),registryUI.removeTag.update()},registryUI.removeTag.show=function(){registryUI.removeTag.dialog.open()},this.one("mount",function(){registryUI.removeTag.dialog=this.tags["material-popup"]})}),riot.tag2("taglist",'
arrow_back

Tags of {registryUI.name() + \'/\' + registryUI.taglist.name}

Repository Size Tag
{registryUI.taglist.name} {item}
',"","",function(e){registryUI.taglist.instance=this,registryUI.taglist.display=function(){if(registryUI.taglist.tags=[],"taglist"==route.routeName){var e=new Http;registryUI.taglist.instance.update(),e.addEventListener("load",function(){registryUI.taglist.tags=[],200==this.status?(registryUI.taglist.tags=JSON.parse(this.responseText).tags||[],registryUI.taglist.tags.sort()):404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText,!0)}),e.addEventListener("error",function(){registryUI.snackbar(this.getErrorMessage(),!0),registryUI.taglist.tags=[]}),e.addEventListener("loadend",function(){registryUI.taglist.loadend=!0,registryUI.taglist.instance.update()}),e.open("GET",registryUI.url()+"/v2/"+registryUI.taglist.name+"/tags/list"),e.send(),registryUI.taglist.asc=!0}},registryUI.taglist.display(),registryUI.taglist.instance.update(),registryUI.taglist.reverse=function(){registryUI.taglist.asc?(registryUI.taglist.tags.reverse(),registryUI.taglist.asc=!1):(registryUI.taglist.tags.sort(),registryUI.taglist.asc=!0),registryUI.taglist.instance.update()},registryUI.taglist.refresh=function(){route(registryUI.taglist.name)}}); \ No newline at end of file diff --git a/dist/scripts/vendor.js b/dist/scripts/vendor.js index f837049..d59ee8a 100644 --- a/dist/scripts/vendor.js +++ b/dist/scripts/vendor.js @@ -1,5 +1,5 @@ -/* Riot v3.9.0, @license MIT */ -var t,e;t=this,e=function(t){"use strict";function e(t,e){return(e||document).querySelector(t)}var n,r,i=[],o={},a="yield",s="__global_mixin",u="riot-",l=["ref","data-ref"],c="data-is",p="if",f="each",d="no-reorder",h="show",g="hide",m="key",v="__riot-events__",y="string",x="object",_="undefined",b="function",w="http://www.w3.org/1999/xlink",N="http://www.w3.org/2000/svg",A=/^xlink:(\w+)/,C=typeof window===_?void 0:window,O=/^on/,E=/([-\w]+) ?= ?(?:"([^"]*)|'([^']*)|({[^}]*}))/g,k={viewbox:"viewBox",preserveaspectratio:"preserveAspectRatio"},L=/^(?:disabled|checked|readonly|required|allowfullscreen|auto(?:focus|play)|compact|controls|default|formnovalidate|hidden|ismap|itemscope|loop|multiple|muted|no(?:resize|shade|validate|wrap)?|open|reversed|seamless|selected|sortable|truespeed|typemustmatch)$/,T=0|(C&&C.document||{}).documentMode;function j(t){return"svg"===t?document.createElementNS(N,t):document.createElement(t)}function M(t,e,n){var r=A.exec(e);r&&r[1]?t.setAttributeNS(w,r[1],n):t.setAttribute(e,n)}var S,I,R={},P=[],V=!1;C&&(S=j("style"),I=e("style[type=riot]"),M(S,"type","text/css"),I?(I.id&&(S.id=I.id),I.parentNode.replaceChild(S,I)):document.head.appendChild(S),r=(n=S).styleSheet);var $={styleNode:n,add:function(t,e){e?R[e]=t:P.push(t),V=!0},inject:function(){if(C&&V){V=!1;var t=Object.keys(R).map(function(t){return R[t]}).concat(P).join("\n");r?r.cssText=t:n.innerHTML=t}}},H=function(){var t="[{(,;:?=|&!^~>%*/",e=["case","default","do","else","in","instanceof","prefix","return","typeof","void","yield"],n=e.reduce(function(t,e){return t+e.slice(-1)},""),r=/^\/(?=[^*>/])[^[/\\]*(?:(?:\\.|\[(?:\\.|[^\]\\]*)*\])[^[\\/]*)*?\/[gimuy]*/,i=/[$\w]/;function o(t,e){for(;--e>=0&&/\s/.test(t[e]););return e}return function(a,s){var u=/.*/g,l=u.lastIndex=s++,c=u.exec(a)[0].match(r);if(c){var p=l+c[0].length,f=a[l=o(a,l)];if(l<0||~t.indexOf(f))return p;if("."===f)"."===a[l-1]&&(s=p);else if("+"===f||"-"===f)(a[--l]!==f||(l=o(a,l))<0||!i.test(a[l]))&&(s=p);else if(~n.indexOf(f)){for(var d=l+1;--l>=0&&i.test(a[l]););~e.indexOf(a.slice(l+1,d))&&(s=p)}}return s}}(),U=function(t){var e,n,r="g",i=/"[^"\\]*(?:\\[\S\s][^"\\]*)*"|'[^'\\]*(?:\\[\S\s][^'\\]*)*'|`[^`\\]*(?:\\[\S\s][^`\\]*)*`/g,o=i.source+"|"+/(?:\breturn\s+|(?:[$\w\)\]]|\+\+|--)\s*(\/)(?![*\/]))/.source+"|"+/\/(?=[^*\/])[^[\/\\]*(?:(?:\[(?:\\.|[^\]\\]*)*\]|\\.)[^[\/\\]*)*?([^<]\/)[gim]*/.source,a=RegExp("[\\x00-\\x1F<>a-zA-Z0-9'\",;\\\\]"),s=/(?=[[\]()*+?.^$|])/g,u=i.source+"|"+/(\/)(?![*\/])/.source,l={"(":RegExp("([()])|"+u,r),"[":RegExp("([[\\]])|"+u,r),"{":RegExp("([{}])|"+u,r)},c="{ }",p=["{","}","{","}",/{[^}]*}/,/\\([{}])/g,/\\({)|{/g,RegExp("\\\\(})|([[({])|(})|"+u,r),c,/^\s*{\^?\s*([$\w]+)(?:\s*,\s*(\S+))?\s+in\s+(\S.*)\s*}/,/(^|[^\\]){=[\S\s]*?}/],f=void 0,d=[];function h(t){return t}function g(t,e){return e||(e=d),new RegExp(t.source.replace(/{/g,e[2]).replace(/}/g,e[3]),t.global?r:"")}function m(t){if(t===c)return p;var e=t.split(" ");if(2!==e.length||a.test(t))throw new Error('Unsupported brackets "'+t+'"');return(e=e.concat(t.replace(s,"\\").split(" ")))[4]=g(e[1].length>1?/{[\S\s]*?}/:p[4],e),e[5]=g(t.length>3?/\\({|})/g:p[5],e),e[6]=g(p[6],e),e[7]=RegExp("\\\\("+e[3]+")|([[({])|("+e[3]+")|"+u,r),e[8]=t,e}function v(t){return t instanceof RegExp?e(t):d[t]}function y(t){(t||(t=c))!==d[8]&&(d=m(t),e=t===c?h:g,d[9]=e(p[9])),f=t}return v.split=function(t,e,n){n||(n=d);var r,i,o,a,s,u,c=[],p=n[6],f=[],h="";for(i=o=p.lastIndex=0;r=p.exec(t);){if(u=p.lastIndex,a=r.index,i){if(r[2]){var g=r[2],m=l[g],v=1;for(m.lastIndex=u;r=m.exec(t);)if(r[1]){if(r[1]===g)++v;else if(!--v)break}else m.lastIndex=x(r.index,m.lastIndex,r[2]);p.lastIndex=v?t.length:m.lastIndex;continue}if(!r[3]){p.lastIndex=x(a,u,r[4]);continue}}r[1]||(y(t.slice(o,a)),o=p.lastIndex,(p=n[6+(i^=1)]).lastIndex=o)}return t&&on+2&&(s="⁗"+f.length+"~",f.push(t.slice(n,r)),h+=t.slice(o,n)+s,o=r),r}},v.hasExpr=function(t){return d[4].test(t)},v.loopKeys=function(t){var e=t.match(d[9]);return e?{key:e[1],pos:e[2],val:d[0]+e[3].trim()+d[1]}:{val:t.trim()}},v.array=function(t){return t?m(t):d},Object.defineProperty(v,"settings",{set:function(t){var e;e=(t=t||{}).brackets,Object.defineProperty(t,"brackets",{set:y,get:function(){return f},enumerable:!0}),n=t,y(e)},get:function(){return n}}),v.settings="undefined"!=typeof riot&&riot.settings||{},v.set=y,v.skipRegex=H,v.R_STRINGS=i,v.R_MLCOMMS=/\/\*[^*]*\*+(?:[^*\/][^*]*\*+)*\//g,v.S_QBLOCKS=o,v.S_QBLOCK2=u,v}(),B=function(){var t={};function e(i,o){return i?(t[i]||(t[i]=function(t){var e=function(t){var e,i=U.split(t.replace(n,'"'),1),o=i.qblocks;if(i.length>2||i[0]){var s,u,l=[];for(s=u=0;s %s",t.riotData.tagName||"Unknown tag",this.tmpl),console.log(this.data))}.bind({data:o,tmpl:i})):i}e.hasExpr=U.hasExpr,e.loopKeys=U.loopKeys,e.clearCache=function(){t={}},e.errorHandler=null;var n=/\u2057/g,r=/\u2057(\d+)~/g;var i=/^(?:(-?[_A-Za-z\xA0-\xFF][-\w\xA0-\xFF]*)|\u2057(\d+)~):/,o={"(":/[()]/g,"[":/[[\]]/g,"{":/[{}]/g};function a(t,e,n){if(t=t.replace(/\s+/g," ").trim().replace(/\ ?([[\({},?\.:])\ ?/g,"$1")){for(var r,a=[],s=0;t&&(r=t.match(i))&&!r.index;){var u,l,p=/,|([[{(])|$/g;for(t=RegExp.rightContext,u=r[2]?n[r[2]].slice(1,-1).trim().replace(/\s+/g," "):r[1];l=(r=p.exec(t))[1];)f(l,p);l=t.slice(0,r.index),t=RegExp.rightContext,a[s++]=c(l,1,u)}t=s?s>1?"["+a.join(",")+'].join(" ").trim()':a[0]:c(t,e)}return t;function f(e,n){var r,i=1,a=o[e];for(a.lastIndex=n.lastIndex;r=a.exec(t);)if(r[0]===e)++i;else if(!--i)break;n.lastIndex=i?t.length:a.lastIndex}}var s='"in this?this:'+("object"!=typeof window?"global":"window")+").",u=/[,{][\$\w]+(?=:)|(^ *|[^$\w\.{])(?!(?:typeof|true|false|null|undefined|in|instanceof|is(?:Finite|NaN)|void|NaN|new|Date|RegExp|Math)(?![$\w]))([$_A-Za-z][$\w]*)/g,l=/^(?=(\.[$\w]+))\1(?:[^.[(]|$)/;function c(t,e,n){var r;return t=t.replace(u,function(t,e,n,i,o){return n&&(i=r?0:i+t.length,"this"!==n&&"global"!==n&&"window"!==n?(t=e+'("'+n+s+n,i&&(r="."===(o=o[i])||"("===o||"["===o)):i&&(r=!l.test(o.slice(i)))),t}),r&&(t="try{return "+t+"}catch(e){E(e,this)}"),n?t=(r?"function(){"+t+"}.call(this)":"("+t+")")+'?"'+n+'":""':e&&(t="function(v){"+(r?t.replace("return ","v="):"v=("+t+")")+';return v||v===0?v:""}.call(this)'),t}return e.version=U.version="v3.0.8",e}(),z=function(t){t=t||{};var e={},n=Array.prototype.slice;return Object.defineProperties(t,{on:{value:function(n,r){return"function"==typeof r&&(e[n]=e[n]||[]).push(r),t},enumerable:!1,writable:!1,configurable:!1},off:{value:function(n,r){if("*"!=n||r)if(r)for(var i,o=e[n],a=0;i=o&&o[a];++a)i==r&&o.splice(a--,1);else delete e[n];else e={};return t},enumerable:!1,writable:!1,configurable:!1},one:{value:function(e,n){return t.on(e,function r(){t.off(e,r),n.apply(t,arguments)})},enumerable:!1,writable:!1,configurable:!1},trigger:{value:function(r){var i,o,a,s=arguments,u=arguments.length-1,l=new Array(u);for(a=0;a'+e+"","application/xml").documentElement,!0);t.appendChild(r)}else t.innerHTML=e}function et(t,e){if(t)for(var n;n=E.exec(t);)e(n[1].toLowerCase(),n[2]||n[3]||n[4])}function nt(){return document.createDocumentFragment()}function rt(t,e,n){t.insertBefore(e,n.parentNode&&n)}function it(t){return Object.keys(t).reduce(function(e,n){return e+" "+n+": "+t[n]+";"},"")}function ot(t,e,n){if(t){var r,i=e(t,n);if(!1===i)return;for(t=t.firstChild;t;)r=t.nextSibling,ot(t,e,i),t=r}}var at=Object.freeze({$$:G,$:e,createDOMPlaceholder:Q,mkEl:j,setAttr:M,toggleVisibility:J,getAttr:X,remAttr:Y,setInnerHTML:tt,walkAttrs:et,createFrag:nt,safeInsert:rt,styleObjectToString:it,walkNodes:ot});function st(t){return F(t)||null===t}function ut(t){return st(t)||""===t}function lt(t){return typeof t===b}function ct(t){return t&&typeof t===x}function pt(t){var e=t.ownerSVGElement;return!!e||null===e}function ft(t){return Array.isArray(t)||t instanceof Array}function dt(t){return L.test(t)}function ht(t){return typeof t===y}var gt=Object.freeze({isBlank:ut,isFunction:lt,isObject:ct,isSvg:pt,isWritable:K,isArray:ft,isBoolAttr:dt,isNil:st,isString:ht,isUndefined:F});function mt(t,e){return-1!==t.indexOf(e)}function vt(t,e){for(var n=t?t.length:0,r=0;r|>([\S\s]*?)<\/yield\s*>|>)/gi,jt=/]*)['"]\s*>([\S\s]*?)<\/yield\s*>/gi,Mt=/|>([\S\s]*?)<\/yield\s*>)/gi,St={tr:"tbody",th:"tr",td:"tr",col:"colgroup"},It=T&&T<10?/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?|opt(?:ion|group))$/:/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?)$/,Rt="div",Pt="svg";function Vt(t,n,r){var i=t&&t.match(/^\s*<([-\w]+)/),o=i&&i[1].toLowerCase(),a=j(r?Pt:Rt);return t=function(t,e){if(!Lt.test(t))return t;var n={};return e=e&&e.replace(jt,function(t,e,r){return n[e]=n[e]||r,""}).trim(),t.replace(Mt,function(t,e,r){return n[e]||r||""}).replace(Tt,function(t,n){return e||n||""})}(t,n),It.test(o)?a=function(t,n,r){var i="o"===r[0],o=i?"select>":"table>";if(t.innerHTML="<"+o+n.trim()+"=A.length,I=k&&T||!k&&!M;I?((M=ye(l,{parent:e,isLoop:!0,isAnonymous:w,tagName:u,root:t.cloneNode(w),item:O,index:h},b)).mount(),S?function(t,e){e?zt.call(this,t):t.appendChild(this.root)}.apply(M,[c||f,N]):function(t,e,n){n?zt.apply(this,[t,e]):rt(t,this.root,e.root)}.apply(M,[f,_[h],N]),S||A.splice(h,0,O),_.splice(h,0,M),g&&Ct(e.tags,u,M,!0)):j!==h&&k&&((a||mt(o,A[j]))&&(function(t,e,n){n?ae.apply(this,[t,e]):rt(t,this.root,e.root)}.apply(M,[f,_[h],N]),_.splice(h,0,_.splice(j,1)[0]),A.splice(h,0,A.splice(j,1)[0])),n.pos&&(M[n.pos]=h),!g&&M.tags&&function(t){var e=this;vt(Object.keys(this.tags),function(n){oe.apply(e.tags[n],[n,t])})}.call(M,h)),q(M.__,{item:O,index:h,parent:e}),d[h]=E,I||M.update(O)}),function(t,e){for(var n=e.length,r=t.length;n>r;)n--,ue.apply(e[n],[e,n])}(o,_),A=d.slice(),f.insertBefore(c,h))},n.unmount=function(){vt(_,function(t){t.unmount()})},n}var ce={init:function(t,e,n,r){return this.dom=t,this.attr=n,this.rawValue=r,this.parent=e,this.hasExp=B.hasExpr(r),this},update:function(){var t=this.value,e=this.parent&&$t(this.parent),n=this.dom.__ref||this.tag||this.dom;this.value=this.hasExp?B(this.rawValue,this.parent):this.rawValue,!ut(t)&&e&&Bt(e.refs,t,n),!ut(this.value)&&ht(this.value)?(e&&Ct(e.refs,this.value,n,null,this.parent.__.index),this.value!==t&&M(this.dom,this.attr,this.value)):Y(this.dom,this.attr),this.dom.__ref||(this.dom.__ref=n)},unmount:function(){var t=this.tag||this.dom,e=this.parent&&$t(this.parent);!ut(this.value)&&e&&Bt(e.refs,this.value,t)}};function pe(t,e,n,r){return W(ce).init(t,e,n,r)}function fe(t){vt(t,function(t){t.unmount?t.unmount(!0):t.tagName?t.tag.unmount(!0):t.unmount&&t.unmount()})}var de={init:function(t,e,n){Y(t,p),q(this,{tag:e,expr:n,stub:Q(),pristine:t});var r=t.parentNode;return r.insertBefore(this.stub,t),r.removeChild(t),this},update:function(){this.value=B(this.expr,this.tag),this.value&&!this.current?(this.current=this.pristine.cloneNode(!0),this.stub.parentNode.insertBefore(this.current,this.stub),this.expressions=ge.apply(this.tag,[this.current,!0])):!this.value&&this.current&&(fe(this.expressions),this.current._tag?this.current._tag.unmount():this.current.parentNode&&this.current.parentNode.removeChild(this.current),this.current=null,this.expressions=[]),this.value&&Kt.call(this.tag,this.expressions)},unmount:function(){fe(this.expressions||[])}};function he(t,e,n){return W(de).init(t,e,n)}function ge(t,e){var n=this,r=[];return ot(t,function(i){var o,a,s=i.nodeType;if((e||i!==t)&&(3===s&&"STYLE"!==i.parentNode.tagName&&B.hasExpr(i.nodeValue)&&r.push({dom:i,expr:i.nodeValue}),1===s)){var u="VIRTUAL"===i.tagName;if(o=X(i,f))return u&&M(i,"loopVirtual",!0),r.push(le(i,n,o)),!1;if(o=X(i,p))return r.push(he(i,n,o)),!1;if((o=X(i,c))&&B.hasExpr(o))return r.push({isRtag:!0,expr:o,dom:i,attrs:[].slice.call(i.attributes)}),!1;if(a=Ot(i),u&&(X(i,"virtualized")&&i.parentElement.removeChild(i),a||X(i,"virtualized")||X(i,"loopVirtual")||(a={tmpl:i.outerHTML})),a&&(i!==t||e)){if(!u)return r.push(Ut(a,{root:i,parent:n},i.innerHTML,n)),!1;X(i,c)&&Nt("Virtual tags shouldn't be used together with the \""+c+'" attribute - https://github.com/riot/riot/issues/2511'),M(i,"virtualized",!0);var l=ye({tmpl:i.outerHTML},{root:i,parent:n},i.innerHTML);r.push(l)}me.apply(n,[i,i.attributes,function(t,e){e&&r.push(e)}])}}),r}function me(t,e,n){var r=this;vt(e,function(e){if(!e)return!1;var i,o=e.name,s=dt(o);mt(l,o)&&t.tagName.toLowerCase()!==a?i=pe(t,r,o,e.value):B.hasExpr(e.value)&&(i={dom:t,expr:e.value,attr:o,bool:s}),n(e,i)})}function ve(t){var e=this.__.isAnonymous;bt(this,"isMounted",t),e||(t?this.trigger("mount"):(this.trigger("unmount"),this.off("*"),this.__.wasCreated=!1))}function ye(t,e,n){void 0===t&&(t={}),void 0===e&&(e={});var r,o=e.context||{},a=q({},e.opts),l=e.parent,c=e.isLoop,p=!!e.isAnonymous,f=Z.skipAnonymousTags&&p,d=e.item,h=e.index,g=[],m=e.root,y=e.tagName||Et(m),x="virtual"===y,_=!x&&!t.tmpl;return f||z(o),t.name&&m._tag&&m._tag.unmount(!0),bt(o,"isMounted",!1),bt(o,"__",{impl:t,root:m,skipAnonymous:f,implAttrs:[],isAnonymous:p,instAttrs:[],innerHTML:n,tagName:y,index:h,isLoop:c,isInline:_,item:d,parent:l,listeners:[],virts:[],wasCreated:!1,tail:null,head:null}),bt(o,"_riot_id",_t()),bt(o,"root",m),q(o,{opts:a},d),bt(o,"parent",l||null),bt(o,"tags",{}),bt(o,"refs",{}),_||c&&p?r=m:(x||(m.innerHTML=""),r=Vt(t.tmpl,n,pt(m))),bt(o,"update",function(t){return n=t,r=g,i=(e=o).__,a={},s=e.isMounted&&!i.skipAnonymous,i.isAnonymous&&i.parent&&q(e,i.parent),q(e,n),qt.apply(e,[i.isLoop,i.parent,i.isAnonymous,a,i.instAttrs]),s&&e.isMounted&<(e.shouldUpdate)&&!e.shouldUpdate(n,a)?e:(q(e.opts,a),s&&e.trigger("update",n),Kt.call(e,r),s&&e.trigger("updated"),e);var e,n,r,i,a,s}),bt(o,"mixin",function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return vt(e,function(e){var n,r,i=[],o=["init","__proto__"];e=ht(e)?ee(e):e,n=lt(e)?new e:e;for(var a=Object.getPrototypeOf(n);i=i.concat(Object.getOwnPropertyNames(r||n)),r=Object.getPrototypeOf(r||n););vt(i,function(e){if(!mt(o,e)){var r=D(n,e)||D(a,e),i=r&&(r.get||r.set);!t.hasOwnProperty(e)&&i?Object.defineProperty(t,e,r):t[e]=lt(n[e])?n[e].bind(t):n[e]}}),n.init&&n.init.bind(t)(t.opts)}),t}.apply(void 0,[o].concat(t))}),bt(o,"mount",function(){return function(t,e,n,r){var i=t.__,o=i.root;o._tag=t,me.apply(i.parent,[o,o.attributes,function(e,n){!i.isAnonymous&&ce.isPrototypeOf(n)&&(n.tag=t),e.expr=n,i.instAttrs.push(e)}]),et(i.impl.attrs,function(t,e){i.implAttrs.push({name:t,value:e})}),me.apply(t,[o,i.implAttrs,function(t,e){e?n.push(e):M(o,t.name,t.value)}]),qt.apply(t,[i.isLoop,i.parent,i.isAnonymous,r,i.instAttrs]);var a=ee(s);if(a&&!i.skipAnonymous)for(var u in a)a.hasOwnProperty(u)&&t.mixin(a[u]);if(i.impl.fn&&i.impl.fn.call(t,r),i.skipAnonymous||t.trigger("before-mount"),vt(ge.apply(t,[e,i.isAnonymous]),function(t){return n.push(t)}),t.update(i.item),!i.isAnonymous&&!i.isInline)for(;e.firstChild;)o.appendChild(e.firstChild);if(bt(t,"root",o),!i.skipAnonymous&&t.parent){var l=$t(t.parent);l.one(l.isMounted?"updated":"mount",function(){ve.call(t,!0)})}else ve.call(t,!0);return t.__.wasCreated=!0,t}(o,r,g,a)}),bt(o,"unmount",function(t){return function(t,e,n){var r=t.__,o=r.root,a=i.indexOf(t),s=o.parentNode;if(r.skipAnonymous||t.trigger("before-unmount"),et(r.impl.attrs,function(t){yt(t,u)&&(t=t.slice(u.length)),Y(o,t)}),t.__.listeners.forEach(function(t){Object.keys(t[v]).forEach(function(e){t.removeEventListener(e,t[v][e])})}),-1!==a&&i.splice(a,1),r.parent&&!r.isAnonymous){var l=$t(r.parent);r.isVirtual?Object.keys(t.tags).forEach(function(e){return Bt(l.tags,e,t.tags[e])}):Bt(l.tags,r.tagName,t)}return t.__.virts&&vt(t.__.virts,function(t){t.parentNode&&t.parentNode.removeChild(t)}),fe(n),vt(r.instAttrs,function(t){return t.expr&&t.expr.unmount&&t.expr.unmount()}),e?tt(o,""):s&&s.removeChild(o),r.onUnmount&&r.onUnmount(),t.isMounted||ve.call(t,!0),ve.call(t,!1),delete o._tag,t}(o,t,g)}),o}function xe(t,e,n,r){var a,s=o[e],u=o[e].class,l=r||(u?W(u.prototype):{}),c=t._innerHTML=t._innerHTML||t.innerHTML,p=q({root:t,opts:n,context:l},{parent:n?n.parent:null});return s&&t&&(a=ye(s,p,c)),a&&a.mount&&(a.mount(!0),mt(i,a)||i.push(a)),a}var _e=Object.freeze({arrayishAdd:Ct,getTagName:Et,inheritParentProps:kt,mountTo:xe,selectTags:Wt,arrayishRemove:Bt,getTag:Ot,initChildTag:Ut,moveChildTag:oe,makeReplaceVirtual:Dt,getImmediateCustomParentTag:$t,makeVirtual:zt,moveVirtual:ae,unmountAll:fe,createIfDirective:he,createRefDirective:pe}),be=Z,we={tmpl:B,brackets:U,styleManager:$,vdom:i,styleNode:$.styleNode,dom:at,check:gt,misc:At,tags:_e},Ne=Zt,Ae=Gt,Ce=Qt,Oe=Jt,Ee=ee,ke=ne,Le=re,Te=z,je=q({},ie,{observable:z,settings:be,util:we});t.settings=be,t.util=we,t.Tag=Ne,t.tag=Ae,t.tag2=Ce,t.mount=Oe,t.mixin=Ee,t.update=ke,t.unregister=Le,t.version="v3.9.0",t.observable=Te,t.default=je,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.riot={}); +/* Riot v3.10.0, @license MIT */ +var t,e;t=this,e=function(t){"use strict";function a(t,e){return(e||document).querySelector(t)}var e,n,y=[],P={},s="yield",_="__global_mixin",b="riot-",u=["ref","data-ref"],f="data-is",p="if",d="each",r="no-reorder",w="show",N="hide",i="key",x="__riot-events__",o="string",V="object",l="undefined",c="function",h="http://www.w3.org/1999/xlink",m="http://www.w3.org/2000/svg",g=/^xlink:(\w+)/,v=typeof window===l?void 0:window,A=/^on/,C=/([-\w]+) ?= ?(?:"([^"]*)|'([^']*)|({[^}]*}))/g,O={viewbox:"viewBox",preserveaspectratio:"preserveAspectRatio"},E=/^(?:disabled|checked|readonly|required|allowfullscreen|auto(?:focus|play)|compact|controls|default|formnovalidate|hidden|ismap|itemscope|loop|multiple|muted|no(?:resize|shade|validate|wrap)?|open|reversed|seamless|selected|sortable|truespeed|typemustmatch)$/,k=0|(v&&v.document||{}).documentMode;function L(t){return"svg"===t?document.createElementNS(m,t):document.createElement(t)}function T(t,e,n){var r=g.exec(e);r&&r[1]?t.setAttributeNS(h,r[1],n):t.setAttribute(e,n)}var j,M,S={},I=!1;v&&(j=L("style"),M=a("style[type=riot]"),T(j,"type","text/css"),M?(M.id&&(j.id=M.id),M.parentNode.replaceChild(j,M)):document.head.appendChild(j),n=(e=j).styleSheet);var R={styleNode:e,add:function(t,e){S[e]=t,I=!0},inject:function(){if(v&&I){I=!1;var t=Object.keys(S).map(function(t){return S[t]}).join("\n");n?n.cssText=t:e.innerHTML=t}},remove:function(t){delete S[t],I=!0}},$=function(){var u="[{(,;:?=|&!^~>%*/",l=["case","default","do","else","in","instanceof","prefix","return","typeof","void","yield"],c=l.reduce(function(t,e){return t+e.slice(-1)},""),f=/^\/(?=[^*>/])[^[/\\]*(?:(?:\\.|\[(?:\\.|[^\]\\]*)*\])[^[\\/]*)*?\/[gimuy]*/,p=/[$\w]/;function d(t,e){for(;0<=--e&&/\s/.test(t[e]););return e}return function(t,e){var n=/.*/g,r=n.lastIndex=e++,i=n.exec(t)[0].match(f);if(i){var o=r+i[0].length,a=t[r=d(t,r)];if(r<0||~u.indexOf(a))return o;if("."===a)"."===t[r-1]&&(e=o);else if("+"===a||"-"===a)(t[--r]!==a||(r=d(t,r))<0||!p.test(t[r]))&&(e=o);else if(~c.indexOf(a)){for(var s=r+1;0<=--r&&p.test(t[r]););~l.indexOf(t.slice(r+1,s))&&(e=o)}}return e}}(),H=function(t){var e,n,r="g",i=/"[^"\\]*(?:\\[\S\s][^"\\]*)*"|'[^'\\]*(?:\\[\S\s][^'\\]*)*'|`[^`\\]*(?:\\[\S\s][^`\\]*)*`/g,o=i.source+"|"+/(?:\breturn\s+|(?:[$\w\)\]]|\+\+|--)\s*(\/)(?![*\/]))/.source+"|"+/\/(?=[^*\/])[^[\/\\]*(?:(?:\[(?:\\.|[^\]\\]*)*\]|\\.)[^[\/\\]*)*?([^<]\/)[gim]*/.source,a=RegExp("[\\x00-\\x1F<>a-zA-Z0-9'\",;\\\\]"),s=/(?=[[\]()*+?.^$|])/g,u=i.source+"|"+/(\/)(?![*\/])/.source,y={"(":RegExp("([()])|"+u,r),"[":RegExp("([[\\]])|"+u,r),"{":RegExp("([{}])|"+u,r)},l="{ }",c=["{","}","{","}",/{[^}]*}/,/\\([{}])/g,/\\({)|{/g,RegExp("\\\\(})|([[({])|(})|"+u,r),l,/^\s*{\^?\s*([$\w]+)(?:\s*,\s*(\S+))?\s+in\s+(\S.*)\s*}/,/(^|[^\\]){=[\S\s]*?}/],f=void 0,_=[];function p(t){return t}function d(t,e){return e||(e=_),new RegExp(t.source.replace(/{/g,e[2]).replace(/}/g,e[3]),t.global?r:"")}function h(t){if(t===l)return c;var e=t.split(" ");if(2!==e.length||a.test(t))throw new Error('Unsupported brackets "'+t+'"');return(e=e.concat(t.replace(s,"\\").split(" ")))[4]=d(1 %s",t.riotData.tagName||"Unknown tag",this.tmpl),console.log(this.data))}.bind({data:e,tmpl:t})):t}r.hasExpr=H.hasExpr,r.loopKeys=H.loopKeys,r.clearCache=function(){n={}},r.errorHandler=null;var s=/\u2057/g,u=/\u2057(\d+)~/g;var c=/^(?:(-?[_A-Za-z\xA0-\xFF][-\w\xA0-\xFF]*)|\u2057(\d+)~):/,f={"(":/[()]/g,"[":/[[\]]/g,"{":/[{}]/g};function l(o,t,e){if(o=o.replace(/\s+/g," ").trim().replace(/\ ?([[\({},?\.:])\ ?/g,"$1")){for(var n,r=[],i=0;o&&(n=o.match(c))&&!n.index;){var a,s,u=/,|([[{(])|$/g;for(o=RegExp.rightContext,a=n[2]?e[n[2]].slice(1,-1).trim().replace(/\s+/g," "):n[1];s=(n=u.exec(o))[1];)l(s,u);s=o.slice(0,n.index),o=RegExp.rightContext,r[i++]=d(s,1,a)}o=i?1'+e+"","application/xml").documentElement,!0);t.appendChild(r)}else t.innerHTML=e}function tt(t,e){if(t)for(var n;n=C.exec(t);)e(n[1].toLowerCase(),n[2]||n[3]||n[4])}function et(){return document.createDocumentFragment()}function nt(t,e,n){t.insertBefore(e,n.parentNode&&n)}function rt(n){return Object.keys(n).reduce(function(t,e){return t+" "+e+": "+n[e]+";"},"")}function it(t,e,n){if(t){var r,i=e(t,n);if(!1===i)return;for(t=t.firstChild;t;)r=t.nextSibling,it(t,e,i),t=r}}var ot=Object.freeze({$$:Z,$:a,createDOMPlaceholder:G,mkEl:L,setAttr:T,toggleVisibility:Q,getAttr:J,remAttr:X,setInnerHTML:Y,walkAttrs:tt,createFrag:et,safeInsert:nt,styleObjectToString:rt,walkNodes:it});function at(t){return D(t)||null===t}function st(t){return at(t)||""===t}function ut(t){return typeof t===c}function lt(t){return t&&typeof t===V}function ct(t){var e=t.ownerSVGElement;return!!e||null===e}function ft(t){return Array.isArray(t)||t instanceof Array}function pt(t){return E.test(t)}function dt(t){return typeof t===o}var ht=Object.freeze({isBlank:st,isFunction:ut,isObject:lt,isSvg:ct,isWritable:F,isArray:ft,isBoolAttr:pt,isNil:at,isString:dt,isUndefined:D});function mt(t,e){return-1!==t.indexOf(e)}function gt(t,e){for(var n=t?t.length:0,r=0;r|>([\S\s]*?)<\/yield\s*>|>)/gi,Tt=/]*)['"]\s*>([\S\s]*?)<\/yield\s*>/gi,jt=/|>([\S\s]*?)<\/yield\s*>)/gi,Mt={tr:"tbody",th:"tr",td:"tr",col:"colgroup"},St=k&&k<10?/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?|opt(?:ion|group))$/:/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?)$/,It="div",Rt="svg";function Pt(t,e,n){var r=t&&t.match(/^\s*<([-\w]+)/),i=r&&r[1].toLowerCase(),o=L(n?Rt:It);return t=function(t,n){if(!kt.test(t))return t;var r={};return n=n&&n.replace(Tt,function(t,e,n){return r[e]=r[e]||n,""}).trim(),t.replace(jt,function(t,e,n){return r[e]||n||""}).replace(Lt,function(t,e){return n||e||""})}(t,e),St.test(i)?o=function(t,e,n){var r="o"===n[0],i=r?"select>":"table>";if(t.innerHTML="<"+i+e.trim()+"=R.length,h=u&&c||!u&&!p;h?((p=ve(k,{parent:w,isLoop:!0,isAnonymous:S,tagName:E,root:b.cloneNode(S),item:n,index:e},M)).mount(),d?function(t,e){e?Bt.call(this,t):t.appendChild(this.root)}.apply(p,[g||v,I]):function(t,e,n){n?Bt.apply(this,[t,e]):nt(t,this.root,e.root)}.apply(p,[v,j[e],I]),d||R.splice(e,0,n),j.splice(e,0,p),L&&At(w.tags,E,p,!0)):f!==e&&u&&((C||mt(m,R[f]))&&(function(t,e,n){n?oe.apply(this,[t,e]):nt(t,this.root,e.root)}.apply(p,[v,j[e],I]),j.splice(e,0,j.splice(f,1)[0]),R.splice(e,0,R.splice(f,1)[0])),N.pos&&(p[N.pos]=e),!L&&p.tags&&function(e){var n=this;gt(Object.keys(this.tags),function(t){ie.apply(n.tags[t],[t,e])})}.call(p,e)),K(p.__,{item:n,index:e,parent:w}),y[e]=s,h||p.update(n)}else x++}),function(t,e,n){for(var r=e.length,i=t.length-n;i
',"","",function(t){var e=this;this.dynamicAttributes=["disabled"],this.disabled=t.disabled||!1,this.launch=function(t){e.disabled||e.refs["material-waves"].trigger("launch",t)},this.on("mount",function(){e.refs["material-waves"].on("wavestart",function(t){e.trigger("wavestart",t)}),e.refs["material-waves"].on("waveend",function(){e.trigger("waveend")})}),this.click=function(){t.link&&(window.location.href=t.link),e.trigger("click")},this.mixin("dynamicAttributes")})},function(t,e,i){"use strict";riot.tag2("material-card",'
',"","",function(t){var e=this;this.titleExist=!1,this.on("mount",function(){e.update({titleExist:!!e.root.querySelector(".material-card-title")})}),this.mixin("content")})},function(t,e,i){"use strict";riot.tag2("material-checkbox",'
',"","",function(t){var e=this;this.checked=t.checked||!1,this.disabled=t.disabled||!1,this.toggle=function(){if(e.disabled)return!1;e.update({checked:!e.checked}),e.trigger("toggle",e.checked)}})},function(module,exports,__webpack_require__){"use strict";riot.tag2("material-combo",' ',"","",function(opts){var _this=this;this.items=[],this.title=null;var lastValue=this.value,valueChanged=function(){_this.value!==lastValue&&(lastValue=_this.value,_this.root.dispatchEvent(new CustomEvent("change",{value:_this.value})))};if(this.getOptions=function(){Array.prototype.forEach.call(_this.refs.options.children,function(t,e){if("option"==t.tagName.toLowerCase()){var i={title:t.innerHTML,value:t.getAttribute("value")};_this.items.push(i),null!=t.getAttribute("isSelected")&&(_this.refs.dropdown.update({selected:e}),_this.update({value:i.value||i.title}),valueChanged(),_this.title=i.title)}}),_this.refs.dropdown.update({items:_this.items}),_this.refs.dropdown.selected&&_this.update({hValue:_this.refs.dropdown.items[_this.refs.dropdown.selected].value||_this.refs.dropdown.items[_this.refs.dropdown.selected].title}),_this.update({isParsed:!0}),valueChanged()},opts.items)try{this.items=eval(opts.items)||[],this.items.length&&this.refs.dropdown.update({items:this.items})}catch(t){console.error("Something wrong with your items. For details look at it - "+t)}this.on("mount",function(){_this.getOptions(),_this.refs.dropdown.on("selectChanged",function(t){_this.update({value:_this.refs.dropdown.items[t].value||_this.refs.dropdown.items[t].title}),valueChanged(),_this.refs.input.update({value:_this.refs.dropdown.items[t].title}),setTimeout(function(){_this.refs.dropdown.update({items:_this.items})},200)}),_this.refs.input.on("valueChanged",function(t){_this.refs.dropdown.update({items:_this.filter("items",{title:t})})}),_this.refs.input.on("focusChanged",function(t){_this.refs.input.value==(opts.defaulttext||"Choose item")&&t&&_this.refs.input.update({value:""}),""!=_this.refs.input.value||t||_this.refs.input.update({value:opts.defaulttext||"Choose item"}),t&&_this.refs.dropdown.open()}),_this.refs.dropdown.root.style.top=_this.refs.input.root.getBoundingClientRect().height+"px",_this.refs.input.update({value:_this.title||opts.defaulttext||"Choose item"})}),this.mixin("collection")})},function(module,exports,__webpack_require__){"use strict";riot.tag2("material-dropdown-list",'
',"","",function(opts){var _this=this;if(this.opened=!1,opts.items){try{this.items=eval(opts.items)||[]}catch(t){console.error("Something wrong with your items. For details look at it - "+t)}this.update({items:this.items})}opts.selected&&this.update({selected:opts.selected}),this.select=function(t){return _this.update({selected:t.item.key}),_this.close(),_this.trigger("selectChanged",t.item.key,t.item.item),!0},this.open=function(){_this.update({opened:!0,opening:!0}),_this.opts.extraclose&&document.body.appendChild(_this.refs.overlay),setTimeout(function(){_this.update({opening:!1})},0)},this.close=function(){_this.update({opening:!0}),setTimeout(function(){_this.update({opened:!1})},200)}})},function(t,e,i){"use strict";riot.tag2("material-dropdown",'
',"","",function(t){var e=this;this.opened=t.opened||!1,this.open=function(){e.update({opened:!0,opening:!0}),setTimeout(function(){e.update({opening:!1})},0)},this.close=function(){e.update({opening:!0}),setTimeout(function(){e.update({opened:!1})},200)}})},function(t,e,i){"use strict";riot.tag2("material-footer",' ',"","",function(t){this.mixin("content")})},function(t,e,i){"use strict";riot.tag2("material-input",'
',"","",function(t){var e=this;if(this.opts=t,this.required="",this.name=t.ref||"input",this.notSupportedTypes=["date","color","datetime","month","range","time"],-1!=this.notSupportedTypes.indexOf(t.type))throw new Error("Sorry but we do not support "+t.type+" type yet!");this.update({showIcon:!1}),this.on("mount",function(){e.update({value:t.value||"",disabled:t.disabled||!1,required:t.required||!1}),e.n=t.ref||"default-input",e.refs[e.n].addEventListener("focus",e.changeFocus),e.refs[e.n].addEventListener("blur",e.changeFocus)}),this.changeFocus=function(i){if(e.disabled)return!1;e.update({focused:e.refs[e.n]==document.activeElement}),e.trigger("focusChanged",e.focused,i),t.focuschanged&&"function"==typeof t.focuschanged&&t.focuschanged(e.focused)},this.changeValue=function(i){e.update({value:e.refs[e.n].value}),e.trigger("valueChanged",e.refs[e.n].value,i),t.valuechanged&&"function"==typeof t.valuechanged&&t.valuechanged(e.refs[e.n].value)},this.iconClickHandler=function(t){e.opts.iconclicked&&"function"==typeof e.opts.iconclicked&&e.opts.iconclicked.call(e,t),e.trigger("iconclicked",t)},this.on("update",function(t){t&&void 0!=t.value&&e.validationType&&e.isValid(e.validate(t.value))}),this.isValid=function(t){e.update({error:!t})},this.mixin("validate")})},function(t,e,i){"use strict";riot.tag2("material-navbar",'',"",'role="toolbar"',function(t){})},function(t,e,i){"use strict";riot.tag2("material-pane",'
',"","",function(t){this.mixin("content")})},function(t,e,i){"use strict";riot.tag2("material-popup",'
',"","",function(t){var e=this;this.opened=t.opened||!1,this.on("mount",function(){document.body.appendChild(e.root)}),this.open=function(){e.update({opened:!0,opening:!0}),setTimeout(function(){e.update({opening:!1})},0)},this.close=function(){e.update({opening:!0}),setTimeout(function(){e.update({opened:!1})},200)},this.mixin("content")})},function(t,e,i){"use strict";riot.tag2("material-snackbar",'
{toast.message}
',"","",function(t){var e=this;this.toasts=[],this.intervals={},this.addToast=function(i,n){var o=e.toastID=Math.random().toString(36).substring(7);e.toasts.push(Object.assign(i,{opening:!0,_id:o})),e.update({toasts:e.toasts}),setTimeout(function(){e.toasts[e.findToastKeyByID(o)].opening=!1,e.update({toasts:e.toasts})},50),e.intervals[o]=setTimeout(function(){e.removeToast(o)},t.duration||n||5e3)},this.removeToastAfterDurationEnding=function(t){e.removeToast(t)},this.findToastKeyByID=function(t){var i=null;return e.toasts.forEach(function(e,n){e._id==t&&(i=n)}),i},this.removeToastByClick=function(t){var i=t.item.toast._id;clearInterval(e.intervals[i]),e.removeToast(i)},this.removeToast=function(t){null!=e.findToastKeyByID(t)&&(e.toasts[e.findToastKeyByID(t)].opening=!0,e.update({toasts:e.toasts}),setTimeout(function(){e.toasts.splice(e.findToastKeyByID(t),1),e.update({toasts:e.toasts})},200))}})},function(t,e,i){"use strict";riot.tag2("material-spinner",' ',"","",function(t){})},function(module,exports,__webpack_require__){"use strict";riot.tag2("material-tabs",'
{parent.opts.cut ? parent.cut(tab.title) : tab.title}
',"","",function(opts){var _this=this;if(this.selected=0,this.tabs=[],opts.tabs){var tabs=[];try{tabs=opts.tabs?eval(opts.tabs):[],this.tabs=tabs}catch(t){}}this.on("mount",function(){_this.setWidth(),_this.setLinePosition()}),this.setWidth=function(){[].forEach.call(_this.root.querySelectorAll("material-button"),function(t){t.style.width=_this.refs.line.style.width=(100/_this.tabs.length).toFixed(2)+"%"})},this.onChangeTab=function(t){var e=_this.tabs.indexOf(t.item.tab);_this.changeTab(e)},this.changeTab=function(t){_this.update({selected:t}),_this.setLinePosition(),_this.trigger("tabChanged",_this.tabs[t],t),opts.tabchanged&&"function"==typeof opts.tabchanged&&opts.tabchanged(_this.tabs[t],t)},this.setLinePosition=function(){_this.refs.line.style.left=(100/_this.tabs.length).toFixed(2)*_this.selected+"%"},this.cut=function(t){return t.length>opts.cut?t.substr(0,opts.cut)+"...":t}})},function(t,e,i){"use strict";riot.tag2("material-textarea",'
',"","",function(t){var e=this;this.opts=t,this.disabled=t.disabled||!1,this.on("mount",function(){t.maxRows&&(e.refs.mirror.style.maxHeight=t.maxRows*e.refs[e.n].getBoundingClientRect().height+"px"),e.n=t.ref||"default-textarea",e.value=t.value||"",e.refs.mirror.innerHTML=e.format(e.value),e.refs[e.n].value=e.value,e.refs[e.n].scrollTop=e.refs[e.n].scrollHeight,e.refs[e.n].addEventListener("focus",e.changeFocus),e.refs[e.n].addEventListener("blur",e.changeFocus),e.refs[e.n].addEventListener("input",e.inputHandler),e.update({value:e.value})}),this.changeFocus=function(t){if(e.disabled)return!1;var i=e.refs[e.n]==document.activeElement;e.update({focused:i}),e.trigger("focusChanged",i)},this.inputHandler=function(t){var i=e.refs[e.n].value;e.refs.mirror.innerHTML=e.format(i),e.update({value:i})},this.changeValue=function(i){e.trigger("valueChanged",e.refs[e.n].value,i),t.valuechanged&&"function"==typeof t.valuechanged&&t.valuechanged(e.refs[e.n].value)},this.isValid=function(t){e.update({error:!t})},this.format=function(t){return t.replace(/\n/g,"
 ")},this.on("update",function(t){t&&void 0!=t.value&&e.validationType&&e.isValid(e.validate(t.value))}),this.mixin("validate")})},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s=i(0),r=function(t){return t&&t.__esModule?t:{default:t}}(s);riot.tag2("material-waves",'
',"","",function(t){var e=this,i=function(t){function e(i,a,s){n(this,e);var r=o(this,t.call(this));return i||console.error("You should set container to the wave!"),r.container=i,r.maxOpacity=a.opacity||.6,r.duration=a.duration||750,r.color=a.color||"#fff",r.center=a.center||!1,r.event=s,r.containerBound=r.receiveBound(),r.maxScale=r.containerBound.size/100*10,r.created=Date.now(),r.start={},r.createNode(),r.waveIn(),r}return a(e,t),e.prototype.createNode=function(){this.wave=document.createElement("div"),this.wave.classList.add("wave"),this.container.appendChild(this.wave)},e.prototype.waveIn=function(){var t=this;this.center&&!this.event&&console.error("Setup at least mouse event... Or just set center attribute"),this.start.x=this.center?this.containerBound.height/2:this.event.pageY-this.containerBound.offsetTop,this.start.y=this.center?this.containerBound.width/2:this.event.pageX-this.containerBound.offsetLeft;var e=-1!==window.navigator.userAgent.indexOf("Trident");setTimeout(function(){return t.setStyles(t.maxOpacity)},e?50:0)},e.prototype.waveOut=function(t){var e=this,i=Date.now()-this.created,n=Math.round(this.duration/2)-i,o=n>0?n:0;setTimeout(function(){e.setStyles(0),setTimeout(function(){e.wave.parentNode===e.container&&(e.container.removeChild(e.wave),t())},e.duration)},o)},e.prototype.setStyles=function(t){this.wave.setAttribute("style",this.convertStyle({top:this.start.x+"px",left:this.start.y+"px",transform:"scale("+this.maxScale+")","transition-duration":this.duration+"ms","transition-timing-function":"cubic-bezier(0.250, 0.460, 0.450, 0.940)",background:this.color,opacity:t}))},e.prototype.convertStyle=function(t){var e="";return Object.keys(t).forEach(function(i){t.hasOwnProperty(i)&&(e+=i+":"+t[i]+";")}),e},e}(r.default);this._waves=[],this._events=[],this.on("launch",function(n){var o=new i(e.refs.waves,t,n);e._waves.push(o),e.trigger("wavestart",o),e.parent&&e.parent.opts&&e.parent.opts.wavestart&&e.parent.opts.wavestart(o),e._events.length||(e._events.push(n.target.addEventListener("mouseup",function(){return e.trigger("hold")})),e._events.push(n.target.addEventListener("mouseleave",function(){return e.trigger("hold")})))}),this.on("hold",function(){e._waves[e._waves.length-1]&&e._waves[e._waves.length-1].waveOut(e.waveOut),e._waves[e._waves.length-1]&&e._waves.slice(e._waves.length-1,1)}),this.waveOut=function(){e.trigger("waveend"),e.parent&&e.parent.opts&&e.parent.opts.waveend&&e.parent.opts.waveend()}})},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){n(this,t)}return t.prototype.filter=function(t,e){return this[t].filter(function(t){var i=!1;return Object.keys(e).forEach(function(n){var o=e[n],a=new RegExp(""+o,"i");i=a.test(t[n])}),i})},t.prototype.find=function(t,e){var i={},n=0;return t.forEach(function(t){Object.keys(e).forEach(function(o){var a=e[o];t[o]==a&&(i.e=t,i.k=n)}),n++}),i},t}();e.default=o,riot.mixin("collection",o)},function(t,e,i){"use strict";var n={init:function(){var t=this;this.on("mount",function(){[].forEach.call(t.root.querySelectorAll("content"),function(e){var i=e.getAttribute("select");[].forEach.call(t.root.querySelectorAll(i),function(t){e.parentNode.insertBefore(t,e.nextSibling)}),e.parentNode.removeChild(e)})})}};riot.mixin("content",n)},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){n(this,t)}return t.prototype.init=function(){var t=this;this.on("update",function(e){e&&t.dynamicAttributes&&t.dynamicAttributes.forEach(function(i){void 0!=e[i]&&t.root.setAttribute(i,e[i])})})},t}();e.default=o,riot.mixin("dynamicAttributes",o)},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){n(this,t)}return t.prototype.findTag=function(t,e){var i=null;return t.forEach(function(t){t.root.getAttribute("name").toLowerCase()!=e.toLowerCase()&&t.root.tagName.toLowerCase()!=e.toLowerCase()&&t.root.getAttribute("ref").toLowerCase()!=e.toLowerCase()||(i=t)}),i},t.prototype.turnHyphensOptsToCamelCase=function(t){for(var e in t)if(/-/.test(e)){var i=e.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()});t[i]=t[e],delete t[e]}},t}();e.default=o,riot.findTag=o.findTag,riot.mixin("helpers",o)},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function t(t,e){for(var i=0;i