1 (self.webpackChunkpleroma_fe=self.webpackChunkpleroma_fe||[]).push([[7586],{25771:(t,e,n)=>{"use strict";n.d(e,{M:()=>i,i:()=>a});var r=n(57458),o=n.n(r),i=function(t){var e=t.filename,n=void 0===e?"data":e,r=t.getExportedObject;return{exportData:function(){var t=o().encode(JSON.stringify(r(),null,2)),e=document.createElement("a");e.setAttribute("download","".concat(n,".json")),e.setAttribute("href","data:application/json;base64,"+window.btoa(t)),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}}},a=function(t){var e=t.onImport,n=t.onImportFailure,r=t.validator,o=void 0===r?function(){return!0}:r;return{importData:function(){var t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("accept",".json"),t.addEventListener("change",(function(t){if(t.target.files[0]){var r=new FileReader;r.onload=function(t){var r=t.target;try{var i=JSON.parse(r.result),a=o(i);!0===a?e(i):n({validationResult:a})}catch(t){n({error:t})}},r.readAsText(t.target.files[0])}})),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}}},57458:(t,e)=>{!function(t){var e,n,r,o=String.fromCharCode;function i(t){for(var e,n,r=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(n=t.charCodeAt(o++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--):r.push(e);return r}function a(t){if(t>=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function s(t,e){return o(t>>e&63|128)}function l(t){if(0==(4294967168&t))return o(t);var e="";return 0==(4294965248&t)?e=o(t>>6&31|192):0==(4294901760&t)?(a(t),e=o(t>>12&15|224),e+=s(t,6)):0==(4292870144&t)&&(e=o(t>>18&7|240),e+=s(t,12),e+=s(t,6)),e+o(63&t|128)}function c(){if(r>=n)throw Error("Invalid byte index");var t=255&e[r];if(r++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function d(){var t,o;if(r>n)throw Error("Invalid byte index");if(r==n)return!1;if(t=255&e[r],r++,0==(128&t))return t;if(192==(224&t)){if((o=(31&t)<<6|c())>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&t)){if((o=(15&t)<<12|c()<<6|c())>=2048)return a(o),o;throw Error("Invalid continuation byte")}if(240==(248&t)&&(o=(7&t)<<18|c()<<12|c()<<6|c())>=65536&&o<=1114111)return o;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=i(t),n=e.length,r=-1,o="";++r<n;)o+=l(e[r]);return o},t.decode=function(t){e=i(t),n=e.length,r=0;for(var a,s=[];!1!==(a=d());)s.push(a);return function(t){for(var e,n=t.length,r=-1,i="";++r<n;)(e=t[r])>65535&&(i+=o((e-=65536)>>>10&1023|55296),e=56320|1023&e),i+=o(e);return i}(s)}}(e)},27586:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>J});var r=n(66252),o=n(3577),i=n(49963),a={class:"settings-modal-panel panel"},s={class:"panel-heading"},l={class:"title"},c=["title"],d=["title"],u={class:"panel-body"},p={class:"panel-footer settings-footer -flexible-height"},f=["title"],m={class:"dropdown-menu"},g=["onClick"],h=["onClick"],b=["onClick"],v={key:1},_={href:"/pleroma/admin/#/login-pleroma",target:"_blank"},w=(0,r._)("span",{id:"unscrolled-content",class:"extra-content"},null,-1),y={key:2,class:"admin-buttons"},k=["disabled"],O=["disabled"],x=n(4942),C=n(29439),j=n(18446),M=n.n(j),$=n(50361),A=n.n($),S=n(48328),D=n(29187),E={class:"async-component-error"};const P={emits:["resetAsyncComponent"],methods:{retry:function(){this.$emit("resetAsyncComponent")}}};var I=n(83744);const z=(0,I.Z)(P,[["render",function(t,e,n,i,a,s){return(0,r.wg)(),(0,r.iD)("div",E,[(0,r._)("div",null,[(0,r._)("h4",null,(0,o.zw)(t.$t("general.generic_error")),1),(0,r._)("p",null,(0,o.zw)(t.$t("general.error_retry")),1),(0,r._)("button",{class:"btn button-default",onClick:e[0]||(e[0]=function(){return s.retry&&s.retry.apply(s,arguments)})},(0,o.zw)(t.$t("general.retry")),1)])])}]]);var N=n(2262);function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}const W=function(t,e){var n=function(){return function(){return(0,r.RC)(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?U(Object(n),!0).forEach((function(e){(0,x.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({loader:t},e))}},o=(0,N.Um)({c:n()});return{render:function(){return(0,r.h)(o.c(),{onResetAsyncComponent:function(){o.c=n()}})}}};var L=n(84535),T=n(66141),Z=n(9382),F=n(25771),q=n(84131),K=n(5737);function R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?R(Object(n),!0).forEach((function(e){(0,x.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}Z.vI.add(q.NBC,K.IQi,q.Y9i,q.kwI,q.ptq);const V={data:function(){var t=this;return{dataImporter:(0,F.i)({validator:this.importValidator,onImport:this.onImport,onImportFailure:this.onImportFailure}),dataThemeExporter:(0,F.M)({filename:"pleromafe_settings.full",getExportedObject:function(){return t.generateExport(!0)}}),dataExporter:(0,F.M)({filename:"pleromafe_settings",getExportedObject:function(){return t.generateExport()}})}},components:{Modal:S.Z,Popover:L.default,Checkbox:T.Z,SettingsModalUserContent:W((function(){return Promise.all([n.e(48),n.e(9060),n.e(7962)]).then(n.bind(n,62691))}),{loadingComponent:D.Z,errorComponent:z,delay:0}),SettingsModalAdminContent:W((function(){return Promise.all([n.e(9060),n.e(9801)]).then(n.bind(n,9541))}),{loadingComponent:D.Z,errorComponent:z,delay:0})},methods:{closeModal:function(){this.$store.dispatch("closeSettingsModal")},peekModal:function(){this.$store.dispatch("togglePeekSettingsModal")},importValidator:function(t){if(!Array.isArray(t._pleroma_settings_version))return{messageKey:"settings.file_import_export.invalid_file"};var e=(0,C.Z)(t._pleroma_settings_version,2),n=e[0],r=e[1];return n>1?{messageKey:"settings.file_export_import.errors.file_too_new",messageArgs:{fileMajor:n,feMajor:1}}:n<1?{messageKey:"settings.file_export_import.errors.file_too_old",messageArgs:{fileMajor:n,feMajor:1}}:(r>0&&this.$store.dispatch("pushGlobalNotice",{level:"warning",messageKey:"settings.file_export_import.errors.file_slightly_new"}),!0)},onImportFailure:function(t){t.error?this.$store.dispatch("pushGlobalNotice",{messageKey:"settings.invalid_settings_imported",level:"error"}):this.$store.dispatch("pushGlobalNotice",G(G({},t.validationResult),{},{level:"error"}))},onImport:function(t){t&&this.$store.dispatch("loadSettings",t)},restore:function(){this.dataImporter.importData()},backup:function(){this.dataExporter.exportData()},backupWithTheme:function(){this.dataThemeExporter.exportData()},generateExport:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.$store.state.config,n=e;if(!t){var r=new Set(["customTheme","customThemeSource","colors"]);n=Object.fromEntries(Object.entries(n).filter((function(t){var e=(0,C.Z)(t,1)[0];return!r.has(e)})))}var o=A()(n);return o._pleroma_settings_version=[1,0],o},resetAdminDraft:function(){this.$store.commit("resetAdminDraft")},pushAdminDraft:function(){this.$store.dispatch("pushAdminDraft")}},computed:{currentSaveStateNotice:function(){return this.$store.state.interface.settings.currentSaveStateNotice},modalActivated:function(){return"hidden"!==this.$store.state.interface.settingsModalState},modalMode:function(){return this.$store.state.interface.settingsModalMode},modalOpenedOnceUser:function(){return this.$store.state.interface.settingsModalLoadedUser},modalOpenedOnceAdmin:function(){return this.$store.state.interface.settingsModalLoadedAdmin},modalPeeked:function(){return"minimized"===this.$store.state.interface.settingsModalState},expertLevel:{get:function(){return this.$store.state.config.expertLevel>0},set:function(t){this.$store.dispatch("setOption",{name:"expertLevel",value:t?1:0})}},adminDraftAny:function(){return!M()(this.$store.state.adminSettings.config,this.$store.state.adminSettings.draft)}}},J=(0,I.Z)(V,[["render",function(t,e,n,x,C,j){var M=(0,r.up)("FAIcon"),$=(0,r.up)("SettingsModalUserContent"),A=(0,r.up)("SettingsModalAdminContent"),S=(0,r.up)("Popover"),D=(0,r.up)("Checkbox"),E=(0,r.up)("i18n-t"),P=(0,r.up)("Modal");return(0,r.wg)(),(0,r.j4)(P,{"is-open":t.modalActivated,class:(0,o.C_)(["settings-modal",{peek:t.modalPeeked}]),"no-background":t.modalPeeked},{default:(0,r.w5)((function(){return[(0,r._)("div",a,[(0,r._)("div",s,[(0,r._)("span",l,(0,o.zw)("user"===t.modalMode?t.$t("settings.settings"):t.$t("admin_dash.window_title")),1),(0,r.Wm)(i.uT,{name:"fade"},{default:(0,r.w5)((function(){return[t.currentSaveStateNotice?((0,r.wg)(),(0,r.iD)("div",{key:0,class:(0,o.C_)(["alert",{transparent:!t.currentSaveStateNotice.error,error:t.currentSaveStateNotice.error}]),onClick:e[0]||(e[0]=(0,i.iM)((function(){}),["prevent"]))},(0,o.zw)(t.currentSaveStateNotice.error?t.$t("settings.saving_err"):t.$t("settings.saving_ok")),3)):(0,r.kq)("",!0)]})),_:1}),(0,r._)("button",{class:"btn button-default",title:t.$t("general.peek"),onClick:e[1]||(e[1]=function(){return t.peekModal&&t.peekModal.apply(t,arguments)})},[(0,r.Wm)(M,{icon:["far","window-minimize"],"fixed-width":""})],8,c),(0,r._)("button",{class:"btn button-default",title:t.$t("general.close"),onClick:e[2]||(e[2]=function(){return t.closeModal&&t.closeModal.apply(t,arguments)})},[(0,r.Wm)(M,{icon:"times","fixed-width":""})],8,d)]),(0,r._)("div",u,["user"===t.modalMode&&t.modalOpenedOnceUser?((0,r.wg)(),(0,r.j4)($,{key:0})):(0,r.kq)("",!0),"admin"===t.modalMode&&t.modalOpenedOnceAdmin?((0,r.wg)(),(0,r.j4)(A,{key:1})):(0,r.kq)("",!0)]),(0,r._)("div",p,["user"===t.modalMode?((0,r.wg)(),(0,r.j4)(S,{key:0,class:"export",trigger:"click",placement:"top",offset:{y:5,x:5},"bound-to":{x:"container"},"remove-padding":""},{trigger:(0,r.w5)((function(){return[(0,r._)("button",{class:"btn button-default",title:t.$t("general.close")},[(0,r._)("span",null,(0,o.zw)(t.$t("settings.file_export_import.backup_restore")),1),(0,r.Uk)(" "+(0,o.zw)(" ")+" "),(0,r.Wm)(M,{icon:"chevron-down"})],8,f)]})),content:(0,r.w5)((function(n){var a=n.close;return[(0,r._)("div",m,[(0,r._)("button",{class:"button-default dropdown-item dropdown-item-icon",onClick:[e[3]||(e[3]=(0,i.iM)((function(){return t.backup&&t.backup.apply(t,arguments)}),["prevent"])),a]},[(0,r.Wm)(M,{icon:"file-download","fixed-width":""}),(0,r._)("span",null,(0,o.zw)(t.$t("settings.file_export_import.backup_settings")),1)],8,g),(0,r._)("button",{class:"button-default dropdown-item dropdown-item-icon",onClick:[e[4]||(e[4]=(0,i.iM)((function(){return t.backupWithTheme&&t.backupWithTheme.apply(t,arguments)}),["prevent"])),a]},[(0,r.Wm)(M,{icon:"file-download","fixed-width":""}),(0,r._)("span",null,(0,o.zw)(t.$t("settings.file_export_import.backup_settings_theme")),1)],8,h),(0,r._)("button",{class:"button-default dropdown-item dropdown-item-icon",onClick:[e[5]||(e[5]=(0,i.iM)((function(){return t.restore&&t.restore.apply(t,arguments)}),["prevent"])),a]},[(0,r.Wm)(M,{icon:"file-upload","fixed-width":""}),(0,r._)("span",null,(0,o.zw)(t.$t("settings.file_export_import.restore_settings")),1)],8,b)])]})),_:1})):(0,r.kq)("",!0),(0,r.Wm)(D,{"model-value":!!t.expertLevel,"onUpdate:modelValue":e[6]||(e[6]=function(e){return t.expertLevel=Number(e)})},{default:(0,r.w5)((function(){return[(0,r.Uk)((0,o.zw)(t.$t("settings.expert_mode")),1)]})),_:1},8,["model-value"]),"admin"===t.modalMode?((0,r.wg)(),(0,r.iD)("span",v,[(0,r.Wm)(E,{keypath:"admin_dash.wip_notice"},{adminFeLink:(0,r.w5)((function(){return[(0,r._)("a",_,(0,o.zw)(t.$t("admin_dash.old_ui_link")),1)]})),_:1})])):(0,r.kq)("",!0),w,"admin"===t.modalMode?((0,r.wg)(),(0,r.iD)("span",y,[(0,r._)("button",{class:"button-default btn",disabled:!t.adminDraftAny,onClick:e[7]||(e[7]=function(){return t.resetAdminDraft&&t.resetAdminDraft.apply(t,arguments)})},(0,o.zw)(t.$t("admin_dash.reset_all")),9,k),(0,r.Uk)(" "+(0,o.zw)(" ")+" "),(0,r._)("button",{class:"button-default btn",disabled:!t.adminDraftAny,onClick:e[8]||(e[8]=function(){return t.pushAdminDraft&&t.pushAdminDraft.apply(t,arguments)})},(0,o.zw)(t.$t("admin_dash.commit_all")),9,O)])):(0,r.kq)("",!0)])])]})),_:1},8,["is-open","class","no-background"])}]])}}]);