1 "use strict";(self.webpackChunkpleroma_fe=self.webpackChunkpleroma_fe||[]).push([[9060],{7761:(t,e,r)=>{r.d(e,{Z:()=>P});var n=r(93433),i=r(50361),a=r.n(i),o=r(36968),s=r.n(o),c=r(27361),u=r.n(c),l=r(66252),d=r(3577),p={key:0,class:"ModifiedIndicator"},f={class:"modified-tooltip"},h=r(84535),g=r(9382),m=r(84131);g.vI.add(m.klh);const b={components:{Popover:h.default},props:["changed"]};var v=r(83744);const D=(0,v.Z)(b,[["render",function(t,e,r,n,i,a){var o=(0,l.up)("FAIcon"),s=(0,l.up)("Popover");return r.changed?((0,l.wg)(),(0,l.iD)("span",p,[(0,l.Wm)(s,{trigger:"hover","trigger-attrs":{"aria-label":t.$t("settings.setting_changed")}},{trigger:(0,l.w5)((function(){return[(0,l.Uk)(" "),(0,l.Wm)(o,{icon:"wrench"})]})),content:(0,l.w5)((function(){return[(0,l._)("div",f,(0,d.zw)(t.$t("settings.setting_changed")),1)]})),_:1},8,["trigger-attrs"])])):(0,l.kq)("",!0)}]]);var k=r(29376),w={class:"DraftButtons"},y={class:"modified-tooltip"},S={class:"modified-tooltip"},O={class:"modified-tooltip"};g.vI.add(m.klh);const _={components:{Popover:h.default},props:["changed"]},P={components:{ModifiedIndicator:D,DraftButtons:(0,v.Z)(_,[["render",function(t,e,r,n,i,a){var o=(0,l.up)("Popover");return(0,l.wg)(),(0,l.iD)("span",w,[t.$parent.isDirty?((0,l.wg)(),(0,l.j4)(o,{key:0,trigger:"hover","normal-button":"","trigger-attrs":{"aria-label":t.$t("settings.commit_value_tooltip")},onClick:t.$parent.commitDraft},{trigger:(0,l.w5)((function(){return[(0,l.Uk)((0,d.zw)(t.$t("settings.commit_value")),1)]})),content:(0,l.w5)((function(){return[(0,l._)("div",y,(0,d.zw)(t.$t("settings.commit_value_tooltip")),1)]})),_:1},8,["trigger-attrs","onClick"])):(0,l.kq)("",!0),t.$parent.isDirty?((0,l.wg)(),(0,l.j4)(o,{key:1,trigger:"hover","normal-button":"","trigger-attrs":{"aria-label":t.$t("settings.reset_value_tooltip")},onClick:t.$parent.reset},{trigger:(0,l.w5)((function(){return[(0,l.Uk)((0,d.zw)(t.$t("settings.reset_value")),1)]})),content:(0,l.w5)((function(){return[(0,l._)("div",S,(0,d.zw)(t.$t("settings.reset_value_tooltip")),1)]})),_:1},8,["trigger-attrs","onClick"])):(0,l.kq)("",!0),t.$parent.canHardReset?((0,l.wg)(),(0,l.j4)(o,{key:2,trigger:"hover","normal-button":"","trigger-attrs":{"aria-label":t.$t("settings.hard_reset_value_tooltip")},onClick:t.$parent.hardReset},{trigger:(0,l.w5)((function(){return[(0,l.Uk)((0,d.zw)(t.$t("settings.hard_reset_value")),1)]})),content:(0,l.w5)((function(){return[(0,l._)("div",O,(0,d.zw)(t.$t("settings.hard_reset_value_tooltip")),1)]})),_:1},8,["trigger-attrs","onClick"])):(0,l.kq)("",!0)])}]]),ProfileSettingIndicator:k.Z},props:{path:{type:[String,Array],required:!0},disabled:{type:Boolean,default:!1},parentPath:{type:[String,Array]},parentInvert:{type:Boolean,default:!1},expert:{type:[Number,String],default:0},source:{type:String,default:void 0},hideDescription:{type:Boolean},swapDescriptionAndLabel:{type:Boolean},overrideBackendDescription:{type:Boolean},overrideBackendDescriptionLabel:{type:Boolean},draftMode:{type:Boolean,default:void 0}},inject:{defaultSource:{default:"default"},defaultDraftMode:{default:!1}},data:function(){return{localDraft:null}},created:function(){this.realDraftMode&&"admin"!==this.realSource&&(this.draft=this.state)},computed:{draft:{get:function(){return"admin"===this.realSource?u()(this.$store.state.adminSettings.draft,this.canonPath):this.localDraft},set:function(t){"admin"===this.realSource?this.$store.commit("updateAdminDraft",{path:this.canonPath,value:t}):this.localDraft=t}},state:function(){var t=u()(this.configSource,this.canonPath);return void 0===t?this.defaultState:t},visibleState:function(){return this.realDraftMode?this.draft:this.state},realSource:function(){return this.source||this.defaultSource},realDraftMode:function(){return void 0===this.draftMode?this.defaultDraftMode:this.draftMode},backendDescription:function(){return u()(this.$store.state.adminSettings.descriptions,this.path)},backendDescriptionLabel:function(){return"admin"!==this.realSource?"":!this.backendDescription||this.overrideBackendDescriptionLabel?this.$t(["admin_dash","temp_overrides"].concat((0,n.Z)(this.canonPath.map((function(t){return t.replace(/\./g,"_DOT_")}))),["label"]).join(".")):this.swapDescriptionAndLabel?null===(t=this.backendDescription)||void 0===t?void 0:t.description:null===(e=this.backendDescription)||void 0===e?void 0:e.label;var t,e},backendDescriptionDescription:function(){return"admin"!==this.realSource?"":this.hideDescription?null:!this.backendDescription||this.overrideBackendDescription?this.$t(["admin_dash","temp_overrides"].concat((0,n.Z)(this.canonPath.map((function(t){return t.replace(/\./g,"_DOT_")}))),["description"]).join(".")):this.swapDescriptionAndLabel?null===(t=this.backendDescription)||void 0===t?void 0:t.label:null===(e=this.backendDescription)||void 0===e?void 0:e.description;var t,e},backendDescriptionSuggestions:function(){var t;return null===(t=this.backendDescription)||void 0===t?void 0:t.suggestions},shouldBeDisabled:function(){var t=void 0!==this.parentPath?u()(this.configSource,this.parentPath):null;return this.disabled||null!==t&&(this.parentInvert?t:!t)},configSource:function(){switch(this.realSource){case"profile":return this.$store.state.profileConfig;case"admin":return this.$store.state.adminSettings.config;default:return this.$store.getters.mergedConfig}},configSink:function(){var t=this;switch(this.realSource){case"profile":return function(e,r){return t.$store.dispatch("setProfileOption",{name:e,value:r})};case"admin":return function(e,r){return t.$store.dispatch("pushAdminSetting",{path:e,value:r})};default:return function(e,r){return t.$store.dispatch("setOption",{name:e,value:r})}}},defaultState:function(){return"profile"===this.realSource?{}:u()(this.$store.getters.defaultConfig,this.path)},isProfileSetting:function(){return"profile"===this.realSource},isChanged:function(){switch(this.realSource){case"profile":case"admin":return!1;default:return this.state!==this.defaultState}},canonPath:function(){return Array.isArray(this.path)?this.path:this.path.split(".")},isDirty:function(){return!("admin"===this.realSource&&this.canonPath.length>3)&&this.realDraftMode&&this.draft!==this.state},canHardReset:function(){return"admin"===this.realSource&&this.$store.state.adminSettings.modifiedPaths.has(this.canonPath.join(" -> "))},matchesExpertLevel:function(){return(this.expert||0)<=this.$store.state.config.expertLevel>0}},methods:{getValue:function(t){return t.target.value},update:function(t){this.realDraftMode?this.draft=this.getValue(t):this.configSink(this.path,this.getValue(t))},commitDraft:function(){this.realDraftMode&&this.configSink(this.path,this.draft)},reset:function(){this.realDraftMode?this.draft=a()(this.state):s()(this.$store.getters.mergedConfig,this.path,a()(this.defaultState))},hardReset:function(){var t=this;if("admin"===this.realSource)return this.$store.dispatch("resetAdminSetting",{path:this.path}).then((function(){t.draft=t.state}));console.warn("Hard reset not implemented yet!")}}}},76875:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(){return{user:function(){return this.$store.state.users.currentUser},expertLevel:function(){return this.$store.getters.mergedConfig.expertLevel>0},mergedConfig:function(){return this.$store.getters.mergedConfig},adminConfig:function(){return this.$store.state.adminSettings.config},adminDraft:function(){return this.$store.state.adminSettings.draft}}}},59236:(t,e,r)=>{r.d(e,{Z:()=>p});var n=r(66252),i=r(3577),a={key:0,class:"BooleanSetting"},o=r(4942),s=r(66141),c=r(7761);function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){(0,o.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const d=l(l({},c.Z),{},{props:l(l({},c.Z.props),{},{indeterminateState:[String,Object]}),components:l(l({},c.Z.components),{},{Checkbox:s.Z}),computed:l(l({},c.Z.computed),{},{isIndeterminate:function(){return this.visibleState===this.indeterminateState}}),methods:l(l({},c.Z.methods),{},{getValue:function(t){return this.indeterminateState&&!t&&!0===this.visibleState?this.indeterminateState:t}})}),p=(0,r(83744).Z)(d,[["render",function(t,e,r,o,s,c){var u=(0,n.up)("Checkbox"),l=(0,n.up)("ModifiedIndicator"),d=(0,n.up)("ProfileSettingIndicator"),p=(0,n.up)("DraftButtons");return t.matchesExpertLevel?((0,n.wg)(),(0,n.iD)("label",a,[(0,n.Wm)(u,{"model-value":t.visibleState,disabled:t.shouldBeDisabled,indeterminate:t.isIndeterminate,"onUpdate:modelValue":t.update},{default:(0,n.w5)((function(){return[(0,n._)("span",{class:(0,i.C_)(["label",{faint:t.shouldBeDisabled}])},[t.backendDescriptionLabel?((0,n.wg)(),(0,n.iD)(n.HY,{key:0},[(0,n.Uk)((0,i.zw)(t.backendDescriptionLabel),1)],64)):"admin"===t.source?((0,n.wg)(),(0,n.iD)(n.HY,{key:1},[(0,n.Uk)(" MISSING LABEL FOR "+(0,i.zw)(t.path),1)],64)):(0,n.WI)(t.$slots,"default",{key:2})],2)]})),_:3},8,["model-value","disabled","indeterminate","onUpdate:modelValue"]),(0,n.Wm)(l,{changed:t.isChanged,onclick:t.reset},null,8,["changed","onclick"]),(0,n.Wm)(d,{"is-profile":t.isProfileSetting},null,8,["is-profile"]),(0,n.Wm)(p),t.backendDescriptionDescription?((0,n.wg)(),(0,n.iD)("p",{key:0,class:(0,i.C_)(["setting-description",{faint:t.shouldBeDisabled}])},(0,i.zw)(t.backendDescriptionDescription+" "),3)):(0,n.kq)("",!0)])):(0,n.kq)("",!0)}]])},77218:(t,e,r)=>{r.d(e,{Z:()=>h});var n=r(66252),i=r(3577),a={key:0,class:"ChoiceSetting"},o=["value"],s={key:2,class:"setting-description"},c=r(4942),u=r(76990),l=r(7761);function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){(0,c.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const f=p(p({},l.Z),{},{components:p(p({},l.Z.components),{},{Select:u.Z}),props:p(p({},l.Z.props),{},{options:{type:Array,required:!1},optionLabelMap:{type:Object,required:!1,default:{}}}),computed:p(p({},l.Z.computed),{},{realOptions:function(){var t=this;return"admin"===this.realSource?this.backendDescriptionSuggestions.map((function(e){return{key:e,value:e,label:t.optionLabelMap[e]||e}})):this.options}}),methods:p(p({},l.Z.methods),{},{getValue:function(t){return t}})}),h=(0,r(83744).Z)(f,[["render",function(t,e,r,c,u,l){var d=(0,n.up)("Select"),p=(0,n.up)("ModifiedIndicator"),f=(0,n.up)("ProfileSettingIndicator"),h=(0,n.up)("DraftButtons");return t.matchesExpertLevel?((0,n.wg)(),(0,n.iD)("label",a,[t.backendDescriptionLabel?((0,n.wg)(),(0,n.iD)(n.HY,{key:0},[(0,n.Uk)((0,i.zw)(t.backendDescriptionLabel),1)],64)):(0,n.WI)(t.$slots,"default",{key:1}),(0,n.Uk)(" "+(0,i.zw)(" ")+" "),(0,n.Wm)(d,{"model-value":t.realDraftMode?t.draft:t.state,disabled:t.disabled,"onUpdate:modelValue":t.update},{default:(0,n.w5)((function(){return[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(t.realOptions,(function(e){return(0,n.wg)(),(0,n.iD)("option",{key:e.key,value:e.value},(0,i.zw)(e.label)+" "+(0,i.zw)(e.value===t.defaultState?t.$t("settings.instance_default_simple"):""),9,o)})),128))]})),_:1},8,["model-value","disabled","onUpdate:modelValue"]),(0,n.Wm)(p,{changed:t.isChanged,onclick:t.reset},null,8,["changed","onclick"]),(0,n.Wm)(f,{"is-profile":t.isProfileSetting},null,8,["is-profile"]),(0,n.Wm)(h),t.backendDescriptionDescription?((0,n.wg)(),(0,n.iD)("p",s,(0,i.zw)(t.backendDescriptionDescription+" "),1)):(0,n.kq)("",!0)])):(0,n.kq)("",!0)}]])},87449:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(66252);const i={components:{NumberSetting:r(20445).Z}},a=(0,r(83744).Z)(i,[["render",function(t,e,r,i,a,o){var s=(0,n.up)("NumberSetting");return(0,n.wg)(),(0,n.j4)(s,(0,n.dG)(t.$attrs,{truncate:"1"}),{default:(0,n.w5)((function(){return[(0,n.WI)(t.$slots,"default")]})),_:3},16)}]])},20445:(t,e,r)=>{r.d(e,{Z:()=>f});var n=r(66252),i=r(3577),a={key:0,class:"NumberSetting"},o=["for"],s=["id","step","disabled","min","value"],c=r(4942),u=r(7761);function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){(0,c.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const p=d(d({},u.Z),{},{props:d(d({},u.Z.props),{},{truncate:{type:Number,required:!1,default:1}}),methods:d(d({},u.Z.methods),{},{getValue:function(t){return 1===!this.truncate?parseInt(t.target.value):this.truncate>1?Math.trunc(t.target.value/this.truncate)*this.truncate:parseFloat(t.target.value)}})}),f=(0,r(83744).Z)(p,[["render",function(t,e,r,c,u,l){var d=(0,n.up)("ModifiedIndicator"),p=(0,n.up)("ProfileSettingIndicator"),f=(0,n.up)("DraftButtons");return t.matchesExpertLevel?((0,n.wg)(),(0,n.iD)("span",a,[(0,n._)("label",{for:t.path,class:(0,i.C_)({faint:t.shouldBeDisabled})},[t.backendDescriptionLabel?((0,n.wg)(),(0,n.iD)(n.HY,{key:0},[(0,n.Uk)((0,i.zw)(t.backendDescriptionLabel+" "),1)],64)):"admin"===t.source?((0,n.wg)(),(0,n.iD)(n.HY,{key:1},[(0,n.Uk)(" MISSING LABEL FOR "+(0,i.zw)(t.path),1)],64)):(0,n.WI)(t.$slots,"default",{key:2})],10,o),(0,n._)("input",{id:t.path,class:"number-input",type:"number",step:t.step||1,disabled:t.shouldBeDisabled,min:t.min||0,value:t.realDraftMode?t.draft:t.state,onChange:e[0]||(e[0]=function(){return t.update&&t.update.apply(t,arguments)})},null,40,s),(0,n.Uk)(" "+(0,i.zw)(" ")+" "),(0,n.Wm)(d,{changed:t.isChanged,onclick:t.reset},null,8,["changed","onclick"]),(0,n.Wm)(p,{"is-profile":t.isProfileSetting},null,8,["is-profile"]),(0,n.Wm)(f),t.backendDescriptionDescription?((0,n.wg)(),(0,n.iD)("p",{key:0,class:(0,i.C_)(["setting-description",{faint:t.shouldBeDisabled}])},(0,i.zw)(t.backendDescriptionDescription+" "),3)):(0,n.kq)("",!0)])):(0,n.kq)("",!0)}]])},29376:(t,e,r)=>{r.d(e,{Z:()=>d});var n=r(66252),i=r(3577),a={key:0,class:"ProfileSettingIndicator"},o={class:"profilesetting-tooltip"},s=r(84535),c=r(9382),u=r(84131);c.vI.add(u.xf3);const l={components:{Popover:s.default},props:["isProfile"]},d=(0,r(83744).Z)(l,[["render",function(t,e,r,s,c,u){var l=(0,n.up)("FAIcon"),d=(0,n.up)("Popover");return r.isProfile?((0,n.wg)(),(0,n.iD)("span",a,[(0,n.Wm)(d,{trigger:"hover"},{trigger:(0,n.w5)((function(){return[(0,n.Uk)(" "),(0,n.Wm)(l,{icon:"server","aria-label":t.$t("settings.setting_server_side")},null,8,["aria-label"])]})),content:(0,n.w5)((function(){return[(0,n._)("div",o,(0,i.zw)(t.$t("settings.setting_server_side")),1)]})),_:1})])):(0,n.kq)("",!0)}]])}}]);