"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["node_modules_nextcloud_dialogs_dist_chunks_PublicAuthPrompt-D1BKEbm6_mjs"],{49279:(t,e,a)=>{a.r(e),a.d(e,{default:()=>b});var i=a(85471),n=a(59097),l=a(21777),s=a(85168),o=(a(97012),a(94219)),r=a(40083),u=a(82182),c=a(3904);const m=(0,n.getBuilder)("public").build(),p=(0,i.pM)({name:"PublicAuthPrompt",components:{NcDialog:o.A,NcNoteCard:r.A,NcTextField:u.A},props:{nickname:{type:String,default:""},title:{type:String,default:(0,c.t)("Guest identification")},text:{type:String,default:""},notice:{type:String,default:(0,c.t)("You are currently not identified.")},submitLabel:{type:String,default:(0,c.t)("Submit name")},cancellable:{type:Boolean,default:!1}},setup:()=>({t:c.t}),emits:["close"],data:()=>({name:""}),computed:{dialogButtons(){const t={label:(0,c.t)("Cancel"),variant:"tertiary",callback:()=>this.$emit("close")},e={label:this.submitLabel,type:"submit",variant:"primary"};return this.cancellable?[t,e]:[e]}},watch:{nickname:{handler(){this.name=this.nickname},immediate:!0}},methods:{onSubmit(){const t=this.$refs.input,e=this.name.trim();if(""===e)return t.setCustomValidity((0,c.t)("You cannot leave the name empty.")),t.reportValidity(),void t.focus();if(e.length<2)return t.setCustomValidity((0,c.t)("Please enter a name with at least 2 characters.")),t.reportValidity(),void t.focus();try{(0,l.L$)(e)}catch(e){return(0,s.Qg)((0,c.t)("Failed to set nickname.")),console.error("Failed to set nickname",e),void t.focus()}m.setItem("public-auth-prompt-shown","true"),this.$emit("close",this.name)}}});var d=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcDialog",{staticClass:"public-auth-prompt",attrs:{buttons:t.dialogButtons,"data-cy-public-auth-prompt-dialog":"","is-form":"","no-close":"",name:t.title},on:{submit:t.onSubmit}},[t.text?e("p",{staticClass:"public-auth-prompt__text"},[t._v(" "+t._s(t.text)+" ")]):t._e(),e("NcNoteCard",{staticClass:"public-auth-prompt__header",attrs:{text:t.notice,type:"info"}}),e("NcTextField",{ref:"input",staticClass:"public-auth-prompt__input",attrs:{"data-cy-public-auth-prompt-dialog-name":"",label:t.t("Name"),placeholder:t.t("Enter your name"),required:!t.cancellable,minlength:"2",name:"name"},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}})],1)},h=[];const b=(0,c.n)(p,d,h,!1,null,"4158d556").exports},82182:(t,e,a)=>{a.d(e,{A:()=>i.N});var i=a(4266)}}]);
//# sourceMappingURL=photos-node_modules_nextcloud_dialogs_dist_chunks_PublicAuthPrompt-D1BKEbm6_mjs.js.map?v=4f229d188a6af26eef57