/*
* Copyright (C) 2016-2023 Jones Magloire @Joxit
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*
* @license AGPL
*/
!function(){"use strict";
/* Riot WIP, @license MIT */var e,t=new Map,r=Symbol("riot-component"),a=new Set,n="is",o="mount",i="update",s="unmount",l="shouldUpdate",u="onBeforeMount",p="onMounted",c="onBeforeUpdate",d="onUpdated",m="onBeforeUnmount",h="onUnmounted",g="props",v="state",f="slots",y="root",x=Symbol("pure"),b=Symbol("is_updating"),T=Symbol("parent"),A=Symbol("attributes"),E=Symbol("template"),w=0,C=2,I=3,k={ATTRIBUTE:w,EVENT:1,TEXT:C,VALUE:I};
/* Riot WIP, @license MIT */function R(e){return e.replace(/-(\w)/g,(function(e,t){return t.toUpperCase()}))}function N(e,t){throw new Error(e,{cause:t})}function U(e){var t=this,r=new Map,a=function(a){return(r.has(a)||r.set(a,e.call(t,a)))&&r.get(a)};return a.cache=r,a}function B(e){return e.reduce((function(e,t){var r=t.value,a=t.type;switch(!0){case!t.name&&a===w:return Object.assign({},e,r);case a===I:e.value=t.value;break;default:e[R(t.name)]=t.value}return e}),{})}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function S(e){for(var t=1;t=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),w(r),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var a=r.completion;if("throw"===a.type){var n=a.arg;w(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},e}function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}function j(){j=function(e,t){return new r(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function r(e,a,n){var o=new RegExp(e,a);return t.set(o,n||t.get(e)),F(o,r.prototype)}function a(e,r){var a=t.get(r);return Object.keys(a).reduce((function(t,r){var n=a[r];if("number"==typeof n)t[r]=e[n];else{for(var o=0;void 0===e[n[o]]&&o+1]+)>/g,(function(e,t){var r=o[t];return"$"+(Array.isArray(r)?r.join("$"):r)})))}if("function"==typeof n){var i=this;return e[Symbol.replace].call(this,r,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(a(e,i)),n.apply(this,e)}))}return e[Symbol.replace].call(this,r,n)},j.apply(this,arguments)}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,a=new Array(t);rg-p)for(var y=r(e[u],0);p'.concat(e,""),"application/xml").documentElement,!0)}(t,e):function(e,t){var r=ie(t)?t:document.createElement("template");return r.innerHTML=e,r.content}(t,e)}var Ke={createDOM:function(e){return this.dom=this.dom||function(e,t){return t&&("string"==typeof t?We(e,t):t)}(e,this.html)||document.createDocumentFragment(),this},mount:function(e,t,r,a){var n=this;void 0===a&&(a={}),e||N("Please provide DOM node to mount properly your template"),this.el&&this.unmount(t);var o=a,i=o.fragment,s=o.children,l=o.avoidDOMInjection,u=(s?s[0]:e).parentNode,p=ie(e),c=p?function(e,t,r){var a=Array.from(e.childNodes);return Math.max(a.indexOf(t),a.indexOf(r.head)+1,0)}(u,e,a):null;this.createDOM(e);var d=i||this.dom.cloneNode(!0);return this.el=p?u:e,this.children=p?s||Array.from(d.childNodes):null,!l&&d&&function(e,t){switch(!0){case oe(e):!function(e,t){for(;e.firstChild;)t.appendChild(e.firstChild)}(t,e);break;case ie(e):e.parentNode.replaceChild(t,e);break;default:e.appendChild(t)}}(e,d),this.bindings=this.bindingsData.map((function(e){return qe(n.el,e,c)})),this.bindings.forEach((function(e){return e.mount(t,r)})),this.meta=a,this},update:function(e,t){return this.bindings.forEach((function(r){return r.update(e,t)})),this},unmount:function(e,t,r){void 0===r&&(r=!1);var a=this.el;if(!a)return this;switch(this.bindings.forEach((function(a){return a.unmount(e,t,r)})),!0){case a[x]||null===r:break;case Array.isArray(this.children):!function(e){for(var t=0;t1?t-1:0),a=1;a0?a:0)}},{key:"setStyles",value:function(e){this.wave.setAttribute("style",this.convertStyle({top:"".concat(this.start.x,"px"),left:"".concat(this.start.y,"px"),transform:"scale(".concat(this.maxScale,")"),"transition-duration":"".concat(this.duration,"ms"),"transition-timing-function":"cubic-bezier(0.250, 0.460, 0.450, 0.940)",background:this.color,opacity:e}))}},{key:"convertStyle",value:function(e){var t="";return Object.keys(e).forEach((function(r){e.hasOwnProperty(r)&&(t+=r+":"+e[r]+";")})),t}}]),r}(function(){function e(){M(this,e)}return P(e,[{key:"receiveBound",value:function(){var e;this.container||console.error("Yor class must contain a container. It is DOM Element. Define please this.container property.");var t=this.container&&this.container.ownerDocument,r=t.documentElement;"undefined"!==L(this.container.getBoundingClientRect)&&(e=this.container.getBoundingClientRect());var a=this.getWindow(t);return this.mix(e,{size:Math.max(e.width,e.height),offsetTop:e.top+a.pageYOffset-r.clientTop,offsetLeft:e.left+a.pageXOffset-r.clientLeft})}},{key:"isWindow",value:function(e){return null!==e&&e===e.window}},{key:"getWindow",value:function(e){return this.isWindow(e)?e:9===e.nodeType&&e.defaultView}},{key:"mix",value:function(e,t){for(var r in e)r in t||(t[r]=e[r]);return t}}]),e}()),Et={css:null,exports:{onMounted(){this._waves=[],this._events=[]},launch(e){var t=new At(this.$("#waves"),this.props,e);this._waves.push(t),this.props.onWaveStart&&this.props.onWaveStart(t),this._events.length||(this._events.push(e.target.addEventListener("mouseup",(()=>this.hold()))),this._events.push(e.target.addEventListener("mouseleave",(()=>this.hold()))))},hold(){this._waves[this._waves.length-1]&&this._waves[this._waves.length-1].waveOut(this.waveOut),this._waves[this._waves.length-1]&&this._waves.slice(this._waves.length-1,1)},waveOut(){this.props.onWaveEnd&&this.props.onWaveEnd()}},template:(e,t,r,a)=>e('',[{redundantAttribute:"expr170",selector:"[expr170]",expressions:[{type:t.EVENT,name:"onmousedown",evaluate:e=>e.launch}]}]),name:"material-waves"},wt=function(e){return""===e||"true"===e},Ct=function(e){if("function"==typeof e){var t=$(Array,Array.prototype.slice.call(arguments)).slice(1);e.apply(void 0,J(t))}},It={array:function(e){if(!e)return[];for(var t=[],r=0;r{Ct(e.onClick,t)}},onUpdated(e,t){this.updateAttributes(e,t)},updateAttributes(e,t){kt.forEach((r=>{wt(e[r])?(this.root.firstElementChild.setAttribute(r,!0),t.attributes[r]=!0):t.attributes[r]=!1}));const r=t.attributes.inverted?e.color:e.textColor,a=t.attributes.inverted?e.textColor:e.color;this.root.firstElementChild.style.background=a,this.root.firstElementChild.style.color=r,t.attributes.outlined&&(this.root.firstElementChild.style["border-color"]=a,this.root.firstElementChild.style.color=r,this.root.firstElementChild.style.background="")},onWaveStart(e){Ct(this.props.onWaveStart,e)},onWaveEnd(e){Ct(this.props.onWaveEnd,e)},attributeToBool:wt},template:(e,t,r,a)=>e('',[{type:r.IF,evaluate:e=>e.props.href,redundantAttribute:"expr131",selector:"[expr131]",template:e('
',[{redundantAttribute:"expr144",selector:"[expr144]",expressions:[{type:t.ATTRIBUTE,name:"class",evaluate:e=>["checkbox ",e.state.checked?"checked":""].join("")},{type:t.EVENT,name:"onclick",evaluate:e=>e.onChange}]},{redundantAttribute:"expr145",selector:"[expr145]",expressions:[{type:t.EVENT,name:"onclick",evaluate:e=>e.onChange}]},{type:r.SLOT,attributes:[],name:"default",redundantAttribute:"expr146",selector:"[expr146]"},{redundantAttribute:"expr147",selector:"[expr147]",expressions:[{type:t.VALUE,evaluate:e=>e.state.checked}]}]),name:"material-checkbox"},Ut={css:null,exports:{state:{transition:!1,opened:!1},onBeforeUpdate(e,t){t.opened!==e.opened&&(t.transition=!0,setTimeout((()=>this.update({opened:e.opened,transition:!1})),e.opened?0:200))},onUpdated(e,t){e.onClick&&this.$$(".material-dropdown-item").forEach(((e,t)=>{e.onclick=r=>{const a=e.attributes.getNamedItem("item");r.target.item=a&&a.value,r.target.index=t,Ct(this.props.onClick,r)}}))}},template:(e,t,r,a)=>e('',[{type:r.IF,evaluate:e=>e.props.opened||e.state.opened,redundantAttribute:"expr137",selector:"[expr137]",template:e('',[{expressions:[{type:t.ATTRIBUTE,name:"class",evaluate:e=>["material-dropdown-container ",!!e.state.transition&&"opening"," ",e.props.animation||"top"].join("")}]},{type:r.IF,evaluate:e=>!e.props.items,redundantAttribute:"expr138",selector:"[expr138]",template:e('',[{type:r.SLOT,attributes:[],name:"default",redundantAttribute:"expr139",selector:"[expr139]"}])},{type:r.EACH,getKey:null,condition:null,template:e('',[{type:r.IF,evaluate:e=>!e.item.href,redundantAttribute:"expr141",selector:"[expr141]",template:e(" ",[{expressions:[{type:t.TEXT,childNodeIndex:0,evaluate:e=>[e.item.title].join("")},{type:t.ATTRIBUTE,name:"class",evaluate:e=>["material-dropdown-item ",e.props.selected===e.key?"selected":""].join("")},{type:t.ATTRIBUTE,name:"item",evaluate:e=>e.item.name||e.item.title}]}])},{type:r.IF,evaluate:e=>e.item.href,redundantAttribute:"expr142",selector:"[expr142]",template:e(" ",[{expressions:[{type:t.TEXT,childNodeIndex:0,evaluate:e=>[e.item.title].join("")},{type:t.ATTRIBUTE,name:"href",evaluate:e=>e.item.href},{type:t.ATTRIBUTE,name:"class",evaluate:e=>["material-dropdown-item ",e.props.selected===e.key?"selected":""].join("")},{type:t.ATTRIBUTE,name:"item",evaluate:e=>e.item.name||e.item.title},{type:t.ATTRIBUTE,name:"title",evaluate:e=>e.item.title}]}])}]),redundantAttribute:"expr140",selector:"[expr140]",itemName:"item",indexName:"key",evaluate:e=>e.props.items}])}]),name:"material-dropdown"},Bt=function(){function e(t){if(M(this,e),t||console.debug("Sorry, but for using validate mixin you should add an opts argument"),this.type=t.type,t.valid){if(this.validationType="function"==typeof t.valid?"Function":"Regexp","Regexp"===this.validationType)try{this.validationRegexp=new RegExp(t.valid)}catch(e){throw new Error("Something wrong with your regular expression!. Checkout --- ".concat(e))}"Function"===this.validationType&&(this.validationFunction=t.valid||!1)}else t&&-1!=Object.keys(this.base).indexOf(this.type)&&(this.validationType="Type")}return P(e,[{key:"base",get:function(){return{email:/^(([\w\.\-_]+)@[\w\-\_]+(\.\w+){1,}|)$/i,number:/^(\d+|)$/i,tel:/^((\+|\d)?([\d\-\(\)\#])|)+$/i,url:/([--:\w?@%&+~#=]*\.[a-z]{2,4}\/{0,2})((?:[?&](?:\w+)=(?:\w+))+|[--:\w?@%&+~#=]+)?/i}}},{key:"validate",value:function(e){return!this.validationType||this["validateBy"+this.validationType](e)}},{key:"validateByFunction",value:function(e){if(this.validationFunction)return this.validationFunction(e)}},{key:"validateByRegexp",value:function(e){if(this.validationRegexp)return this.validationRegexp.test(e)}},{key:"validateByType",value:function(e){return this.base[this.type].test(e)}}]),e}();const Ot=["disabled","rounded","outlined","inverted","icon"];var St={css:null,exports:{state:{focused:!1,showIcon:!1,value:"",disabled:!1,required:!1,error:!1},components:{MaterialButton:Rt},onMounted(e,t){if(this.required="",this.notSupportedTypes=["date","color","datetime","month","range","time"],-1!=this.notSupportedTypes.indexOf(this.props.type))throw new Error(`Sorry but we do not support ${this.props.type} type yet!`);this.validator=new Bt(this.props),this.update({showIcon:!1,value:this.props.value||""}),this.$("input").addEventListener("focus",this.changeFocus),this.$("input").addEventListener("blur",this.changeFocus),this.updateAttributes(e,t)},onBeforeUpdate(e,t){this.state.value=this.$("input").value,this.state.error=0!==t.value.length&&!this.validator.validate(t.value)||0===t.value.length&&wt(e.required)},onUpdated(e,t){this.updateAttributes(e,t)},updateAttributes(e,t){const r=function(e,t){return e.reduce((function(e,r){return e[r]=wt(t[r]),e}),{})}(Ot,e),a=r.inverted?e.textColor:e.color,n=r.inverted?e.color:e.textColor;It.children(this.$(".underline")).forEach((e=>e.style.background=a)),this.$("input").style.color=n,this.$("label")&&(this.$("label").style.color=e.labelColor||n),(r.outlined||r.rounded)&&(this.$(".input-content").style["border-color"]=a)},changeFocus(e){if(wt(this.props.disabled))return!1;const t=this.$("input")==document.activeElement;this.state.focused!=t&&(this.update({focused:t}),Ct(this.props.onFocus,t,e))},changeValue(e){this.update({value:this.$("input").value}),Ct(this.props.onValueChange,this.$("input").value,e)},iconClickHandler(e){Ct.call(this,this.props.onIconClick,e)},attributeToBool:wt},template:(e,t,r,a)=>e('
Mixed Content: The page at ``\n was loaded over HTTPS, but requested an insecure server endpoint ``.\n
This request may has been blocked; the content must be served over HTTPS.
\n You may unset the option `REGISTRY_URL` and set the registry server container URL in\n `NGINX_PROXY_PASS_URL`. It\'s usually the name of your container, and it should be on the shame\n network as the UI.\n
',[{redundantAttribute:"expr28",selector:"[expr28]",expressions:[{type:t.TEXT,childNodeIndex:0,evaluate:e=>["`",e.props.url,"` does not seems to be a correct URL, should starts with http:// or https://."].join("")}]}])},{type:r.IF,evaluate:e=>"PAGINATION_NUMBER_INVALID"===e.props.code,redundantAttribute:"expr29",selector:"[expr29]",template:e('
\n A default limit of 1000 images in catalog has been added in docker registry server\n v2.8.2 (May 11, 2023) and we\n cannot exceed this value without configuration.\n
\n The new default value for the UI is 1000 since\n 2.5.0 and was 100000 from\n 0.3.6.\n
Possible fixes
\n You can update the environment variable\n of your\n docker registry server or you can update your\n /etc/docker/registry/config.yml configuration of your docker registry server and add\n those lines:\n
\ncatalog:\n maxentries: \n
\n If you don\'t need that many images, you can reduce the number of elements fetch by the\n docker registry UI with the environment variable CATALOG_ELEMENTS_LIMIT=1000.\n
Configuration environment variables are : CATALOG_MIN_BRANCH and CATALOG_MAX_BRANCH
',[{redundantAttribute:"expr33",selector:"[expr33]",expressions:[{type:t.TEXT,childNodeIndex:0,evaluate:e=>["Wrong configuration for the branching feature: ",e.props.message].join("")}]}])}]),name:"error-page"};const An="version-notification:latest",En="version-notification:expiration-date";var wn,Cn={css:'version-notification,[is="version-notification"]{ display: inline; } version-notification svg,[is="version-notification"] svg{ margin-left: 10px; cursor: pointer; } version-notification material-popup material-button > a:first-child,[is="version-notification"] material-popup material-button > a:first-child{ display: flex; align-items: center; } version-notification material-popup .material-popup-content code,[is="version-notification"] material-popup .material-popup-content code{ background-color: var(--hover-background); padding: 0 5px; border-radius: 4px; line-height: 1.5em; } version-notification material-popup .material-popup-content b,[is="version-notification"] material-popup .material-popup-content b{ color: var(--accent-text); }',exports:{onMounted(e,t){const r=la(localStorage.getItem(An)),a=parseInt(localStorage.getItem(En));r&&r.tag_name&&this.update({tag_name:r.tag_name,latest:r}),(isNaN(a)||(new Date).getTime()>a)&&this.checkForUpdates(e,t)},onUpdated(e,t){const r=this.$("span");r&&(r.innerHTML=(new DOMParser).parseFromString('\n',"image/svg+xml").firstElementChild.outerHTML)},onClose(){this.update({open:!1})},onClick(){this.update({open:!0})},checkForUpdates(e,t){const r=new va,a=this;r.addEventListener("load",(function(){if(localStorage.setItem(En,(new Date).getTime()+864e5),200===this.status){const t=la(this.responseText);t&&a.tag_name!==t.tag_name&&!sa(e.version,t.tag_name)&&e.onNotify("A new version of Docker Registry UI is available!"),localStorage.setItem(An,this.responseText),a.update({tag_name:t.tag_name,latest:t})}else 404!==this.status&&(e.onNotify("Cannot check for new updates. Will try again in 24 hours. See the browser console."),console.error("Cannot check for new Docker Registry UI updates. This is most likely a GitHub issue. You don't need to worry about it."),console.error(`Got status code ${this.status} from Github API with response ${this.responseText}`))})),r.open("GET","https://api.github.com/repos/joxit/docker-registry-ui/releases/latest"),r.send()},isNewestVersion:sa},template:(e,t,r,a)=>e('',[{type:r.IF,evaluate:e=>e.state.tag_name&&!e.isNewestVersion(e.props.version,e.state.tag_name),redundantAttribute:"expr34",selector:"[expr34]",template:e(null,[{expressions:[{type:t.EVENT,name:"onclick",evaluate:e=>e.onClick}]}])},{type:r.TAG,getComponent:a,evaluate:e=>"material-popup",slots:[{id:"default",html:'