File: /volume1/@appstore/WebStation/ui/webstation_vue.js
/*!
* // @require: SYNO.SDS.WebStation.Errors.GetMessage
* // @require: SYNO.SDS.Utils.FileChooser.Chooser
* // @require: SYNO.SDS.WebStation.Util.CreatePackageInfo
* // @require: SYNO.SDS.WebStation.Dialog.DefaultServer
* // @require: SYNO.SDS.WebStation.Web.PHPAdvancedSetting
* // @require: SYNO.SDS.WebStation.Web.AliasPortalEditor
* // @require: SYNO.SDS.Docker.Project.ProjectActionLogDialog
*/!function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=121)}([function(t,e,i){"use strict";(function(t){i.d(e,"b",(function(){return w})),i.d(e,"c",(function(){return b}));var n=("undefined"!=typeof window?window:void 0!==t?t:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function s(t,e){if(void 0===e&&(e=[]),null===t||"object"!=typeof t)return t;var i,n=(i=function(e){return e.original===t},e.filter(i)[0]);if(n)return n.copy;var a=Array.isArray(t)?[]:{};return e.push({original:t,copy:a}),Object.keys(t).forEach((function(i){a[i]=s(t[i],e)})),a}function a(t,e){Object.keys(t).forEach((function(i){return e(t[i],i)}))}function r(t){return null!==t&&"object"==typeof t}var o=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var i=t.state;this.state=("function"==typeof i?i():i)||{}},l={namespaced:{configurable:!0}};l.namespaced.get=function(){return!!this._rawModule.namespaced},o.prototype.addChild=function(t,e){this._children[t]=e},o.prototype.removeChild=function(t){delete this._children[t]},o.prototype.getChild=function(t){return this._children[t]},o.prototype.hasChild=function(t){return t in this._children},o.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},o.prototype.forEachChild=function(t){a(this._children,t)},o.prototype.forEachGetter=function(t){this._rawModule.getters&&a(this._rawModule.getters,t)},o.prototype.forEachAction=function(t){this._rawModule.actions&&a(this._rawModule.actions,t)},o.prototype.forEachMutation=function(t){this._rawModule.mutations&&a(this._rawModule.mutations,t)},Object.defineProperties(o.prototype,l);var p=function(t){this.register([],t,!1)};p.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},p.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,i){return t+((e=e.getChild(i)).namespaced?i+"/":"")}),"")},p.prototype.update=function(t){!function t(e,i,n){0;if(i.update(n),n.modules)for(var s in n.modules){if(!i.getChild(s))return void 0;t(e.concat(s),i.getChild(s),n.modules[s])}}([],this.root,t)},p.prototype.register=function(t,e,i){var n=this;void 0===i&&(i=!0);var s=new o(e,i);0===t.length?this.root=s:this.get(t.slice(0,-1)).addChild(t[t.length-1],s);e.modules&&a(e.modules,(function(e,s){n.register(t.concat(s),e,i)}))},p.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),i=t[t.length-1],n=e.getChild(i);n&&n.runtime&&e.removeChild(i)},p.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),i=t[t.length-1];return!!e&&e.hasChild(i)};var c;var d=function(t){var e=this;void 0===t&&(t={}),!c&&"undefined"!=typeof window&&window.Vue&&g(window.Vue);var i=t.plugins;void 0===i&&(i=[]);var s=t.strict;void 0===s&&(s=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new p(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new c,this._makeLocalGettersCache=Object.create(null);var a=this,r=this.dispatch,o=this.commit;this.dispatch=function(t,e){return r.call(a,t,e)},this.commit=function(t,e,i){return o.call(a,t,e,i)},this.strict=s;var l=this._modules.root.state;m(this,l,[],this._modules.root),_(this,l),i.forEach((function(t){return t(e)})),(void 0!==t.devtools?t.devtools:c.config.devtools)&&function(t){n&&(t._devtoolHook=n,n.emit("vuex:init",t),n.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){n.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){n.emit("vuex:action",t,e)}),{prepend:!0}))}(this)},u={state:{configurable:!0}};function f(t,e,i){return e.indexOf(t)<0&&(i&&i.prepend?e.unshift(t):e.push(t)),function(){var i=e.indexOf(t);i>-1&&e.splice(i,1)}}function h(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var i=t.state;m(t,i,[],t._modules.root,!0),_(t,i,e)}function _(t,e,i){var n=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var s=t._wrappedGetters,r={};a(s,(function(e,i){r[i]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,i,{get:function(){return t._vm[i]},enumerable:!0})}));var o=c.config.silent;c.config.silent=!0,t._vm=new c({data:{$$state:e},computed:r}),c.config.silent=o,t.strict&&function(t){t._vm.$watch((function(){return this._data.$$state}),(function(){0}),{deep:!0,sync:!0})}(t),n&&(i&&t._withCommit((function(){n._data.$$state=null})),c.nextTick((function(){return n.$destroy()})))}function m(t,e,i,n,s){var a=!i.length,r=t._modules.getNamespace(i);if(n.namespaced&&(t._modulesNamespaceMap[r],t._modulesNamespaceMap[r]=n),!a&&!s){var o=S(e,i.slice(0,-1)),l=i[i.length-1];t._withCommit((function(){c.set(o,l,n.state)}))}var p=n.context=function(t,e,i){var n=""===e,s={dispatch:n?t.dispatch:function(i,n,s){var a=v(i,n,s),r=a.payload,o=a.options,l=a.type;return o&&o.root||(l=e+l),t.dispatch(l,r)},commit:n?t.commit:function(i,n,s){var a=v(i,n,s),r=a.payload,o=a.options,l=a.type;o&&o.root||(l=e+l),t.commit(l,r,o)}};return Object.defineProperties(s,{getters:{get:n?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var i={},n=e.length;Object.keys(t.getters).forEach((function(s){if(s.slice(0,n)===e){var a=s.slice(n);Object.defineProperty(i,a,{get:function(){return t.getters[s]},enumerable:!0})}})),t._makeLocalGettersCache[e]=i}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return S(t.state,i)}}}),s}(t,r,i);n.forEachMutation((function(e,i){!function(t,e,i,n){(t._mutations[e]||(t._mutations[e]=[])).push((function(e){i.call(t,n.state,e)}))}(t,r+i,e,p)})),n.forEachAction((function(e,i){var n=e.root?i:r+i,s=e.handler||e;!function(t,e,i,n){(t._actions[e]||(t._actions[e]=[])).push((function(e){var s,a=i.call(t,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:t.getters,rootState:t.state},e);return(s=a)&&"function"==typeof s.then||(a=Promise.resolve(a)),t._devtoolHook?a.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):a}))}(t,n,s,p)})),n.forEachGetter((function(e,i){!function(t,e,i,n){if(t._wrappedGetters[e])return void 0;t._wrappedGetters[e]=function(t){return i(n.state,n.getters,t.state,t.getters)}}(t,r+i,e,p)})),n.forEachChild((function(n,a){m(t,e,i.concat(a),n,s)}))}function S(t,e){return e.reduce((function(t,e){return t[e]}),t)}function v(t,e,i){return r(t)&&t.type&&(i=e,e=t,t=t.type),{type:t,payload:e,options:i}}function g(t){c&&t===c||
/*!
* vuex v3.6.2
* (c) 2021 Evan You
* @license MIT
*/
function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:i});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[i].concat(t.init):i,e.call(this,t)}}function i(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(c=t)}u.state.get=function(){return this._vm._data.$$state},u.state.set=function(t){0},d.prototype.commit=function(t,e,i){var n=this,s=v(t,e,i),a=s.type,r=s.payload,o=(s.options,{type:a,payload:r}),l=this._mutations[a];l&&(this._withCommit((function(){l.forEach((function(t){t(r)}))})),this._subscribers.slice().forEach((function(t){return t(o,n.state)})))},d.prototype.dispatch=function(t,e){var i=this,n=v(t,e),s=n.type,a=n.payload,r={type:s,payload:a},o=this._actions[s];if(o){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(r,i.state)}))}catch(t){0}var l=o.length>1?Promise.all(o.map((function(t){return t(a)}))):o[0](a);return new Promise((function(t,e){l.then((function(e){try{i._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(r,i.state)}))}catch(t){0}t(e)}),(function(t){try{i._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(r,i.state,t)}))}catch(t){0}e(t)}))}))}},d.prototype.subscribe=function(t,e){return f(t,this._subscribers,e)},d.prototype.subscribeAction=function(t,e){return f("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},d.prototype.watch=function(t,e,i){var n=this;return this._watcherVM.$watch((function(){return t(n.state,n.getters)}),e,i)},d.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},d.prototype.registerModule=function(t,e,i){void 0===i&&(i={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),m(this,this.state,t,this._modules.get(t),i.preserveState),_(this,this.state)},d.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var i=S(e.state,t.slice(0,-1));c.delete(i,t[t.length-1])})),h(this)},d.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},d.prototype.hotUpdate=function(t){this._modules.update(t),h(this,!0)},d.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(d.prototype,u);var b=E((function(t,e){var i={};return x(e).forEach((function(e){var n=e.key,s=e.val;i[n]=function(){var e=this.$store.state,i=this.$store.getters;if(t){var n=k(this.$store,"mapState",t);if(!n)return;e=n.context.state,i=n.context.getters}return"function"==typeof s?s.call(this,e,i):e[s]},i[n].vuex=!0})),i})),y=E((function(t,e){var i={};return x(e).forEach((function(e){var n=e.key,s=e.val;i[n]=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];var n=this.$store.commit;if(t){var a=k(this.$store,"mapMutations",t);if(!a)return;n=a.context.commit}return"function"==typeof s?s.apply(this,[n].concat(e)):n.apply(this.$store,[s].concat(e))}})),i})),w=E((function(t,e){var i={};return x(e).forEach((function(e){var n=e.key,s=e.val;s=t+s,i[n]=function(){if(!t||k(this.$store,"mapGetters",t))return this.$store.getters[s]},i[n].vuex=!0})),i})),T=E((function(t,e){var i={};return x(e).forEach((function(e){var n=e.key,s=e.val;i[n]=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];var n=this.$store.dispatch;if(t){var a=k(this.$store,"mapActions",t);if(!a)return;n=a.context.dispatch}return"function"==typeof s?s.apply(this,[n].concat(e)):n.apply(this.$store,[s].concat(e))}})),i}));function x(t){return function(t){return Array.isArray(t)||r(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function E(t){return function(e,i){return"string"!=typeof e?(i=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,i)}}function k(t,e,i){return t._modulesNamespaceMap[i]}function D(t,e,i){var n=i?t.groupCollapsed:t.group;try{n.call(t,e)}catch(i){t.log(e)}}function A(t){try{t.groupEnd()}catch(e){t.log("—— log end ——")}}function O(){var t=new Date;return" @ "+N(t.getHours(),2)+":"+N(t.getMinutes(),2)+":"+N(t.getSeconds(),2)+"."+N(t.getMilliseconds(),3)}function N(t,e){return i="0",n=e-t.toString().length,new Array(n+1).join(i)+t;var i,n}var $={Store:d,install:g,version:"3.6.2",mapState:b,mapMutations:y,mapGetters:w,mapActions:T,createNamespacedHelpers:function(t){return{mapState:b.bind(null,t),mapGetters:w.bind(null,t),mapMutations:y.bind(null,t),mapActions:T.bind(null,t)}},createLogger:function(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var i=t.filter;void 0===i&&(i=function(t,e,i){return!0});var n=t.transformer;void 0===n&&(n=function(t){return t});var a=t.mutationTransformer;void 0===a&&(a=function(t){return t});var r=t.actionFilter;void 0===r&&(r=function(t,e){return!0});var o=t.actionTransformer;void 0===o&&(o=function(t){return t});var l=t.logMutations;void 0===l&&(l=!0);var p=t.logActions;void 0===p&&(p=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var d=s(t.state);void 0!==c&&(l&&t.subscribe((function(t,r){var o=s(r);if(i(t,d,o)){var l=O(),p=a(t),u="mutation "+t.type+l;D(c,u,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",n(d)),c.log("%c mutation","color: #03A9F4; font-weight: bold",p),c.log("%c next state","color: #4CAF50; font-weight: bold",n(o)),A(c)}d=o})),p&&t.subscribeAction((function(t,i){if(r(t,i)){var n=O(),s=o(t),a="action "+t.type+n;D(c,a,e),c.log("%c action","color: #03A9F4; font-weight: bold",s),A(c)}})))}}};e.a=$}).call(this,i(36))},function(t,e,i){var n=i(173);t.exports=function(t){return n(t,5)}},function(t,e,i){var n=i(61),s=i(62),a=i(17);t.exports=function(t){return a(t)?n(t):s(t)}},function(t,e,i){var n=i(141),s=i(168)((function(t,e){return null==t?{}:n(t,e)}));t.exports=s},function(t,e,i){var n=i(23),s=i(16),a=i(129),r=i(17),o=i(19),l=i(2),p=Object.prototype.hasOwnProperty,c=a((function(t,e){if(o(e)||r(e))s(e,l(e),t);else for(var i in e)p.call(e,i)&&n(t,i,e[i])}));t.exports=c},function(t,e,i){"use strict";var n,s=i(84),a=Object.prototype.toString,r=(n=Object.create(null),function(t){var e=a.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())});function o(t){return t=t.toLowerCase(),function(e){return r(e)===t}}function l(t){return Array.isArray(t)}function p(t){return void 0===t}var c=o("ArrayBuffer");function d(t){return null!==t&&"object"==typeof t}function u(t){if("object"!==r(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var f=o("Date"),h=o("File"),_=o("Blob"),m=o("FileList");function S(t){return"[object Function]"===a.call(t)}var v=o("URLSearchParams");function g(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),l(t))for(var i=0,n=t.length;i<n;i++)e.call(null,t[i],i,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var b,y=(b="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return b&&t instanceof b});t.exports={isArray:l,isArrayBuffer:c,isBuffer:function(t){return null!==t&&!p(t)&&null!==t.constructor&&!p(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return t&&("function"==typeof FormData&&t instanceof FormData||"[object FormData]"===a.call(t)||S(t.toString)&&"[object FormData]"===t.toString())},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&c(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:d,isPlainObject:u,isUndefined:p,isDate:f,isFile:h,isBlob:_,isFunction:S,isStream:function(t){return d(t)&&S(t.pipe)},isURLSearchParams:v,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:g,merge:function t(){var e={};function i(i,n){u(e[n])&&u(i)?e[n]=t(e[n],i):u(i)?e[n]=t({},i):l(i)?e[n]=i.slice():e[n]=i}for(var n=0,s=arguments.length;n<s;n++)g(arguments[n],i);return e},extend:function(t,e,i){return g(e,(function(e,n){t[n]=i&&"function"==typeof e?s(e,i):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,i,n){t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,i&&Object.assign(t.prototype,i)},toFlatObject:function(t,e,i){var n,s,a,r={};e=e||{};do{for(s=(n=Object.getOwnPropertyNames(t)).length;s-- >0;)r[a=n[s]]||(e[a]=t[a],r[a]=!0);t=Object.getPrototypeOf(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},kindOf:r,kindOfTest:o,endsWith:function(t,e,i){t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;var n=t.indexOf(e,i);return-1!==n&&n===i},toArray:function(t){if(!t)return null;var e=t.length;if(p(e))return null;for(var i=new Array(e);e-- >0;)i[e]=t[e];return i},isTypedArray:y,isFileList:m}},function(t,e,i){var n=i(57),s="object"==typeof self&&self&&self.Object===Object&&self,a=n||s||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){var i=Array.isArray;t.exports=i},function(t,e){t.exports=Vue},function(t,e,i){var n=i(123),s=i(128);t.exports=function(t,e){var i=s(t,e);return n(i)?i:void 0}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,i){var n=i(6).Symbol;t.exports=n},function(t,e,i){var n=i(28);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,i){"use strict";var n=i(5);function s(t,e,i,n,s){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s)}n.inherits(s,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var a=s.prototype,r={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(t){r[t]={value:t}})),Object.defineProperties(s,r),Object.defineProperty(a,"isAxiosError",{value:!0}),s.from=function(t,e,i,r,o,l){var p=Object.create(a);return n.toFlatObject(t,p,(function(t){return t!==Error.prototype})),s.call(p,t.message,e,i,r,o),p.name=t.name,l&&Object.assign(p,l),p},t.exports=s},function(t,e,i){var n=i(12),s=i(124),a=i(125),r=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":r&&r in Object(t)?s(t):a(t)}},function(t,e,i){var n=i(23),s=i(55);t.exports=function(t,e,i,a){var r=!i;i||(i={});for(var o=-1,l=e.length;++o<l;){var p=e[o],c=a?a(i[p],t[p],p,i,t):void 0;void 0===c&&(c=t[p]),r?s(i,p,c):n(i,p,c)}return i}},function(t,e,i){var n=i(34),s=i(38);t.exports=function(t){return null!=t&&s(t.length)&&!n(t)}},function(t,e){var i=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&i.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){var i=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||i)}},function(t,e,i){var n=i(8),s=i(43),a=i(143),r=i(163);t.exports=function(t,e){return n(t)?t:s(t,e)?[t]:a(r(t))}},function(t,e,i){var n=i(190),s=i(45),a=i(191),r=i(192),o=i(193),l=i(15),p=i(58),c=p(n),d=p(s),u=p(a),f=p(r),h=p(o),_=l;(n&&"[object DataView]"!=_(new n(new ArrayBuffer(1)))||s&&"[object Map]"!=_(new s)||a&&"[object Promise]"!=_(a.resolve())||r&&"[object Set]"!=_(new r)||o&&"[object WeakMap]"!=_(new o))&&(_=function(t){var e=l(t),i="[object Object]"==e?t.constructor:void 0,n=i?p(i):"";if(n)switch(n){case c:return"[object DataView]";case d:return"[object Map]";case u:return"[object Promise]";case f:return"[object Set]";case h:return"[object WeakMap]"}return e}),t.exports=_},function(t,e,i){var n=i(62),s=i(21),a=i(25),r=i(8),o=i(17),l=i(26),p=i(19),c=i(40),d=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(o(t)&&(r(t)||"string"==typeof t||"function"==typeof t.splice||l(t)||c(t)||a(t)))return!t.length;var e=s(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(p(t))return!n(t).length;for(var i in t)if(d.call(t,i))return!1;return!0}},function(t,e,i){var n=i(55),s=i(24),a=Object.prototype.hasOwnProperty;t.exports=function(t,e,i){var r=t[e];a.call(t,e)&&s(r,i)&&(void 0!==i||e in t)||n(t,e,i)}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,i){var n=i(137),s=i(11),a=Object.prototype,r=a.hasOwnProperty,o=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(t){return s(t)&&r.call(t,"callee")&&!o.call(t,"callee")};t.exports=l},function(t,e,i){(function(t){var n=i(6),s=i(138),a=e&&!e.nodeType&&e,r=a&&"object"==typeof t&&t&&!t.nodeType&&t,o=r&&r.exports===a?n.Buffer:void 0,l=(o?o.isBuffer:void 0)||s;t.exports=l}).call(this,i(39)(t))},function(t,e,i){var n=i(20),s=i(13);t.exports=function(t,e){for(var i=0,a=(e=n(e,t)).length;null!=t&&i<a;)t=t[s(e[i++])];return i&&i==a?t:void 0}},function(t,e,i){var n=i(15),s=i(11);t.exports=function(t){return"symbol"==typeof t||s(t)&&"[object Symbol]"==n(t)}},function(t,e,i){var n=i(10)(Object,"create");t.exports=n},function(t,e,i){var n=i(153),s=i(154),a=i(155),r=i(156),o=i(157);function l(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=a,l.prototype.has=r,l.prototype.set=o,t.exports=l},function(t,e,i){var n=i(24);t.exports=function(t,e){for(var i=t.length;i--;)if(n(t[i][0],e))return i;return-1}},function(t,e,i){var n=i(159);t.exports=function(t,e){var i=t.__data__;return n(e)?i["string"==typeof e?"string":"hash"]:i.map}},function(t,e,i){"use strict";var n=i(14);function s(t){n.call(this,null==t?"canceled":t,n.ERR_CANCELED),this.name="CanceledError"}i(5).inherits(s,n,{__CANCEL__:!0}),t.exports=s},function(t,e,i){var n=i(15),s=i(7);t.exports=function(t){if(!s(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,i){t.exports=i(217)},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,i){var n=i(139),s=i(41),a=i(42),r=a&&a.isTypedArray,o=r?s(r):n;t.exports=o},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,i){(function(t){var n=i(57),s=e&&!e.nodeType&&e,a=s&&"object"==typeof t&&t&&!t.nodeType&&t,r=a&&a.exports===s&&n.process,o=function(){try{var t=a&&a.require&&a.require("util").types;return t||r&&r.binding&&r.binding("util")}catch(t){}}();t.exports=o}).call(this,i(39)(t))},function(t,e,i){var n=i(8),s=i(28),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!s(t))||(r.test(t)||!a.test(t)||null!=e&&t in Object(e))}},function(t,e,i){var n=i(146),s=i(158),a=i(160),r=i(161),o=i(162);function l(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=a,l.prototype.has=r,l.prototype.set=o,t.exports=l},function(t,e,i){var n=i(10)(i(6),"Map");t.exports=n},function(t,e){t.exports=function(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t}},function(t,e,i){var n=i(30),s=i(174),a=i(175),r=i(176),o=i(177),l=i(178);function p(t){var e=this.__data__=new n(t);this.size=e.size}p.prototype.clear=s,p.prototype.delete=a,p.prototype.get=r,p.prototype.has=o,p.prototype.set=l,t.exports=p},function(t,e,i){var n=i(61),s=i(182),a=i(17);t.exports=function(t){return a(t)?n(t,!0):s(t)}},function(t,e,i){var n=i(187),s=i(67),a=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols,o=r?function(t){return null==t?[]:(t=Object(t),n(r(t),(function(e){return a.call(t,e)})))}:s;t.exports=o},function(t,e,i){var n=i(72);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},function(t,e,i){"use strict";(function(e){var n=i(5),s=i(223),a=i(14),r=i(86),o=i(87),l={"Content-Type":"application/x-www-form-urlencoded"};function p(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var c,d={transitional:r,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(c=i(88)),c),transformRequest:[function(t,e){if(s(e,"Accept"),s(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t))return t;if(n.isArrayBufferView(t))return t.buffer;if(n.isURLSearchParams(t))return p(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var i,a=n.isObject(t),r=e&&e["Content-Type"];if((i=n.isFileList(t))||a&&"multipart/form-data"===r){var l=this.env&&this.env.FormData;return o(i?{"files[]":t}:t,l&&new l)}return a||"application/json"===r?(p(e,"application/json"),function(t,e,i){if(n.isString(t))try{return(e||JSON.parse)(t),n.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(i||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||d.transitional,i=e&&e.silentJSONParsing,s=e&&e.forcedJSONParsing,r=!i&&"json"===this.responseType;if(r||s&&n.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw a.from(t,a.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:i(235)},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(t){d.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){d.headers[t]=n.merge(l)})),t.exports=d}).call(this,i(222))},function(t,e,i){var n=i(7),s=i(271),a=i(272),r=Math.max,o=Math.min;t.exports=function(t,e,i){var l,p,c,d,u,f,h=0,_=!1,m=!1,S=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var i=l,n=p;return l=p=void 0,h=e,d=t.apply(n,i)}function g(t){return h=t,u=setTimeout(y,e),_?v(t):d}function b(t){var i=t-f;return void 0===f||i>=e||i<0||m&&t-h>=c}function y(){var t=s();if(b(t))return w(t);u=setTimeout(y,function(t){var i=e-(t-f);return m?o(i,c-(t-h)):i}(t))}function w(t){return u=void 0,S&&l?v(t):(l=p=void 0,d)}function T(){var t=s(),i=b(t);if(l=arguments,p=this,f=t,i){if(void 0===u)return g(f);if(m)return clearTimeout(u),u=setTimeout(y,e),v(f)}return void 0===u&&(u=setTimeout(y,e)),d}return e=a(e)||0,n(i)&&(_=!!i.leading,c=(m="maxWait"in i)?r(a(i.maxWait)||0,e):c,S="trailing"in i?!!i.trailing:S),T.cancel=function(){void 0!==u&&clearTimeout(u),h=0,l=f=p=u=void 0},T.flush=function(){return void 0===u?d:w(s())},T}},function(t,e,i){var n=i(244),s=i(263);t.exports=function(t,e){var i=[];if(!t||!t.length)return i;var a=-1,r=[],o=t.length;for(e=n(e,3);++a<o;){var l=t[a];e(l,a,t)&&(i.push(l),r.push(a))}return s(t,r),i}},function(t,e,i){},function(t,e,i){var n=i(56);t.exports=function(t,e,i){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}},function(t,e,i){var n=i(10),s=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=s},function(t,e,i){(function(e){var i="object"==typeof e&&e&&e.Object===Object&&e;t.exports=i}).call(this,i(36))},function(t,e){var i=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return i.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,i){var n=i(131),s=Math.max;t.exports=function(t,e,i){return e=s(void 0===e?t.length-1:e,0),function(){for(var a=arguments,r=-1,o=s(a.length-e,0),l=Array(o);++r<o;)l[r]=a[e+r];r=-1;for(var p=Array(e+1);++r<e;)p[r]=a[r];return p[e]=i(l),n(t,this,p)}}},function(t,e,i){var n=i(132),s=i(134)(n);t.exports=s},function(t,e,i){var n=i(136),s=i(25),a=i(8),r=i(26),o=i(18),l=i(40),p=Object.prototype.hasOwnProperty;t.exports=function(t,e){var i=a(t),c=!i&&s(t),d=!i&&!c&&r(t),u=!i&&!c&&!d&&l(t),f=i||c||d||u,h=f?n(t.length,String):[],_=h.length;for(var m in t)!e&&!p.call(t,m)||f&&("length"==m||d&&("offset"==m||"parent"==m)||u&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||o(m,_))||h.push(m);return h}},function(t,e,i){var n=i(19),s=i(140),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return s(t);var e=[];for(var i in Object(t))a.call(t,i)&&"constructor"!=i&&e.push(i);return e}},function(t,e){t.exports=function(t,e){return function(i){return t(e(i))}}},function(t,e,i){var n=i(23),s=i(20),a=i(18),r=i(7),o=i(13);t.exports=function(t,e,i,l){if(!r(t))return t;for(var p=-1,c=(e=s(e,t)).length,d=c-1,u=t;null!=u&&++p<c;){var f=o(e[p]),h=i;if("__proto__"===f||"constructor"===f||"prototype"===f)return t;if(p!=d){var _=u[f];void 0===(h=l?l(_,f,u):void 0)&&(h=r(_)?_:a(e[p+1])?[]:{})}n(u,f,h),u=u[f]}return t}},function(t,e,i){var n=i(166),s=i(167);t.exports=function(t,e){return null!=t&&s(t,e,n)}},function(t,e,i){},function(t,e){t.exports=function(){return[]}},function(t,e,i){var n=i(46),s=i(69),a=i(49),r=i(67),o=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)n(e,a(t)),t=s(t);return e}:r;t.exports=o},function(t,e,i){var n=i(63)(Object.getPrototypeOf,Object);t.exports=n},function(t,e,i){var n=i(71),s=i(49),a=i(2);t.exports=function(t){return n(t,a,s)}},function(t,e,i){var n=i(46),s=i(8);t.exports=function(t,e,i){var a=e(t);return s(t)?a:n(a,i(t))}},function(t,e,i){var n=i(6).Uint8Array;t.exports=n},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){"use strict";t.exports=function(t,e){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return t.apply(e,i)}}},function(t,e,i){"use strict";var n=i(5);function s(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,i){if(!e)return t;var a;if(i)a=i(e);else if(n.isURLSearchParams(e))a=e.toString();else{var r=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),r.push(s(e)+"="+s(t))})))})),a=r.join("&")}if(a){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+a}return t}},function(t,e,i){"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(t,e,i){"use strict";(function(e){var n=i(5);t.exports=function(t,i){i=i||new FormData;var s=[];function a(t){return null===t?"":n.isDate(t)?t.toISOString():n.isArrayBuffer(t)||n.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):e.from(t):t}return function t(e,r){if(n.isPlainObject(e)||n.isArray(e)){if(-1!==s.indexOf(e))throw Error("Circular reference detected in "+r);s.push(e),n.forEach(e,(function(e,s){if(!n.isUndefined(e)){var o,l=r?r+"."+s:s;if(e&&!r&&"object"==typeof e)if(n.endsWith(s,"{}"))e=JSON.stringify(e);else if(n.endsWith(s,"[]")&&(o=n.toArray(e)))return void o.forEach((function(t){!n.isUndefined(t)&&i.append(l,a(t))}));t(e,l)}})),s.pop()}else i.append(r,a(e))}(t),i}}).call(this,i(224).Buffer)},function(t,e,i){"use strict";var n=i(5),s=i(228),a=i(229),r=i(85),o=i(89),l=i(232),p=i(233),c=i(86),d=i(14),u=i(33),f=i(234);t.exports=function(t){return new Promise((function(e,i){var h,_=t.data,m=t.headers,S=t.responseType;function v(){t.cancelToken&&t.cancelToken.unsubscribe(h),t.signal&&t.signal.removeEventListener("abort",h)}n.isFormData(_)&&n.isStandardBrowserEnv()&&delete m["Content-Type"];var g=new XMLHttpRequest;if(t.auth){var b=t.auth.username||"",y=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";m.Authorization="Basic "+btoa(b+":"+y)}var w=o(t.baseURL,t.url);function T(){if(g){var n="getAllResponseHeaders"in g?l(g.getAllResponseHeaders()):null,a={data:S&&"text"!==S&&"json"!==S?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:n,config:t,request:g};s((function(t){e(t),v()}),(function(t){i(t),v()}),a),g=null}}if(g.open(t.method.toUpperCase(),r(w,t.params,t.paramsSerializer),!0),g.timeout=t.timeout,"onloadend"in g?g.onloadend=T:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(T)},g.onabort=function(){g&&(i(new d("Request aborted",d.ECONNABORTED,t,g)),g=null)},g.onerror=function(){i(new d("Network Error",d.ERR_NETWORK,t,g,g)),g=null},g.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||c;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(new d(e,n.clarifyTimeoutError?d.ETIMEDOUT:d.ECONNABORTED,t,g)),g=null},n.isStandardBrowserEnv()){var x=(t.withCredentials||p(w))&&t.xsrfCookieName?a.read(t.xsrfCookieName):void 0;x&&(m[t.xsrfHeaderName]=x)}"setRequestHeader"in g&&n.forEach(m,(function(t,e){void 0===_&&"content-type"===e.toLowerCase()?delete m[e]:g.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(g.withCredentials=!!t.withCredentials),S&&"json"!==S&&(g.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&g.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&g.upload&&g.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(h=function(t){g&&(i(!t||t&&t.type?new u:t),g.abort(),g=null)},t.cancelToken&&t.cancelToken.subscribe(h),t.signal&&(t.signal.aborted?h():t.signal.addEventListener("abort",h))),_||(_=null);var E=f(w);E&&-1===["http","https","file"].indexOf(E)?i(new d("Unsupported protocol "+E+":",d.ERR_BAD_REQUEST,t)):g.send(_)}))}},function(t,e,i){"use strict";var n=i(230),s=i(231);t.exports=function(t,e){return t&&!n(e)?s(t,e):e}},function(t,e,i){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,i){"use strict";var n=i(5);t.exports=function(t,e){e=e||{};var i={};function s(t,e){return n.isPlainObject(t)&&n.isPlainObject(e)?n.merge(t,e):n.isPlainObject(e)?n.merge({},e):n.isArray(e)?e.slice():e}function a(i){return n.isUndefined(e[i])?n.isUndefined(t[i])?void 0:s(void 0,t[i]):s(t[i],e[i])}function r(t){if(!n.isUndefined(e[t]))return s(void 0,e[t])}function o(i){return n.isUndefined(e[i])?n.isUndefined(t[i])?void 0:s(void 0,t[i]):s(void 0,e[i])}function l(i){return i in e?s(t[i],e[i]):i in t?s(void 0,t[i]):void 0}var p={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l};return n.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=p[t]||a,s=e(t);n.isUndefined(s)&&e!==l||(i[t]=s)})),i}},function(t,e){t.exports={version:"0.27.2"}},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){var n=i(247),s=i(11);t.exports=function t(e,i,a,r,o){return e===i||(null==e||null==i||!s(e)&&!s(i)?e!=e&&i!=i:n(e,i,a,r,t,o))}},function(t,e,i){var n=i(248),s=i(251),a=i(252);t.exports=function(t,e,i,r,o,l){var p=1&i,c=t.length,d=e.length;if(c!=d&&!(p&&d>c))return!1;var u=l.get(t),f=l.get(e);if(u&&f)return u==e&&f==t;var h=-1,_=!0,m=2&i?new n:void 0;for(l.set(t,e),l.set(e,t);++h<c;){var S=t[h],v=e[h];if(r)var g=p?r(v,S,h,e,t,l):r(S,v,h,t,e,l);if(void 0!==g){if(g)continue;_=!1;break}if(m){if(!s(e,(function(t,e){if(!a(m,e)&&(S===t||o(S,t,i,r,l)))return m.push(e)}))){_=!1;break}}else if(S!==v&&!o(S,v,i,r,l)){_=!1;break}}return l.delete(t),l.delete(e),_}},function(t,e,i){var n=i(7);t.exports=function(t){return t==t&&!n(t)}},function(t,e){t.exports=function(t,e){return function(i){return null!=i&&(i[t]===e&&(void 0!==e||t in Object(i)))}}},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e){t.exports=function(t,e){return e(t),t}},function(t,e,i){var n=i(64);t.exports=function(t,e,i){return null==t?t:n(t,e,i)}},function(t,e,i){var n=i(52),s=i(7);t.exports=function(t,e,i){var a=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(a="leading"in i?!!i.leading:a,r="trailing"in i?!!i.trailing:r),n(t,e,{leading:a,maxWait:e,trailing:r})}},function(t,e,i){t.exports=i(289)},function(t,e,i){"use strict";i(54)},function(t,e,i){var n=i(34),s=i(126),a=i(7),r=i(58),o=/^\[object .+?Constructor\]$/,l=Function.prototype,p=Object.prototype,c=l.toString,d=p.hasOwnProperty,u=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!a(t)||s(t))&&(n(t)?u:o).test(r(t))}},function(t,e,i){var n=i(12),s=Object.prototype,a=s.hasOwnProperty,r=s.toString,o=n?n.toStringTag:void 0;t.exports=function(t){var e=a.call(t,o),i=t[o];try{t[o]=void 0;var n=!0}catch(t){}var s=r.call(t);return n&&(e?t[o]=i:delete t[o]),s}},function(t,e){var i=Object.prototype.toString;t.exports=function(t){return i.call(t)}},function(t,e,i){var n,s=i(127),a=(n=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!a&&a in t}},function(t,e,i){var n=i(6)["__core-js_shared__"];t.exports=n},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,i){var n=i(130),s=i(135);t.exports=function(t){return n((function(e,i){var n=-1,a=i.length,r=a>1?i[a-1]:void 0,o=a>2?i[2]:void 0;for(r=t.length>3&&"function"==typeof r?(a--,r):void 0,o&&s(i[0],i[1],o)&&(r=a<3?void 0:r,a=1),e=Object(e);++n<a;){var l=i[n];l&&t(e,l,n,r)}return e}))}},function(t,e,i){var n=i(37),s=i(59),a=i(60);t.exports=function(t,e){return a(s(t,e,n),t+"")}},function(t,e){t.exports=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}},function(t,e,i){var n=i(133),s=i(56),a=i(37),r=s?function(t,e){return s(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:a;t.exports=r},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var i=Date.now;t.exports=function(t){var e=0,n=0;return function(){var s=i(),a=16-(s-n);if(n=s,a>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,i){var n=i(24),s=i(17),a=i(18),r=i(7);t.exports=function(t,e,i){if(!r(i))return!1;var o=typeof e;return!!("number"==o?s(i)&&a(e,i.length):"string"==o&&e in i)&&n(i[e],t)}},function(t,e){t.exports=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}},function(t,e,i){var n=i(15),s=i(11);t.exports=function(t){return s(t)&&"[object Arguments]"==n(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,i){var n=i(15),s=i(38),a=i(11),r={};r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,t.exports=function(t){return a(t)&&s(t.length)&&!!r[n(t)]}},function(t,e,i){var n=i(63)(Object.keys,Object);t.exports=n},function(t,e,i){var n=i(142),s=i(65);t.exports=function(t,e){return n(t,e,(function(e,i){return s(t,i)}))}},function(t,e,i){var n=i(27),s=i(64),a=i(20);t.exports=function(t,e,i){for(var r=-1,o=e.length,l={};++r<o;){var p=e[r],c=n(t,p);i(c,p)&&s(l,a(p,t),c)}return l}},function(t,e,i){var n=i(144),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,r=n((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(s,(function(t,i,n,s){e.push(n?s.replace(a,"$1"):i||t)})),e}));t.exports=r},function(t,e,i){var n=i(145);t.exports=function(t){var e=n(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}},function(t,e,i){var n=i(44);function s(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=e?e.apply(this,n):n[0],a=i.cache;if(a.has(s))return a.get(s);var r=t.apply(this,n);return i.cache=a.set(s,r)||a,r};return i.cache=new(s.Cache||n),i}s.Cache=n,t.exports=s},function(t,e,i){var n=i(147),s=i(30),a=i(45);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||s),string:new n}}},function(t,e,i){var n=i(148),s=i(149),a=i(150),r=i(151),o=i(152);function l(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=a,l.prototype.has=r,l.prototype.set=o,t.exports=l},function(t,e,i){var n=i(29);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,i){var n=i(29),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return s.call(e,t)?e[t]:void 0}},function(t,e,i){var n=i(29),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:s.call(e,t)}},function(t,e,i){var n=i(29);t.exports=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,i){var n=i(31),s=Array.prototype.splice;t.exports=function(t){var e=this.__data__,i=n(e,t);return!(i<0)&&(i==e.length-1?e.pop():s.call(e,i,1),--this.size,!0)}},function(t,e,i){var n=i(31);t.exports=function(t){var e=this.__data__,i=n(e,t);return i<0?void 0:e[i][1]}},function(t,e,i){var n=i(31);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,i){var n=i(31);t.exports=function(t,e){var i=this.__data__,s=n(i,t);return s<0?(++this.size,i.push([t,e])):i[s][1]=e,this}},function(t,e,i){var n=i(32);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,i){var n=i(32);t.exports=function(t){return n(this,t).get(t)}},function(t,e,i){var n=i(32);t.exports=function(t){return n(this,t).has(t)}},function(t,e,i){var n=i(32);t.exports=function(t,e){var i=n(this,t),s=i.size;return i.set(t,e),this.size+=i.size==s?0:1,this}},function(t,e,i){var n=i(164);t.exports=function(t){return null==t?"":n(t)}},function(t,e,i){var n=i(12),s=i(165),a=i(8),r=i(28),o=n?n.prototype:void 0,l=o?o.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(a(e))return s(e,t)+"";if(r(e))return l?l.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}},function(t,e){t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,i){var n=i(20),s=i(25),a=i(8),r=i(18),o=i(38),l=i(13);t.exports=function(t,e,i){for(var p=-1,c=(e=n(e,t)).length,d=!1;++p<c;){var u=l(e[p]);if(!(d=null!=t&&i(t,u)))break;t=t[u]}return d||++p!=c?d:!!(c=null==t?0:t.length)&&o(c)&&r(u,c)&&(a(t)||s(t))}},function(t,e,i){var n=i(169),s=i(59),a=i(60);t.exports=function(t){return a(s(t,void 0,n),t+"")}},function(t,e,i){var n=i(170);t.exports=function(t){return(null==t?0:t.length)?n(t,1):[]}},function(t,e,i){var n=i(46),s=i(171);t.exports=function t(e,i,a,r,o){var l=-1,p=e.length;for(a||(a=s),o||(o=[]);++l<p;){var c=e[l];i>0&&a(c)?i>1?t(c,i-1,a,r,o):n(o,c):r||(o[o.length]=c)}return o}},function(t,e,i){var n=i(12),s=i(25),a=i(8),r=n?n.isConcatSpreadable:void 0;t.exports=function(t){return a(t)||s(t)||!!(r&&t&&t[r])}},function(t,e,i){"use strict";i(66)},function(t,e,i){var n=i(47),s=i(179),a=i(23),r=i(180),o=i(181),l=i(184),p=i(185),c=i(186),d=i(188),u=i(70),f=i(189),h=i(21),_=i(194),m=i(195),S=i(200),v=i(8),g=i(26),b=i(202),y=i(7),w=i(204),T=i(2),x=i(48),E={};E["[object Arguments]"]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object DataView]"]=E["[object Boolean]"]=E["[object Date]"]=E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Map]"]=E["[object Number]"]=E["[object Object]"]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object Symbol]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E["[object Error]"]=E["[object Function]"]=E["[object WeakMap]"]=!1,t.exports=function t(e,i,k,D,A,O){var N,$=1&i,L=2&i,W=4&i;if(k&&(N=A?k(e,D,A,O):k(e)),void 0!==N)return N;if(!y(e))return e;var P=v(e);if(P){if(N=_(e),!$)return p(e,N)}else{var Y=h(e),R="[object Function]"==Y||"[object GeneratorFunction]"==Y;if(g(e))return l(e,$);if("[object Object]"==Y||"[object Arguments]"==Y||R&&!A){if(N=L||R?{}:S(e),!$)return L?d(e,o(N,e)):c(e,r(N,e))}else{if(!E[Y])return A?e:{};N=m(e,Y,$)}}O||(O=new n);var C=O.get(e);if(C)return C;O.set(e,N),w(e)?e.forEach((function(n){N.add(t(n,i,k,n,e,O))})):b(e)&&e.forEach((function(n,s){N.set(s,t(n,i,k,s,e,O))}));var I=P?void 0:(W?L?f:u:L?x:T)(e);return s(I||e,(function(n,s){I&&(n=e[s=n]),a(N,s,t(n,i,k,s,e,O))})),N}},function(t,e,i){var n=i(30);t.exports=function(){this.__data__=new n,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,i){var n=i(30),s=i(45),a=i(44);t.exports=function(t,e){var i=this.__data__;if(i instanceof n){var r=i.__data__;if(!s||r.length<199)return r.push([t,e]),this.size=++i.size,this;i=this.__data__=new a(r)}return i.set(t,e),this.size=i.size,this}},function(t,e){t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}},function(t,e,i){var n=i(16),s=i(2);t.exports=function(t,e){return t&&n(e,s(e),t)}},function(t,e,i){var n=i(16),s=i(48);t.exports=function(t,e){return t&&n(e,s(e),t)}},function(t,e,i){var n=i(7),s=i(19),a=i(183),r=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return a(t);var e=s(t),i=[];for(var o in t)("constructor"!=o||!e&&r.call(t,o))&&i.push(o);return i}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}},function(t,e,i){(function(t){var n=i(6),s=e&&!e.nodeType&&e,a=s&&"object"==typeof t&&t&&!t.nodeType&&t,r=a&&a.exports===s?n.Buffer:void 0,o=r?r.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var i=t.length,n=o?o(i):new t.constructor(i);return t.copy(n),n}}).call(this,i(39)(t))},function(t,e){t.exports=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}},function(t,e,i){var n=i(16),s=i(49);t.exports=function(t,e){return n(t,s(t),e)}},function(t,e){t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length,s=0,a=[];++i<n;){var r=t[i];e(r,i,t)&&(a[s++]=r)}return a}},function(t,e,i){var n=i(16),s=i(68);t.exports=function(t,e){return n(t,s(t),e)}},function(t,e,i){var n=i(71),s=i(68),a=i(48);t.exports=function(t){return n(t,a,s)}},function(t,e,i){var n=i(10)(i(6),"DataView");t.exports=n},function(t,e,i){var n=i(10)(i(6),"Promise");t.exports=n},function(t,e,i){var n=i(10)(i(6),"Set");t.exports=n},function(t,e,i){var n=i(10)(i(6),"WeakMap");t.exports=n},function(t,e){var i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&i.call(t,"index")&&(n.index=t.index,n.input=t.input),n}},function(t,e,i){var n=i(50),s=i(196),a=i(197),r=i(198),o=i(199);t.exports=function(t,e,i){var l=t.constructor;switch(e){case"[object ArrayBuffer]":return n(t);case"[object Boolean]":case"[object Date]":return new l(+t);case"[object DataView]":return s(t,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(t,i);case"[object Map]":return new l;case"[object Number]":case"[object String]":return new l(t);case"[object RegExp]":return a(t);case"[object Set]":return new l;case"[object Symbol]":return r(t)}}},function(t,e,i){var n=i(50);t.exports=function(t,e){var i=e?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}},function(t,e){var i=/\w*$/;t.exports=function(t){var e=new t.constructor(t.source,i.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,i){var n=i(12),s=n?n.prototype:void 0,a=s?s.valueOf:void 0;t.exports=function(t){return a?Object(a.call(t)):{}}},function(t,e,i){var n=i(50);t.exports=function(t,e){var i=e?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}},function(t,e,i){var n=i(201),s=i(69),a=i(19);t.exports=function(t){return"function"!=typeof t.constructor||a(t)?{}:n(s(t))}},function(t,e,i){var n=i(7),s=Object.create,a=function(){function t(){}return function(e){if(!n(e))return{};if(s)return s(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();t.exports=a},function(t,e,i){var n=i(203),s=i(41),a=i(42),r=a&&a.isMap,o=r?s(r):n;t.exports=o},function(t,e,i){var n=i(21),s=i(11);t.exports=function(t){return s(t)&&"[object Map]"==n(t)}},function(t,e,i){var n=i(205),s=i(41),a=i(42),r=a&&a.isSet,o=r?s(r):n;t.exports=o},function(t,e,i){var n=i(21),s=i(11);t.exports=function(t){return s(t)&&"[object Set]"==n(t)}},function(t,e,i){"use strict";i(73)},function(t,e,i){"use strict";i(74)},function(t,e,i){"use strict";i(75)},function(t,e,i){"use strict";i(76)},function(t,e,i){"use strict";i(77)},function(t,e,i){"use strict";i(78)},function(t,e,i){"use strict";i(79)},function(t,e,i){"use strict";i(80)},function(t,e,i){"use strict";i(81)},function(t,e,i){"use strict";i(82)},function(t,e,i){"use strict";i(83)},function(t,e,i){"use strict";var n=i(5),s=i(84),a=i(218),r=i(91);var o=function t(e){var i=new a(e),o=s(a.prototype.request,i);return n.extend(o,a.prototype,i),n.extend(o,i),o.create=function(i){return t(r(e,i))},o}(i(51));o.Axios=a,o.CanceledError=i(33),o.CancelToken=i(237),o.isCancel=i(90),o.VERSION=i(92).version,o.toFormData=i(87),o.AxiosError=i(14),o.Cancel=o.CanceledError,o.all=function(t){return Promise.all(t)},o.spread=i(238),o.isAxiosError=i(239),t.exports=o,t.exports.default=o},function(t,e,i){"use strict";var n=i(5),s=i(85),a=i(219),r=i(220),o=i(91),l=i(89),p=i(236),c=p.validators;function d(t){this.defaults=t,this.interceptors={request:new a,response:new a}}d.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=o(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var i=e.transitional;void 0!==i&&p.assertOptions(i,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var n=[],s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var a,l=[];if(this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)})),!s){var d=[r,void 0];for(Array.prototype.unshift.apply(d,n),d=d.concat(l),a=Promise.resolve(e);d.length;)a=a.then(d.shift(),d.shift());return a}for(var u=e;n.length;){var f=n.shift(),h=n.shift();try{u=f(u)}catch(t){h(t);break}}try{a=r(u)}catch(t){return Promise.reject(t)}for(;l.length;)a=a.then(l.shift(),l.shift());return a},d.prototype.getUri=function(t){t=o(this.defaults,t);var e=l(t.baseURL,t.url);return s(e,t.params,t.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(t){d.prototype[t]=function(e,i){return this.request(o(i||{},{method:t,url:e,data:(i||{}).data}))}})),n.forEach(["post","put","patch"],(function(t){function e(e){return function(i,n,s){return this.request(o(s||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}d.prototype[t]=e(),d.prototype[t+"Form"]=e(!0)})),t.exports=d},function(t,e,i){"use strict";var n=i(5);function s(){this.handlers=[]}s.prototype.use=function(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},s.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},s.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=s},function(t,e,i){"use strict";var n=i(5),s=i(221),a=i(90),r=i(51),o=i(33);function l(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new o}t.exports=function(t){return l(t),t.headers=t.headers||{},t.data=s.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||r.adapter)(t).then((function(e){return l(t),e.data=s.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return a(e)||(l(t),e&&e.response&&(e.response.data=s.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,i){"use strict";var n=i(5),s=i(51);t.exports=function(t,e,i){var a=this||s;return n.forEach(i,(function(i){t=i.call(a,t,e)})),t}},function(t,e){var i,n,s=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(t){i=a}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(t){n=r}}();var l,p=[],c=!1,d=-1;function u(){c&&l&&(c=!1,l.length?p=l.concat(p):d=-1,p.length&&f())}function f(){if(!c){var t=o(u);c=!0;for(var e=p.length;e;){for(l=p,p=[];++d<e;)l&&l[d].run();d=-1,e=p.length}l=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===r||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function _(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];p.push(new h(t,e)),1!==p.length||c||o(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=_,s.addListener=_,s.once=_,s.off=_,s.removeListener=_,s.removeAllListeners=_,s.emit=_,s.prependListener=_,s.prependOnceListener=_,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,i){"use strict";var n=i(5);t.exports=function(t,e){n.forEach(t,(function(i,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=i,delete t[n])}))}},function(t,e,i){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var n=i(225),s=i(226),a=i(227);function r(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return d(this,t)}return p(this,t,e,i)}function p(t,e,i,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,n){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=u(t,e);return t}(t,e,i,n):"string"==typeof e?function(t,e,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,i),s=(t=o(t,n)).write(e,i);s!==n&&(t=t.slice(0,s));return t}(t,e,i):function(t,e){if(l.isBuffer(e)){var i=0|f(e.length);return 0===(t=o(t,i)).length||e.copy(t,0,0,i),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?o(t,0):u(t,e);if("Buffer"===e.type&&a(e.data))return u(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function d(t,e){if(c(e),t=o(t,e<0?0:0|f(e)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function u(t,e){var i=e.length<0?0:0|f(e.length);t=o(t,i);for(var n=0;n<i;n+=1)t[n]=255&e[n];return t}function f(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function h(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return U(t).length;default:if(n)return j(t).length;e=(""+e).toLowerCase(),n=!0}}function _(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,i);case"utf8":case"utf-8":return k(this,e,i);case"ascii":return D(this,e,i);case"latin1":case"binary":return A(this,e,i);case"base64":return E(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function S(t,e,i,n,s){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=s?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(s)return-1;i=t.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:v(t,e,i,n,s);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):v(t,[e],i,n,s);throw new TypeError("val must be string, number or Buffer")}function v(t,e,i,n,s){var a,r=1,o=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;r=2,o/=2,l/=2,i/=2}function p(t,e){return 1===r?t[e]:t.readUInt16BE(e*r)}if(s){var c=-1;for(a=i;a<o;a++)if(p(t,a)===p(e,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*r}else-1!==c&&(a-=a-c),c=-1}else for(i+l>o&&(i=o-l),a=i;a>=0;a--){for(var d=!0,u=0;u<l;u++)if(p(t,a+u)!==p(e,u)){d=!1;break}if(d)return a}return-1}function g(t,e,i,n){i=Number(i)||0;var s=t.length-i;n?(n=Number(n))>s&&(n=s):n=s;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var r=0;r<n;++r){var o=parseInt(e.substr(2*r,2),16);if(isNaN(o))return r;t[i+r]=o}return r}function b(t,e,i,n){return F(j(e,t.length-i),t,i,n)}function y(t,e,i,n){return F(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function w(t,e,i,n){return y(t,e,i,n)}function T(t,e,i,n){return F(U(e),t,i,n)}function x(t,e,i,n){return F(function(t,e){for(var i,n,s,a=[],r=0;r<t.length&&!((e-=2)<0);++r)i=t.charCodeAt(r),n=i>>8,s=i%256,a.push(s),a.push(n);return a}(e,t.length-i),t,i,n)}function E(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function k(t,e,i){i=Math.min(t.length,i);for(var n=[],s=e;s<i;){var a,r,o,l,p=t[s],c=null,d=p>239?4:p>223?3:p>191?2:1;if(s+d<=i)switch(d){case 1:p<128&&(c=p);break;case 2:128==(192&(a=t[s+1]))&&(l=(31&p)<<6|63&a)>127&&(c=l);break;case 3:a=t[s+1],r=t[s+2],128==(192&a)&&128==(192&r)&&(l=(15&p)<<12|(63&a)<<6|63&r)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=t[s+1],r=t[s+2],o=t[s+3],128==(192&a)&&128==(192&r)&&128==(192&o)&&(l=(15&p)<<18|(63&a)<<12|(63&r)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),s+=d}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return i}(n)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=r(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,i){return p(null,t,e,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,i){return function(t,e,i,n){return c(e),e<=0?o(t,e):void 0!==i?"string"==typeof n?o(t,e).fill(i,n):o(t,e).fill(i):o(t,e)}(null,t,e,i)},l.allocUnsafe=function(t){return d(null,t)},l.allocUnsafeSlow=function(t){return d(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,s=0,a=Math.min(i,n);s<a;++s)if(t[s]!==e[s]){i=t[s],n=e[s];break}return i<n?-1:n<i?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=l.allocUnsafe(e),s=0;for(i=0;i<t.length;++i){var r=t[i];if(!l.isBuffer(r))throw new TypeError('"list" argument must be an Array of Buffers');r.copy(n,s),s+=r.length}return n},l.byteLength=h,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):_.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,i,n,s){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),e<0||i>t.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&e>=i)return 0;if(n>=s)return-1;if(e>=i)return 1;if(this===t)return 0;for(var a=(s>>>=0)-(n>>>=0),r=(i>>>=0)-(e>>>=0),o=Math.min(a,r),p=this.slice(n,s),c=t.slice(e,i),d=0;d<o;++d)if(p[d]!==c[d]){a=p[d],r=c[d];break}return a<r?-1:r<a?1:0},l.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},l.prototype.indexOf=function(t,e,i){return S(this,t,e,i,!0)},l.prototype.lastIndexOf=function(t,e,i){return S(this,t,e,i,!1)},l.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var s=this.length-e;if((void 0===i||i>s)&&(i=s),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return g(this,t,e,i);case"utf8":case"utf-8":return b(this,t,e,i);case"ascii":return y(this,t,e,i);case"latin1":case"binary":return w(this,t,e,i);case"base64":return T(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(t,e,i){var n="";i=Math.min(t.length,i);for(var s=e;s<i;++s)n+=String.fromCharCode(127&t[s]);return n}function A(t,e,i){var n="";i=Math.min(t.length,i);for(var s=e;s<i;++s)n+=String.fromCharCode(t[s]);return n}function O(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var s="",a=e;a<i;++a)s+=B(t[a]);return s}function N(t,e,i){for(var n=t.slice(e,i),s="",a=0;a<n.length;a+=2)s+=String.fromCharCode(n[a]+256*n[a+1]);return s}function $(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,i,n,s,a){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<a)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function W(t,e,i,n){e<0&&(e=65535+e+1);for(var s=0,a=Math.min(t.length-i,2);s<a;++s)t[i+s]=(e&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function P(t,e,i,n){e<0&&(e=4294967295+e+1);for(var s=0,a=Math.min(t.length-i,4);s<a;++s)t[i+s]=e>>>8*(n?s:3-s)&255}function Y(t,e,i,n,s,a){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function R(t,e,i,n,a){return a||Y(t,0,i,4),s.write(t,e,i,n,23,4),i+4}function C(t,e,i,n,a){return a||Y(t,0,i,8),s.write(t,e,i,n,52,8),i+8}l.prototype.slice=function(t,e){var i,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=l.prototype;else{var s=e-t;i=new l(s,void 0);for(var a=0;a<s;++a)i[a]=this[a+t]}return i},l.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||$(t,e,this.length);for(var n=this[t],s=1,a=0;++a<e&&(s*=256);)n+=this[t+a]*s;return n},l.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||$(t,e,this.length);for(var n=this[t+--e],s=1;e>0&&(s*=256);)n+=this[t+--e]*s;return n},l.prototype.readUInt8=function(t,e){return e||$(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||$(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||$(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||$(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||$(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||$(t,e,this.length);for(var n=this[t],s=1,a=0;++a<e&&(s*=256);)n+=this[t+a]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||$(t,e,this.length);for(var n=e,s=1,a=this[t+--n];n>0&&(s*=256);)a+=this[t+--n]*s;return a>=(s*=128)&&(a-=Math.pow(2,8*e)),a},l.prototype.readInt8=function(t,e){return e||$(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||$(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(t,e){e||$(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(t,e){return e||$(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||$(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||$(t,4,this.length),s.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||$(t,4,this.length),s.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||$(t,8,this.length),s.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||$(t,8,this.length),s.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||L(this,t,e,i,Math.pow(2,8*i)-1,0);var s=1,a=0;for(this[e]=255&t;++a<i&&(s*=256);)this[e+a]=t/s&255;return e+i},l.prototype.writeUIntBE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||L(this,t,e,i,Math.pow(2,8*i)-1,0);var s=i-1,a=1;for(this[e+s]=255&t;--s>=0&&(a*=256);)this[e+s]=t/a&255;return e+i},l.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):W(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):W(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var s=Math.pow(2,8*i-1);L(this,t,e,i,s-1,-s)}var a=0,r=1,o=0;for(this[e]=255&t;++a<i&&(r*=256);)t<0&&0===o&&0!==this[e+a-1]&&(o=1),this[e+a]=(t/r>>0)-o&255;return e+i},l.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var s=Math.pow(2,8*i-1);L(this,t,e,i,s-1,-s)}var a=i-1,r=1,o=0;for(this[e+a]=255&t;--a>=0&&(r*=256);)t<0&&0===o&&0!==this[e+a+1]&&(o=1),this[e+a]=(t/r>>0)-o&255;return e+i},l.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):W(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):W(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,i){return R(this,t,e,!0,i)},l.prototype.writeFloatBE=function(t,e,i){return R(this,t,e,!1,i)},l.prototype.writeDoubleLE=function(t,e,i){return C(this,t,e,!0,i)},l.prototype.writeDoubleBE=function(t,e,i){return C(this,t,e,!1,i)},l.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var s,a=n-i;if(this===t&&i<e&&e<n)for(s=a-1;s>=0;--s)t[s+e]=this[s+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(s=0;s<a;++s)t[s+e]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+a),e);return a},l.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===t.length){var s=t.charCodeAt(0);s<256&&(t=s)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var a;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(a=e;a<i;++a)this[a]=t;else{var r=l.isBuffer(t)?t:j(new l(t,n).toString()),o=r.length;for(a=0;a<i-e;++a)this[a+e]=r[a%o]}return this};var I=/[^+\/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function j(t,e){var i;e=e||1/0;for(var n=t.length,s=null,a=[],r=0;r<n;++r){if((i=t.charCodeAt(r))>55295&&i<57344){if(!s){if(i>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(r+1===n){(e-=3)>-1&&a.push(239,191,189);continue}s=i;continue}if(i<56320){(e-=3)>-1&&a.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&(e-=3)>-1&&a.push(239,191,189);if(s=null,i<128){if((e-=1)<0)break;a.push(i)}else if(i<2048){if((e-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function U(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,i,n){for(var s=0;s<n&&!(s+i>=e.length||s>=t.length);++s)e[s+i]=t[s];return s}}).call(this,i(36))},function(t,e,i){"use strict";e.byteLength=function(t){var e=p(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){var e,i,n=p(t),r=n[0],o=n[1],l=new a(function(t,e,i){return 3*(e+i)/4-i}(0,r,o)),c=0,d=o>0?r-4:r;for(i=0;i<d;i+=4)e=s[t.charCodeAt(i)]<<18|s[t.charCodeAt(i+1)]<<12|s[t.charCodeAt(i+2)]<<6|s[t.charCodeAt(i+3)],l[c++]=e>>16&255,l[c++]=e>>8&255,l[c++]=255&e;2===o&&(e=s[t.charCodeAt(i)]<<2|s[t.charCodeAt(i+1)]>>4,l[c++]=255&e);1===o&&(e=s[t.charCodeAt(i)]<<10|s[t.charCodeAt(i+1)]<<4|s[t.charCodeAt(i+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e);return l},e.fromByteArray=function(t){for(var e,i=t.length,s=i%3,a=[],r=0,o=i-s;r<o;r+=16383)a.push(c(t,r,r+16383>o?o:r+16383));1===s?(e=t[i-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===s&&(e=(t[i-2]<<8)+t[i-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],s=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=r.length;o<l;++o)n[o]=r[o],s[r.charCodeAt(o)]=o;function p(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function c(t,e,i){for(var s,a,r=[],o=e;o<i;o+=3)s=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),r.push(n[(a=s)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return r.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},function(t,e){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,i,n,s){var a,r,o=8*s-n-1,l=(1<<o)-1,p=l>>1,c=-7,d=i?s-1:0,u=i?-1:1,f=t[e+d];for(d+=u,a=f&(1<<-c)-1,f>>=-c,c+=o;c>0;a=256*a+t[e+d],d+=u,c-=8);for(r=a&(1<<-c)-1,a>>=-c,c+=n;c>0;r=256*r+t[e+d],d+=u,c-=8);if(0===a)a=1-p;else{if(a===l)return r?NaN:1/0*(f?-1:1);r+=Math.pow(2,n),a-=p}return(f?-1:1)*r*Math.pow(2,a-n)},e.write=function(t,e,i,n,s,a){var r,o,l,p=8*a-s-1,c=(1<<p)-1,d=c>>1,u=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,h=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,r=c):(r=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-r))<1&&(r--,l*=2),(e+=r+d>=1?u/l:u*Math.pow(2,1-d))*l>=2&&(r++,l/=2),r+d>=c?(o=0,r=c):r+d>=1?(o=(e*l-1)*Math.pow(2,s),r+=d):(o=e*Math.pow(2,d-1)*Math.pow(2,s),r=0));s>=8;t[i+f]=255&o,f+=h,o/=256,s-=8);for(r=r<<s|o,p+=s;p>0;t[i+f]=255&r,f+=h,r/=256,p-=8);t[i+f-h]|=128*_}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e,i){"use strict";var n=i(14);t.exports=function(t,e,i){var s=i.config.validateStatus;i.status&&s&&!s(i.status)?e(new n("Request failed with status code "+i.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}},function(t,e,i){"use strict";var n=i(5);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,i,s,a,r){var o=[];o.push(t+"="+encodeURIComponent(e)),n.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),n.isString(s)&&o.push("path="+s),n.isString(a)&&o.push("domain="+a),!0===r&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,i){"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},function(t,e,i){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,i){"use strict";var n=i(5),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,i,a,r={};return t?(n.forEach(t.split("\n"),(function(t){if(a=t.indexOf(":"),e=n.trim(t.substr(0,a)).toLowerCase(),i=n.trim(t.substr(a+1)),e){if(r[e]&&s.indexOf(e)>=0)return;r[e]="set-cookie"===e?(r[e]?r[e]:[]).concat([i]):r[e]?r[e]+", "+i:i}})),r):r}},function(t,e,i){"use strict";var n=i(5);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function s(t){var n=t;return e&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return t=s(window.location.href),function(e){var i=n.isString(e)?s(e):e;return i.protocol===t.protocol&&i.host===t.host}}():function(){return!0}},function(t,e,i){"use strict";t.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}},function(t,e){t.exports=null},function(t,e,i){"use strict";var n=i(92).version,s=i(14),a={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){a[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));var r={};a.transitional=function(t,e,i){function a(t,e){return"[Axios v"+n+"] Transitional option '"+t+"'"+e+(i?". "+i:"")}return function(i,n,o){if(!1===t)throw new s(a(n," has been removed"+(e?" in "+e:"")),s.ERR_DEPRECATED);return e&&!r[n]&&(r[n]=!0,console.warn(a(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,n,o)}},t.exports={assertOptions:function(t,e,i){if("object"!=typeof t)throw new s("options must be an object",s.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(t),a=n.length;a-- >0;){var r=n[a],o=e[r];if(o){var l=t[r],p=void 0===l||o(l,r,t);if(!0!==p)throw new s("option "+r+" must be "+p,s.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new s("Unknown option "+r,s.ERR_BAD_OPTION)}},validators:a}},function(t,e,i){"use strict";var n=i(33);function s(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var i=this;this.promise.then((function(t){if(i._listeners){var e,n=i._listeners.length;for(e=0;e<n;e++)i._listeners[e](t);i._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){i.subscribe(t),e=t})).then(t);return n.cancel=function(){i.unsubscribe(e)},n},t((function(t){i.reason||(i.reason=new n(t),e(i.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},s.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},s.source=function(){var t;return{token:new s((function(e){t=e})),cancel:t}},t.exports=s},function(t,e,i){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,i){"use strict";var n=i(5);t.exports=function(t){return n.isObject(t)&&!0===t.isAxiosError}},function(t,e,i){"use strict";i(93)},function(t,e,i){"use strict";i(94)},function(t,e,i){"use strict";i(95)},function(t,e,i){"use strict";i(96)},function(t,e,i){var n=i(245),s=i(258),a=i(37),r=i(8),o=i(260);t.exports=function(t){return"function"==typeof t?t:null==t?a:"object"==typeof t?r(t)?s(t[0],t[1]):n(t):o(t)}},function(t,e,i){var n=i(246),s=i(257),a=i(100);t.exports=function(t){var e=s(t);return 1==e.length&&e[0][2]?a(e[0][0],e[0][1]):function(i){return i===t||n(i,t,e)}}},function(t,e,i){var n=i(47),s=i(97);t.exports=function(t,e,i,a){var r=i.length,o=r,l=!a;if(null==t)return!o;for(t=Object(t);r--;){var p=i[r];if(l&&p[2]?p[1]!==t[p[0]]:!(p[0]in t))return!1}for(;++r<o;){var c=(p=i[r])[0],d=t[c],u=p[1];if(l&&p[2]){if(void 0===d&&!(c in t))return!1}else{var f=new n;if(a)var h=a(d,u,c,t,e,f);if(!(void 0===h?s(u,d,3,a,f):h))return!1}}return!0}},function(t,e,i){var n=i(47),s=i(98),a=i(253),r=i(256),o=i(21),l=i(8),p=i(26),c=i(40),d="[object Object]",u=Object.prototype.hasOwnProperty;t.exports=function(t,e,i,f,h,_){var m=l(t),S=l(e),v=m?"[object Array]":o(t),g=S?"[object Array]":o(e),b=(v="[object Arguments]"==v?d:v)==d,y=(g="[object Arguments]"==g?d:g)==d,w=v==g;if(w&&p(t)){if(!p(e))return!1;m=!0,b=!1}if(w&&!b)return _||(_=new n),m||c(t)?s(t,e,i,f,h,_):a(t,e,v,i,f,h,_);if(!(1&i)){var T=b&&u.call(t,"__wrapped__"),x=y&&u.call(e,"__wrapped__");if(T||x){var E=T?t.value():t,k=x?e.value():e;return _||(_=new n),h(E,k,i,f,_)}}return!!w&&(_||(_=new n),r(t,e,i,f,h,_))}},function(t,e,i){var n=i(44),s=i(249),a=i(250);function r(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new n;++e<i;)this.add(t[e])}r.prototype.add=r.prototype.push=s,r.prototype.has=a,t.exports=r},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,i){var n=i(12),s=i(72),a=i(24),r=i(98),o=i(254),l=i(255),p=n?n.prototype:void 0,c=p?p.valueOf:void 0;t.exports=function(t,e,i,n,p,d,u){switch(i){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!d(new s(t),new s(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var f=o;case"[object Set]":var h=1&n;if(f||(f=l),t.size!=e.size&&!h)return!1;var _=u.get(t);if(_)return _==e;n|=2,u.set(t,e);var m=r(f(t),f(e),n,p,d,u);return u.delete(t),m;case"[object Symbol]":if(c)return c.call(t)==c.call(e)}return!1}},function(t,e){t.exports=function(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}},function(t,e){t.exports=function(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}},function(t,e,i){var n=i(70),s=Object.prototype.hasOwnProperty;t.exports=function(t,e,i,a,r,o){var l=1&i,p=n(t),c=p.length;if(c!=n(e).length&&!l)return!1;for(var d=c;d--;){var u=p[d];if(!(l?u in e:s.call(e,u)))return!1}var f=o.get(t),h=o.get(e);if(f&&h)return f==e&&h==t;var _=!0;o.set(t,e),o.set(e,t);for(var m=l;++d<c;){var S=t[u=p[d]],v=e[u];if(a)var g=l?a(v,S,u,e,t,o):a(S,v,u,t,e,o);if(!(void 0===g?S===v||r(S,v,i,a,o):g)){_=!1;break}m||(m="constructor"==u)}if(_&&!m){var b=t.constructor,y=e.constructor;b==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(_=!1)}return o.delete(t),o.delete(e),_}},function(t,e,i){var n=i(99),s=i(2);t.exports=function(t){for(var e=s(t),i=e.length;i--;){var a=e[i],r=t[a];e[i]=[a,r,n(r)]}return e}},function(t,e,i){var n=i(97),s=i(259),a=i(65),r=i(43),o=i(99),l=i(100),p=i(13);t.exports=function(t,e){return r(t)&&o(e)?l(p(t),e):function(i){var r=s(i,t);return void 0===r&&r===e?a(i,t):n(e,r,3)}}},function(t,e,i){var n=i(27);t.exports=function(t,e,i){var s=null==t?void 0:n(t,e);return void 0===s?i:s}},function(t,e,i){var n=i(261),s=i(262),a=i(43),r=i(13);t.exports=function(t){return a(t)?n(r(t)):s(t)}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,i){var n=i(27);t.exports=function(t){return function(e){return n(e,t)}}},function(t,e,i){var n=i(264),s=i(18),a=Array.prototype.splice;t.exports=function(t,e){for(var i=t?e.length:0,r=i-1;i--;){var o=e[i];if(i==r||o!==l){var l=o;s(o)?a.call(t,o,1):n(t,o)}}return t}},function(t,e,i){var n=i(20),s=i(265),a=i(266),r=i(13);t.exports=function(t,e){return e=n(e,t),null==(t=a(t,e))||delete t[r(s(e))]}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,i){var n=i(27),s=i(267);t.exports=function(t,e){return e.length<2?t:n(t,s(e,0,-1))}},function(t,e){t.exports=function(t,e,i){var n=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var a=Array(s);++n<s;)a[n]=t[n+e];return a}},function(t,e,i){"use strict";i(101)},function(t,e,i){"use strict";i(102)},function(t,e,i){"use strict";i(103)},function(t,e,i){var n=i(6);t.exports=function(){return n.Date.now()}},function(t,e,i){var n=i(7),s=i(28),a=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,p=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(s(t))return NaN;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var i=o.test(t);return i||l.test(t)?p(t.slice(2),i?2:8):r.test(t)?NaN:+t}},function(t,e,i){"use strict";i(104)},function(t,e,i){"use strict";i(105)},function(t,e,i){"use strict";i(106)},function(t,e,i){"use strict";i(107)},function(t,e,i){"use strict";i(108)},function(t,e,i){"use strict";i(109)},function(t,e,i){"use strict";i(110)},function(t,e,i){"use strict";i(111)},function(t,e,i){"use strict";i(112)},function(t,e,i){"use strict";i(113)},function(t,e,i){"use strict";i(114)},function(t,e,i){"use strict";i(115)},function(t,e,i){"use strict";i(116)},function(t,e,i){"use strict";i(117)},function(t,e,i){},function(t,e,i){},function(t,e,i){"use strict";i.r(e);var n={};i.r(n),i.d(n,"requirementRules",(function(){return vt})),i.d(n,"dependencyRules",(function(){return gt}));var s={};i.r(s),i.d(s,"descRules",(function(){return Bn})),i.d(s,"generateCodeRules",(function(){return jn})),i.d(s,"errorPageStaticFileRules",(function(){return Un})),i.d(s,"importErrorProfileFileRules",(function(){return Fn})),i.d(s,"relativeUrlRules",(function(){return Mn})),i.d(s,"absoluteUrlRules",(function(){return qn}));var a=i(9),r=i.n(a);function o(...t){return t.join(":")}var l={created(){this._T=window._T||o,this._TT=window._TT||o}};const p={STATIC:"static",RELATIVE_URL:"relative_url",REDIRECT_302:"redirect_302"},c=()=>[{label:_TT("SYNO.SDS.WebStation.Application","custom_error_page","insert_static"),value:p.STATIC},{label:_TT("SYNO.SDS.WebStation.Application","custom_error_page","execute_url"),value:p.RELATIVE_URL},{label:_TT("SYNO.SDS.WebStation.Application","custom_error_page","redirect_302"),value:p.REDIRECT_302}],d=()=>({ENABLE:{class:"green-status",text:_T("helpbrowser","font_normal")},DISABLE:{class:"syno-webstation-grey-status",text:_T("common","disabled")},ERROR:{class:"red-status",text:_T("common","status_abnormal")}});var u={mixins:[l],mounted(){this.loadData()},beforeMount(){SYNO.SDS.StatusNotifier.on("thirdpartychanged",this.onPkgChanged,this),SYNO.SDS.StatusNotifier.on("sharefolderchanged",this.onShareChanged,this)},beforeDestory(){SYNO.SDS.StatusNotifier.un("thirdpartychanged",this.onPkgChanged,this),SYNO.SDS.StatusNotifier.on("sharefolderchanged",this.onShareChanged,this)},data:()=>({general:{default:{class:"",text:"--"},userdir:{class:"",text:"--"},webServicePortal:{class:"",text:"--"}},backend:{columns:[{title:_TT("SYNO.SDS.WebStation.Application","common","name"),field:"name",align:"left"},{title:_TT("SYNO.SDS.WebStation.Application","common","status"),field:"status",align:"left",disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","status","management"),field:"management",align:"center",disableSort:!0}],data:[]},service:{columns:[{title:_TT("SYNO.SDS.WebStation.Application","common","name"),field:"name",align:"left"},{title:_TT("SYNO.SDS.WebStation.Application","common","status"),field:"status",align:"left",disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","status","management"),field:"management",align:"center",disableSort:!0}],data:[]}}),computed:{generalList(){return[{id:"defalt",label:_TT("SYNO.SDS.WebStation.Application","status","default_server_status"),status:this.general.default},{id:"userdir",label:_TT("SYNO.SDS.WebStation.Application","status","personal_website_status"),status:this.general.userdir},{id:"server-portal",label:_TT("SYNO.SDS.WebStation.Application","status","web_portal_status"),status:this.general.webServicePortal}]}},methods:{onPkgChanged(t){[void 0,"WebStation"].includes(t)||this._isDestroyed||this.loadData()},onShareChanged(t){return this._isDestroyed||this.loadData()},async sendRequest(){let t=[{api:"SYNO.WebStation.Status",method:"get",version:1},{api:"SYNO.WebStation.WebService.Service",method:"list",version:1,params:{all:!0}},{api:"SYNO.WebStation.WebService.Portal",method:"list",version:1}];try{return await synowebapi.promises.request({compound:{stopwhenerror:!0,params:t}})}catch(t){throw t}},async loadData(){try{let t=await this.sendRequest();this.loadGeneral(t),this.loadBackend(t),this.loadService(t)}catch(t){SYNO.Debug.error(t)}},checkBackendStatus:(t,e,i)=>(null===i||void 0!==t.php_profiles.profiles.find(t=>t.uuid===i))&&-1!==t.available_server_backend.indexOf(e),loadGeneral(t){const e=d();let i=t.result[0];i.data.available_php_backend=i.data.available_php_backend||[],function(t){this.general.default=this.checkBackendStatus(t,t.backend,t.php)?e.ENABLE:e.ERROR}.call(this,i.data),function(t){let i=Object.assign({},e.ENABLE);i.text=_T("common","enabled"),t.userdir&&[SYNO.SDS.WebStation.Util.HomeShareStatus.StatusNormal,SYNO.SDS.WebStation.Util.HomeShareStatus.StatusBackendNotExist].includes(t.home_share_status)?this.checkBackendStatus(t,t.userdir_backend,t.userdir_php)||(i=e.ERROR):i=e.DISABLE,this.general.userdir=i}.call(this,i.data),function(t){let i=t.result[1].data.services,n=t.result[2].data.portals,s=!1,a=!1;n&&n.forEach(t=>{if(t.enable){let e=i.find(e=>e.id===t.service);void 0!==e&&"ERROR"!==(null==e?void 0:e.status.type)||("alias"===t.type?s=!0:"server"===t.type&&(a=!0))}});let r=Object.assign({},e.ERROR);a&&s?r.text+=` (${_TT("SYNO.SDS.WebStation.Application","title","portal")} / ${_T("app_port_alias","desc_alias")})`:a?r.text+=` (${_TT("SYNO.SDS.WebStation.Application","title","portal")})`:s?r.text+=` (${_T("app_port_alias","desc_alias")})`:r=e.ENABLE,this.general.webServicePortal=r}.call(this,t)},async loadBackend(t){let e=[],i=(await SYNO.SDS.WebStation.Util.PackageInfo.Get(!0)).backendData;for(let t of[...i.server,...i.php,...i.python]){let i="Nginx"===t.name,n=i?"enabled":await SYNO.SDS.WebStation.Util.PackageInfo.GetStatusByPkgID(t.pkgID,!0);e.push({name:t.name,status:this.getBackendStatus(n),management:{isNginx:i,cls:i?"":"syno-webstation-management webstation-overview-management",action:i?()=>{}:()=>SYNO.SDS.AppLaunch("SYNO.SDS.PkgManApp.Instance",{action:"open",packages:[t.pkgID]})}})}this.backend.data=e},async loadService(t){let e=[],i=t.result[1].data.services,n=await SYNO.SDS.WebStation.Util.PackageInfo.queryPackages("install",!0,t=>i.map(t=>t.category).includes(t.id)&&"WebStation"!==t.id),s=await SYNO.SDS.WebStation.Util.PackageInfo.queryPackages("install",!0,t=>t.additional.provide_pkgs?Object.prototype.hasOwnProperty.call(t.additional.provide_pkgs,"WEBSTATION_SERVICE"):0),a=await SYNO.SDS.WebStation.Util.PackageInfo.queryPackages("official",!0,t=>t.provides?t.provides.includes("WEBSTATION_SERVICE"):0),r=i.filter(t=>Object.keys(n).includes(t.category)).map(t=>({display_name:t.display_name,...n[t.category]})).reduce((t,e)=>({...t,[e.display_name]:e}),{}),o=Object.values({...r,...s,...a});for(let t of o){let i=await SYNO.SDS.WebStation.Util.PackageInfo.GetStatusByPkgID(t.id,!0),n=void 0!==t.display_name?`${t.display_name} (${t.dname})`:t.dname;e.push({name:SYNO.SDS.WebStation.Util.geti18nString(n),status:this.getBackendStatus(i),management:{cls:"syno-webstation-management webstation-overview-management",action:()=>SYNO.SDS.AppLaunch("SYNO.SDS.PkgManApp.Instance",{action:"open",packages:[t.dname]})}})}this.service.data=e},getBackendStatus(t){const e=d();let i=Object.assign({},e.DISABLE);switch(t){case"not_installed":i.text=_TT("SYNO.SDS.WebStation.Application","common","not_installed");break;case"enabled":i=e.ENABLE;break;case"disabled":i=e.DISABLE;break;case"error":i=e.ERROR,i.tip={content:_TT("SYNO.SDS.WebStation.Application","error","eol_tip")};break;default:i.text="-"}return i}}};i(122);function f(t,e,i,n,s,a,r,o){var l,p="function"==typeof t?t.options:t;if(e&&(p.render=e,p.staticRenderFns=i,p._compiled=!0),n&&(p.functional=!0),a&&(p._scopeId="data-v-"+a),r?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},p._ssrRegister=l):s&&(l=o?function(){s.call(this,(p.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(p.functional){p._injectStyles=l;var c=p.render;p.render=function(t,e){return l.call(e),c(t,e)}}else{var d=p.beforeCreate;p.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:p}}var h=f(u,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-panel",{staticClass:"webstation-overview",attrs:{"syno-id":"webstation-overview-panel",fbar:!1},scopedSlots:t._u([{key:"body",fn:function(){return[i("v-scrollbar",{staticClass:"scrollbar"},[i("v-fieldset",{attrs:{"syno-id":"webstation-general-fieldset",title:t._T("log","general"),collapsible:!1}},[i("v-form",{attrs:{"syno-id":"webstation-general-form"}},t._l(t.generalList,(function(e){return i("v-form-item",{key:e.id,staticClass:"webstation-overview-form",attrs:{"syno-id":"webstation-"+e.id+"-form-item",label:""+e.label+t._T("common","colon"),textonly:""}},[i("font",{class:e.status.class},[t._v(" "+t._s(e.status.text)+" ")])],1)})),1)],1),t._v(" "),i("v-fieldset",{staticClass:"grid-fieldset",attrs:{"syno-id":"webstation-support-backend-fieldset",title:t._TT("SYNO.SDS.WebStation.Application","status","support_backend"),collapsible:!1}},[i("v-data-table",{staticClass:"webstation-overview__data-table",attrs:{"syno-id":"webstation-support-backend-data-table",columns:t.backend.columns,"current-data":t.backend.data,showPagingBar:!1,"enable-hd-menu":!1},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.data;return[i("div",{staticStyle:{display:"flex",overflow:"hidden"}},[i("span",{class:n.class},[t._v(t._s(n.text))]),t._v(" "),i("div",{staticClass:"v-whitetip-wrapper normal",staticStyle:{flex:"0 0 auto"},attrs:{tabindex:"-1"}},[n.tip?i("v-whitetip",{attrs:{content:n.tip.content,"tooltip-options":{isHtml:!0}}}):t._e()],1)])]}},{key:"management",fn:function(e){var n=e.data;return[n.isNginx?i("div",[i("font",[t._v(" -- ")])],1):i("div",[i("a",{class:n.cls,attrs:{target:"_blank"},on:{click:n.action}})])]}}])})],1),t._v(" "),i("v-fieldset",{staticClass:"grid-fieldset",attrs:{"syno-id":"webstation-support-service-fieldset",title:t._TT("SYNO.SDS.WebStation.Application","status","support_service_pkg"),collapsible:!1}},[i("v-data-table",{staticClass:"webstation-overview__data-table",attrs:{"syno-id":"webstation-support-service-data-table",columns:t.service.columns,"current-data":t.service.data,showPagingBar:!1,"enable-hd-menu":!1},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.data;return[i("span",{class:n.class,staticStyle:{"padding-right":"8px"}},[t._v(t._s(n.text))])]}},{key:"management",fn:function(t){var e=t.data;return[i("a",{class:e.cls,attrs:{target:"_blank"},on:{click:e.action}})]}}])})],1)],1)]},proxy:!0}])})}),[],!1,null,null,null).exports;var _={mounted(){var t,e;null!==(t=this.$parent)&&void 0!==t&&null!==(e=t.$options)&&void 0!==e&&e.appWin?this.$options.appWin=this.$parent.$options.appWin:this.$options.appWin=function t(e){return e?e.$refs.window?e.$refs.window:t(e.$parent):null}(this.$parent)}},m=i(0);function S(t={}){return{id:void 0,name:"",pages:[v({code:"default"})],...t}}function v(t={}){return{code:"",description:"",type:p.STATIC,absolute_url:void 0,relative_url:void 0,file:void 0,modified_time:void 0,...t}}var g={state:{newProfile:S(),profiles:[]},getters:{newProfile:t=>t.newProfile,profiles:t=>t.profiles,getCustomProfilesById:t=>e=>e.profiles.find(e=>e.id===t)},mutations:{ADD_PROFILE(t,e={}){t.profiles.push(S(e))},UPDATE_NEW_PROFILE(t,e={}){t.newProfile=S({...t.newProfile,...e})},ADD_NEW_PROFILE_EMPTY_PAGE:(t,e={})=>t.newProfile.pages.push(v(e))},actions:{addCustomProfile({commit:t,state:e}){t("ADD_PROFILE",e.newProfile)},async fetchProfiles({commit:t}){const e=(await synowebapi.promises.request({api:"SYNO.WebStation.ErrorPage",method:"list",version:1})).profiles.map(t=>S({id:t.id,name:t.desc,pages:t.pages.map(t=>v(t))}));return e.forEach(e=>t("ADD_PROFILE",e)),e},updateNewProfile({commit:t},e={}){t("UPDATE_NEW_PROFILE",e)},addNewProfileEmptyPage({commit:t},e={}){t("ADD_NEW_PROFILE_EMPTY_PAGE",e)}}},b=i(4),y=i.n(b),w=i(3),T=i.n(w),x=i(2),E=i.n(x);var k={namespaced:!0,state:{template:{},general:{based:"name",fqdn:"",alias:"",preserve:!1,name_port:!0,name_http:!1,name_https:!1,name_http_port:"",name_https_port:"",port_http:!1,port_https:!1,port_http_port:"",port_https_port:"",hsts:!1,acl:null,error_page:"default",enable_log:!1},shortcut:{enable:!1,display_name:"",all_users:"all"},aclList:[],errorPageList:[],FQDNPortPairList:[],category:"",serviceList:[],serviceListByAppLaunch:[]},getters:{IS_ALIAS:t=>"alias"===t.general.based,ALL_FIELDS:t=>({...t.template,...t.general,shortcut:t.shortcut})},mutations:{UPDATE_TEMPLATE(t,e){t.template={...t.template,...e}},UPDATE_GENERAL(t,e){t.general=y()({},t.general,T()(e,E()(t.general)))},UPDATE_SHORTCUT(t,e){e&&(t.shortcut=y()({},t.shortcut,T()(e,E()(t.shortcut))))},UPDATE_ALLLIST(t,e){t.serverList=e.serverList,t.phpList=e.phpList,t.pythonList=e.pythonList,t.aclList=e.aclList,t.errorPageList=e.errorPageList},RESET_GENERAL(t){t.general={based:"name",fqdn:"",alias:"",preserve:!1,name_port:!0,name_http:!1,name_https:!1,name_http_port:"",name_https_port:"",port_http:!1,port_https:!1,port_http_port:"",port_https_port:"",hsts:!1,acl:null,error_page:"default",enable_log:!1}},RESET_ALL(t){t.template={},t.general={based:"name",fqdn:"",alias:"",preserve:!1,name_port:!0,name_http:!1,name_https:!1,name_http_port:"",name_https_port:"",port_http:!1,port_https:!1,port_http_port:"",port_https_port:"",hsts:!1,acl:null,error_page:"default",enable_log:!1},t.shortcut={enable:!1,display_name:"",all_users:"all"},t.aclList=[],t.category="",t.serviceList=[],t.serviceListByAppLaunch=[]},UPDATE_SERVICE(t,e){t.template.service=e},UPDATE_CATEGORY(t,e){t.category=e},UPDATE_SERVICE_LIST(t,e){t.serviceList=e},UPDATE_SERVICE_BY_APPLAUNCH_LIST(t,e){t.serviceListByAppLaunch=e}},actions:{}};const D={DEFAULT:"DEFAULT",DOCKERIZED:"DOCKERIZED",PACKAGE:"PACKAGE",STATIC:"STATIC",SCRIPT_LANGUAGE:"SCRIPT_LANGUAGE"},A={LOADING:"LOADING",RUNNING:"RUNNING",PAUSED:"PAUSED",WARNING:"WARNING",ERROR:"ERROR"},O=Object.freeze({SUCCESS:0,DOCKER_NOT_INSTALL:1,PROJECT_NOT_FOUND:2,PROJECT_FAILED:3,PROJECT_UNHEALTHY:4});function N(){return{use_docker:!1,_type:D.STATIC,package:"php",display_name:"",description:"",root:"",backend:0,script_language:"not_configured",php:null,python:null,wsgi_file:null,callable:"application",connect_timeout:60,send_timeout:60,read_timeout:60}}var $={namespaced:!0,state:{template:{},general:N(),database:{db_settings:{type:"none",version:null,database:"",db_user:"",db_password:""}},serverList:[],phpList:[],pythonList:[],forceAcl:!1,profiles:[],category:"",serviceList:[],scriptLanguageList:[],packageList:[],serverList:[],builtInScriptLanguageList:{},loadingDockerIdList:[],processTasks:{}},getters:{ALL_FIELDS:t=>({...t.template,...t.general,...t.database})},mutations:{UPDATE_TEMPLATE(t,e){t.template={...t.template,...e}},UPDATE_GENERAL(t,e){for(let t of["connect_timeout","send_timeout","read_timeout"])e[t]=parseInt(e[t]);t.general.script_language=e.php?"php":e.python?"python":"not_configured",t.general=y()({},t.general,T()(e,E()(t.general)))},UPDATE_DATABASE(t,e){let i=e.db_settings;"type"in i&&"none"!==i.type&&(t.database.db_settings=y()({},t.database.db_settings,T()(i,E()(t.database.db_settings))))},UPDATE_ALLLIST(t,e){t.serverList=e.serverList,t.serviceList=e.serviceList,t.scriptLanguageList=e.scriptLanguageList,t.packageList=e.packageList,t.serverList=e.serverList,t.builtInScriptLanguageList=e.builtInScriptLanguageList},RESET_GENERAL(t){t.general={...N()}},RESET_DATABASE(t){t.database={db_settings:{type:"none",version:null,database:"",db_user:"",db_password:""}}},RESET_ALL(t){t.template={},t.general={...N()},t.database={db_settings:{type:"none",version:null,database:"",db_user:"",db_password:""}},t.serviceList=[],t.scriptLanguageList=[],t.packageList=[],t.serverList=[],t.builtInScriptLanguageList={},t.forceAcl=!1},UPDATE_SERVICE(t,e){t.template.service=e},UPDATE_FORCE_ACL(t,e){t.forceAcl=e},UPDATE_CATEGORY(t,e){t.category=e},UPDATE_ROOT(t,e){t.general.root=e},UPDATE_SCRIPT_LANGUAGE_LIST(t,e){t.scriptLanguageList=e},UPDATE_PACKAGE_LIST(t,e){t.packageList=e},UPDATE_SERVICE_LIST(t,e){t.serviceList=e},UPDATE_SERVER_LIST(t,e){t.serverList=e},UPDATE_BUILT_IN_SCRIPT_LANGUAGE_LIST(t,e){t.builtInScriptLanguageList=e},RESET_LOADING_DOCKER_ID_LIST(t){t.loadingDockerIdList=[]},RESET_RPOCESS_TASKS(t){t.processTasks={}}},actions:{}};var L={namespaced:!0,state:{template:{},general:{profile_name:"",profile_desc:"",backend:1,version:"",project_root:""},uwsgi:{uwsgi_settings:{process:4,enable_threads:!1,threads:2,max_request:65536,buffer:4096}},modules:{packages:{}},backendList:[],profiles:[]},getters:{ALL_FIELDS:t=>({...t.template,...t.general,...t.uwsgi,...t.modules})},mutations:{UPDATE_TEMPLATE(t,e){t.template.uuid=e.uuid||t.template.uuid},UPDATE_GENERAL(t,e){t.general=y()({},t.general,T()(e,E()(t.general)))},INIT_UWSGI(t){var e,i,n;void 0!==(null===(e=SYNO.SDS.WebStation.Util)||void 0===e||null===(i=e.PackageInfo)||void 0===i||null===(n=i.scriptLanguage)||void 0===n?void 0:n.php)&&(t.uwsgi.uwsgi_settings={...SYNO.SDS.WebStation.Util.PackageInfo.scriptLanguage.python.uwsgi})},UPDATE_UWSGI(t,e){t.uwsgi=y()({},t.uwsgi,T()(e,E()(t.uwsgi)))},UPDATE_MODULES(t,e){t.modules=y()({},t.modules,T()(e,E()(t.modules)))},RESET_ALL(t){t.template={},t.general={profile_name:"",profile_desc:"",backend:1,version:"",project_root:""},t.uwsgi={uwsgi_settings:{process:4,enable_threads:!1,threads:2,max_request:65536,buffer:4096}},t.modules={packages:{}}}},actions:{}};var W={namespaced:!0,state:{template:{},general:{profile_name:"",profile_desc:"",backend:8,enable_cache:!1,enable_xdebug:!1,display_errors:!1,custom_open_basedir:!1,open_basedir:"",version:"",project_root:""},fpm:{fpm_settings:{mode:"dynamic",max_children:20,start_servers:2,min_spare_servers:1,max_spare_servers:3}},extensions:{extensions:[]},core_settings:{php_settings:{}},default_profile:{installed:!1,enable:!1,open_basedir:"",extensions:[],php_settings:{}},require:{require:{}},backendList:[],profiles:[]},getters:{ALL_FIELDS:t=>({...t.template,...t.general,...t.fpm,...t.extensions,...t.core_settings,...t.require})},mutations:{UPDATE_TEMPLATE(t,e){t.template.uuid=e.uuid||t.template.uuid},UPDATE_GENERAL(t,e){t.general=y()({},t.general,T()(e,E()(t.general)))},INIT_FPM(t){var e,i,n;void 0!==(null===(e=SYNO.SDS.WebStation.Util)||void 0===e||null===(i=e.PackageInfo)||void 0===i||null===(n=i.scriptLanguage)||void 0===n?void 0:n.php)&&(t.fpm.fpm_settings={...SYNO.SDS.WebStation.Util.PackageInfo.scriptLanguage.php.fpm})},UPDATE_FPM(t,e){t.fpm=y()({},t.fpm,T()(e,E()(t.fpm)))},UPDATE_EXTENSIONS(t,e){t.extensions=y()({},t.extensions,T()(e,E()(t.extensions)))},UPDATE_CORE_SETTINGS(t,e){t.core_settings=y()({},t.core_settings,T()(e,E()(t.core_settings)))},UPDATE_DEFAULT_PROFILE(t,e){e&&(t.default_profile=y()({},t.default_profile,T()(e,E()(t.default_profile))))},UPDATE_REQUIRE(t,e){t.require=y()({},t.require,T()(e,E()(t.require)))},RESET_ALL(t){t.template={},t.general={profile_name:"",profile_desc:"",backend:8,enable_cache:!1,enable_xdebug:!1,display_errors:!1,custom_open_basedir:!1,open_basedir:"",version:"",project_root:""},t.fpm={fpm_settings:{mode:"dynamic",max_children:20,start_servers:2,min_spare_servers:1,max_spare_servers:3}},t.extensions={extensions:[]},t.core_settings={php_settings:{}},t.default_profile={installed:!1,enable:!1,open_basedir:"",extensions:[],php_settings:{}},t.require={require:{}}}},actions:{}};var P={namespaced:!0,state:{template:{},general:{version:"",project_root:"",script_settings:{project_port:"",command:""}},package_json:{package_settings:{version:"",author:"",main:"",license:"",scripts:{}},upload_file:"",file:null,package_json_type:"manual"},dependencies:{dependencies:{}}},getters:{ALL_FIELDS:t=>({...t.template,...t.general,...t.package_json,...t.dependencies})},mutations:{UPDATE_TEMPLATE(t,e){t.template.uuid=e.uuid||t.template.uuid},UPDATE_GENERAL(t,e){t.general=y()({},t.general,T()(e,E()(t.general)))},UPDATE_PACKAGE_JSON(t,e){t.package_json=y()({},t.package_json,T()(e,E()(t.package_json)))},UPDATE_DEPENDENCIES(t,e){t.dependencies=y()({},t.dependencies,T()(e,E()(t.dependencies)))},RESET_ALL(t){t.template={},t.general={version:"",project_root:"",script_settings:{project_port:"",command:""}},t.package_json={package_settings:{version:"",author:"",main:"",license:"",scripts:{}},upload_file:"",file:null,package_json_type:"manual"},t.dependencies={dependencies:{}}}},actions:{}};var Y={namespaced:!0,state:{template:{},general:{version:"",project_root:""},plex:{volumes:[]},meta:{type:""}},getters:{ALL_FIELDS:t=>({...t.template,...t.general,...t.plex})},mutations:{UPDATE_TEMPLATE(t,e){t.template.uuid=e.uuid||t.template.uuid},UPDATE_GENERAL(t,e){t.general=y()({},t.general,T()(e,E()(t.general)))},UPDATE_PLEX(t,e){t.plex=y()({},t.plex,T()(e,E()(t.plex)))},RESET_ALL(t){t.template={},t.general={version:"",project_root:""},t.plex={volumes:[]},t.meta={type:""}}},actions:{}};var R=new m.a.Store({devtools:!!location&&location.search.includes("jsDebug"),modules:{profile:g,portal:k,service:$,python:L,php:W,node:P,package:Y}}),C={methods:{T(t,e){let i=_T(t,e);return""===i?`${t}:${e}`:i},TT(t,e,i){try{return SYNO.SDS.Strings[t][e][i]}catch(t){return""}},JSLIBSTR(t,e){try{return SYNOJSLIB_Strings[t][e]}catch(t){return""}}}},I={name:"PortalType",props:{id:{type:String,require:!0},iconPath:{type:String,require:!0},title:{type:String,require:!0},description:{type:String,require:!0},isSelected:{type:Boolean,default:!1}},computed:{typeCls(){return["portal-type",{"portal-type-selected":this.isSelected}]},tooltipOptions(){return{content:this.description,overflowOnly:!0}}},methods:{onClick(){this.$emit("type-select",this.id)}}},B=(i(172),f(I,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.typeCls,on:{click:function(e){return e.preventDefault(),t.onClick(e)}}},[i("div",{staticClass:"portal-type-container"},[i("img",{staticClass:"portal-icon",attrs:{src:t.iconPath,draggable:"false"}}),i("div",{staticClass:"description-wrapper"},[i("div",{staticClass:"description-title"},[i("span",{domProps:{innerHTML:t._s(t.title)}})]),t._v(" "),i("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.tooltipOptions,expression:"tooltipOptions"}],staticClass:"description-content"},[i("span",{domProps:{innerHTML:t._s(t.description)}})])])])])}),[],!1,null,null,null).exports),j=i(1),U=i.n(j);const F=t=>`${t}-${Math.random().toString(36).substr(2,9)}`;async function M(t,e){let i=await SYNO.SDS.WebStation.Util.PackageInfo.Get();return t.profiles.filter(t=>null===t.default_profile).map(t=>({backend:t.backend,uuid:t.uuid,full_name:`${t.profile_name} ( ${i.backendData[e].find(e=>e.id===t.backend).name} )`,profile_name:t.profile_name}))}function q(t,e={}){let i={...e};switch(t){case D.STATIC:break;case D.PACKAGE:i.package=i.category;case D.SCRIPT_LANGUAGE:i.type.includes("nginx")&&(i.backend=0);for(let t of["php","python"])t in i&&("python"===t&&(i.wsgi_file=i[t].wsgi_file,i.callable=i[t].callable),i.script_language=t,i.package=t,i[t]=i[t].id||i.id);break;case D.DOCKERIZED:if(i.use_docker=!0,(i.type.includes("nginx")||i.type.includes("reverse_proxy"))&&(i.backend=0),i.type.includes("node")){i.package="node";break}if(i.type.includes("package")){i.package="package";break}for(let t of["php","python"])if(t in i){"python"===t&&(i.wsgi_file=i[t].link_settings.script_settings.wsgi_file,i.callable=i[t].link_settings.script_settings.callable),i.package=t;break}}return i}function G(t,e,i={}){let n=((t,e)=>{let i;switch(t){case D.STATIC:i={category:"WebStation",backend:0,root:"",service:F(t),display_name:"",description:"",apply_permission:!1};break;case D.SCRIPT_LANGUAGE:i={category:"WebStation",backend:0,root:"",service:F(t),display_name:"",description:"",connect_timeout:60,send_timeout:60,read_timeout:60,apply_permission:!1};break;case D.PACKAGE:case D.DOCKERIZED:i={category:"WebStation",backend:0,root:"",service:F(t),display_name:"",description:"",managed_by_docker:!0,connect_timeout:60,send_timeout:60,read_timeout:60}}return e&&(i.id=""),i})(t,!0===i.editor);switch(n=y()({},n,T()(e,E()(n))),t){case D.STATIC:n.type="static";break;case D.SCRIPT_LANGUAGE:n.type=0===e.backend?"nginx_"+e.script_language:"apache_"+e.script_language,n[e.script_language]={id:e[e.script_language]},"python"===e.script_language&&(n.python.wsgi_file=e.wsgi_file,n.python.callable=e.callable);break;case D.PACKAGE:break;case D.DOCKERIZED:if(["php","python","node"].includes(e.package)){switch("node"===e.package?n.type="reverse_proxy_node":n.type=0===e.backend?"nginx_"+e.package:"apache_"+e.package,n[e.package]={type:e.package,project_name:e.display_name,project_desc:e.description,project_root:e.root,version:e[e.package].version,profile_settings:{},link_settings:{}},e.package){case"php":n.php.profile_settings={composer_settings:{vendor:"webstation",name:e.display_name,require:e.php.require},extensions:e.php.extensions},n.php.link_settings.script_settings={fpm_settings:e.php.fpm_settings,php_settings:e.php.php_settings};break;case"python":n.python.profile_settings={packages:e.python.packages},n.python.link_settings.script_settings={uwsgi_settings:e.python.uwsgi_settings,wsgi_file:e.wsgi_file,callable:e.callable};break;case"node":"upload"===e.node.package_json_type?n.node.profile_settings={upload_file:e.node.upload_file}:n.node.profile_settings={package_settings:{...T()(e.node.package_settings,["version","author","main","license","scripts"]),name:n.node.project_name}},n.node.profile_settings.dependencies=e.node.dependencies,n.node.link_settings.script_settings=T()(e.node.script_settings,["project_port","command"]),!0===i.editor&&(n.node.id=e.id)}"none"!==e.db_settings.type&&(n[e.package].link_settings.db_settings={...e.db_settings,enable:!0})}else i.meta?"proxy"===i.meta.type?n.type="reverse_proxy_package":n.type=0===e.backend?`nginx_${i.meta.type}_package`:`apache_${i.meta.type}_package`:n.type=0===e.backend?"nginx_php_package":"apache_php_package",n.package={type:e.package,project_name:e.display_name,project_desc:e.description,project_root:e.root,version:e._package.version},"plex"===e.package&&(n.package.extra_settings={volumes:e._package.volumes},n.custom_rule={universal_rule:"/var/packages/WebStation/target/misc/nginx_plex_rewrite.mustache"}),"none"!==e.db_settings.type&&(n.package.db_settings={...e.db_settings,enable:!0})}return i.forceAcl&&(n.apply_permission=i.forceAcl,"plex"===e.package&&(n.appen_write_attr=i.forceAcl)),n}async function z(t,e){var i;if(!t)return null;const n=t.version,s=t.hash,a=null==e||null===(i=e.tags)||void 0===i?void 0:i[t.image];if(void 0===a)return null;let r={major:[],minor:[]};for(const t of a){if(!(SYNO.SDS.WebStation.Util.PackageInfo.compareDockerImageVersion(t,{tag:n})>0)){if(0===SYNO.SDS.WebStation.Util.PackageInfo.compareDockerImageVersion(t,{tag:n})){if(!t.hash||""===s||t.hash===s)break;r.minor.push(t);break}break}r.major.push(t)}return 0===r.major.length&&0===r.minor.length?null:(0===r.major.length?r.major=null:0===r.minor.length&&(r.minor=null),r)}const H={postgres:"PostgreSQL",mariadb:"MariaDB"};async function V(){const t=await synowebapi.promises.request({api:"SYNO.WebStation.Status",method:"get",version:1});return await async function(t){let e=await SYNO.SDS.WebStation.Util.PackageInfo.Get();return t.available_server_backend.map(t=>({backend_id:t,backend_name:e.backendData.server.find(e=>e.id===t).name}))}(t)}async function K(){const t=await synowebapi.promises.request({api:"SYNO.WebStation.Package",method:"list",version:1});return null==t?void 0:t.packages}async function J(t="php"){var e,i;const n=await SYNO.SDS.WebStation.Util.PackageInfo.GetDockerImageLatest();return{tags:Array.isArray(null==n||null===(e=n.tags)||void 0===e?void 0:e[t])?null==n||null===(i=n.tags)||void 0===i?void 0:i[t].map(t=>({label:t.tag,value:t.version})):[],network:!0===(null==n?void 0:n.network)}}function Z(t="start",e=[]){if(0!==e.length)return{api:"SYNO.WebStation.Package",method:t,version:1,params:{ids:e}}}function Q(t=[]){if(0!==t.length)return{api:"SYNO.WebStation.WebService.Service",method:"remove",version:1,params:{ids:t}}}function X(t=[]){if(0!==t.length)return{api:"SYNO.WebStation.Package",method:"remove",version:1,params:{ids:t}}}async function tt(t=[]){const{has_fail:e,result:i}=await synowebapi.promises.request({compound:{stopwhenerror:!0,params:t.filter(t=>null!==t)}});if(e){const t=i.filter(t=>!t.sucess),e=t.map(t=>`${t.api}:${t.error.code}`).join(", ");throw SYNO.Debug.error("Synowebapi request has fail: "+e),t}return i}const et=(t,e={})=>async(...i)=>{try{return await t(...i)}catch(t){return SYNO.Debug.error("Synowebapi request has fail: "+t),e}};async function it(){const t=await synowebapi.promises.request({api:"SYNO.WebStation.PHP.Profile",method:"list",version:1});return await M(t,"php")}async function nt(){const t=await synowebapi.promises.request({api:"SYNO.WebStation.Python.Profile",method:"list",version:1});return await M(t,"python")}async function st(){const t=await synowebapi.promises.request({api:"SYNO.WebStation.ScriptLanguage",method:"list",version:1});return null==t?void 0:t.scripts}function at(t="start",e=[]){if(0!==e.length)return{api:"SYNO.WebStation.ScriptLanguage",method:t,version:1,params:{ids:e}}}function rt(t=[]){if(0!==t.length)return{api:"SYNO.WebStation.ScriptLanguage",method:"remove",version:1,params:{ids:t}}}const ot=et((async function(t="php",e="extension",i={}){return await synowebapi.promises.request({api:"SYNO.WebStation.ScriptLanguage.Utils",method:"get",version:1,params:{script:{type:t,property:e,...i}}})}));const lt=et((async function(t){return await synowebapi.promises.request({api:"SYNO.WebStation.ScriptLanguage.Utils",method:"get_version",version:1,params:{id:t}})}));var pt={name:"PythonGeneral",mixins:[l],data(){return{fields:{...this.$store.state.python.general},rules:{profile_name:[{required:!0}],profile_desc:[{required:!0}]},pythonList:[]}},methods:{async preload(){this.fields={...this.$store.state.python.general},this.pythonList=await SYNO.SDS.WebStation.Util.PackageInfo.GetBackendMap("python")},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){this.$store.commit("python/UPDATE_GENERAL",this.fields)}}},ct=(i(206),f(pt,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-scrollbar",[i("v-form",{ref:"form",attrs:{rules:t.rules,usePerfectScroll:!0,"syno-id":"python-general-form"}},[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","python","profile_name")+t._T("common","colon"),prop:"profile_name"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"python-profile-name",name:"profile_name"},model:{value:t.fields.profile_name,callback:function(e){t.$set(t.fields,"profile_name",e)},expression:"fields.profile_name"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","python","profile_desc")+t._T("common","colon"),prop:"profile_desc"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"python-profile-desc",name:"profile_desc"},model:{value:t.fields.profile_desc,callback:function(e){t.$set(t.fields,"profile_desc",e)},expression:"fields.profile_desc"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","python","version")+t._T("common","colon")}},[i("v-single-select",{attrs:{"syno-id":"python_version",width:"200px",name:"python_version",displayField:"name",valueField:"id",options:t.pythonList,readonly:"",hasTooltip:""},model:{value:t.fields.backend,callback:function(e){t.$set(t.fields,"backend",e)},expression:"fields.backend"}})],1)],1)],1)],1)}),[],!1,null,"7330477f",null).exports),dt=f({name:"StepPythonGeneral",mixins:[l,C],components:{"python-general":ct},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.general.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.general.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.general.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-python-general","step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","python","general_wizrad_title"),"pre-enter-next-step":t.preEnterNextStep,"next-step-key":"python-uwsgi"},on:{activate:t.onActivate}},[i("python-general",{ref:"general",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,ut={methods:{}},ft={name:"PythonUwsgi",mixins:[ut,l],props:{editor:{type:Boolean,default:!1}},data(){const t=(t,e,i)=>e<=0?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_positive_number"))):i();return{fields:{...this.$store.state.python.uwsgi},rules:{process:[{required:!0,validator:t}],threads:[{required:!0,validator:t}],max_request:[{validator:t}],buffer:[{validator:(t,e,i)=>e<4096||e>65535?i(new Error(_TT("SYNO.SDS.WebStation.Application","python","buffer_size_alert"))):i()}]}}},computed:{enableThreads(){return this.fields.uwsgi_settings.enable_threads}},methods:{preload(){this.editor||this.$store.commit("python/INIT_UWSGI"),this.fields={...this.$store.state.python.uwsgi}},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){for(let t in this.fields.uwsgi_settings)"enable_threads"!==t&&"string"==typeof this.fields.uwsgi_settings[t]&&(this.fields.uwsgi_settings[t]=parseInt(this.fields.uwsgi_settings[t]));this.$store.commit("python/UPDATE_UWSGI",this.fields)}}},ht=(i(207),f(ft,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-scrollbar",[i("v-form",{ref:"form",attrs:{rules:t.rules,usePerfectScroll:!0,"syno-id":"python-settings-form"}},[i("v-form-item",{attrs:{"hide-label":"",textonly:""}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","python","uwsgi_desc"))+"\n ")]),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","python","process")+t._T("common","colon"),prop:"process"},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","python","process_help"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}])},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"python-profile-process",name:"process","number-only":!0},model:{value:t.fields.uwsgi_settings.process,callback:function(e){t.$set(t.fields.uwsgi_settings,"process",e)},expression:"fields.uwsgi_settings.process"}})],1),t._v(" "),i("v-form-item",{attrs:{prop:"enable_threads","hide-label":""}},[i("v-checkbox",{attrs:{"syno-id":"enable_threads",name:"enable_threads"},model:{value:t.fields.uwsgi_settings.enable_threads,callback:function(e){t.$set(t.fields.uwsgi_settings,"enable_threads",e)},expression:"fields.uwsgi_settings.enable_threads"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","python","enable_threads")))])],1),t._v(" "),i("v-form-item",{ref:"threads",attrs:{indent:1,prop:"threads",label:t._TT("SYNO.SDS.WebStation.Application","python","threads")+t._T("common","colon")}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"threads",name:"threads","number-only":!0,disabled:!t.enableThreads},model:{value:t.fields.uwsgi_settings.threads,callback:function(e){t.$set(t.fields.uwsgi_settings,"threads",e)},expression:"fields.uwsgi_settings.threads"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","python","max_request")+t._T("common","colon"),prop:"max_request"},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","python","max_requset_help"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}])},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"python-profile-max_request",name:"max_request","number-only":!0},model:{value:t.fields.uwsgi_settings.max_request,callback:function(e){t.$set(t.fields.uwsgi_settings,"max_request",e)},expression:"fields.uwsgi_settings.max_request"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","python","buffer")+t._T("common","colon"),prop:"buffer"},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","python","buffer_size_help"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}])},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"python-profile-buffer",name:"buffer","number-only":!0,maxlength:5},model:{value:t.fields.uwsgi_settings.buffer,callback:function(e){t.$set(t.fields.uwsgi_settings,"buffer",e)},expression:"fields.uwsgi_settings.buffer"}})],1)],1)],1)],1)}),[],!1,null,"201b38c4",null).exports),_t=f({mixins:[l],components:{PythonUwsgi:ht},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.uwsgi.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.uwsgi.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.uwsgi.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-python-uwsgi","step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","python","uwsgi_wizrad_title"),"pre-enter-next-step":t.preEnterNextStep,"next-step-key":"python-modules"},on:{activate:t.onActivate}},[i("python-uwsgi",{ref:"uwsgi",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports;async function mt(t){let e=await synowebapi.promises.request({api:"SYNO.WebStation.Python",method:"get_version",version:1,params:{id:t}});return null==e?void 0:e.packages}et(mt);function St(t,e){try{return SYNOJSLIB_Strings[t][e]}catch(t){return""}}const vt=[{validator:(t,e,i)=>null===e||e.length<=0?i(new Error(St("extlang","fieldblank"))):!1===/^([=|>|<|~|!]=\s*[0-9]\d*(\.\d+)*)(\s*,\s*[=|>|<|~|!]=\s*[0-9]\d*(\.\d+)*)*$/g.test(e)?i(new Error(_TT("SYNO.SDS.WebStation.Application","python","error_format"))):void i()}],gt=[{validator:(t,e,i)=>null===e||e.length<=0?i(new Error(St("extlang","fieldblank"))):!1===/^[~^]?(>|<)?=?[\dx*]+(?:[.](?:[\dx*]+))*(\s~?(>|<)?=?[\dx*]+(?:[.](?:[\dx*]+))*)*$/g.test(e)?i(new Error(_TT("SYNO.SDS.WebStation.Application","python","error_format"))):void i()}],bt=r.a.extend({template:'<v-message-box-window syno-id="overwrite-msgbox" :do-confirm="doConfirm">\n\t\t\t\t<template v-slot:content>\n\t\t\t\t\t<v-form syno-id="overwrite-form" class="no-padding-form">\n\t\t\t\t\t\t<v-form-item syno-id="overwrite-form-item" hide-label textonly v-if="tableConflict">\n\t\t\t\t\t\t\t{{quesitonText}}\n\t\t\t\t\t\t</v-form-item>\n\t\t\t\t\t\t<v-form-item syno-id="action-form-item" hide-label v-if="tableConflict">\n\t\t\t\t\t\t\t<v-radio-group\n\t\t\t\t\t\t\t\tsyno-id="action-radio-group"\n\t\t\t\t\t\t\t\tname="action"\n\t\t\t\t\t\t\t\tv-model="action"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<v-radio syno-id="overwrite-radio" :value="\'overwrite\'">{{overwriteText}}</v-radio>\n\t\t\t\t\t\t\t\t<v-radio syno-id="skip-radio" :value="\'skip\'">{{skipText}}</v-radio>\n\t\t\t\t\t\t\t</v-radio-group>\n\t\t\t\t\t\t</v-form-item>\n\t\t\t\t\t\t<v-form-item syno-id="duplicate-form-item" hide-label textonly v-if="fileConflict">\n\t\t\t\t\t\t\t<span v-if="tableConflict" class="note"> {{note}}</span> {{duplicateText}}\n\t\t\t\t\t\t</v-form-item>\n\t\t\t\t\t</v-form>\n\t\t\t\t</template>\n\t\t\t</v-message-box-window>\n\t\t\t',props:{note:l,quesitonText:l,overwriteText:l,skipText:l,duplicateText:l,tableConflict:!1,fileConflict:!1},data:()=>({action:"overwrite"}),methods:{doConfirm(){return Promise.resolve({action:this.action})}}});var yt={name:"PythonModules",mixins:[l,C],props:{showVersion:{type:Boolean,default:!1},isDockerized:{type:Boolean,default:!1}},data(){return{data:[],fileName:"",value:null,options:[],typeOptions:[{label:_TT("SYNO.SDS.WebStation.Application","python","latest"),value:"latest"},{label:_TT("SYNO.SDS.WebStation.Application","python","custom"),value:"custom"}],fields:{...this.$store.state.python.modules},defaultColumns:[{title:_TT("SYNO.SDS.WebStation.Application","python","module_name"),field:"module",width:160},{title:_TT("SYNO.SDS.WebStation.Application","python","default_version"),field:"value",width:354,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","python","action"),field:"action",width:90,disableSort:!0,align:"center"}],selectedRows:[],RULES:n,isDragging:!1,isDelete:!1}},computed:{columns(){return this.showVersion&&this.defaultColumns.splice(2,0,{title:_TT("SYNO.SDS.WebStation.Application","python","versioni_in_use"),field:"version",width:130,disableSort:!0}),this.defaultColumns}},methods:{async preload(){if(this.fields={...this.$store.state.python.modules},this.data=[],this.showVersion)var t=this.isDockerized?await lt(this.$store.state.service.template.id):await mt(this.$store.state.python.template.uuid);for(let e of Object.keys(this.fields.packages)){let i={module:{text:e,link:"https://pypi.org/project/"+e},value:"latest"===this.fields.packages[e]?{type:"latest",desc:""}:{type:"custom",desc:this.fields.packages[e]}};this.showVersion&&(i={...i,version:t[e]}),this.data.push(i)}await this.$nextTick(),this.$refs.form.commit()},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){this.fields.packages=0===this.data.length?{}:this.data.reduce((t,e)=>({...t,[e.module.text]:"latest"===e.value.type?"latest":e.value.desc}),{}),this.$store.commit("python/UPDATE_MODULES",this.fields)},reset(){this.$store.commit("python/RESET_ALL")},async search(t){let e=await async function(t="0"){return(await synowebapi.promises.request({api:"SYNO.WebStation.Python",method:"search",version:1,params:{prefix:t}})).result.map(t=>({label:t,value:t}))}(t);e.forEach(t=>{t.disabled=!!this.data.find(e=>e.module.text===t.value)}),this.options=e},addPackage(t){this.data.push({module:{text:t.value,link:"https://pypi.org/project/"+t.value},value:{type:"latest",desc:""}}),this.$refs.select.clear()},onRowClick(t){this.isDelete&&(this.data.splice(t.index,1),this.isDelete=!1)},async onDrop(t){this.isDragging=!1,await this.$nextTick(),await this.readFile(t.dataTransfer.files[0])},onRead(){this.readFile(this.$refs.file.getFile())},async readFile(t){let e=(await this.readFileAsync(t)).split(/\r?\n/).filter(t=>/^[A-Za-z0-9_-]+\s*(([=|>|<|~|!]=\s*[0-9]\s*\d*(\.\d+)*)(\s*,\s*[=|>|<|~|!]=\s*[0-9]\d*(\.\d+)*)*)?$/g.test(t)).map(t=>{let e=t.split(/\s(.+)/)[0].trim(),i=t.split(/\s(.+)/)[1];return{module:{text:e,link:"https://pypi.org/project/"+e},value:null==i?{type:"latest",desc:""}:{type:"custom",desc:i.trim()}}}),i=null,n=e.filter(t=>void 0!==this.data.find(e=>e.module.text===t.module.text)),s=!!e.find((t,i)=>e.findIndex(e=>e.module.text===t.module.text)!==i);if(n.length||s){let{window:t}=this.$root.$refs.window.openModalWindow(bt,{note:`${_T("common","note")} ${_T("common","colon")}`,quesitonText:_TT("SYNO.SDS.WebStation.Application","python","overwite_module_quesiton"),overwriteText:_TT("SYNO.SDS.WebStation.Application","python","overwite_module"),skipText:_TT("SYNO.SDS.WebStation.Application","python","skip_module"),duplicateText:_TT("SYNO.SDS.WebStation.Application","python","duplicate_module"),tableConflict:!!n.length,fileConflict:s});const e=await t.confirm("");if("cancel"==e)return!1;i=e.action,t.doClose()}e.forEach(t=>{let e=this.data.findIndex(e=>e.module.text===t.module.text);null!=i&&n.find(e=>e.module.text===t.module.text)?"overwrite"===i&&this.$set(this.data,e,t):-1!=e?this.$set(this.data,e,t):this.data.push(t)})},readFileAsync:t=>new Promise((e,i)=>{let n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=i,n.readAsText(t)})}},wt=(i(208),f(yt,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"ws-wizard-step-fit-container"},[i("v-form",{ref:"form",staticClass:"ws-python-module-form",attrs:{"syno-id":"webstation-python_modules"}},[i("v-form-item",{attrs:{"syno-id":"modules-desc-form-item","hide-label":"",textonly:""}},[i("v-rich-text",{attrs:{text:t._TT("SYNO.SDS.WebStation.Application","python","modules_desc"),"allow-attrs":["href","target"]}})],1),t._v(" "),i("div",{staticClass:"python-modules__select-modules"},[i("v-single-select",{ref:"select",staticClass:"select-modules",attrs:{"syno-id":"webstation-python-select-modules",width:"500px",options:t.options,search:t.search,clearable:""},on:{select:t.addPackage},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}}),t._v(" "),i("div",{staticClass:"vl"}),t._v(" "),i("v-file-button",{ref:"file",staticClass:"file-btn",attrs:{"syno-id":"webstation-python-file-button",accept:".txt",display:"button"},on:{change:t.onRead},model:{value:t.fileName,callback:function(e){t.fileName=e},expression:"fileName"}})],1),t._v(" "),i("div",{ref:"fileDragger",class:{"file-dragger":!0,"file-dragger--dragging":t.isDragging},attrs:{id:"file-dragger"},on:{dragenter:function(e){e.stopPropagation(),e.preventDefault(),t.isDragging=!0}}},[i("div",{class:{"file-dragger__cover":!0,"file-dragger__cover--hidden":!t.isDragging},on:{dragover:function(t){t.stopPropagation(),t.preventDefault()},dragleave:function(e){e.stopPropagation(),e.preventDefault(),t.isDragging=!1},drop:function(e){return e.stopPropagation(),e.preventDefault(),t.onDrop(e)}}},[i("div",{staticClass:"file-dragger__cover__content"},[i("div",{staticClass:"file-dragger__cover__content__img"}),t._v(" "),i("div",{staticClass:"file-dragger__cover__content__text"},[t._v(" "+t._s(t._TT("SYNO.SDS.WebStation.Application","custom_error_page","drag_file_here"))+" ")])])]),t._v(" "),i("v-data-table",{ref:"table",staticClass:"python-modules__data-table",attrs:{"syno-id":"webstation-python-data-table",columns:t.columns,"current-data":t.data,"enable-hd-menu":!1,"hide-refresh-btn":""},on:{"selected-change":function(e){t.selectedRows=e},dataloaded:function(e){t.selectedRows=[]},rowclick:t.onRowClick},scopedSlots:t._u([{key:"module",fn:function(e){var n=e.data;return[i("a",{staticClass:"module-name",attrs:{href:n.link,target:"_blank",rel:"noopener noreferrer"}},[t._v(" "+t._s(n.text)+" ")])]}},{key:"value",fn:function(e){var n=e.data;return[i("div",{staticClass:"requirement-version"},[i("v-form-item",[i("v-single-select",{staticClass:"select-type",attrs:{"syno-id":"webstation-python-data-table-select-type",width:"154px",options:t.typeOptions},model:{value:n.type,callback:function(e){t.$set(n,"type",e)},expression:"data.type"}})],1),t._v(" "),"custom"===n.type?i("v-form-item",{attrs:{prop:"desc",rules:t.RULES.requirementRules},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","python","requirement_tip"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}],null,!0)},[i("v-input",{staticClass:"desc-input",attrs:{"syno-id":"webstation-python-data-table-desc-input",placeholder:t._TT("SYNO.SDS.WebStation.Application","python","requirement_placeholder"),name:"desc"},model:{value:n.desc,callback:function(e){t.$set(n,"desc",e)},expression:"data.desc"}})],1):t._e()],1)]}},{key:"action",fn:function(){return[i("button",{staticClass:"delete-btn",on:{click:function(e){t.isDelete=!0}}})]},proxy:!0},{key:"empty-area",fn:function(){return[i("div",{staticClass:"empty-desc"},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","python","no_modules")))])]},proxy:!0}])})],1)],1)],1)}),[],!1,null,null,null).exports),Tt=f({mixins:[l],components:{"python-modules":wt},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.modules.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.modules.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.modules.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-python-modules","step-key":t.stepKey,"next-step-key":"python-summary","pre-enter-next-step":t.preEnterNextStep,headline:t._TT("SYNO.SDS.WebStation.Application","python","modules_wizrad_title")},on:{activate:t.onActivate}},[i("python-modules",{ref:"modules",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,xt={props:{title:{type:String,default:""},content:{type:String,default:""}}},Et=(i(209),f(xt,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"win",attrs:{"syno-id":"ws-error-window",title:t.title,width:"700",height:"500"}},[i("v-panel",{attrs:{"syno-id":"ws-error-panel","layout-type":"content",fbar:!1},scopedSlots:t._u([{key:"body",fn:function(){return[i("div",{staticClass:"ws_error-wrapper"},[i("v-scrollbar",[i("pre",{staticClass:"error-content"},[t._v(t._s(t.content))])])],1)]},proxy:!0}])})],1)}),[],!1,null,"609be0a8",null).exports);let kt=Vue.extend(Et);var Dt=f({mixins:[l],props:{nextStepkey:String,stepKey:String},data:()=>({data:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","service","item"),field:"item",width:260,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","service","value"),field:"value",width:414,disableSort:!0}],groupInfo:{category:"group"}}),computed:{...Object(m.c)("python",["general","uwsgi","modules"]),...Object(m.b)("python",["ALL_FIELDS"])},methods:{async onActivate(){this.$emit("spinning",!0),this.data=[];for(let t in this.general)"backend"===t?this.data.push({item:_TT("SYNO.SDS.WebStation.Application","python","version"),value:await SYNO.SDS.WebStation.Util.PackageInfo.GetPackageNameByIndex("python",this.general[t]),group:_TT("SYNO.SDS.WebStation.Application","service","general")}):["profile_desc","profile_name"].includes(t)&&this.data.push({item:_TT("SYNO.SDS.WebStation.Application","python",t),value:this.general[t],group:_TT("SYNO.SDS.WebStation.Application","service","general")});for(let t in this.uwsgi.uwsgi_settings)this.data.push({item:_TT("SYNO.SDS.WebStation.Application","python",t),value:this.uwsgi.uwsgi_settings[t]||_TT("SYNO.SDS.WebStation.Application","common","status_not_configured"),group:_TT("SYNO.SDS.WebStation.Application","python","uwsgi_setting")});let t="";for(let e in this.modules.packages)"latest"===this.modules.packages[e]?t+=e+", ":t+=`${e}(${this.modules.packages[e]}), `;this.data.push({item:_TT("SYNO.SDS.WebStation.Application","python","module"),value:t.slice(0,-2),group:_TT("SYNO.SDS.WebStation.Application","python","module")}),this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!0)},async finished(){if(!await this.apiSetPythonProfile())return!1;this.$emit("close")},async apiSetPythonProfile(){let t=!0;try{this.$emit("spinning",!0);await synowebapi.promises.request({api:"SYNO.WebStation.Python.Profile",method:"add",version:1,params:{profile:this.ALL_FIELDS}})}catch(e){let i=1628===e.code?e.errors.error:_T("error","error_error_system");await this.$root.$refs.window.openModalWindow(kt,{content:i,title:_TT("SYNO.SDS.WebStation.Application","python","error_window_title")}),t=!1}return this.$emit("spinning",!1),t}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-python-summary","step-key":this.stepKey,finished:this.finished,headline:this._TT("SYNO.SDS.WebStation.Application","wizard","summary_wizrad_title")},on:{activate:this.onActivate}},[e("v-data-table",{ref:"table",attrs:{"syno-id":"webstation-python-data-table",columns:this.columns,"current-data":this.data,"enable-hd-menu":!1,"show-paging-bar":!1,"hide-refresh-btn":!0,"group-table":"","group-info":this.groupInfo,"auto-row-height":""}})],1)}),[],!1,null,null,null),At=f({name:"ScriptLanguageWizard",mixins:[C],components:{"step-python-general":dt,"step-python-uwsgi":_t,"step-python-modules":Tt,"step-python-summary":Dt.exports},data:()=>({showStatusBar:!1,statusBarState:"",statusBarErrorText:"",buttonsGroup:{}}),methods:{onEnableNextButton(t,e=!0){this.buttonsGroup={next:{text:e?_T("common","create"):_T("common","next"),disabled:!t}}},async displayError(t){this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,await new Promise(t=>setTimeout(t,5e3)),this.showStatusBar=!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard",{attrs:{"syno-id":"ws-service-wizard","active-step-key":"python-general","custom-buttons-group":t.buttonsGroup,refs:"wizard","show-status-bar":t.showStatusBar,"status-bar-state":t.statusBarState,"status-bar-error-text":t.statusBarErrorText},on:{"step-scroll":function(e){return t.$emit("step-scroll",e)}}},[i("step-python-general",{attrs:{"syno-id":"step-python-general","step-key":"python-general"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-python-uwsgi",{attrs:{"syno-id":"step-python-uwsgi","step-key":"python-uwsgi"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-python-modules",{attrs:{"syno-id":"step-python-modules","step-key":"python-modules"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-python-summary",{attrs:{"syno-id":"step-python-summary","step-key":"python-summary"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}})],1)}),[],!1,null,null,null).exports,Ot=f({name:"PHPGeneral",mixins:[l],data(){return{fields:{...this.$store.state.php.general},default_profile:{...this.$store.state.php.default_profile},rules:{profile_name:[{required:!0}],profile_desc:[{required:!0}]},phpList:[],open_basedir_type:"default",default_open_basedir:"None",phpVersion:""}},computed:{isDefaultProfile(){var t;return!0===(null===(t=this.default_profile)||void 0===t?void 0:t.installed)}},methods:{async preload(){this.fields={...this.$store.state.php.general},this.default_profile={...this.$store.state.php.default_profile};let{php:t}=await SYNO.SDS.WebStation.Util.PackageInfo.GetPhpData(),e=t.default_settings.map(t=>t.backend);if(this.phpList=(await SYNO.SDS.WebStation.Util.PackageInfo.GetBackendMap("php")).filter(t=>e.includes(t.id)),this.fields.backend=void 0!==this.phpList.find(t=>this.fields.backend===t.id)?this.fields.backend:this.phpList[0].id,!0===this.fields.custom_open_basedir&&(this.open_basedir_type="custom"),this.isDefaultProfile){this.default_open_basedir=this.default_profile.open_basedir;let t=this.phpList.find(t=>this.fields.backend===t.id);this.phpVersion=void 0!==t?t.name:""}await this.$nextTick(),this.$refs.form.commit()},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){this.fields.custom_open_basedir="custom"===this.open_basedir_type,this.$store.commit("php/UPDATE_GENERAL",this.fields)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-form",{ref:"form",attrs:{flex:"row",rules:t.rules,usePerfectScroll:!0,"syno-id":"php-general-form"}},[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","php","profile_name")+t._T("common","colon"),prop:"profile_name","control-flex":"200px",textonly:t.isDefaultProfile,"disable-validation":t.isDefaultProfile}},[t.isDefaultProfile?[t._v(" "+t._s(t.fields.profile_name)+" ")]:i("v-input",{attrs:{"syno-id":"php-profile-name",name:"profile_name"},model:{value:t.fields.profile_name,callback:function(e){t.$set(t.fields,"profile_name",e)},expression:"fields.profile_name"}})],2),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","php","profile_desc")+t._T("common","colon"),prop:"profile_desc","control-flex":"200px",textonly:t.isDefaultProfile,"disable-validation":t.isDefaultProfile}},[t.isDefaultProfile?[t._v(" "+t._s(t.fields.profile_desc)+" ")]:i("v-input",{attrs:{"syno-id":"php-profile-desc",name:"profile_desc"},model:{value:t.fields.profile_desc,callback:function(e){t.$set(t.fields,"profile_desc",e)},expression:"fields.profile_desc"}})],2),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","php","version")+t._T("common","colon"),"control-flex":"200px",textonly:t.isDefaultProfile,"disable-validation":t.isDefaultProfile}},[t.isDefaultProfile?[t._v(" "+t._s(t.phpVersion)+" ")]:i("v-single-select",{attrs:{"syno-id":"php_version",width:"auto",name:"php_version",displayField:"name",valueField:"id",options:t.phpList,readonly:"",hasTooltip:""},model:{value:t.fields.backend,callback:function(e){t.$set(t.fields,"backend",e)},expression:"fields.backend"}})],2),t._v(" "),i("v-form-item",{attrs:{prop:"enable_cache","hide-label":""}},[i("v-checkbox",{attrs:{"syno-id":"enable_cache",name:"enable_cache"},model:{value:t.fields.enable_cache,callback:function(e){t.$set(t.fields,"enable_cache",e)},expression:"fields.enable_cache"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","php","php_cache_enabled")))])],1),t._v(" "),i("v-form-item",{attrs:{prop:"enable_xdebug","hide-label":""}},[i("v-checkbox",{attrs:{"syno-id":"enable_xdebug",name:"enable_xdebug"},model:{value:t.fields.enable_xdebug,callback:function(e){t.$set(t.fields,"enable_xdebug",e)},expression:"fields.enable_xdebug"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","php","php_xdebug_enabled")))])],1),t._v(" "),i("v-form-item",{attrs:{prop:"display_errors","hide-label":""}},[i("v-checkbox",{attrs:{"syno-id":"display_errors",name:"display_errors"},model:{value:t.fields.display_errors,callback:function(e){t.$set(t.fields,"display_errors",e)},expression:"fields.display_errors"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","php","php_display_errors")))])],1),t._v(" "),i("v-form-item",{attrs:{"syno-id":"open_basedir","hide-label":"",textonly:""}},[t._v("\n\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","php","php_openbasedir_customize"))+" "+t._s(t._T("common","colon"))+"\n\t\t")]),t._v(" "),i("v-form-multiple-item",{attrs:{"syno-id":"open_basedir_custom-form-item","hide-label":"",indent:1}},[i("v-form-item",{attrs:{prop:"open_basedir_custom","register-key":"open_basedir_custom","control-flex":"200px"}},[i("v-radio",{attrs:{"syno-id":"open_basedir_custom",name:"open_basedir_custom",value:"custom"},model:{value:t.open_basedir_type,callback:function(e){t.open_basedir_type=e},expression:"open_basedir_type"}},[t._v("\n\t\t\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","common","customize"))+"\n\t\t\t\t")])],1),t._v(" "),i("v-form-item",{attrs:{prop:"custom_open_basedir","register-key":"custom_open_basedir","control-flex":"300px"}},[i("v-input",{attrs:{"syno-id":"open_basedir-input",name:"custom_open_basedir",disabled:"custom"!==t.open_basedir_type},model:{value:t.fields.open_basedir,callback:function(e){t.$set(t.fields,"open_basedir",e)},expression:"fields.open_basedir"}})],1)],1),t._v(" "),i("v-form-multiple-item",{attrs:{"syno-id":"open_basedir_default-form-item","hide-label":"",indent:1}},[i("v-form-item",{attrs:{prop:"open_basedir_default","register-key":"open_basedir_default","control-flex":"200px"}},[i("v-radio",{attrs:{"syno-id":"open_basedir_default",name:"open_basedir_default",value:"default"},model:{value:t.open_basedir_type,callback:function(e){t.open_basedir_type=e},expression:"open_basedir_type"}},[t._v("\n\t\t\t\t\t"+t._s(t._T("common","default"))+"\n\t\t\t\t")])],1),t._v(" "),i("v-form-item",{attrs:{textonly:""}},[t._v("\n\t\t\t\t"+t._s(t.default_open_basedir)+"\n\t\t\t")])],1)],1)],1)}),[],!1,null,null,null).exports,Nt=f({name:"StepPHPGeneral",mixins:[l,C],components:{"php-general":Ot},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.general.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.general.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.general.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-general","step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","service","general_title"),"pre-enter-next-step":t.preEnterNextStep,"next-step-key":"php-extensions"},on:{activate:t.onActivate}},[i("php-general",{ref:"general",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,$t={name:"PHPExtension",mixins:[l,C],props:{isDockerized:{type:Boolean,default:!1},editor:{type:Boolean,default:!1}},data(){return{data:[],fields:{...this.$store.state.php.extensions},columns:[{title:"",field:"enable",action:"enable",align:"center",width:10},{title:_TT("SYNO.SDS.WebStation.Application","php","extension_name"),field:"name",width:40},{title:_TT("SYNO.SDS.WebStation.Application","php","extension_desc"),field:"desc",width:250,disableSort:!0}],policy:{}}},methods:{async preload(){if(this.fields={...this.$store.state.php.extensions},this.isDockerized){let t=await ot("php","extension",{version:this.$store.state.php.general.version.split("@")[0]});this.policy=(null==t?void 0:t.policy)||{},this.data=Object.entries((null==t?void 0:t.extension)||{}).map(([t,e])=>({enable:this.fields.extensions.includes(t),name:t,desc:e}))}else{var t;this.default_profile={...this.$store.state.php.default_profile};let e=!0===(null===(t=this.default_profile)||void 0===t?void 0:t.installed)?this.default_profile.extensions:[],{php:i}=await SYNO.SDS.WebStation.Util.PackageInfo.GetPhpData();this.data=i.extensions_list.find(t=>t.backend===this.$store.state.php.general.backend).extensions.map(t=>({enable:this.fields.extensions.includes(t.name)||e.includes(t.name),disabled:e.includes(t.name),name:t.name,desc:t.description}))}await this.$nextTick(),this.$refs.form.commit()},validate(){const t=this.data.filter(({enable:t})=>t).map(({name:t})=>t);for(const e in this.policy.conflict)if(t.includes(e)){const i=this.policy.conflict[e].filter(e=>t.includes(e));if(i.length>0){const[t]=i;throw SYNO.SDS.formatString(_TT("SYNO.SDS.WebStation.Application","error","err_php_extension_conflict"),e,t)}}return!0},isDirty(){return this.$refs.form.isDirty()},commit(){this.fields.extensions=this.data.filter(t=>!0===t.enable).map(t=>t.name),this.$store.commit("php/UPDATE_EXTENSIONS",this.fields)},reset(){this.$store.commit("php/RESET_ALL")}}},Lt=(i(210),f($t,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("v-form",{ref:"form",attrs:{"syno-id":"webstation-php-extensions"}},[e("v-data-table",{ref:"table",staticClass:"php-extensions__data-table",style:{height:this.editor?"396px":"366px"},attrs:{"syno-id":"webstation-php-data-table",columns:this.columns,"current-data":this.data,"enable-hd-menu":!1,"hide-refresh-btn":""}})],1)],1)}),[],!1,null,null,null).exports),Wt=f({mixins:[l],components:{"php-extensions":Lt},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.extensions.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){this.$refs.extensions.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-extensions","step-key":t.stepKey,"next-step-key":"php-fpm","pre-enter-next-step":t.preEnterNextStep,headline:t._TT("SYNO.SDS.WebStation.Application","php","extension_title")},on:{activate:t.onActivate}},[i("php-extensions",{ref:"extensions",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,Pt={name:"PHPFPM",mixins:[ut,l,C],props:{editor:{type:Boolean,default:!1}},data(){return{modeList:[{label:_TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_mode_static"),value:"static"},{label:_TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_mode_dynamic"),value:"dynamic"},{label:_TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_mode_ondemand"),value:"ondemand"}],fields:U()(this.$store.state.php.fpm),rules:{max_children:[{required:!0},{validator:(t,e,i)=>"dynamic"!==this.fields.fpm_settings.mode?i():e<=0?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_positive_number"))):this.fields.fpm_settings.min_spare_servers>=e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_fpm_less_min_spare"))):this.fields.fpm_settings.max_spare_servers>=e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_fpm_less_max_spare"))):i()}],start_servers:[{required:!0},{validator:(t,e,i)=>"dynamic"!==this.fields.fpm_settings.mode?i():e<=0?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_positive_number"))):this.fields.fpm_settings.min_spare_servers>e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_fpm_less_min_spare"))):this.fields.fpm_settings.max_spare_servers<e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_fpm_larger_max_spare"))):i()}],min_spare_servers:[{required:!0},{validator:(t,e,i)=>"dynamic"!==this.fields.fpm_settings.mode?i():e<=0?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_positive_number"))):this.fields.fpm_settings.start_servers<e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_fpm_larger_start_servers"))):this.fields.fpm_settings.max_children<=e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_fpm_larger_max_children"))):i()}],max_spare_servers:[{required:!0},{validator:(t,e,i)=>"dynamic"!==this.fields.fpm_settings.mode?i():e<=0?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_positive_number"))):this.fields.fpm_settings.start_servers>e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_fpm_less_start_servers"))):this.fields.fpm_settings.max_children<=e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_fpm_larger_max_children"))):i()}]}}},methods:{preload(){this.editor||this.$store.commit("php/INIT_FPM"),this.fields=U()(this.$store.state.php.fpm)},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){for(let t in this.fields.fpm_settings)"mode"!==t&&"string"==typeof this.fields.fpm_settings[t]&&(this.fields.fpm_settings[t]=parseInt(this.fields.fpm_settings[t]));this.$store.commit("php/UPDATE_FPM",this.fields)}}},Yt=(i(211),f(Pt,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-scrollbar",[i("v-form",{ref:"form",attrs:{rules:t.rules,usePerfectScroll:!0,"syno-id":"php-settings-form"}},[i("v-form-item",{attrs:{label:""+t._TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_process_mode")+t._T("common","colon"),prop:"mode"}},[i("v-single-select",{attrs:{"syno-id":"php-fpm-mode",width:"200px",name:"mode",options:t.modeList,readonly:"",hasTooltip:""},model:{value:t.fields.fpm_settings.mode,callback:function(e){t.$set(t.fields.fpm_settings,"mode",e)},expression:"fields.fpm_settings.mode"}})],1),t._v(" "),i("v-form-item",{attrs:{label:""+t._TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_max_children")+t._T("common","colon"),prop:"max_children"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"php-fpm-max-children",name:"max_children","number-only":!0},model:{value:t.fields.fpm_settings.max_children,callback:function(e){t.$set(t.fields.fpm_settings,"max_children",e)},expression:"fields.fpm_settings.max_children"}})],1),t._v(" "),i("v-form-item",{attrs:{label:""+t._TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_start_servers")+t._T("common","colon"),prop:"start_servers"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"php-fpm-start-servers",name:"start_servers","number-only":!0},model:{value:t.fields.fpm_settings.start_servers,callback:function(e){t.$set(t.fields.fpm_settings,"start_servers",e)},expression:"fields.fpm_settings.start_servers"}})],1),t._v(" "),i("v-form-item",{attrs:{label:""+t._TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_min_spare_servers")+t._T("common","colon"),prop:"min_spare_servers"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"php-fpm-min-spare-servers",name:"min_spare_servers","number-only":!0},model:{value:t.fields.fpm_settings.min_spare_servers,callback:function(e){t.$set(t.fields.fpm_settings,"min_spare_servers",e)},expression:"fields.fpm_settings.min_spare_servers"}})],1),t._v(" "),i("v-form-item",{attrs:{label:""+t._TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_max_spare_servers")+t._T("common","colon"),prop:"max_spare_servers"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"php-fpm-max-spare-servers",name:"max_spare_servers","number-only":!0},model:{value:t.fields.fpm_settings.max_spare_servers,callback:function(e){t.$set(t.fields.fpm_settings,"max_spare_servers",e)},expression:"fields.fpm_settings.max_spare_servers"}})],1)],1)],1)],1)}),[],!1,null,"4da3847a",null).exports),Rt=f({mixins:[l],components:{"php-fpm":Yt},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||this.$refs.fpm.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.fpm.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.fpm.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-fpm","step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","php","fpm_title"),"pre-enter-next-step":t.preEnterNextStep,"next-step-key":"php-core-settings"},on:{activate:t.onActivate}},[i("php-fpm",{ref:"fpm",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,Ct={name:"PHPCoreSettings",mixins:[l,C],props:{isDockerized:{type:Boolean,default:!1},editor:{type:Boolean,default:!1}},computed:{menuCls(){return this.editor?"editor-menu":""}},data(){return{reset:"all",show:"all",data:[],fields:{...this.$store.state.php.core_settings},columns:[{title:_TT("SYNO.SDS.WebStation.Application","common","name"),field:"name",width:90},{title:_TT("SYNO.SDS.WebStation.Application","php_advanced_setting","value"),field:"value",width:200,disableSort:!0}],selectedRows:[],showOptions:[{label:_TT("SYNO.SDS.WebStation.Application","common","show_all"),value:"all"},{label:_TT("SYNO.SDS.WebStation.Application","common","show_edited"),value:"edited"}]}},methods:{async preload(){if(this.fields=U()(this.$store.state.php.core_settings),this.data=[],this.default_php_settings={},this.isDockerized){let t=await ot("php","core_setting",{id:this.$store.state.service.template.id}),e={};for(let i in t)e[i]=t[i].global_value||null;this.default_php_settings={...e};for(let[t,i]of Object.entries({...e,...this.fields.php_settings}))this.data.push({id:t,name:t,value:i})}else{var t;this.default_profile={...this.$store.state.php.default_profile};let e=!0===(null===(t=this.default_profile)||void 0===t?void 0:t.installed)?this.default_profile.php_settings:{},{php:i}=await SYNO.SDS.WebStation.Util.PackageInfo.GetPhpData(),n=i.default_settings.find(t=>t.backend===this.$store.state.php.general.backend);this.default_php_settings={...n.core,...n.extensions,...e};for(let[t,e]of Object.entries({...this.default_php_settings,...this.fields.php_settings}))this.data.push({id:t,name:t,value:e})}await this.$nextTick(),this.$refs.table.commit()},validate:()=>!0,isDirty(){return this.$refs.form.isDirty()},commit(){this.$refs.table.filter({fields:[{name:new RegExp("")}]}),this.fields.php_settings={...this.data.reduce((t,e)=>{var i;return(null===(i=this.default_php_settings)||void 0===i?void 0:i[e.name])!==e.value?{...t,[e.name]:e.value}:{...t}},{})},this.$store.commit("php/UPDATE_CORE_SETTINGS",this.fields)},reset(){this.$store.commit("php/RESET_ALL")},onFilter(t){if(""===t)return this.$refs.table.clearFilter();this.$refs.table.filter({fields:[{name:new RegExp(t)}]})},getOriginalEditedRows(){let t=[];for(let[e,i]of Object.entries(this.default_php_settings)){let n=this.data.findIndex(t=>t.name===e);-1!==n&&this.data[n].value!==i&&t.push({name:e,value:i})}return t},onReset(){let t=this.getOriginalEditedRows();var e;"all"===this.reset?t.forEach(t=>{let e=this.data.findIndex(e=>e.name===t.name);-1!==e&&(this.data[e].value=t.value)}):this.selectedRows&&(null===(e=this.selectedRows.rows)||void 0===e?void 0:e.length)>0&&this.selectedRows.rows.forEach(e=>{let i=t.find(t=>t.name===e.name);if(void 0!==i){let t=this.data.findIndex(t=>t.name===e.name);-1!==t&&(this.data[t].value=i.value)}})},onShow(){if("edited"===this.show){let t=this.getOriginalEditedRows().reduce((t,e)=>`${t}|(^${e.name}$)`,"");""===t?this.$refs.table.filter({fields:[{name:new RegExp("nothing^")}]}):(t=t.substring(1),this.$refs.table.filter({fields:[{name:new RegExp(t)}]}))}else this.$refs.table.filter({fields:[{name:new RegExp("")}]})}}},It=(i(212),f(Ct,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"php-core-settings"},[i("div",{class:"php-core-settings__menu "+t.menuCls},[i("v-button",{attrs:{type:"dropdown","syno-id":"php-core-reset-split-button"},scopedSlots:t._u([{key:"dropdown",fn:function(){return[i("v-menu",{attrs:{"syno-id":"php-core-reset-split-button-menu"}},[i("v-menu-item",{attrs:{"syno-id":"php-core-reset-menu-item-selected",title:t._TT("SYNO.SDS.WebStation.Application","actions","reset_selected"),id:"selected"},on:{click:function(e){t.reset="selected",t.onReset()}}}),t._v(" "),i("v-menu-item",{attrs:{"syno-id":"php-core-reset-menu-item-all",title:t._TT("SYNO.SDS.WebStation.Application","actions","reset_all"),id:"all"},on:{click:function(e){t.reset="all",t.onReset()}}})],1)]},proxy:!0}])},[t._v("\n\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","php_advanced_setting","reset"))+"\n\t\t\t")]),t._v(" "),i("v-space",[i("v-single-select",{attrs:{"syno-id":"php-core-show-select",width:200,name:"show",options:this.showOptions,readonly:"",hasTooltip:""},on:{select:t.onShow},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}}),t._v(" "),i("v-single-select",{ref:"filter",attrs:{"syno-id":"php-core-filter",width:"200px",filter:function(){},"show-dropdown":!1,clearable:""},on:{"display-changed":t.onFilter}})],1)],1),t._v(" "),i("v-form",{ref:"form",staticClass:"ws-php-core-settings-form",attrs:{"syno-id":"webstation-php-core-settings"}},[i("v-data-table",{ref:"table",staticClass:"php-core-settings__data-table",style:{height:t.editor?"352px":"331px"},attrs:{"syno-id":"php-data-table",columns:t.columns,"current-data":t.data,"enable-hd-menu":!1,"show-paging-bar":!1,"virtual-scroll":""},on:{"update:currentData":function(e){t.data=e},"update:current-data":function(e){t.data=e},"selected-change":function(e){t.selectedRows=e}},scopedSlots:t._u([{key:"value",fn:function(t){var e=t.row,n=t.update,s=t.initialData;return[i("v-form-item",{attrs:{prop:e.name,"fix-initial-value":s}},[i("v-input",{attrs:{"syno-id":"php-core-data-table-value-input",name:"value",value:e.value},on:{input:function(t){return n(t)}}})],1)]}}])})],1)],1)}),[],!1,null,"0e005106",null).exports),Bt=f({mixins:[l],components:{"php-core-settings":It},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.core.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){this.$refs.core.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-core-settings","step-key":t.stepKey,"next-step-key":"php-summary","pre-enter-next-step":t.preEnterNextStep,headline:t._TT("SYNO.SDS.WebStation.Application","php","core_title")},on:{activate:t.onActivate}},[i("php-core-settings",{ref:"core",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,jt=f({mixins:[l],props:{nextStepkey:String,stepKey:String},data:()=>({data:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","service","item"),field:"item",width:260,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","service","value"),field:"value",width:414,disableSort:!0}],groupInfo:{category:"group"}}),computed:{...Object(m.c)("php",["general","fpm","extensions","core_settings"]),...Object(m.b)("php",["ALL_FIELDS"])},methods:{async onActivate(){this.$emit("spinning",!0),this.data=[];for(let t in this.general)"backend"===t?this.data.push({item:_TT("SYNO.SDS.WebStation.Application","php","version"),value:await SYNO.SDS.WebStation.Util.PackageInfo.GetPackageNameByIndex("php",this.general[t]),group:_TT("SYNO.SDS.WebStation.Application","service","general")}):["profile_desc","profile_name"].includes(t)&&this.data.push({item:_TT("SYNO.SDS.WebStation.Application","php",t),value:this.general[t],group:_TT("SYNO.SDS.WebStation.Application","service","general")});for(let t in this.fpm.fpm_settings)this.data.push({item:"mode"===t?_TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_process_mode"):_TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_"+t),value:this.fpm.fpm_settings[t],group:_TT("SYNO.SDS.WebStation.Application","php","fpm")});this.data.push({item:_TT("SYNO.SDS.WebStation.Application","php","extensions"),value:this.extensions.extensions.join(", "),group:_TT("SYNO.SDS.WebStation.Application","php","extensions")});for(let t in this.core_settings.php_settings)this.data.push({item:t,value:this.core_settings.php_settings[t],group:_TT("SYNO.SDS.WebStation.Application","php","core")});this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!0)},async finished(){if(!await this.apiSetPHPProfile())return!1;this.$emit("close")},async apiSetPHPProfile(){let t=!0;try{this.$emit("spinning",!0);let t=U()(this.ALL_FIELDS);for(let e of["version","project_root","require"])delete t[e];await synowebapi.promises.request({api:"SYNO.WebStation.PHP.Profile",method:"add",version:1,params:{profile:t}})}catch(e){let i=1628===e.code?e.errors.error:_T("error","error_error_system");await this.$root.$refs.window.getMsgBox().alert("",i),t=!1}return this.$emit("spinning",!1),t}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-summary","step-key":this.stepKey,finished:this.finished,headline:this._TT("SYNO.SDS.WebStation.Application","wizard","summary_wizrad_title")},on:{activate:this.onActivate}},[e("v-data-table",{ref:"table",attrs:{"syno-id":"webstation-php-data-table",columns:this.columns,"current-data":this.data,"enable-hd-menu":!1,"show-paging-bar":!1,"hide-refresh-btn":!0,"group-table":"","group-info":this.groupInfo,"auto-row-height":""}})],1)}),[],!1,null,null,null),Ut=f({name:"PHPWizard",mixins:[C],components:{"step-php-general":Nt,"step-php-extensions":Wt,"step-php-fpm":Rt,"step-php-core-settings":Bt,"step-php-summary":jt.exports},data:()=>({showStatusBar:!1,statusBarState:"",statusBarErrorText:"",buttonsGroup:{}}),methods:{onEnableNextButton(t,e=!0){this.buttonsGroup={next:{text:e?_T("common","create"):_T("common","next"),disabled:!t}}},async displayError(t){this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,await new Promise(t=>setTimeout(t,5e3)),this.showStatusBar=!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard",{attrs:{"syno-id":"ws-service-wizard","active-step-key":"php-general","custom-buttons-group":t.buttonsGroup,refs:"wizard","show-status-bar":t.showStatusBar,"status-bar-state":t.statusBarState,"status-bar-error-text":t.statusBarErrorText},on:{"step-scroll":function(e){return t.$emit("step-scroll",e)}}},[i("step-php-general",{attrs:{"syno-id":"step-php-general","step-key":"php-general"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-php-extensions",{attrs:{"syno-id":"step-php-extensions","step-key":"php-extensions"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-php-fpm",{attrs:{"syno-id":"step-php-fpm","step-key":"php-fpm"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-php-core-settings",{attrs:{"syno-id":"step-php-core-settings","step-key":"php-core-settings"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-php-summary",{attrs:{"syno-id":"step-php-summary","step-key":"php-summary"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}})],1)}),[],!1,null,null,null),Ft=f({name:"ScriptLanguageWizardWindow",mixins:[l],components:{"php-wizard":Ut.exports,"python-wizard":At},props:{type:String},methods:{onStepScrolled(t){this.$refs.window.onStepScrolled(t)},onSpinning(t){this.$refs.window.onlyMask=!1,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatusBusy()},onLoading(t){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatusBusy()},onClose(){this.$refs.window.close()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-window",{ref:"window",attrs:{"syno-id":"ws-service-wizard-window",title:t._TT("SYNO.SDS.WebStation.Application","script_language","wizard_title"),width:700,height:540,"before-close":function(){}}},["php"===t.type?i("php-wizard",{on:{"step-scroll":t.onStepScrolled,spinning:t.onSpinning,loading:t.onLoading,close:t.onClose}}):i("python-wizard",{on:{"step-scroll":t.onStepScrolled,spinning:t.onSpinning,loading:t.onLoading,close:t.onClose}})],1)}),[],!1,null,null,null).exports,Mt={mixins:[l,C,_],props:{stepKey:String},data(){return{fields:{...this.$store.state.service.general},BuiltInList:{php:{options:[]},python:{options:[]}},builtInbackend:8,builtInScriptLanguageList:U()(this.$store.state.service.builtInScriptLanguageList),DockerPackageList:{[_TT("SYNO.SDS.WebStation.Application","service","script_language")]:{options:[{label:_TT("SYNO.SDS.WebStation.Application","script_language","php"),value:"php"},{label:_TT("SYNO.SDS.WebStation.Application","script_language","python"),value:"python"},{label:_TT("SYNO.SDS.WebStation.Application","script_language","node"),value:"node"}]},[_TT("SYNO.SDS.WebStation.Application","service","service_package")]:{options:[{label:"Wordpress",value:"wordpress"},{label:"MediaWiki",value:"mediawiki"},{label:"Joomla",value:"joomla"},{label:"phpMyAdmin",value:"phpmyadmin"},{label:"Plex",value:"plex"}]}},rules:{profile:[{validator:(t,e,i)=>e?void 0===this.builtInScriptLanguageList[this.fields.script_language].find(t=>e===t.uuid)?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_profile_not_found"))):i():i(new Error(this.JSLIBSTR("extlang","fieldblank")))}],version:[{validator:(t,e,i)=>e?i():!1===this.hasNetwork?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_tip_import_docker_images"))):i(new Error(this.JSLIBSTR("extlang","fieldblank")))}]},dockerVersion:"",DockerVersionList:[],hasDocker:!1,TYPE:D,type:D.STATIC,supportDocker:!0}},computed:{hasBuiltIn(){return Object.values(this.BuiltInList).reduce((t,e)=>[...t,...e.options],[]).length>0},BuiltInProfileList(){var t;return null===(t=this.builtInScriptLanguageList[this.fields.script_language])||void 0===t?void 0:t.filter(t=>t.backend===this.builtInbackend)}},methods:{onBuiltInSelect(t){this.fields.script_language=t.inGroup,this.packageState[this.fields.script_language].backend=t.value},onBuiltInChanged(t){var e;this.fields[this.fields.script_language]=(null===(e=this.BuiltInProfileList[0])||void 0===e?void 0:e.uuid)||null},async onBuiltInProfileChanged(){await this.$nextTick(),this.$refs["profile-form"].validate()},async onDockerPackageChanged(t){var e;let i=Object.values(this.DockerPackageList).reduce((t,e)=>[...t,...e.options],[]).find(e=>e.label===t).value;this.DockerVersionList=await async function(t="php"){const{tags:e}=await J(t);return e}(i),this.dockerVersion=this.DockerVersionList.length>0?null===(e=this.DockerVersionList[0])||void 0===e?void 0:e.value:null},async onDockerVersionChanged(){await this.$nextTick(),this.$refs["version-form"].validate()},async onActivate(){var t,e,i;this.$emit("spinning",!0),this.supportDocker=await SYNO.SDS.WebStation.Util.PackageInfo.IsSupportDocker();let n={php:await it(),python:await nt()};this.$store.commit("service/UPDATE_BUILT_IN_SCRIPT_LANGUAGE_LIST",n);let s=await st();this.$store.commit("service/UPDATE_SCRIPT_LANGUAGE_LIST",s);let a=await K();this.$store.commit("service/UPDATE_PACKAGE_LIST",a),this.fields={...this.$store.state.service.general},this.builtInScriptLanguageList=U()(this.$store.state.service.builtInScriptLanguageList),"not_configured"===this.fields.script_language&&(this.fields.script_language="php"),this.packageState={php:{...this.$store.state.php.general},python:{...this.$store.state.python.general},node:{...this.$store.state.node.general},package:{...this.$store.state.package.general}};let r=(await SYNO.SDS.WebStation.Util.PackageInfo.Get()).backendData;this.BuiltInList={php:{options:[]},python:{options:[]}};for(let t of Object.keys(this.BuiltInList))for(let e of r[t])"enabled"===await SYNO.SDS.WebStation.Util.PackageInfo.GetStatusByPkgID(e.pkgID,!0)&&this.BuiltInList[t].options.push({label:e.name,value:e.id});if(void 0===r[this.fields.script_language].find(t=>t.id===this.builtInbackend))for(let t of Object.keys(this.BuiltInList))if(this.BuiltInList[t].options.length>0){this.fields.script_language=t,this.builtInbackend=this.BuiltInList[t].options[0].value;break}var o;void 0===this.BuiltInProfileList.find(t=>t.uuid===this.fields[this.fields.script_language])&&(this.fields[this.fields.script_language]=(null===(o=this.BuiltInProfileList[0])||void 0===o?void 0:o.uuid)||null);let l=null===(t=await SYNO.SDS.WebStation.Util.PackageInfo.queryPackages("install",!0,t=>"ContainerManager"===t.id))||void 0===t||null===(e=t.ContainerManager)||void 0===e?void 0:e.version.split("-").pop();this.hasDocker="enabled"===await SYNO.SDS.WebStation.Util.PackageInfo.GetStatusByPkgID("ContainerManager",!0)&&l>=1398;let{tags:p,network:c}=await J(this.fields.package);this.DockerVersionList=p,this.hasNetwork=c,this.dockerVersion=this.dockerVersion||(void 0!==this.DockerVersionList&&this.DockerVersionList.length>0?null===(i=this.DockerVersionList[0])||void 0===i?void 0:i.value:null),this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.form.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}if(this.fields._type=this.type,this.fields.use_docker=this.type===D.DOCKERIZED,this.type===D.DOCKERIZED){let t="";["php","python","node"].includes(this.fields.package)?(this.packageState[this.fields.package].version=this.dockerVersion,t=this.fields.package):(t="package",this.packageState.package={version:this.dockerVersion},this.$store.state.package.meta.type="plex"!==this.fields.package?"php":"proxy"),this.$store.commit(t+"/UPDATE_GENERAL",this.packageState[t])}else this.type===D.SCRIPT_LANGUAGE&&this.$store.commit(this.fields.script_language+"/UPDATE_GENERAL",this.packageState[this.fields.script_language]);this.$store.commit("service/UPDATE_GENERAL",this.fields),this.$store.commit("service/UPDATE_BUILT_IN_SCRIPT_LANGUAGE_LIST",this.builtInScriptLanguageList)},openCreateProfileWizard(){this.$refs.select.closeDropdown();let t=Vue.extend({store:R}).extend(Ft);this.$store.state[this.fields.script_language].general.backend=this.packageState[this.fields.script_language].backend;let{window:e}=this.$options.appWin.openModalWindow(t,{type:this.fields.script_language});e.$on("close",()=>{this.$store.commit(this.fields.script_language+"/RESET_ALL"),this.onActivate()})}}},qt=(i(213),f(Mt,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{attrs:{"syno-id":"ws-sw-select-type","pre-enter-next-step":t.preEnterNextStep,"step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","service_wizard","title_service_type"),"next-step-key":"general"},on:{activate:t.onActivate}},[i("v-form",{ref:"form",staticClass:"select-type-form",attrs:{usePerfectScroll:!0,"syno-id":"select-type-form",rules:t.rules}},[i("v-form-item",{attrs:{"hide-label":""}},[i("v-radio",{attrs:{"syno-id":"static-radio",name:"static",value:t.TYPE.STATIC},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","service","static_website_label"))+"\n ")])],1),t._v(" "),i("v-form-item",{attrs:{"hide-label":"",textonly:"",indent:1}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","service","static_website_desc"))+"\n ")]),t._v(" "),i("v-form-item",{attrs:{"hide-label":""},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","service","tip_native_website"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}])},[i("v-radio",{attrs:{disabled:!t.hasBuiltIn,"syno-id":"built-in-radio",name:"builtIn",value:t.TYPE.SCRIPT_LANGUAGE},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","service","native_website_label"))+"\n ")])],1),t._v(" "),i("v-form-item",{attrs:{"hide-label":"",textonly:"",indent:1}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","service","native_website_desc"))+"\n ")]),t._v(" "),i("v-form-multiple-item",{attrs:{indent:1,label:t._TT("SYNO.SDS.WebStation.Application","service","service")+" "+t._T("common","colon")}},[i("v-form-item",{attrs:{prop:"script_language"}},[i("v-single-select",{attrs:{"syno-id":"built-in",name:"script_language",options:this.BuiltInList,width:180,readonly:"",disabled:t.type!==t.TYPE.SCRIPT_LANGUAGE},on:{select:t.onBuiltInSelect,"display-changed":t.onBuiltInChanged},model:{value:t.builtInbackend,callback:function(e){t.builtInbackend=e},expression:"builtInbackend"}})],1),t._v(" "),i("v-form-item",{ref:"profile-form",attrs:{prop:"profile","immediate-validate":""}},[i("v-single-select",{ref:"select",attrs:{"syno-id":"built-in-profile",name:"profile",options:this.BuiltInProfileList,width:230,displayField:"profile_name",valueField:"uuid",readonly:"",hasTooltip:"",disabled:t.type!==t.TYPE.SCRIPT_LANGUAGE},on:{"display-changed":t.onBuiltInProfileChanged},scopedSlots:t._u([{key:"bottom-actions",fn:function(){return[i("v-select-divider-option"),t._v(" "),i("v-select-action-option",{attrs:{display:t._TT("SYNO.SDS.WebStation.Application","service","create_profile")},on:{click:t.openCreateProfileWizard}})]},proxy:!0}]),model:{value:t.fields[t.fields.script_language],callback:function(e){t.$set(t.fields,t.fields.script_language,e)},expression:"fields[fields.script_language]"}})],1)],1),t._v(" "),t.supportDocker?i("div",[i("v-form-item",{attrs:{"hide-label":""},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","service","tip_dockerized_website"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}],null,!1,2039869060)},[i("v-radio",{attrs:{disabled:!t.hasDocker,"syno-id":"docker-radio",name:"docker",value:t.TYPE.DOCKERIZED},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","service","dockerized_website_label"))+"\n ")])],1),t._v(" "),i("v-form-item",{attrs:{"hide-label":"",textonly:"",indent:1}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","service","dockerized_website_desc"))+"\n ")]),t._v(" "),i("v-form-multiple-item",{attrs:{indent:1,label:t._TT("SYNO.SDS.WebStation.Application","service","service")+" "+t._T("common","colon")}},[i("v-form-item",{attrs:{prop:"package"}},[i("v-single-select",{attrs:{"syno-id":"docker",name:"package",options:this.DockerPackageList,width:180,readonly:"",disabled:t.type!==t.TYPE.DOCKERIZED},on:{"display-changed":t.onDockerPackageChanged},model:{value:t.fields.package,callback:function(e){t.$set(t.fields,"package",e)},expression:"fields.package"}})],1),t._v(" "),i("v-form-item",{ref:"version-form",attrs:{prop:"version","immediate-validate":""}},[i("v-single-select",{attrs:{"syno-id":"docker-version",name:"version",options:this.DockerVersionList,width:230,readonly:"",hasTooltip:"",disabled:t.type!==t.TYPE.DOCKERIZED},on:{"display-changed":t.onDockerVersionChanged},model:{value:t.dockerVersion,callback:function(e){t.dockerVersion=e},expression:"dockerVersion"}})],1)],1)],1):t._e()],1)],1)}),[],!1,null,null,null).exports),Gt=f({mixins:[l,_],components:{},props:{stepKey:String,update:Object},data:()=>({update_scope_choice:"service_and_db",next_step_key:""}),methods:{async onActivate(){this.syncUpdatePolicy(),this.$emit("enableNextButton",!0,!1)},onScopeChange(){this.syncUpdatePolicy()},syncUpdatePolicy(){switch(this.update_scope_choice){case"service_and_db":this.update.scope.service=!0,this.update.scope.db=!0,this.next_step_key="step-update-service-configure";break;case"service":this.update.scope.service=!0,this.update.scope.db=!1,this.next_step_key="step-update-service-configure";break;case"db":this.update.scope.service=!1,this.update.scope.db=!0,this.next_step_key="step-update-db-configure"}}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-update-scope",headline:t._TT("SYNO.SDS.WebStation.Application","wizard","select_update_scope"),"step-key":t.stepKey,"next-step-key":t.next_step_key},on:{activate:t.onActivate}},[i("v-form",{attrs:{"syno-id":"ws-step-update-scope-form"}},[i("v-form-item",{attrs:{"syno-id":"ws-step-update-scope-label-desc","hide-label":"",textonly:""}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","wizard","select_update_scope_desc")))]),t._v(" "),i("v-radio-group",{attrs:{"syno-id":"ws-step-update-scope-select"},on:{input:t.onScopeChange},model:{value:t.update_scope_choice,callback:function(e){t.update_scope_choice=e},expression:"update_scope_choice"}},[i("v-radio",{attrs:{"syno-id":"ws-step-update-scope-select1",value:"service_and_db"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","wizard","update_both_service_and_database")))]),t._v(" "),i("v-radio",{attrs:{"syno-id":"ws-step-update-scope-select2",value:"service"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","wizard","update_service_only")))]),t._v(" "),i("v-radio",{attrs:{"syno-id":"ws-step-update-scope-select3",value:"db"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","wizard","update_db_only")))])],1)],1)],1)}),[],!1,null,null,null).exports;const zt={php:"https://hub.docker.com/_/php/tags",node:"https://hub.docker.com/_/node/tags",python:"https://hub.docker.com/_/python/tags",wordpress:"https://hub.docker.com/_/wordpress/tags",mediawiki:"https://hub.docker.com/_/mediawiki/tags",joomla:"https://hub.docker.com/_/joomla/tags",phpmyadmin:"https://hub.docker.com/_/phpmyadmin/tags",plex:"https://hub.docker.com/r/linuxserver/plex/tags"};function Ht(t){let e=[];if(!t)return{available_micro_version:null,update_version_option:e};if(t.major&&t.major.forEach(t=>{e.push({label:t.tag,value:t.version})}),!t.minor)return{available_micro_version:null,update_version_option:e};let i=null;return t.minor.forEach(t=>{i=t.version,e.push({label:t.tag,value:i})}),{available_micro_version:i,update_version_option:e}}class Vt{constructor(t){var e,i;this.info=t,this.api="SYNO.WebStation.ScriptLanguage",this.api_service_key="script",this.check_major_release_note=_TT("SYNO.SDS.WebStation.Application","wizard","check_release_note_with_module_change"),this.backup_note=_TT("SYNO.SDS.WebStation.Application","wizard","setting_backup_note"),this.db_name=null===(e=this.info._docker_project_data.link_settings)||void 0===e||null===(i=e.db_settings)||void 0===i?void 0:i.database}}class Kt{constructor(t){var e;this.info=t,this.api="SYNO.WebStation.Package",this.api_service_key="package",this.check_major_release_note=_TT("SYNO.SDS.WebStation.Application","wizard","check_package_release_note"),this.backup_note=_TT("SYNO.SDS.WebStation.Application","wizard","setting_root_and_db_backup_note"),this.db_name=null===(e=this.info._docker_project_data.db_settings)||void 0===e?void 0:e.database}}class Jt{constructor(t,e){this.info=t,this.docker_service_translator=e,this.display={name_label:_TT("SYNO.SDS.WebStation.Application","common","name"),name_value:this.info._docker_project_data.project_name,type_label:_TT("SYNO.SDS.WebStation.Application","common","service"),type_value:this.info._service_type.text,current_version:this.info._docker_project_data.image_info.service.tag,...Ht(this.info._docker_project_data.upgrade_info.service)}}getNotes(t){let e=t?_TT("SYNO.SDS.WebStation.Application","wizard","check_release_note"):this.docker_service_translator.check_major_release_note;const i=this.info._docker_project_data.type;return e=e.replace("{0}",zt[i]?zt[i]:""),[{text:e,allowAttrs:["href","target"]},{text:this.docker_service_translator.backup_note,allowAttrs:[]}]}}class Zt{constructor(t,e){this.info=t,this.docker_service_translator=e,this.display={name_label:_TT("SYNO.SDS.WebStation.Application","database","database"),name_value:this.docker_service_translator.db_name,type_label:_TT("SYNO.SDS.WebStation.Application","database","type"),type_value:H[this.info._docker_project_data.image_info.db.image],current_version:this.info._docker_project_data.image_info.db.tag,...Ht(this.info._docker_project_data.upgrade_info.db)}}getNotes(t){return[{text:_TT("SYNO.SDS.WebStation.Application","wizard","setting_and_db_backup_note"),allow_attrs:[]}]}}var Qt=f({mixins:[l,_],components:{},props:{stepKey:String,update:Object,step:String},data(){var t,e;let i=this.$store.state.service.template,n=null,s=null;return null!==(t=i._docker_project_data.upgrade_info)&&void 0!==t&&t[this.step]&&(s="script_language"===i._docker_project_data.docker_service_type?new Vt(i):new Kt(i),n="service"===this.step?new Jt(i,s):new Zt(i,s)),{update_scope_choice:"service_and_db",next_step_key:"",info:i,configure:n,docker_service_translator:s,update_version:n?n.display.available_micro_version?n.display.available_micro_version:null===(e=n.display.update_version_option[0])||void 0===e?void 0:e.value:"",finishHandler:void 0}},computed:{notes:function(){return this.configure.getNotes(this.update_version===this.configure.display.available_micro_version)}},methods:{async onActivate(){switch(this.syncConfigure(),this.step){case"db":this.next_step_key=void 0,this.finishHandler=this.onFinish,this.$emit("enableNextButton",!0,!0);break;case"service":this.update.scope.db?(this.next_step_key="step-update-db-configure",this.finishHandler=void 0,this.$emit("enableNextButton",!0,!1)):(this.next_step_key="",this.finishHandler=this.onFinish,this.$emit("enableNextButton",!0,!0));break;default:throw"Unknown step"}},syncConfigure(){this.update.configure[this.step]=""===this.update_version?null:this.update_version},async onFinish(){let t=void 0;try{this.$emit("spinning",!0);let e={id:this.update.configure.id,db:this.update.configure.db};e[this.docker_service_translator.api_service_key]=this.update.configure.service,await synowebapi.promises.request({api:this.docker_service_translator.api,version:1,method:"upgrade",params:e}),this.$options.appWin.$emit("update_success"),this.$emit("close")}catch(e){t=e.code,this.$emit("spinning",!1),this.$emit("error","default",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{attrs:{"syno-id":"ws-step-update-configure",headline:"service"==t.step?t._TT("SYNO.SDS.WebStation.Application","wizard","update_service"):t._TT("SYNO.SDS.WebStation.Application","wizard","update_db"),"step-key":t.stepKey,"next-step-key":t.next_step_key,finished:t.finishHandler},on:{activate:t.onActivate}},[t.configure?i("v-form",{attrs:{"syno-id":"ws-step-update-configure-form"}},[i("v-form-item",{attrs:{"syno-id":"ws-step-update-configure-form-name",label:""+t.configure.display.name_label+t._T("common","colon"),textonly:""}},[t._v(t._s(t.configure.display.name_value))]),t._v(" "),i("v-form-item",{attrs:{"syno-id":"ws-step-update-configure-form-type",label:""+t.configure.display.type_label+t._T("common","colon"),textonly:""}},[t._v(t._s(t.configure.display.type_value))]),t._v(" "),i("v-form-item",{attrs:{"syno-id":"ws-step-update-configure-form-current-version",label:""+t._TT("SYNO.SDS.WebStation.Application","script_language","version_in_use")+t._T("common","colon"),textonly:""}},[t._v("\n\t\t\t"+t._s(t.configure.display.current_version)+"\n\t\t")]),t._v(" "),i("v-form-item",{attrs:{"syno-id":"ws-step-update-configure-form-update-version",label:""+t._TT("SYNO.SDS.WebStation.Application","common","update_version")+t._T("common","colon"),textonly:""}},[i("v-single-select",{attrs:{"syno-id":"single-select",options:t.configure.display.update_version_option,"force-selection":"",editable:"","virtual-scrollbar":"","select-on-focus":"","display-mode":"text"},on:{input:t.syncConfigure},model:{value:t.update_version,callback:function(e){t.update_version=e},expression:"update_version"}})],1),t._v(" "),i("v-form-item",{attrs:{"hide-label":"",textonly:""}},[i("strong",[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","common","note_header")))])]),t._v(" "),t._l(t.notes,(function(t){return i("v-form-item",{key:t,attrs:{"hide-label":"",textonly:""}},[i("v-rich-text",{attrs:{text:"- "+t.text,"allow-attrs":t.allowAttrs}})],1)}))],2):t._e()],1)}),[],!1,null,null,null),Xt=f({mixins:[C,_],components:{"step-update-scope":Gt,"step-update-configure":Qt.exports},data(){let t={scope:{service:!1,db:!1},configure:{id:this.$store.state.service.template._docker_project_data.id,service:null,db:null}};const e=this.$store.state.service.template._docker_project_data.upgrade_info;let i="step-update-scope";return e.db?e.service||(t.scope.db=!0,i="step-update-db-configure"):(t.scope.service=!0,i="step-update-service-configure"),{activeStepKey:i,showStatusBar:!1,statusBarState:"",statusBarErrorText:"",buttonsGroup:{},update:t}},methods:{onEnableNextButton(t,e=!0){this.buttonsGroup={back:{text:_T("common","back")},next:{text:e?_TT("SYNO.SDS.WebStation.Application","common","update"):_T("common","next"),disabled:!t}}},async displayError(t){this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,await new Promise(t=>setTimeout(t,5e3)),this.showStatusBar=!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard",{ref:"wizard",attrs:{"syno-id":"ws-docker-service-update-wizard","active-step-key":t.activeStepKey,"custom-buttons-group":t.buttonsGroup,"show-status-bar":t.showStatusBar,"status-bar-state":t.statusBarState,"status-bar-error-text":t.statusBarErrorText},on:{"step-scroll":function(e){return t.$emit("step-scroll",e)}}},[i("step-update-scope",{attrs:{"syno-id":"step-update-scope","step-key":"step-update-scope",update:t.update},on:{"update:update":function(e){t.update=e},spinning:function(e){return t.$emit("spinning",e)},enableNextButton:t.onEnableNextButton}}),t._v(" "),i("step-update-configure",{attrs:{"syno-id":"step-update-service-configure","step-key":"step-update-service-configure",step:"service",update:t.update},on:{"update:update":function(e){t.update=e},spinning:function(e){return t.$emit("spinning",e)},error:t.onError,"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-update-configure",{attrs:{"syno-id":"step-update-db-configure","step-key":"step-update-db-configure",step:"db",update:t.update},on:{"update:update":function(e){t.update=e},spinning:function(e){return t.$emit("spinning",e)},error:t.onError,"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}})],1)}),[],!1,null,null,null),te=f({mixins:[l],components:{"docker-service-update-wizard":Xt.exports},methods:{onStepScrolled(t){this.$refs.window.onStepScrolled(t)},onSpinning(t){this.$refs.window.onlyMask=!1,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatusBusy()},onLoading(t){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatusBusy()},onClose(){this.$refs.window.close()}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-window",{ref:"window",attrs:{"syno-id":"ws-docker-service-update-wizard-window",title:this._TT("SYNO.SDS.WebStation.Application","common","update"),width:600,height:480,"before-close":function(){}}},[e("docker-service-update-wizard",{on:{"step-scroll":this.onStepScrolled,spinning:this.onSpinning,loading:this.onLoading,close:this.onClose}})],1)}),[],!1,null,null,null).exports;function ee(t){if(!t._docker_project_data||!t._docker_project_data.backup_info)return null;const e=t._docker_project_data.backup_info;let i="",n="-";var s,a,r;"script_language"===e.target_type?null!==(s=e.conf)&&void 0!==s&&null!==(a=s.link_settings)&&void 0!==a&&a.db_settings&&(i=e.conf.link_settings.db_settings.type,n=e.conf.link_settings.db_settings.version):null!==(r=e.conf)&&void 0!==r&&r.db_settings&&(i=e.conf.db_settings.type,n=e.conf.db_settings.version);return"-"!==n&&(n=H[i]+" "+n.split("@")[0]),{service_version:t._service_type.text+" "+e.conf.version.split("@")[0],database_version:n,last_backup_time:SYNO.SDS.DateTimeFormatter(new Date(1e3*e.create_time),{type:"datetimesec"})}}var ie=f({name:"ServiceBackupView",mixins:[l,C,_],props:{},data(){const t=this.$store.state.service.template;return{meta:t,display_data:ee(t)}},methods:{async onRestore(){let t=this.$options.appWin;if("confirm"!==await t.getMsgBox().confirm(null,_TT("SYNO.SDS.WebStation.Application","service","confirm_restore_backup"),{confirm:{text:_T("backup","restore")}}))return;t.setStatusBusy();const e="script_language"===this.meta._docker_project_data.docker_service_type?"SYNO.WebStation.ScriptLanguage":"SYNO.WebStation.Package";await synowebapi.promises.request({api:e,method:"restore",version:1,params:{id:this.meta._docker_project_data.id}}),this.display_data=null,t.clearStatus(),this.$emit("restore")},async onExport(){await synowebapi.promises.download({api:"SYNO.WebStation.Backup",method:"export",version:1,params:{id:this.meta._docker_project_data.backup_info.id}})},async onRemove(){let t=this.$options.appWin;"confirm"===await t.getMsgBox().confirmDelete(null,_TT("SYNO.SDS.WebStation.Application","service","confirm_delete_backup")+'<div style="height: 6px;"></div>'+_TT("SYNO.SDS.WebStation.Application","service","confirm_delete_backup_question"),void 0,{useHtml:!0})&&(t.setStatusBusy(),await synowebapi.promises.request({api:"SYNO.WebStation.Backup",method:"remove",version:1,params:{id:this.meta._docker_project_data.backup_info.id}}),this.display_data=null,this.$emit("remove"),t.clearStatus())}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.display_data?i("v-fieldset",{attrs:{"syno-id":"ws-service-backup-view-fieldset",title:t._TT("SYNO.SDS.WebStation.Application","service","backup_record_title")}},[i("v-form",{attrs:{"syno-id":"ws-service-backup-view-form"}},[i("v-form-item",{attrs:{"syno-id":"ws-service-backup-view-service-version",label:""+t._TT("SYNO.SDS.WebStation.Application","service","service_version")+t._T("common","colon"),textonly:""}},[t._v("\n "+t._s(t.display_data.service_version)+"\n ")]),t._v(" "),i("v-form-item",{attrs:{"syno-id":"ws-service-backup-view-data-version",label:""+t._TT("SYNO.SDS.WebStation.Application","service","database_version")+t._T("common","colon"),textonly:""}},[t._v("\n "+t._s(t.display_data.database_version)+"\n ")]),t._v(" "),i("v-form-item",{attrs:{"syno-id":"ws-service-backup-view-backup-time",label:""+t._TT("SYNO.SDS.WebStation.Application","service","last_backup_time")+t._T("common","colon"),textonly:""}},[t._v("\n "+t._s(t.display_data.last_backup_time)+"\n ")]),t._v(" "),i("div",[i("v-button",{attrs:{"syno-id":"ws-service-backup-view-button-restore"},on:{click:t.onRestore}},[t._v("\n "+t._s(t._T("backup","restore"))+"\n ")]),t._v(" "),i("v-button",{attrs:{"syno-id":"ws-service-backup-view-button-export"},on:{click:t.onExport}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","actions","export"))+"\n ")]),t._v(" "),i("v-button",{attrs:{"syno-id":"ws-service-backup-view-button-remove",suffix:"red"},on:{click:t.onRemove}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","common","btn_delete"))+"\n ")])],1)],1)],1):t._e()}),[],!1,null,null,null).exports;let ne=Vue.extend({store:R}).extend(te);var se={name:"General",mixins:[l,C,_],components:{ServiceBackupView:ie},props:{editor:{type:Boolean,default:!1},packageType:{type:String,default:"php"}},data(){let t={};["desc","root","wsgi_file","callable","project_port","command"].forEach(e=>t[e]={required:!0,message:this.JSLIBSTR("extlang","fieldblank")});const e=(t,e,i)=>(""===e&&i(new Error(this.JSLIBSTR("extlang","fieldblank"))),e<=0?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_timeout"))):i());return{fields:{...this.$store.state.service.general},meta:this.$store.state.service.template,script:{...this.$store.state[this.packageType].general},rules:{name:[{type:"pattern",pattern:/^[a-z0-9][a-z0-9_-]*$/,required:!0,message:_TT("SYNO.SDS.WebStation.Application","error","err_no_upper_case")}],backend:[{validator:(t,e,i)=>void 0===this.serverList.find(t=>e===t.backend_id)?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_http_backend_not_found"))):i()}],profile:[{validator:(t,e,i)=>void 0===this.builtInScriptLanguageOptionList.find(t=>e===t.uuid)?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_profile_not_found"))):i()}],connect_timeout:[{validator:e}],send_timeout:[{validator:e}],read_timeout:[{validator:e}],...t},serverList:[],builtInScriptLanguageOptionList:[],isDockerServiceUpdateWizardOpened:!1}},computed:{showScriptLanguage(){return this.isStatic&&this.fields._type!==D.DOCKERIZED},nameNotEditable(){return this.editor&&this.fields._type===D.DOCKERIZED},isStatic(){return this.fields._type===D.STATIC},usePython(){return this.fields._type===D.SCRIPT_LANGUAGE&&"python"===this.fields.script_language||this.isDockerized&&"python"===this.fields.package},useNode(){return this.isDockerized&&"node"===this.fields.package},onlyNginx(){return this.useNode||"proxy"===this.$store.state.package.meta.type},isDockerized(){return this.fields._type===D.DOCKERIZED},is3rdpartPackage(){return"package"===this.packageType},serverOptions(){return this.serverList.forEach(t=>{t.disabled=this.editor}),this.onlyNginx?this.serverList.filter(t=>0===t.backend_id):this.serverList}},mounted(){this.$wizardWindow=this.$root.$refs.window},methods:{async preload(){this.fields={...this.$store.state.service.general},this.script={...this.$store.state[this.packageType].general},this.serverList=await V(),this.serverList.length>0?this.fields.backend=this.$store.state.service.general.backend||this.serverList[0].backend_id:this.$refs.http_backend.setInvalid(this._TT("SYNO.SDS.WebStation.Application","error","err_http_backend_not_found")),this.fields._type===D.SCRIPT_LANGUAGE&&(this.builtInScriptLanguageOptionList=U()(this.$store.state.service.builtInScriptLanguageList[this.fields.script_language]),this.fields[this.fields.script_language]=this.$store.state.service.general[this.fields.script_language]||(this.builtInScriptLanguageOptionList.length>0?this.builtInScriptLanguageOptionList[0].uuid:null)),this.$store.commit("service/UPDATE_SERVER_LIST",this.serverList),await this.$nextTick(),this.$refs.form.commit()},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},reset(){this.$store.commit("service/RESET_ALL")},commit(){this.fields._type!==D.STATIC&&(this.script.project_root=this.fields.root,this.$store.commit(this.packageType+"/UPDATE_GENERAL",this.script)),this.$store.commit("service/UPDATE_GENERAL",this.fields)},openFileChooser(t="folder"){this.$wizardWindow._S=window._S;let e="folder"===t,i=new SYNO.SDS.Utils.FileChooser.Chooser({owner:this.$wizardWindow,superuser:!0,needrw:!1,usage:{type:e?"chooseDir":"chooseFile",folder_path:"file"===t?"/"+this.fields.root:null},title:_TT("SYNO.SDS.WebStation.Application","vhost",e?"select_folder":"select_file"),folderToolbar:e,enumCluster:!1,enumC2Share:!0,listeners:{choose:(t,i,n)=>{var s=i.path;s&&(s=s.replace(/^\/+/,""))&&(e?this.fields.root=s:this.fields.wsgi_file=s.replace(this.fields.root,"").substring(1),this.$refs.rootdoc.resetInvalid(),t.close())}},treeFilter:function(t,e){if(e){if("remote"===e.mountType)return!1;let t=["/web_packages","/home","/homes"],i=e.spath;for(let e=0;e<t.length;e++)if(!(i.length<t[e]||i.substr(0,t[e].length)!==t[e]||i.length!==t[e].length&&"/"!==i[t[e].length]))return!1}return!0}});this.$wizardWindow.openExtWindow(i)},openCreateProfileWizard(){this.$refs.select.closeDropdown();let t=Vue.extend({store:R}).extend(Ft),{window:e}=this.$options.appWin.openModalWindow(t,{type:this.fields.script_language});e.$on("close",async()=>{this.$store.commit(this.fields.script_language+"/RESET_ALL"),this.builtInScriptLanguageList={php:await it(),python:await nt()},this.$store.commit("service/UPDATE_BUILT_IN_SCRIPT_LANGUAGE_LIST",this.builtInScriptLanguageList),await this.preload()})},onOpenUpdateDockerProject(){if(this.meta._docker_project_data&&!this.isDockerServiceUpdateWizardOpened){this.isDockerServiceUpdateWizardOpened=!0;let{window:t}=this.$options.appWin.openModalWindow(ne);this.isDockerServiceUpdateWizardOpened=!1;let e=!1;t.$on("update_success",async()=>{e=!0}),t.$on("close",async()=>{e&&this.$options.appWin.doClose()})}},onBackupRestore(){this.backup_info=null,this.$options.appWin.doClose()},onBackupRemove(){this.backup_info=null}}},ae=(i(214),f(se,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"ws-service-general"},[i("v-scrollbar",[i("v-form",{ref:"form",staticClass:"ws-vhost-backend-form",attrs:{usePerfectScroll:!0,"syno-id":"general-form",rules:t.rules}},[i("div",{staticClass:"general-backend"},[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","service","name")+" "+t._T("common","colon"),prop:"name",textonly:t.nameNotEditable,"disable-validation":t.nameNotEditable}},[t.nameNotEditable?[t._v(" "+t._s(t.fields.display_name)+" ")]:i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"general-name",name:"name"},model:{value:t.fields.display_name,callback:function(e){t.$set(t.fields,"display_name",e)},expression:"fields.display_name"}})],2),t._v(" "),t.editor?i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","common","status")+" "+t._T("common","colon"),textonly:""}},[[i("span",{class:t.meta._status.class},[t._v(t._s(t.meta._status.message))]),t.meta._docker_project_data&&t.meta._docker_project_data.upgrade_info?i("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.meta._docker_project_data.upgrade_info.tip_content,placement:"bottom",isHtml:!0},expression:"{\n content: meta._docker_project_data.upgrade_info.tip_content,\n placement: 'bottom',\n isHtml: true,\n }"}]},[t._v("\n ("),i("span",{staticClass:"syno-webstation-loading-status",on:{click:function(e){return t.onOpenUpdateDockerProject()}}},[t._v(" "+t._s(t._TT("SYNO.SDS.WebStation.Application","service","upgrade_available"))+" ")]),t._v(")\n ")]):t._e()]],2):t._e(),t._v(" "),t.editor&&!t.isStatic?i("div",[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","service","service")+" "+t._T("common","colon"),textonly:""}},[[t._v(" "+t._s(t.meta._service_type.text)+" ")]],2),t._v(" "),t.isDockerized?i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","service","version")+" "+t._T("common","colon"),textonly:""}},[t._v("\n "+t._s(t.meta._docker_project_data.image_info.service.tag)+"\n\n ")]):i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","service","profile")+" "+t._T("common","colon"),prop:"profile"},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application",t.fields.script_language,"no_php_profile_available"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}],null,!1,279123472)},[i("v-single-select",{ref:"select",attrs:{"syno-id":"script_language",width:220,name:"profile",displayField:"full_name",valueField:"uuid",options:t.builtInScriptLanguageOptionList,readonly:"",hasTooltip:"",nullValue:""},scopedSlots:t._u([{key:"bottom-actions",fn:function(){return[i("v-select-divider-option"),t._v(" "),i("v-select-action-option",{attrs:{display:t._TT("SYNO.SDS.WebStation.Application","service","create_profile")},on:{click:t.openCreateProfileWizard}})]},proxy:!0}],null,!1,2426936212),model:{value:t.fields[t.fields.script_language],callback:function(e){t.$set(t.fields,t.fields.script_language,e)},expression:"fields[fields.script_language]"}})],1)],1):t._e(),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","service","description")+" "+t._T("common","colon"),prop:"desc"}},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"general-desc",name:"desc"},model:{value:t.fields.description,callback:function(e){t.$set(t.fields,"description",e)},expression:"fields.description"}})],1),t._v(" "),i("v-form-multiple-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","docroot")+t._T("common","colon")}},[i("v-form-item",{ref:"rootdoc",attrs:{prop:"root"}},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"general-rootdoc",name:"root"},model:{value:t.fields.root,callback:function(e){t.$set(t.fields,"root",e)},expression:"fields.root"}})],1),t._v(" "),i("v-button",{attrs:{"syno-id":"filechooser"},on:{click:function(e){return t.openFileChooser("folder")}}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","vhost","choose_dir")))])],1),t._v(" "),i("v-form-item",{ref:"http_backend",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","http_backend")+t._T("common","colon"),prop:"backend","disable-validation":t.onlyNginx}},[i("v-single-select",{attrs:{"syno-id":"backend",width:220,name:"backend",displayField:"backend_name",valueField:"backend_id",options:t.serverOptions,readonly:""},model:{value:t.fields.backend,callback:function(e){t.$set(t.fields,"backend",e)},expression:"fields.backend"}})],1)],1),t._v(" "),i("div",{staticClass:"general-script"},[t.usePython?i("div",[i("v-form-multiple-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","python","wsgi_file")+t._T("common","colon")}},[i("v-form-item",{ref:"wsgi_file",attrs:{prop:"wsgi_file"}},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"wsgi_file",name:"wsgi_file",disabled:!t.usePython||!t.fields.root},model:{value:t.fields.wsgi_file,callback:function(e){t.$set(t.fields,"wsgi_file",e)},expression:"fields.wsgi_file"}})],1),t._v(" "),i("v-button",{attrs:{"syno-id":"wsgi_filechooser",disabled:!t.usePython||!t.fields.root},on:{click:function(e){return t.openFileChooser("file")}}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","vhost","choose_dir")))])],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","python","callable")+t._T("common","colon"),prop:"callable"},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","python","callable_tip"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}],null,!1,551160263)},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"callable",name:"callable",disabled:!t.usePython},model:{value:t.fields.callable,callback:function(e){t.$set(t.fields,"callable",e)},expression:"fields.callable"}})],1)],1):t._e(),t._v(" "),t.useNode?i("div",[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","script_language","node_project_port")+" "+t._T("common","colon"),prop:"project_port"}},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"project_port",name:"project_port",placeholder:"3000"},model:{value:t.script.script_settings.project_port,callback:function(e){t.$set(t.script.script_settings,"project_port",e)},expression:"script.script_settings.project_port"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","script_language","node_command")+" "+t._T("common","colon"),prop:"command"}},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"command",name:"command",placeholder:"npm start"},model:{value:t.script.script_settings.command,callback:function(e){t.$set(t.script.script_settings,"command",e)},expression:"script.script_settings.command"}})],1)],1):t._e()]),t._v(" "),t.isStatic?t._e():i("div",{staticClass:"general-timeout"},[i("v-form-item",{attrs:{"hide-label":"",textonly:""}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","vhost","timeout_desc"))+"\n ")]),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","connect_timeout")+t._T("common","colon"),prop:"connect_timeout"}},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"connection-timeout",name:"connect_timeout","number-only":!0},model:{value:t.fields.connect_timeout,callback:function(e){t.$set(t.fields,"connect_timeout",e)},expression:"fields.connect_timeout"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","send_timeout")+t._T("common","colon"),prop:"send_timeout"}},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"send-timeout",name:"send_timeout","number-only":!0},model:{value:t.fields.send_timeout,callback:function(e){t.$set(t.fields,"send_timeout",e)},expression:"fields.send_timeout"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","read_timeout")+t._T("common","colon"),prop:"read_timeout"}},[i("v-input",{staticClass:"service-package-general-input",attrs:{"syno-id":"read-timeout",name:"read_timeout","number-only":!0},model:{value:t.fields.read_timeout,callback:function(e){t.$set(t.fields,"read_timeout",e)},expression:"fields.read_timeout"}})],1)],1)]),t._v(" "),t.meta._docker_project_data&&t.meta._docker_project_data.backup_info?i("ServiceBackupView",{on:{spinning:function(e){return t.$emit("spinning",e)},restore:t.onBackupRestore,remove:t.onBackupRemove}}):t._e(),t._v(" "),t.is3rdpartPackage&&!t.editor?i("div",{staticClass:"note-wrapper"},[i("span",{staticClass:"note"},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","common","note_header"))+"\n ")]),t._v(" "),i("v-rich-text",{attrs:{text:t._TT("SYNO.SDS.WebStation.Application","service","3rdparty_root_note")}})],1):t._e()],1)],1)}),[],!1,null,null,null).exports),re=f({name:"StepGeneral",mixins:[l],components:{general:ae},props:{stepKey:String},data:()=>({nextStepKey:"summary",packageType:"php"}),methods:{async onActivate(){this.$emit("spinning",!0);let t=this.$store.state.service.general;if(t.use_docker)switch(this.packageType=t.package,t.package){case"php":this.nextStepKey="php-extensions";break;case"python":this.nextStepKey="python-uwsgi";break;case"node":this.nextStepKey="node-general";break;default:this.nextStepKey="plex"===t.package?"plex-settings":"database",this.packageType="package"}else this.nextStepKey="summary",this.packageType=this.$store.state.service.script_language;await this.$nextTick(),await this.$refs.general.preload(),this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.general.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.general.commit()}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-sw-general","pre-enter-next-step":this.preEnterNextStep,"step-key":this.stepKey,headline:this._TT("SYNO.SDS.WebStation.Application","service","general_title"),"next-step-key":this.nextStepKey},on:{activate:this.onActivate}},[e("general",{ref:"general",attrs:{"package-type":this.packageType},on:{"display-error":this.onError}})],1)}),[],!1,null,null,null).exports,oe=f({mixins:[l],props:{stepKey:String},data:()=>({data:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","service","item"),field:"item",defaultWidth:130,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","service","value"),field:"value",defaultWidth:212,disableSort:!0}]}),computed:{...Object(m.c)("service",["general"]),...Object(m.b)("service",["ALL_FIELDS"])},methods:{async onActivate(){this.$emit("spinning",!0),this.data=[];let t=this.general._type===D.STATIC?_TT("SYNO.SDS.WebStation.Application","service","static_website"):_TT("SYNO.SDS.WebStation.Application","service","native_website");if(this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service_type"),value:t}),this.general._type===D.SCRIPT_LANGUAGE){let t=this.general.script_language;this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service"),value:await SYNO.SDS.WebStation.Util.PackageInfo.GetPackageNameByIndex(t,this.$store.state[t].general.backend)});let e=this.$store.state.service.builtInScriptLanguageList;this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","profile"),value:e[t].find(e=>e.uuid===this.general[t]).profile_name})}if(this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","name"),value:this.general.display_name}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","description"),value:this.general.description}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","docroot"),value:this.general.root}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","http_backend"),value:this.$store.state.service.serverList.find(t=>t.backend_id==this.general.backend).backend_name}),this.general._type!==D.STATIC)for(let t of["connect_timeout","send_timeout","read_timeout"])this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost",t),value:this.general[t]});this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!0)},async finished(){if(!await this.apiSetService())return!1;this.$emit("close")},async apiSetService(){let t;try{this.$emit("spinning",!0);await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",version:1,method:"create",params:{service:G(this.general._type,this.ALL_FIELDS,{forceAcl:this.$store.state.service.forceAcl})}})}catch(e){if(t=e.code,this.$emit("spinning",!1),1022===t){if("confirm"===await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t))){this.$store.commit("service/UPDATE_FORCE_ACL",!0),await this.apiSetService()&&(t=void 0)}}else this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-summary","step-key":this.stepKey,finished:this.finished,headline:this._TT("SYNO.SDS.WebStation.Application","wizard","summary_wizrad_title")},on:{activate:this.onActivate}},[e("v-data-table",{ref:"table",attrs:{"syno-id":"webstation-data-table",columns:this.columns,"current-data":this.data,"enable-hd-menu":!1,"show-paging-bar":!1,"hide-refresh-btn":!0}})],1)}),[],!1,null,null,null).exports,le={name:"Database",mixins:[l,C],props:{editor:{type:Boolean,default:!1}},data(){const t=(t,e,i)=>!this.isTypeNone&&(null===e||e.length<=0)?i(new Error(this.JSLIBSTR("extlang","fieldblank"))):i();return{fields:U()(this.$store.state.service.database),databaseList:[],rules:{version:[{validator:t}],database:[{validator:(t,e,i)=>!this.isTypeNone&&(null===e||e.length<=0)?i(new Error(this.JSLIBSTR("extlang","fieldblank"))):!1===/^[a-zA-Z0-9]+$/.test(e)?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_only_allow_word"))):i()}],db_user:[{validator:(t,e,i)=>!this.isTypeNone&&(null===e||e.length<=0)?i(new Error(this.JSLIBSTR("extlang","fieldblank"))):!1===/^[a-zA-Z0-9]+$/.test(e)||"root"===e?i(new Error(_TT("SYNO.SDS.WebStation.Application","error","err_db_user_only_allow_word"))):i()}],db_password:[{validator:t}]},displayType:"",displayVersion:""}},computed:{isTypeNone(){return"none"===this.fields.db_settings.type},versionList(){return this.isTypeNone||0===this.databaseList.length?[{label:"None",value:null}]:this.databaseList.find(t=>t.value===this.fields.db_settings.type).versions.map(t=>({label:t.tag,value:t.version}))}},methods:{async preload(){this.fields=U()(this.$store.state.service.database);let t=!["php","python","node"].includes(this.$store.state.service.general.package);if(this.databaseList=await async function(t=!1){var e,i;const n=await SYNO.SDS.WebStation.Util.PackageInfo.GetDockerImageLatest();let s=null==n||null===(e=n.tags)||void 0===e||null===(i=e.mariadb)||void 0===i?void 0:i.map(t=>({version:t.version,tag:t.tag,hash:t.hash})),a={databases:[{name:H.mariadb,value:"mariadb",version:s}]};if(!t){var r,o;let t=null==n||null===(r=n.tags)||void 0===r||null===(o=r.postgres)||void 0===o?void 0:o.map(t=>({version:t.version,tag:t.tag,hash:t.hash}));a.databases.push({name:H.postgres,value:"postgres",version:t}),a.databases.push({name:"None",value:"none",version:[null]})}return a.databases.map(t=>({label:t.name,value:t.value,versions:t.version}))}(t),t&&"none"==this.fields.db_settings.type&&(this.fields.db_settings.type="mariadb"),this.editor){let t=this.databaseList.find(t=>t.value===this.fields.db_settings.type);this.displayType=t.label||"None",this.displayVersion=this.fields.db_settings.version?this.fields.db_settings.version.split("@")[0]:"None"}},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){this.$store.commit("service/UPDATE_DATABASE",this.fields),this.isTypeNone&&this.$store.commit("service/RESET_DATABASE")},onSelectTypeChanged(t){var e;t==this.$store.state.service.database.db_settings.type?this.fields.db_settings.version=this.$store.state.service.database.db_settings.version:this.fields.db_settings.version=(null===(e=this.versionList[0])||void 0===e?void 0:e.value)||null}}},pe=(i(215),f(le,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-form",{ref:"form",attrs:{"syno-id":"network-form",rules:t.rules}},[i("v-form-item",{ref:"type",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","database","type")+" "+t._T("common","colon"),prop:"type",textonly:t.editor,"disable-validation":t.editor}},[t.editor?[t._v(" "+t._s(t.displayType)+" ")]:i("v-single-select",{attrs:{"syno-id":"type-select",width:220,name:"type",options:t.databaseList,readonly:""},on:{"display-changed":t.onSelectTypeChanged},model:{value:t.fields.db_settings.type,callback:function(e){t.$set(t.fields.db_settings,"type",e)},expression:"fields.db_settings.type"}})],2),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","service","version")+" "+t._T("common","colon"),prop:"version",textonly:t.editor,"disable-validation":t.editor}},[t.editor?[t._v(" "+t._s(t.displayVersion)+" ")]:i("v-single-select",{attrs:{"syno-id":"version-select",width:220,name:"version",disabled:t.isTypeNone,options:t.versionList,readonly:""},model:{value:t.fields.db_settings.version,callback:function(e){t.$set(t.fields.db_settings,"version",e)},expression:"fields.db_settings.version"}})],2),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","database","database")+" "+t._T("common","colon"),prop:"database",textonly:t.editor,"disable-validation":t.editor}},[t.editor?[t._v(" "+t._s(t.fields.db_settings.database)+" ")]:i("v-input",{staticClass:"database-input",attrs:{"syno-id":"database-input",name:"database",disabled:t.isTypeNone,placeholder:"db"},model:{value:t.fields.db_settings.database,callback:function(e){t.$set(t.fields.db_settings,"database",e)},expression:"fields.db_settings.database"}})],2),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","database","db_user")+" "+t._T("common","colon"),prop:"db_user",textonly:t.editor,"disable-validation":t.editor}},[t.editor?[t._v(" "+t._s(t.fields.db_settings.db_user)+" ")]:i("v-input",{staticClass:"database-input",attrs:{"syno-id":"db_user-input",name:"db_user",disabled:t.isTypeNone,placeholder:"user"},model:{value:t.fields.db_settings.db_user,callback:function(e){t.$set(t.fields.db_settings,"db_user",e)},expression:"fields.db_settings.db_user"}})],2),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","database","db_password")+" "+t._T("common","colon"),prop:"db_password"}},[i("v-input",{staticClass:"database-input",attrs:{"syno-id":"db_password-input",name:"db_password",type:"password",disabled:t.isTypeNone,readonly:t.editor},model:{value:t.fields.db_settings.db_password,callback:function(e){t.$set(t.fields.db_settings,"db_password",e)},expression:"fields.db_settings.db_password"}})],1),t._v(" "),i("div",{staticClass:"note-wrapper"},[i("span",{staticClass:"note"},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","common","note_header"))+"\n ")]),t._v(" "),i("v-rich-text",{attrs:{text:t._TT("SYNO.SDS.WebStation.Application","database","note")}})],1)],1)],1)}),[],!1,null,"026ac0da",null).exports),ce=f({name:"StepDatabase",mixins:[l],components:{database:pe},props:{stepKey:String},data:()=>({nextStepKey:"php-summary"}),methods:{async onActivate(){this.$emit("spinning",!0);let t=this.$store.state.service.general;["php","python","node"].includes(t.package)?this.nextStepKey=t.package+"-summary":this.nextStepKey="package-summary",await this.$nextTick(),await this.$refs.database.preload(),this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.database.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.database.commit()}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-sw-database","pre-enter-next-step":this.preEnterNextStep,"step-key":this.stepKey,headline:this._TT("SYNO.SDS.WebStation.Application","database","database_title"),"next-step-key":this.nextStepKey},on:{activate:this.onActivate}},[e("database",{ref:"database",on:{"display-error":this.onError}})],1)}),[],!1,null,null,null).exports,de=f({name:"vIconFolder",props:{width:{type:[Number,String],default:64},height:{type:[Number,String],default:64}}},(function(t,e){var i=e._c;return i("svg",{attrs:{viewBox:"0 0 64 64",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor",width:e.props.width,height:e.props.height}},[i("title",[e._v("64/folder")]),i("g",{attrs:{id:"7d28b9db6ec4c898ba266a77f150ec69__2021Q1-7.0-file-station-icon",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"}},[i("g",{attrs:{id:"7d28b9db6ec4c898ba266a77f150ec69__64/folder"}},[i("path",{attrs:{d:"M8,8 L27.7567169,8 C28.5527464,8 29.3161405,8.31637167 29.8788125,8.87945524 L35,14.0043882 L35,14.0043882 L56.0000001,14.0005485 C57.6568542,13.9996971 59.0002455,15.3425973 59.0005484,16.9994515 C59.0005485,16.9996343 59.0005485,16.9998172 59,17 L59,47 C59,48.6568542 57.6568542,50 56,50 L8,50 C6.34314575,50 5,48.6568542 5,47 L5,11 C5,9.34314575 6.34314575,8 8,8 Z",id:"7d28b9db6ec4c898ba266a77f150ec69__Rectangle",fill:"#FCBC30"}}),i("rect",{attrs:{id:"7d28b9db6ec4c898ba266a77f150ec69__Rectangle",fill:"#FFD359",x:"5",y:"21",width:"54",height:"35",rx:"3"}})])])])}),[],!0,null,null,null).exports;Vue.prototype.$iconManager.register("webstation-folder",de);var ue={name:"PlexSettings",mixins:[l],props:{stepKey:String},data:()=>({data:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","3rdparty","selected_folder"),field:"folder"}]}),computed:{isEmpty(){return 0===this.data.length}},mounted(){this.$wizardWindow=this.$root.$refs.window},methods:{async preload(){this.data=this.$store.state.package.plex.volumes.map(t=>({folder:t})),await this.$nextTick(),this.$refs.table.commit()},validate:()=>!0,isDirty(){return this.$refs.table.isDirty()},commit(){let t=this.data.map(t=>t.folder);this.$store.commit("package/UPDATE_PLEX",{volumes:t})},openFileChooser(){const t=new SYNO.SDS.Utils.FileChooser.Chooser({owner:this.$wizardWindow,title:_TT("SYNO.SDS.WebStation.Application","vhost","select_folder"),folderToolbar:!0,enumCluster:!1,enumC2Share:!0,usage:{type:"chooseDir",folder_path:null},treeFilter:(t,e)=>{if(e){return void 0===this.data.map(t=>t.folder).concat(["/home","/homes"]).find(t=>e.spath===t)}return!0},listeners:{scope:this,choose:(t,e,i)=>{this.onAddVolumeBinding(e.path),t.close()}}});return t.open(),t},onAddVolumeBinding(t=""){this.data=this.data.filter(e=>!0!==e.folder.startsWith(t)||"/"!==e.folder.charAt(t.length)),this.data.push({folder:t})},onRemove(){this.data=this.data.filter((t,e)=>-1==this.selectedRows.indexes.indexOf(e))}}},fe=(i(216),f(ue,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-form",{ref:"form",staticClass:"plex-settings",attrs:{"syno-id":"plex-general-form",flex:"row"}},[i("v-form-item",{attrs:{"hide-label":"",textonly:""}},[i("v-rich-text",{attrs:{text:t._TT("SYNO.SDS.WebStation.Application","3rdparty","plex_settings_desc")}})],1),t._v(" "),i("v-toolbar",[i("v-button",{attrs:{"syno-id":"plex-add-folder-btn"},on:{click:function(){return t.openFileChooser()}}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","3rdparty","add_folder"))+"\n ")]),t._v(" "),i("v-button",{attrs:{"syno-id":"plex-remove-btn",disabled:t.isEmpty},on:{click:t.onRemove}},[t._v("\n "+t._s(t._T("common","remove"))+"\n ")])],1),t._v(" "),i("v-data-table",{ref:"table",staticClass:"plex-settings__data-table",attrs:{"syno-id":"webstation-plex-data-table",columns:t.columns,"current-data":t.data,"enable-hd-menu":!1,"hide-refresh-btn":""},on:{"selected-change":function(e){t.selectedRows=e},dataloaded:function(e){t.selectedRows=[]},rowclick:t.onRowClick},scopedSlots:t._u([{key:"folder",fn:function(e){var n=e.data;return[i("div",{staticClass:"plex-settings_folder-wrapper"},[i("v-icon",{staticClass:"icon small",attrs:{name:"webstation-folder",component:t.FolderSVG,type:"svg"}}),t._v(" "),i("div",{staticClass:"folder-text"},[t._v(t._s(n))])],1)]}},{key:"empty-area",fn:function(){return[i("div",{staticClass:"empty-desc"},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","3rdparty","no_items")))])]},proxy:!0}])})],1)}),[],!1,null,null,null).exports);Vue.prototype.$iconManager.register("webstation-folder",de);var he=f({name:"StepPlexSettings",mixins:[l],props:{stepKey:String},components:{"plex-settings":fe},data:()=>({nextStepKey:"package-summary"}),methods:{async onActivate(){this.$emit("spinning",!0),await this.$refs.plex.preload(),this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.plex.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.plex.commit()}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-sw-plex-settings","pre-enter-next-step":this.preEnterNextStep,"step-key":this.stepKey,headline:this._TT("SYNO.SDS.WebStation.Application","3rdparty","plex_title"),"next-step-key":this.nextStepKey},on:{activate:this.onActivate}},[e("plex-settings",{ref:"plex",on:{"display-error":this.onError}})],1)}),[],!1,null,null,null).exports,_e=f({mixins:[l],props:{nextStepkey:String,stepKey:String},data:()=>({data:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","service","item"),field:"item",width:260,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","service","value"),field:"value",width:414,disableSort:!0}],groupInfo:{category:"group"}}),computed:{...Object(m.c)("package",["general","plex"]),...Object(m.c)("service",{service:t=>t.general,database:t=>t.database}),...Object(m.b)({PACKAGE_FIELDS:"package/ALL_FIELDS",SERVICE_FIELDS:"service/ALL_FIELDS"})},methods:{async onActivate(){this.$emit("spinning",!0),this.data=[],this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service_type"),value:_TT("SYNO.SDS.WebStation.Application","service","dockerized_website"),group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service"),value:this.service.package,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","version"),value:this.general.version.split("@")[0],group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","name"),value:this.service.display_name,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","description"),value:this.service.description,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","docroot"),value:this.service.root,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","http_backend"),value:this.$store.state.service.serverList.find(t=>t.backend_id==this.service.backend).backend_name,group:_TT("SYNO.SDS.WebStation.Application","service","general")});for(let t of["connect_timeout","send_timeout","read_timeout"])this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost",t),value:this.service[t],group:_TT("SYNO.SDS.WebStation.Application","service","general")});if("plex"===this.service.package)for(let[t,e]of Object.entries(this.plex))this.data.push({item:_TT("SYNO.SDS.WebStation.Application","3rdparty",t),value:e.join(),group:_TT("SYNO.SDS.WebStation.Application","3rdparty","plex_settings")});else if("none"===this.database.db_settings.type)this.data.push({item:_TT("SYNO.SDS.WebStation.Application","database","type"),value:_TT("SYNO.SDS.WebStation.Application","database","no_choose"),group:_TT("SYNO.SDS.WebStation.Application","database","database")});else for(let[t,e]of Object.entries(this.database.db_settings))this.data.push({item:_TT("SYNO.SDS.WebStation.Application","database",t),value:"version"===t?e.split("@")[0]:e,group:_TT("SYNO.SDS.WebStation.Application","database","database")});this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!0)},async finished(){if(!await this.apiSetPackageService())return!1;this.$emit("close")},async apiSetPackageService(){let t,e=G(this.service._type,{...this.SERVICE_FIELDS,_package:this.PACKAGE_FIELDS},{meta:this.$store.state.package.meta});try{this.$emit("spinning",!0),await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"check",version:1,params:{service:e}})}catch(e){if(t=e.code,this.$emit("spinning",!1),1022===t){if("confirm"!==await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t)))return void 0===t;this.$store.commit("service/UPDATE_FORCE_ACL",!0),t=void 0}}this.$store.state.service.forceAcl&&(e=G(this.service._type,{...this.SERVICE_FIELDS,_package:this.PACKAGE_FIELDS},{forceAcl:this.$store.state.service.forceAcl,meta:this.$store.state.package.meta}));try{this.$emit("spinning",!0);let i=await synowebapi.promises.request({api:"SYNO.WebStation.Package",method:"create",version:1,params:{package:e.package}});e.id=i,delete e.package,await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"create",version:1,params:{service:e}})}catch(e){t=e.code,this.$emit("spinning",!1),this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-package-summary","step-key":this.stepKey,finished:this.finished,headline:this._TT("SYNO.SDS.WebStation.Application","wizard","summary_wizrad_title")},on:{activate:this.onActivate}},[e("v-data-table",{ref:"table",attrs:{"syno-id":"webstation-package-data-table",columns:this.columns,"current-data":this.data,"enable-hd-menu":!1,"show-paging-bar":!1,"hide-refresh-btn":!0,"group-table":"","group-info":this.groupInfo,"auto-row-height":""}})],1)}),[],!1,null,null,null).exports,me=f({mixins:[l],components:{"php-extensions":Lt},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.extensions.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},preEnterNextStep(){try{if(!this.$refs.extensions.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.extensions.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-extensions","step-key":t.stepKey,"next-step-key":"php-fpm","pre-enter-next-step":t.preEnterNextStep,headline:t._TT("SYNO.SDS.WebStation.Application","php","extension_title")},on:{activate:t.onActivate}},[i("php-extensions",{ref:"extensions",attrs:{"is-dockerized":!0},on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,Se=f({mixins:[l],components:{"php-fpm":Yt},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||this.$refs.fpm.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.fpm.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.fpm.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-fpm","step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","php","fpm_title"),"pre-enter-next-step":t.preEnterNextStep,"next-step-key":"php-dependency"},on:{activate:t.onActivate}},[i("php-fpm",{ref:"fpm",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,ve=i(35),ge=i.n(ve),be={name:"PHPDependency",mixins:[l,C],props:{showVersion:{type:Boolean,default:!1}},data(){return{data:[],fileName:"",value:null,options:[],typeOptions:[{label:_TT("SYNO.SDS.WebStation.Application","script_language","latest"),value:"latest"},{label:_TT("SYNO.SDS.WebStation.Application","script_language","custom"),value:"custom"}],fields:{...this.$store.state.php.require},defaultColumns:[{title:_TT("SYNO.SDS.WebStation.Application","script_language","module_name"),field:"require",width:160},{title:_TT("SYNO.SDS.WebStation.Application","script_language","default_version"),field:"value",width:354,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","script_language","action"),field:"action",width:90,disableSort:!0,align:"center"}],selectedRows:[],dependencyRules:gt,isDragging:!1,isDelete:!1}},computed:{columns(){return this.showVersion&&this.defaultColumns.splice(2,0,{title:_TT("SYNO.SDS.WebStation.Application","script_language","version_in_use"),field:"version",width:130,disableSort:!0}),this.defaultColumns}},methods:{async preload(){if(this.fields={...this.$store.state.php.require},this.data=[],this.showVersion)var t=await lt(this.$store.state.service.template.id)||{};for(let e of Object.keys(this.fields.require)){let i={require:{text:e,link:"https://packagist.org/packages/"+e},value:"latest"===this.fields.require[e]?{type:"latest",desc:""}:{type:"custom",desc:this.fields.require[e]}};this.showVersion&&(i={...i,version:t[e]||""}),this.data.push(i)}await this.$nextTick(),this.$refs.form.commit()},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){this.fields.require=0===this.data.length?{}:this.data.reduce((t,e)=>({...t,[e.require.text]:"latest"===e.value.type?"latest":e.value.desc}),{}),this.$store.commit("php/UPDATE_REQUIRE",this.fields)},reset(){this.$store.commit("php/RESET_ALL")},async search(t){let e=(await ge.a.get("https://packagist.org/search.json?q="+t)).data.results.map(t=>({label:t.name,value:t.name}));e.forEach(t=>{t.disabled=!!this.data.find(e=>e.require.text===t.value)}),this.options=e},addPackage(t){this.data.push({require:{text:t.value,link:"https://packagist.org/packages/"+t.value},value:{type:"latest",desc:""}}),this.$refs.select.clear()},onRowClick(t){this.isDelete&&(this.data.splice(t.index,1),this.isDelete=!1)}}},ye=(i(240),f(be,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"ws-wizard-step-fit-container"},[i("v-form",{ref:"form",staticClass:"ws-php-require-form",attrs:{"syno-id":"webstation-php_require"}},[i("v-form-item",{attrs:{"syno-id":"require-desc-form-item","hide-label":"",textonly:""}},[i("v-rich-text",{attrs:{text:t._TT("SYNO.SDS.WebStation.Application","script_language","php_composer_desc"),"allow-attrs":["href","target"]}})],1),t._v(" "),i("div",{staticClass:"php-require__select-require"},[i("v-single-select",{ref:"select",staticClass:"select-require",attrs:{"syno-id":"webstation-php-select-require",width:"500px",options:t.options,search:t.search,clearable:""},on:{select:t.addPackage},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1),t._v(" "),i("v-data-table",{ref:"table",staticClass:"php-require__data-table",attrs:{"syno-id":"webstation-php-data-table",columns:t.columns,"current-data":t.data,"enable-hd-menu":!1,"hide-refresh-btn":""},on:{"selected-change":function(e){t.selectedRows=e},dataloaded:function(e){t.selectedRows=[]},rowclick:t.onRowClick},scopedSlots:t._u([{key:"require",fn:function(e){var n=e.data;return[i("a",{staticClass:"require-name",attrs:{href:n.link,target:"_blank",rel:"noopener noreferrer"}},[t._v(" "+t._s(n.text)+" ")])]}},{key:"value",fn:function(e){var n=e.data;return[i("div",{staticClass:"requirement-version"},[i("v-form-item",[i("v-single-select",{staticClass:"select-type",attrs:{"syno-id":"webstation-php-data-table-select-type",width:"154px",options:t.typeOptions},model:{value:n.type,callback:function(e){t.$set(n,"type",e)},expression:"data.type"}})],1),t._v(" "),"custom"===n.type?i("v-form-item",{attrs:{prop:"desc",rules:t.dependencyRules},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","script_language","php_require_tip"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}],null,!0)},[i("v-input",{staticClass:"desc-input",attrs:{"syno-id":"webstation-php-data-table-desc-input",placeholder:t._TT("SYNO.SDS.WebStation.Application","script_language","php_require_placeholder"),name:"desc"},model:{value:n.desc,callback:function(e){t.$set(n,"desc",e)},expression:"data.desc"}})],1):t._e()],1)]}},{key:"action",fn:function(){return[i("button",{staticClass:"delete-btn",on:{click:function(e){t.isDelete=!0}}})]},proxy:!0},{key:"empty-area",fn:function(){return[i("div",{staticClass:"empty-desc"},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","script_language","no_module")))])]},proxy:!0}])})],1)],1)}),[],!1,null,null,null).exports),we=f({mixins:[l],components:{"php-dependency":ye},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.dependency.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.dependency.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.dependency.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-dependency","step-key":t.stepKey,"next-step-key":"database","pre-enter-next-step":t.preEnterNextStep,headline:t._TT("SYNO.SDS.WebStation.Application","script_language","dependency_title")},on:{activate:t.onActivate}},[i("php-dependency",{ref:"dependency",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,Te=f({mixins:[l],props:{nextStepkey:String,stepKey:String},data:()=>({data:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","service","item"),field:"item",width:260,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","service","value"),field:"value",width:414,disableSort:!0}],groupInfo:{category:"group"}}),computed:{...Object(m.c)("php",["general","fpm","extensions","core_settings","require"]),...Object(m.c)("service",{service:t=>t.general,database:t=>t.database}),...Object(m.b)({PHP_FIELDS:"php/ALL_FIELDS",SERVICE_FIELDS:"service/ALL_FIELDS"})},methods:{async onActivate(){this.$emit("spinning",!0),this.data=[],this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service_type"),value:_TT("SYNO.SDS.WebStation.Application","service","dockerized_website"),group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service"),value:_TT("SYNO.SDS.WebStation.Application","script_language","php"),group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","version"),value:this.general.version.split("@")[0],group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","name"),value:this.service.display_name,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","description"),value:this.service.description,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","docroot"),value:this.service.root,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","http_backend"),value:this.$store.state.service.serverList.find(t=>t.backend_id==this.service.backend).backend_name,group:_TT("SYNO.SDS.WebStation.Application","service","general")});for(let t of["connect_timeout","send_timeout","read_timeout"])this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost",t),value:this.service[t],group:_TT("SYNO.SDS.WebStation.Application","service","general")});this.data.push({item:_TT("SYNO.SDS.WebStation.Application","php","extensions"),value:this.extensions.extensions.join(", "),group:_TT("SYNO.SDS.WebStation.Application","php","extensions")});for(let t in this.fpm.fpm_settings)this.data.push({item:"mode"===t?_TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_process_mode"):_TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_"+t),value:this.fpm.fpm_settings[t],group:_TT("SYNO.SDS.WebStation.Application","php","fpm")});let t="";for(let e in this.require.require)"latest"===this.require.require[e]?t+=e+", ":t+=`${e}(${this.require.require[e]}), `;if(this.data.push({item:_TT("SYNO.SDS.WebStation.Application","script_language","dependency"),value:t.slice(0,-2),group:_TT("SYNO.SDS.WebStation.Application","script_language","dependency")}),"none"===this.database.db_settings.type)this.data.push({item:_TT("SYNO.SDS.WebStation.Application","database","type"),value:_TT("SYNO.SDS.WebStation.Application","database","no_choose"),group:_TT("SYNO.SDS.WebStation.Application","database","database")});else for(let[t,e]of Object.entries(this.database.db_settings))this.data.push({item:_TT("SYNO.SDS.WebStation.Application","database",t),value:"version"===t?e.split("@")[0]:e,group:_TT("SYNO.SDS.WebStation.Application","database","database")});this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!0)},async finished(){if(!await this.apiSetPHPService())return!1;this.$emit("close")},async apiSetPHPService(){let t;try{this.$emit("spinning",!0);await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"create",version:1,params:{service:G(this.service._type,{...this.SERVICE_FIELDS,php:this.PHP_FIELDS},{forceAcl:this.$store.state.service.forceAcl})}})}catch(e){if(t=e.code,this.$emit("spinning",!1),1022===t){if("confirm"===await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t))){this.$store.commit("service/UPDATE_FORCE_ACL",!0),await this.apiSetPHPService()&&(t=void 0)}}else this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-php-summary","step-key":t.stepKey,finished:t.finished,headline:t._TT("SYNO.SDS.WebStation.Application","wizard","summary_wizrad_title")},on:{activate:t.onActivate}},[i("v-form-item",{attrs:{"hide-label":"",textonly:""}},[t._v("\n\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","script_language","php_core_remove_help"))+"\n\t")]),t._v(" "),i("v-data-table",{ref:"table",attrs:{"syno-id":"webstation-php-data-table",columns:t.columns,"current-data":t.data,"enable-hd-menu":!1,"show-paging-bar":!1,"hide-refresh-btn":!0,"group-table":"","group-info":t.groupInfo,"auto-row-height":""}})],1)}),[],!1,null,null,null).exports,xe=f({mixins:[l],components:{PythonUwsgi:ht},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.uwsgi.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.uwsgi.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.uwsgi.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-python-uwsgi","step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","python","uwsgi_wizrad_title"),"pre-enter-next-step":t.preEnterNextStep,"next-step-key":"python-modules"},on:{activate:t.onActivate}},[i("python-uwsgi",{ref:"uwsgi",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,Ee=f({mixins:[l],components:{"python-modules":wt},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.modules.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.modules.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.modules.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-python-modules","step-key":t.stepKey,"next-step-key":"database","pre-enter-next-step":t.preEnterNextStep,headline:t._TT("SYNO.SDS.WebStation.Application","python","modules_wizrad_title")},on:{activate:t.onActivate}},[i("python-modules",{ref:"modules",attrs:{"is-dockerized":""},on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,ke=f({mixins:[l],props:{nextStepkey:String,stepKey:String},data:()=>({data:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","service","item"),field:"item",width:260,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","service","value"),field:"value",width:414,disableSort:!0}],groupInfo:{category:"group"}}),computed:{...Object(m.c)("python",["general","uwsgi","modules"]),...Object(m.c)("service",{service:t=>t.general,database:t=>t.database}),...Object(m.b)({PYTHON_FIELDS:"python/ALL_FIELDS",SERVICE_FIELDS:"service/ALL_FIELDS"})},methods:{async onActivate(){this.$emit("spinning",!0),this.data=[],this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service_type"),value:_TT("SYNO.SDS.WebStation.Application","service","dockerized_website"),group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service"),value:_TT("SYNO.SDS.WebStation.Application","script_language","python"),group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","version"),value:this.general.version.split("@")[0],group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","name"),value:this.service.display_name,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","description"),value:this.service.description,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","docroot"),value:this.service.root,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","http_backend"),value:this.$store.state.service.serverList.find(t=>t.backend_id==this.service.backend).backend_name,group:_TT("SYNO.SDS.WebStation.Application","service","general")});for(let t of["connect_timeout","send_timeout","read_timeout"])this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost",t),value:this.service[t],group:_TT("SYNO.SDS.WebStation.Application","service","general")});for(let t in this.uwsgi.uwsgi_settings)this.data.push({item:_TT("SYNO.SDS.WebStation.Application","python",t),value:this.uwsgi.uwsgi_settings[t]||_TT("SYNO.SDS.WebStation.Application","common","status_not_configured"),group:_TT("SYNO.SDS.WebStation.Application","python","uwsgi_setting")});let t="";for(let e in this.modules.packages)"latest"===this.modules.packages[e]?t+=e+", ":t+=`${e}(${this.modules.packages[e]}), `;if(this.data.push({item:_TT("SYNO.SDS.WebStation.Application","python","module"),value:t.slice(0,-2),group:_TT("SYNO.SDS.WebStation.Application","python","module")}),"none"===this.database.db_settings.type)this.data.push({item:_TT("SYNO.SDS.WebStation.Application","database","type"),value:_TT("SYNO.SDS.WebStation.Application","database","no_choose"),group:_TT("SYNO.SDS.WebStation.Application","database","database")});else for(let[t,e]of Object.entries(this.database.db_settings))this.data.push({item:_TT("SYNO.SDS.WebStation.Application","database",t),value:"version"===t?e.split("@")[0]:e,group:_TT("SYNO.SDS.WebStation.Application","database","database")});this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!0)},async finished(){if(!await this.apiSetPythonService())return!1;this.$emit("close")},async apiSetPythonService(){let t;try{this.$emit("spinning",!0);await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"create",version:1,params:{service:G(this.service._type,{...this.SERVICE_FIELDS,python:this.PYTHON_FIELDS},{forceAcl:this.$store.state.service.forceAcl})}})}catch(e){if(t=e.code,this.$emit("spinning",!1),1022===t){if("confirm"===await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t))){this.$store.commit("service/UPDATE_FORCE_ACL",!0),await this.apiSetPythonService()&&(t=void 0)}}else this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-python-summary","step-key":this.stepKey,finished:this.finished,headline:this._TT("SYNO.SDS.WebStation.Application","wizard","summary_wizrad_title")},on:{activate:this.onActivate}},[e("v-data-table",{ref:"table",attrs:{"syno-id":"webstation-python-data-table",columns:this.columns,"current-data":this.data,"enable-hd-menu":!1,"show-paging-bar":!1,"hide-refresh-btn":!0,"group-table":"","group-info":this.groupInfo,"auto-row-height":""}})],1)}),[],!1,null,null,null).exports,De={name:"NodeGeneral",mixins:[l,C],props:{editor:{type:Boolean,default:!1}},data(){const t=(t,e,i)=>"manual"===this.fields.package_json_type&&(null===e||e.length<=0)?i(new Error(this.JSLIBSTR("extlang","fieldblank"))):i();let e={};return["version","author","main","license","script","command"].forEach(i=>e[i]=[{validator:t}]),{fields:U()(this.$store.state.node.package_json),scripts:[{script:"",command:""}],rules:{upload_file:[{validator:(t,e,i)=>"upload"===this.fields.package_json_type&&(null===e||e.length<=0)?i(new Error(this.JSLIBSTR("extlang","fieldblank"))):i()}],...e}}},methods:{async preload(){if(this.fields=U()(this.$store.state.node.package_json),Object.keys(this.fields.package_settings.scripts).length){this.scripts=[];for(let[t,e]of Object.entries(this.fields.package_settings.scripts))this.scripts.push({script:t,command:e})}await this.$nextTick(),this.$refs.incrementForm.commit(),this.$refs.form.commit()},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){this.fields.package_settings.scripts=this.scripts.reduce((t,e)=>({...t,[e.script]:e.command}),{}),this.fields.file=this.$refs.file.getFile(),this.$store.commit("node/UPDATE_PACKAGE_JSON",this.fields)},addScript(){this.scripts.push({script:"",command:""})},async onRead(){let t=await this.readFileAsync(this.$refs.file.getFile());try{let e=JSON.parse(t);if(!e.dependencies)return;this.$store.commit("node/UPDATE_DEPENDENCIES",e)}catch(t){return}},readFileAsync:t=>new Promise((e,i)=>{let n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=i,n.readAsText(t)})}},Ae=(i(241),f(De,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticStyle:{height:"100%"}},[i("v-form",{ref:"form",attrs:{rules:t.rules,model:t.fields,usePerfectScroll:!0,"syno-id":"node-general-form",flex:"row"}},[i("v-form-item",{attrs:{"syno-id":"general-desc-form-item","hide-label":"",textonly:""}},[i("v-rich-text",{attrs:{text:t._TT("SYNO.SDS.WebStation.Application","script_language","node_package_json_desc"),"allow-attrs":["href","target"]}})],1),t._v(" "),i("v-form-item",{attrs:{hideLabel:""}},[i("v-radio",{attrs:{"syno-id":"upload-radio",name:"upload",value:"upload"},model:{value:t.fields.package_json_type,callback:function(e){t.$set(t.fields,"package_json_type",e)},expression:"fields.package_json_type"}},[t._v("\n\t\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","script_language","upload_file"))+"\n\t\t\t")])],1),t._v(" "),i("v-form-item",{ref:"upload_file",attrs:{indent:1,prop:"upload_file",hideLabel:""}},[i("v-file-button",{ref:"file",attrs:{name:"upload_file","syno-id":"nodejs-file-button",accept:".json",display:"input-button",disabled:"upload"!=t.fields.package_json_type},on:{change:t.onRead},model:{value:t.fields.upload_file,callback:function(e){t.$set(t.fields,"upload_file",e)},expression:"fields.upload_file"}})],1),t._v(" "),i("v-form-item",{attrs:{hideLabel:""}},[i("v-radio",{attrs:{"syno-id":"manual-radio",name:"manual",value:"manual"},model:{value:t.fields.package_json_type,callback:function(e){t.$set(t.fields,"package_json_type",e)},expression:"fields.package_json_type"}},[t._v("\n\t\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","script_language","manual_config"))+"\n\t\t\t")])],1),t._v(" "),i("v-form-item",{attrs:{indent:1,label:t._TT("SYNO.SDS.WebStation.Application","service","version")+" "+t._T("common","colon"),prop:"version","label-flex":"200px"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"version",name:"version",placeholder:"1.0.0",disabled:"manual"!=t.fields.package_json_type},model:{value:t.fields.package_settings.version,callback:function(e){t.$set(t.fields.package_settings,"version",e)},expression:"fields.package_settings.version"}})],1),t._v(" "),i("v-form-item",{attrs:{indent:1,label:t._TT("SYNO.SDS.WebStation.Application","script_language","author")+" "+t._T("common","colon"),prop:"author","label-flex":"200px"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"author",name:"author",placeholder:"admin",disabled:"manual"!=t.fields.package_json_type},model:{value:t.fields.package_settings.author,callback:function(e){t.$set(t.fields.package_settings,"author",e)},expression:"fields.package_settings.author"}})],1),t._v(" "),i("v-form-item",{attrs:{indent:1,label:t._TT("SYNO.SDS.WebStation.Application","script_language","main")+" "+t._T("common","colon"),prop:"main","label-flex":"200px"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"main",name:"main",placeholder:"index.js",disabled:"manual"!=t.fields.package_json_type},model:{value:t.fields.package_settings.main,callback:function(e){t.$set(t.fields.package_settings,"main",e)},expression:"fields.package_settings.main"}})],1),t._v(" "),i("v-form-item",{attrs:{indent:1,label:t._TT("SYNO.SDS.WebStation.Application","script_language","license")+" "+t._T("common","colon"),prop:"license","label-flex":"200px"}},[i("v-input",{staticClass:"input-width",attrs:{"syno-id":"license",name:"license",placeholder:"ISC",disabled:"manual"!=t.fields.package_json_type},model:{value:t.fields.package_settings.license,callback:function(e){t.$set(t.fields.package_settings,"license",e)},expression:"fields.package_settings.license"}})],1),t._v(" "),i("v-form-item",{attrs:{indent:1,label:t._TT("SYNO.SDS.WebStation.Application","script_language","scripts")+" "+t._T("common","colon"),textonly:"","disable-label":"manual"!=t.fields.package_json_type}}),t._v(" "),i("v-incremental-form-multiple-item",{ref:"incrementForm",attrs:{"syno-id":"script-incremental-form",indent:1,hideLabel:!0,items:t.scripts,"add-text":t._TT("SYNO.SDS.WebStation.Application","script_language","add_script"),"min-items-length":1,"disabled-add-button":"manual"!=t.fields.package_json_type},on:{"update:items":function(e){t.scripts=e},"add-item":t.addScript},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.item;return[i("v-col",[i("v-form-item",{attrs:{prop:"script"}},[i("v-input",{staticClass:"script-width",attrs:{"syno-id":"script",name:"script",placeholder:"start",disabled:"manual"!=t.fields.package_json_type},model:{value:n.script,callback:function(e){t.$set(n,"script",e)},expression:"item.script"}})],1)],1),t._v(" "),i("v-col",[i("v-form-item",{attrs:{prop:"command"}},[i("v-input",{staticClass:"command-width",attrs:{"syno-id":"command",name:"command",placeholder:"node src/index.js",disabled:"manual"!=t.fields.package_json_type},model:{value:n.command,callback:function(e){t.$set(n,"command",e)},expression:"item.command"}})],1)],1)]}}])})],1)],1)}),[],!1,null,"3e0651c8",null).exports),Oe=f({name:"StepNodeGeneral",mixins:[l,C],components:{"node-general":Ae},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),this.loaded||await this.$refs.general.preload(),this.loaded=!0,this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.general.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.general.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-node-general","step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","service","nodejs_headline"),"pre-enter-next-step":t.preEnterNextStep,"next-step-key":"node-dependency"},on:{activate:t.onActivate}},[i("node-general",{ref:"general",style:{height:"420px"},on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,Ne={name:"NodeDependency",mixins:[l,C],props:{showVersion:{type:Boolean,default:!1}},data(){return{data:[],fileName:"",value:null,options:[],typeOptions:[{label:_TT("SYNO.SDS.WebStation.Application","script_language","latest"),value:"latest"},{label:_TT("SYNO.SDS.WebStation.Application","script_language","custom"),value:"custom"}],fields:{...this.$store.state.node.dependencies},defaultColumns:[{title:_TT("SYNO.SDS.WebStation.Application","script_language","dependency_name"),field:"dependencies",width:160},{title:_TT("SYNO.SDS.WebStation.Application","script_language","default_version"),field:"value",width:354,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","script_language","action"),field:"action",width:90,disableSort:!0,align:"center"}],selectedRows:[],dependencyRules:gt,isDragging:!1,isDelete:!1}},computed:{columns(){return this.showVersion&&this.defaultColumns.splice(2,0,{title:_TT("SYNO.SDS.WebStation.Application","script_language","version_in_use"),field:"version",width:130,disableSort:!0}),this.defaultColumns}},methods:{async preload(){if(this.fields={...this.$store.state.node.dependencies},this.data=[],this.showVersion)var t=await lt(this.$store.state.service.template.id);for(let e of Object.keys(this.fields.dependencies)){let i={dependencies:{text:e,link:"https://www.npmjs.com/package/"+e},value:"latest"===this.fields.dependencies[e]?{type:"latest",desc:""}:{type:"custom",desc:this.fields.dependencies[e]}};this.showVersion&&(i={...i,version:t[e]}),this.data.push(i)}await this.$nextTick(),this.$refs.form.commit()},async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},commit(){this.fields.dependencies=0===this.data.length?{}:this.data.reduce((t,e)=>({...t,[e.dependencies.text]:"latest"===e.value.type?"latest":e.value.desc}),{}),this.$store.commit("node/UPDATE_DEPENDENCIES",this.fields)},async search(t){let e=(await ge.a.get("https://registry.npmjs.org/-/v1/search?text="+t)).data.objects.map(t=>({label:t.package.name,value:t.package.name}));e.forEach(t=>{t.disabled=!!this.data.find(e=>e.dependencies.text===t.value)}),this.options=e},addPackage(t){this.data.push({dependencies:{text:t.value,link:"https://www.npmjs.com/package/"+t.value},value:{type:"latest",desc:""}}),this.$refs.select.clear()},onRowClick(t){this.isDelete&&(this.data.splice(t.index,1),this.isDelete=!1)}}},$e=(i(242),f(Ne,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"ws-wizard-step-fit-container"},[i("v-form",{ref:"form",staticClass:"ws-node-dependencies-form",attrs:{"syno-id":"webstation-node_dependencies"}},[i("v-form-item",{attrs:{"syno-id":"dependencies-desc-form-item","hide-label":"",textonly:""}},[i("v-rich-text",{attrs:{text:t._TT("SYNO.SDS.WebStation.Application","script_language","node_npm_desc"),"allow-attrs":["href","target"]}})],1),t._v(" "),i("div",{staticClass:"node-dependencies__select-dependencies"},[i("v-single-select",{ref:"select",staticClass:"select-dependencies",attrs:{"syno-id":"webstation-node-select-dependencies",width:"500px",options:t.options,search:t.search,clearable:""},on:{select:t.addPackage},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1),t._v(" "),i("v-data-table",{ref:"table",staticClass:"node-dependencies__data-table",attrs:{"syno-id":"webstation-node-data-table",columns:t.columns,"current-data":t.data,"enable-hd-menu":!1,"hide-refresh-btn":""},on:{"selected-change":function(e){t.selectedRows=e},dataloaded:function(e){t.selectedRows=[]},rowclick:t.onRowClick},scopedSlots:t._u([{key:"dependencies",fn:function(e){var n=e.data;return[i("a",{staticClass:"dependencies-name",attrs:{href:n.link,target:"_blank",rel:"noopener noreferrer"}},[t._v(" "+t._s(n.text)+" ")])]}},{key:"value",fn:function(e){var n=e.data;return[i("div",{staticClass:"requirement-version"},[i("v-form-item",[i("v-single-select",{staticClass:"select-type",attrs:{"syno-id":"webstation-node-data-table-select-type",width:"154px",options:t.typeOptions},model:{value:n.type,callback:function(e){t.$set(n,"type",e)},expression:"data.type"}})],1),t._v(" "),"custom"===n.type?i("v-form-item",{attrs:{prop:"desc",rules:t.dependencyRules},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","script_language","node_dependency_tip"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}],null,!0)},[i("v-input",{staticClass:"desc-input",attrs:{"syno-id":"webstation-node-data-table-desc-input",placeholder:t._TT("SYNO.SDS.WebStation.Application","script_language","node_dependency_placeholder"),name:"desc"},model:{value:n.desc,callback:function(e){t.$set(n,"desc",e)},expression:"data.desc"}})],1):t._e()],1)]}},{key:"action",fn:function(){return[i("button",{staticClass:"delete-btn",on:{click:function(e){t.isDelete=!0}}})]},proxy:!0},{key:"empty-area",fn:function(){return[i("div",{staticClass:"empty-desc"},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","script_language","no_dependencies")))])]},proxy:!0}])})],1)],1)}),[],!1,null,null,null).exports),Le=f({mixins:[l],components:{"node-dependency":$e},props:{nextStepkey:String,stepKey:String},methods:{async onActivate(){this.$emit("spinning",!0),await this.$refs.dependency.preload(),this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!1)},async preEnterNextStep(){try{if(!await this.$refs.dependency.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.dependency.commit()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-node-dependency","step-key":t.stepKey,"next-step-key":"database","pre-enter-next-step":t.preEnterNextStep,headline:t._TT("SYNO.SDS.WebStation.Application","script_language","dependency_title")},on:{activate:t.onActivate}},[i("node-dependency",{ref:"dependency",on:{"display-error":function(e){return t.$emit("display-error",e)}}})],1)}),[],!1,null,null,null).exports,We=i(22),Pe=i.n(We),Ye=f({mixins:[l],props:{nextStepkey:String,stepKey:String},data:()=>({data:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","service","item"),field:"item",width:260,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","service","value"),field:"value",width:414,disableSort:!0}],groupInfo:{category:"group"}}),computed:{...Object(m.c)("node",["general","package_json","dependencies"]),...Object(m.c)("service",{service:t=>t.general,database:t=>t.database}),...Object(m.b)({NODE_FIELDS:"node/ALL_FIELDS",SERVICE_FIELDS:"service/ALL_FIELDS"})},methods:{async onActivate(){this.$emit("spinning",!0),this.data=[],this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service_type"),value:_TT("SYNO.SDS.WebStation.Application","service","dockerized_website"),group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","service"),value:_TT("SYNO.SDS.WebStation.Application","script_language","node"),group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","version"),value:this.general.version.split("@")[0],group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","name"),value:this.service.display_name,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","service","description"),value:this.service.description,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","docroot"),value:this.service.root,group:_TT("SYNO.SDS.WebStation.Application","service","general")}),this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost","http_backend"),value:this.$store.state.service.serverList.find(t=>t.backend_id==this.service.backend).backend_name,group:_TT("SYNO.SDS.WebStation.Application","service","general")});for(let[t,e]of Object.entries(this.general.script_settings))this.data.push({item:_TT("SYNO.SDS.WebStation.Application","script_language","node_"+t),value:e,group:_TT("SYNO.SDS.WebStation.Application","service","general")});for(let t of["connect_timeout","send_timeout","read_timeout"])this.data.push({item:_TT("SYNO.SDS.WebStation.Application","vhost",t),value:this.service[t],group:_TT("SYNO.SDS.WebStation.Application","service","general")});if("upload"===this.package_json.package_json_type)this.data.push({item:_TT("SYNO.SDS.WebStation.Application","script_language","upload_file"),value:this.package_json.upload_file,group:_TT("SYNO.SDS.WebStation.Application","script_language","node_package_json")});else for(let[t,e]of Object.entries(this.package_json.package_settings))if(!["upload_file","package_json_type"].includes(t))if("scripts"!==t)this.data.push({item:_TT("SYNO.SDS.WebStation.Application","script_language",t),value:e,group:_TT("SYNO.SDS.WebStation.Application","script_language","node_package_json")});else{this.data.push({item:_TT("SYNO.SDS.WebStation.Application","script_language","scripts"),value:"",group:_TT("SYNO.SDS.WebStation.Application","script_language","node_package_json")});for(let[t,i]of Object.entries(e))this.data.push({item:t,value:i,group:_TT("SYNO.SDS.WebStation.Application","script_language","node_package_json")})}let t="";for(let e in this.dependencies.dependencies)"latest"===this.dependencies.dependencies[e]?t+=e+", ":t+=`${e}(${this.dependencies.dependencies[e]}), `;if(this.data.push({item:_TT("SYNO.SDS.WebStation.Application","script_language","dependency"),value:t.slice(0,-2),group:_TT("SYNO.SDS.WebStation.Application","script_language","dependency")}),"none"===this.database.db_settings.type)this.data.push({item:_TT("SYNO.SDS.WebStation.Application","database","type"),value:_TT("SYNO.SDS.WebStation.Application","database","no_choose"),group:_TT("SYNO.SDS.WebStation.Application","database","database")});else for(let[t,e]of Object.entries(this.database.db_settings))this.data.push({item:_TT("SYNO.SDS.WebStation.Application","database",t),value:"version"===t?e.split("@")[0]:e,group:_TT("SYNO.SDS.WebStation.Application","database","database")});this.$emit("spinning",!1),this.$emit("enableNextButton",!0,!0)},async finished(){if(!await this.apiSetNodeService())return!1;this.$emit("close")},async apiSetNodeService(){let t,e=G(this.service._type,{...this.SERVICE_FIELDS,node:this.NODE_FIELDS});try{this.$emit("spinning",!0),await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"check",version:1,params:{service:e}})}catch(e){if(t=e.code,this.$emit("spinning",!1),1022===t){if("confirm"!==await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t)))return void 0===t;this.$store.commit("service/UPDATE_FORCE_ACL",!0),t=void 0}}this.$store.state.service.forceAcl&&(e=G(this.service._type,{...this.SERVICE_FIELDS,node:this.NODE_FIELDS},{forceAcl:this.$store.state.service.forceAcl}));try{this.$emit("spinning",!0);let i=await synowebapi.promises.request({api:"SYNO.WebStation.ScriptLanguage",method:"create",version:1,formData:"upload"===this.NODE_FIELDS.package_json_type?{script:JSON.stringify(e.node),[this.NODE_FIELDS.upload_file]:this.NODE_FIELDS.file}:{script:JSON.stringify(e.node)}});e.id=i,delete e.node,await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"create",version:1,params:{service:e}})}catch(e){t=e.code,this.$emit("spinning",!1),this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-step-node-summary","step-key":this.stepKey,finished:this.finished,headline:this._TT("SYNO.SDS.WebStation.Application","wizard","summary_wizrad_title")},on:{activate:this.onActivate}},[e("v-data-table",{ref:"table",attrs:{"syno-id":"webstation-node-data-table",columns:this.columns,"current-data":this.data,"enable-hd-menu":!1,"show-paging-bar":!1,"hide-refresh-btn":!0,"group-table":"","group-info":this.groupInfo,"auto-row-height":""}})],1)}),[],!1,null,null,null),Re=f({mixins:[C],components:{"step-select-type":qt,"step-general":re,"step-summary":oe,"step-database":ce,"step-plex-settings":he,"package-step-summary":_e,"php-step-extensions":me,"php-step-fpm":Se,"php-step-dependency":we,"php-step-summary":Te,"python-step-uwsgi":xe,"python-step-modules":Ee,"python-step-summary":ke,"node-step-general":Oe,"node-step-dependency":Le,"node-step-summary":Ye.exports},data:()=>({showStatusBar:!1,statusBarState:"",statusBarErrorText:"",buttonsGroup:{}}),methods:{onEnableNextButton(t,e=!0){this.buttonsGroup={next:{text:e?_T("common","create"):_T("common","next"),disabled:!t}}},async displayError(t){this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,await new Promise(t=>setTimeout(t,5e3)),this.showStatusBar=!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard",{attrs:{"syno-id":"ws-service-package-wizard","active-step-key":"select-type","custom-buttons-group":t.buttonsGroup,refs:"wizard","show-status-bar":t.showStatusBar,"status-bar-state":t.statusBarState,"status-bar-error-text":t.statusBarErrorText},on:{"step-scroll":function(e){return t.$emit("step-scroll",e)}}},[i("step-select-type",{attrs:{"syno-id":"step-select-type","step-key":"select-type"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-general",{attrs:{"syno-id":"step-general","step-key":"general"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-summary",{attrs:{"syno-id":"step-summary","step-key":"summary"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-database",{attrs:{"syno-id":"step-database","step-key":"database"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-plex-settings",{attrs:{"syno-id":"step-plex-settings","step-key":"plex-settings"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("package-step-summary",{attrs:{"syno-id":"package-step-summary","step-key":"package-summary"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("php-step-extensions",{attrs:{"syno-id":"php-step-extensions","step-key":"php-extensions"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("php-step-fpm",{attrs:{"syno-id":"php-step-fpm","step-key":"php-fpm"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("php-step-dependency",{attrs:{"syno-id":"php-step-dependency","step-key":"php-dependency"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("php-step-summary",{attrs:{"syno-id":"php-step-summary","step-key":"php-summary"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("python-step-uwsgi",{attrs:{"syno-id":"python-step-uwsgi","step-key":"python-uwsgi"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("python-step-modules",{attrs:{"syno-id":"python-step-modules","step-key":"python-modules"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("python-step-summary",{attrs:{"syno-id":"python-step-summary","step-key":"python-summary"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("node-step-general",{attrs:{"syno-id":"node-step-general","step-key":"node-general"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("node-step-dependency",{attrs:{"syno-id":"node-step-dependency","step-key":"node-dependency"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("node-step-summary",{attrs:{"syno-id":"node-step-summary","step-key":"node-summary"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}})],1)}),[],!1,null,null,null),Ce=f({mixins:[l],components:{"service-package-wizard":Re.exports},methods:{onStepScrolled(t){this.$refs.window.onStepScrolled(t)},onSpinning(t){this.$refs.window.onlyMask=!1,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatusBusy()},onLoading(t){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatusBusy()},onClose(){this.$refs.window.close()}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-window",{ref:"window",attrs:{"syno-id":"ws-service-wizard-window",title:this._TT("SYNO.SDS.WebStation.Application","service","wizard_title"),width:700,height:540,"before-close":function(){}}},[e("service-package-wizard",{on:{"step-scroll":this.onStepScrolled,spinning:this.onSpinning,loading:this.onLoading,close:this.onClose}})],1)}),[],!1,null,null,null).exports;let Ie=Vue.extend({store:R}).extend(Ce);var Be=f({mixins:[l,_],components:{PortalType:B},props:{stepKey:String,nextStepkey:String},data(){return{nextStep:"",portalServerInfo:{id:"server-portal",iconPath:`webman/3rdparty/WebStation/images/default/${this.iconResolution()}/wizard_icn_package_server_portal.png`,title:_TT("SYNO.SDS.WebStation.Application","service_wizard","service_portal"),description:_TT("SYNO.SDS.WebStation.Application","service_wizard","service_portal_desc")},defaultPortalServerInfo:{id:"default-server-portal",iconPath:`webman/3rdparty/WebStation/images/default/${this.iconResolution()}/wizard_icn_alternative.png`,title:_TT("SYNO.SDS.WebStation.Application","portal","alternative_host_title_case"),description:_TT("SYNO.SDS.WebStation.Application","portal","alternative_host_description")},localPackageMap:{},serverPackageMap:{},webServiceMap:{},isServicePackageWizardOpened:!1}},methods:{async onActivate(){this.$emit("enableNextButton",!1),this.$emit("spinning",!0);try{let t=await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"list",version:1,params:{all:!0}});if(this.$store.commit("portal/UPDATE_SERVICE_LIST",t.services),0===t.services.filter(t=>"WebStation"!==t.category||"default_server"!==t.service).length){if("confirm"===await this.$options.appWin.getMsgBox().confirm("",_TT("SYNO.SDS.WebStation.Application","portal","no_service_tip"),{leftCustom:{text:null},cancel:{text:_TT("SYNO.SDS.WebStation.Application","portal","later")},confirm:{type:"footbar",text:_TT("SYNO.SDS.WebStation.Application","service","create_service"),suffix:"main"}})){if(this.isServicePackageWizardOpened)return;this.isServicePackageWizardOpened=!0;let{window:t}=this.$options.appWin.openModalWindow(Ie);t.$on("close",()=>{this.$store.commit("service/RESET_ALL"),this.isServicePackageWizardOpened=!1,this.onActivate()})}}}catch(t){this.$emit("display-error",t.code)}finally{this.$emit("spinning",!1)}},async onTypeSelect(t){this.nextStep=t,await this.$nextTick(),this.$refs.step.nextStep()},iconResolution:()=>SYNO.SDS.UIFeatures.IconSizeManager.isRetinaMode()?"2x":"1x"}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-sw-select-portal","show-footer":!1,"step-key":t.stepKey,headline:t._TT("SYNO.SDS.WebStation.Application","service_wizard","title_portal"),"next-step-key":t.nextStep},on:{activate:t.onActivate}},[i("div",[i("Portal-Type",{attrs:{id:t.portalServerInfo.id,iconPath:t.portalServerInfo.iconPath,title:t.portalServerInfo.title,description:t.portalServerInfo.description},on:{"type-select":t.onTypeSelect}}),t._v(" "),i("Portal-Type",{attrs:{id:t.defaultPortalServerInfo.id,iconPath:t.defaultPortalServerInfo.iconPath,title:t.defaultPortalServerInfo.title,description:t.defaultPortalServerInfo.description},on:{"type-select":t.onTypeSelect}})],1)])}),[],!1,null,null,null).exports,je=i(118),Ue=i.n(je),Fe=i(119),Me=i.n(Fe),qe={methods:{update(t,e){this.$emit("input",Ue()(U()(this.fields),i=>Me()(i,t,e)))}}};const Ge={FQDN(t){if(this.IP(t))return!1;return/^(?:[^\s`=~!@#$%^&*()_+\[\]\\{}|;:'",\/<>?\.]+\.)*(?:[^\s`=~!@#$%^&*()_+\[\]\\{}|;:'",\/<>?\.]+)$/.test(t)},IP(t){return!(!this.IPv4(t)&&!this.IPv6(t))},IPv4:t=>/^([1-9][0-9]{0,1}|1[0-9][0-9]|2[01][0-9]|22[0-3])([.]([1-9]{0,1}[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){2}[.]([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(t),IPv6:t=>/^([1-9][0-9]{0,1}|1[0-9][0-9]|2[01][0-9]|22[0-3])([.]([1-9]{0,1}[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){2}[.]([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(t),FQDN_MASK:t=>t.replace(/[\s`=~!@#$%^&*()_+\[\]\\{}|;:'",\/<>?]+/,"")},ze=[{validator:(t,e,i)=>{if(null===e||e.length<=0)return i(new Error(St("extlang","fieldblank")));let n=parseInt(e,10);if(n<=0||n>65535)return i(new Error("1 ~ 65535"));i()}}],He=(t,e=[])=>[{validator:(i,n,s)=>{let a=(t,i)=>{t=t.toLowerCase();for(let n=0;n<e.length;n++){let s=e[n];if(s.fqdn===t&&s.port===i)return!0}return!1};if(null===n||n.length<=0)return s(new Error(St("extlang","fieldblank")));if(!Ge.FQDN(n))return s(new Error(St("vtype","bad_domain_name")));if(t.name_port&&(a(n,80)||a(n,443)))return s(new Error(_T("app_port_alias","err_fqdn_duplicated")));if(t.name_http){let e=parseInt(t.name_http_port,10);if(e&&a(n,e))return s(new Error(_T("app_port_alias","err_fqdn_duplicated")))}if(t.name_https){let e=parseInt(t.name_https_port,10);if(e&&a(n,e))return s(new Error(_T("app_port_alias","err_fqdn_duplicated")))}s()}}],Ve=[{validator:(t,e,i)=>{if(null===e||e.length<=0)return i(new Error(St("extlang","fieldblank")));if(!/^[a-zA-Z0-9][-_a-zA-Z0-9]{0,18}[a-zA-Z0-9]$/.test(e))return i(new Error(_TT("SYNO.SDS.WebStation.Application","alias","bad_alias_detail")));i()}}];var Ke={name:"NetworkForm",mixins:[l,qe],props:{type:String,FQDNPortList:Array,value:Object,hasAlias:{type:Boolean,default:!1},aliasOnly:{type:Boolean,default:!1}},data(){return{rules:{"fields.fqdn":He(this.value,this.FQDNPortList),"fields.name_http_port":ze,"fields.name_https_port":ze,"fields.port_http_port":ze,"fields.port_https_port":ze,"fields.alias":Ve},VALIDATE_NETWORK:Ge,defaultTypeList:[{name:_TT("SYNO.SDS.WebStation.Application","vhost","name_based"),based:"name"},{name:_TT("SYNO.SDS.WebStation.Application","vhost","port_based"),based:"port"}]}},computed:{typeList(){return this.hasAlias&&this.defaultTypeList.push({name:_TT("SYNO.SDS.WebStation.Application","service_wizard","title_alias"),based:"alias"}),this.aliasOnly&&(this.defaultTypeList=[{name:_TT("SYNO.SDS.WebStation.Application","service_wizard","title_alias"),based:"alias"}]),this.defaultTypeList},fields(){return U()(this.value)},nameHttpDisabled(){return"name"!==this.fields.based||!1===this.fields.name_http},nameHttpsDisabled(){return"name"!==this.fields.based||!1===this.fields.name_https},portHttpDisabled(){return"port"!==this.fields.based||!1===this.fields.port_http},portHttpsDisabled(){return"port"!==this.fields.based||!1===this.fields.port_https}},methods:{async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},setHttpFieldInvaid(t){"name"===this.fields.based?this.$refs.itemNameHttpPort.setInvalid(t):this.$refs.itemPortHttpPort.setInvalid(t)},setHttpsFieldInvaid(t){"name"===this.fields.based?this.$refs.itemNameHttpsPort.setInvalid(t):this.$refs.itemPortHttpsPort.setInvalid(t)},onError(t){let e=SYNO.SDS.WebStation.Errors.GetMessage(t.code);switch(t.code){case 1004:case 1009:case 1021:this.handleConflictHost(t.errors.conflict_ports);break;case 1007:this.$refs.itemFqdn.setInvalid(e);break;case 1307:this.setHttpFieldInvaid(e);break;case 1308:this.setHttpsFieldInvaid(e);break;case 1309:this.setHttpFieldInvaid(e),this.setHttpsFieldInvaid(e)}},handleConflictHost(t){let e=this.fields,i="",n=-1,s=-1;"name"===e.based?(!1===this.nameHttpDisabled&&(n=parseInt(e.name_http_port,10)),!1===this.nameHttpsDisabled&&(s=parseInt(e.name_https_port,10)),i=_TT("SYNO.SDS.WebStation.Application","error","err_host_duplicated")):(!1===this.portHttpDisabled&&(n=parseInt(e.port_http_port,10)),!1===this.portHttpsDisabled&&(s=parseInt(e.port_https_port,10)),i=_TT("SYNO.SDS.WebStation.Application","error","err_port_conflict")),"name"===e.based&&!0===e.name_port&&this.$refs.itemFqdn.setInvalid(i),i=_TT("SYNO.SDS.WebStation.Application","error","err_port_conflict"),t.includes(n)&&this.setHttpFieldInvaid(i),t.includes(s)&&this.setHttpsFieldInvaid(i)}}},Je=(i(243),f(Ke,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-form",{ref:"form",attrs:{"syno-id":"network-form",rules:t.rules}},[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","portal","portal_type")+t._T("common","colon"),prop:"fields.based","register-key":"select"},scopedSlots:t._u(["alias"===t.fields.based?{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","portal","alias_tip"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}:null],null,!0)},[i("v-single-select",{attrs:{"syno-id":"select-based",name:"based",width:260,displayField:"name",valueField:"based",options:this.typeList,value:t.fields.based,readonly:"",hasTooltip:"","subscribe-field":"select"},on:{input:function(e){return t.update("based",e)},"display-changed":function(e){return t.$emit("based-changed",e)}}})],1),t._v(" "),"name"===t.fields.based?[i("v-form-item",{ref:"itemFqdn",staticClass:"potal-type-form-label",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","hostname")+t._T("common","colon"),prop:"fields.fqdn","register-key":"fqdn"}},[i("v-input",{staticClass:"network__name-input",attrs:{"syno-id":"fqdn",name:"fqdn",value:t.fields.fqdn,disabled:"name"!==t.fields.based,mask:t.VALIDATE_NETWORK.FQDN_MASK,"subscribe-field":"fqdn"},on:{input:function(e){return t.update("fqdn",e)}}})],1),t._v(" "),i("v-form-item",{staticClass:"potal-type-form-label",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","port")+t._T("common","colon"),prop:"fields.name_port","register-key":"name_port"}},[i("v-checkbox",{attrs:{"syno-id":"name_port",name:"name_port",value:t.fields.name_port,disabled:"name"!==t.fields.based,"subscribe-field":"name_port"},on:{input:function(e){return t.update("name_port",e)}}},[t._v("\n\t\t\t\t\t80 / 443\n\t\t\t\t")])],1),t._v(" "),i("v-form-multiple-item",{attrs:{"syno-id":"name_based_http_port"}},[i("v-form-item",{attrs:{prop:"fields.name_http","register-key":"name_http"}},[i("v-checkbox",{staticClass:"port-checkbox",attrs:{"syno-id":"name_http",name:"name_http",value:t.fields.name_http,disabled:"name"!==t.fields.based,"subscribe-field":"name_http"},on:{input:function(e){return t.update("name_http",e)}}},[t._v("HTTP ")])],1),t._v(" "),i("v-form-item",{ref:"itemNameHttpPort",attrs:{prop:"fields.name_http_port","register-key":"name_http_port"}},[i("v-input",{staticClass:"network__port-input",attrs:{"syno-id":"name_http_port",name:"name_http_port",value:t.fields.name_http_port,"number-only":!0,disabled:t.nameHttpDisabled,"subscribe-field":"name_http_port"},on:{input:function(e){return t.update("name_http_port",e)}}})],1)],1),t._v(" "),i("v-form-multiple-item",{attrs:{"syno-id":"name_based_https_port"}},[i("v-form-item",{attrs:{prop:"fields.name_https","register-key":"name_https"}},[i("v-checkbox",{staticClass:"port-checkbox",attrs:{"syno-id":"name_https",name:"name_https",value:t.fields.name_https,disabled:"name"!==t.fields.based,"subscribe-field":"name_https"},on:{input:function(e){return t.update("name_https",e)}}},[t._v("HTTPS")])],1),t._v(" "),i("v-form-item",{ref:"itemNameHttpsPort",attrs:{prop:"fields.name_https_port","register-key":"name_https_port"}},[i("v-input",{staticClass:"network__port-input",attrs:{"syno-id":"name_https_port",name:"name_https_port",value:t.fields.name_https_port,"number-only":!0,disabled:t.nameHttpsDisabled,"subscribe-field":"name_https_port"},on:{input:function(e){return t.update("name_https_port",e)}}})],1)],1)]:"port"===t.fields.based?[i("v-form-multiple-item",{staticClass:"potal-type-form-label",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","port")+t._T("common","colon")}},[i("v-form-item",{attrs:{prop:"fields.port_http","register-key":"port_http"}},[i("v-checkbox",{staticClass:"port-checkbox",attrs:{"syno-id":"port_http",name:"port_http",value:t.fields.port_http,disabled:"port"!==t.fields.based,"subscribe-field":"port_http"},on:{input:function(e){return t.update("port_http",e)}}},[t._v("HTTP ")])],1),t._v(" "),i("v-form-item",{ref:"itemPortHttpPort",attrs:{prop:"fields.port_http_port","register-key":"port_http_port"}},[i("v-input",{staticClass:"network__port-input",attrs:{"syno-id":"port_http_port",name:"port_http_port",value:t.fields.port_http_port,"number-only":!0,disabled:t.portHttpDisabled,"subscribe-field":"port_http_port"},on:{input:function(e){return t.update("port_http_port",e)}}})],1)],1),t._v(" "),i("v-form-multiple-item",{attrs:{"syno-id":"port_based_https_port"}},[i("v-form-item",{attrs:{prop:"fields.port_https","register-key":"port_https"}},[i("v-checkbox",{staticClass:"port-checkbox",attrs:{"syno-id":"port_https",name:"port_https",value:t.fields.port_https,disabled:"port"!==t.fields.based,"subscribe-field":"port_https"},on:{input:function(e){return t.update("port_https",e)}}},[t._v("HTTPS")])],1),t._v(" "),i("v-form-item",{ref:"itemPortHttpsPort",attrs:{prop:"fields.port_https_port","register-key":"port_https_port"}},[i("v-input",{staticClass:"network__port-input",attrs:{"syno-id":"port_https_port",name:"port_https_port",value:t.fields.port_https_port,"number-only":!0,disabled:t.portHttpsDisabled,"subscribe-field":"port_https_port"},on:{input:function(e){return t.update("port_https_port",e)}}})],1)],1)]:"alias"===t.fields.based?["alias"===t.fields.based?i("v-form-item",{ref:"itemAlias",staticClass:"potal-type-form-label",attrs:{label:t._T("app_port_alias","desc_alias")+t._T("common","colon"),prop:"fields.alias","register-key":"alias"}},[i("v-input",{staticClass:"network__name-input",attrs:{"syno-id":"alias",name:"alias",value:t.fields.alias,disabled:"alias"!==t.fields.based,"subscribe-field":"alias"},on:{input:function(e){return t.update("alias",e)}}})],1):t._e()]:t._e(),t._v(" "),i("v-form-item",{directives:[{name:"show",rawName:"v-show",value:"alias"!==t.fields.based,expression:"fields.based !== 'alias'"}],attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","https_settings")+t._T("common","colon"),prop:"fields.hsts","register-key":"hsts"}},[i("v-checkbox",{attrs:{"syno-id":"hsts",name:"hsts",value:t.fields.hsts,"subscribe-field":"hsts"},on:{input:function(e){return t.update("hsts",e)}}},[t._v("HSTS")])],1)],2)],1)}),[],!1,null,"1dd038dc",null).exports);const Ze="DEFAULT_SERVER",Qe="VIRTUAL_HOST",Xe="SERVER_PORTAL",ti="ALIAS";var ei=i(53),ii=i.n(ei);function ni(t=[]){return t.map(t=>{t._type=oi(t);let e={id:t.id,service:t.service,category:t.category,group:si(t),status:ai(t.status.type),value:t.id,label:t.display_name},i=function(t={},e={}){switch(t._type){case D.DEFAULT:case D.STATIC:return"";case D.PACKAGE:return t.service.toLowerCase();case D.SCRIPT_LANGUAGE:for(let e of["php","python"])if(t.type.includes(e))return e;return"";case D.DOCKERIZED:if(t.type.includes("package")){let i=e.packages.find(e=>e.id===t.id);if(void 0!==i)return i.type}for(let e of["php","python","node"])if(t.type.includes(e))return e;return"docker";default:return""}}(t,{packages:this.$store.state.service.packageList});return i.length>0&&(e.icon={name:"syno-webstation-service-icon-select__"+i,type:"bkg-img"}),e})}function si(t={}){switch(t._type){case D.DEFAULT:return _TT("SYNO.SDS.WebStation.Application","service","default_service");case D.STATIC:return _TT("SYNO.SDS.WebStation.Application","service","static_website");case D.SCRIPT_LANGUAGE:return _TT("SYNO.SDS.WebStation.Application","service","native_website");case D.DOCKERIZED:return _TT("SYNO.SDS.WebStation.Application","service","dockerized_website");case D.PACKAGE:return _TT("SYNO.SDS.WebStation.Application","service","3rdparty_website")}}function ai(t){const e={[A.RUNNING]:{type:A.RUNNING,class:"green-status",message:_T("helpbrowser","font_normal")},[A.PAUSED]:{type:A.PAUSED,class:"syno-webstation-grey-status",message:_TT("SYNO.SDS.WebStation.Application","actions","pause")},[A.LOADING]:{type:A.LOADING,class:"syno-webstation-loading-status",message:_TT("SYNO.SDS.WebStation.Application","actions","loading")},[A.WARNING]:{type:A.WARNING,class:"orange-status",message:_TT("SYNO.SDS.WebStation.Application","actions","warning")},[A.ERROR]:{type:A.ERROR,class:"red-status",message:_T("common","status_abnormal")}};switch(t){case A.RUNNING:return e[A.RUNNING];case A.PAUSED:return e[A.PAUSED];case A.WARNING:return e[A.WARNING];case A.ERROR:return e[A.ERROR];case A.LOADING:return e[A.LOADING]}return e[A.RUNNING]}function ri(t){let e={};switch(t){case O.DOCKER_NOT_INSTALL:e.content=_TT("SYNO.SDS.WebStation.Application","error","err_docker_uninstall");break;case O.PROJECT_NOT_FOUND:e.content=_TT("SYNO.SDS.WebStation.Application","error","err_dokcer_project_not_found");break;case O.PROJECT_FAILED:e.content=String.format(_TT("SYNO.SDS.WebStation.Application","error","err_docker_terminal_fail"),""),e.detail={text:_TT("SYNO.SDS.WebStation.Application","common","view_detail"),onClick:(t,e)=>{t.openModalWindow(SYNO.SDS.Docker.Project.ProjectActionLogDialog,{projectId:e._originalData.docker_id,projectName:e.name})}};break;case O.PROJECT_UNHEALTHY:e.content=_TT("SYNO.SDS.WebStation.Application","error","err_docker_project_unhealthy");break;default:e.content=_TT("SYNO.SDS.WebStation.Application","error","err_settings")}return e}function oi(t={}){return"WebStation"===t.category?"default_server"===t.service?D.DEFAULT:t.managed_by_docker?D.DOCKERIZED:"static"===t.type?D.STATIC:D.SCRIPT_LANGUAGE:"Docker"===t.category?D.DOCKERIZED:D.PACKAGE}function li(t,e,i={}){let n=(t=>{let e;switch(t){case Ze:case Xe:e={fqdn:"",http_port:[],https_port:[],hsts:!1,acl:null,error_page:null,enable:!0,type:"server",service:null,enable_log:!1};break;case Qe:e={port:{http:[],https:[]},https:{hsts:!1},root:"",backend:null,script_language:"not_configured",php:null,python:null,wsgi_file:null,callable:null,acl:null,enable:!0,version:2,apply_permission:!1,connect_timeout:60,send_timeout:60,read_timeout:60};break;case ti:e={alias:"",acl:null,error_page:null,enable:!0,type:"alias",service:null}}return e})(t);if(e.shortcut.enable&&(n.shortcut={enable:!0,display_name:e.shortcut.display_name,all_users:"all"===e.shortcut.all_users}),t==ti)return n.service=e.service,n.alias=e.alias,n.acl=e.acl,n.error_page=e.error_page,i.editor&&(n.id=e.id,n.enable=e.enable),n;let s=[],a=[];if("name"===e.based?(n.fqdn=e.fqdn,e.name_port&&(s.push(80),a.push(443)),e.name_http&&s.push(parseInt(e.name_http_port,10)),e.name_https&&a.push(parseInt(e.name_https_port,10))):(delete n.fqdn,e.port_http&&s.push(parseInt(e.port_http_port,10)),e.port_https&&a.push(parseInt(e.port_https_port,10))),t===Qe){switch(n.port.http=s,n.port.https=a,n.https.hsts=e.hsts,n.root=e.root,n.backend=e.backend,n.connect_timeout=e.connect_timeout,n.send_timeout=e.send_timeout,n.read_timeout=e.read_timeout,i.forceAcl&&(n.apply_permission=i.forceAcl),e.script_language){case"php":n.php=e.php;break;case"python":n.python=e.python,n.wsgi_file=e.wsgi_file,n.callable=e.callable}i.editor&&(n.UUID=e.id,n.enable=e.enable)}else n.http_port=s,n.https_port=a,n.hsts=e.hsts,n.service=e.service,i.editor&&(n.id=e.id,n.type=e.type,n.enable=e.enable,n.compatible_crt_service=e.compatible_crt_service,n.compatible_crt_subscriber=e.compatible_crt_subscriber,n.compatible_sc_section=e.compatible_sc_section);return n.acl=e.acl,n.error_page=e.error_page,n.enable_log=e.enable_log,n}async function pi(){return function(t){let e=[];var i;return(i=t.result[0].data).fqdn&&(e.push({fqdn:i.fqdn.toLowerCase(),port:80}),e.push({fqdn:i.fqdn.toLowerCase(),port:443})),function(t){t.portal.forEach(t=>{t.fqdn&&(e.push({fqdn:t.fqdn.toLowerCase(),port:80}),e.push({fqdn:t.fqdn.toLowerCase(),port:443}))})}(t.result[1].data),function(t){t.entries.forEach(t=>{t.frontend&&t.frontend.fqdn&&e.push({fqdn:t.frontend.fqdn.toLowerCase(),port:t.frontend.port})})}(t.result[2].data),e}(await synowebapi.promises.request({compound:{stopwhenerror:!0,params:[{api:"SYNO.Core.Web.DSM",method:"get",version:2},{api:"SYNO.Core.AppPortal",method:"list",version:2},{api:"SYNO.Core.AppPortal.ReverseProxy",method:"list",version:1}]}}))}async function ci(){const t=await synowebapi.promises.request({api:"SYNO.Core.AppPortal.AccessControl",method:"list",version:1});return e=t,[{UUID:null,name:_TT("SYNO.SDS.WebStation.Application","default","not_configured")}].concat(e.entries);var e}async function di(){const t=await synowebapi.promises.request({api:"SYNO.WebStation.ErrorPage",method:"list",version:1});return await function(t){let e=t.profiles;return e.find(t=>"default"==t.id).desc=_TT("SYNO.SDS.WebStation.Application","custom_error_page","default_profile"),e}(t)}let ui=Vue.extend({store:R}).extend(Ce);var fi={name:"ServerPortal",mixins:[l,_],components:{"network-form":Je},props:{windowType:String,editor:{type:Boolean,default:!1}},data(){return{service:"",fields:{...this.$store.state.portal.general},shortcut:{...this.$store.state.portal.shortcut},FQDNPortList:[],serviceList:[],serviceOptions:[],aclList:[],errorPageList:[],serviceRule:[{required:!0}],status:{class:"green-status",message:"Normal"},shortcutOptions:[{label:_TT("SYNO.SDS.WebStation.Application","shortcut","all_user"),value:"all"},{label:_TT("SYNO.SDS.WebStation.Application","shortcut","admin_only"),value:"admin"}],rules:{display_name:[{required:!0}]}}},computed:{iconType(){return void 0===this.serviceIcon?"none":"custom"},serviceIcon(){var t;return this.serviceList.length?null===(t=this.serviceList.find(t=>t.value===this.service))||void 0===t?void 0:t.icon:void 0},serviceName(){return this.serviceList.length?this.serviceList.find(t=>t.id===this.service).name:""},isAlias(){return"alias"===this.fields.based},isPreserve(){return this.fields.preserve},...Object(m.c)("portal",["serviceListByAppLaunch"])},mounted(){this.$appWindow=this.$options.appWin},methods:{async preload(){this.fields={...this.$store.state.portal.general},this.shortcut={...this.$store.state.portal.shortcut},this.FQDNPortList=await pi(),this.packageList=await K(),this.$store.commit("service/UPDATE_PACKAGE_LIST",this.packageList);let t=Array.isArray(this.serviceListByAppLaunch)&&this.serviceListByAppLaunch.length>0;if(this.serviceList=ni.call(this,await async function(t=!1){const e=await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"list",version:1});return await async function(t,e){return e?t.services.filter(t=>t.enable):t.services}(e,t)}(!t)),t&&(this.serviceList=this.serviceList.filter(t=>this.serviceListByAppLaunch.includes(t.service))),this.serviceOptions=function(t=[]){return t.reduce((t,e)=>(e.group in t||(t[e.group]={options:[]}),t[e.group].options.push(e),t),{})}(this.serviceList),0===this.serviceList.length)this.service=void 0,this.status={class:"syno-webstation-grey-status",message:_T("common","disabled")};else if(this.editor){let t=this.serviceList.find(t=>t.id===this.$store.state.portal.template.service);void 0!==t?(this.service=t.id,this.status=null==t?void 0:t.status):this.service=void 0}else{var e;this.service=this.serviceList[0].id,this.status=null===(e=this.serviceList.find(t=>t.id===this.service))||void 0===e?void 0:e.status}this.aclList=await ci();let i=this.aclList.find(t=>t.UUID===this.$store.state.portal.general.acl);this.fields.acl=void 0!==i?this.$store.state.portal.general.acl:this.aclList[0].UUID,this.errorPageList=await di();let n=this.errorPageList.find(t=>t.id===this.$store.state.portal.general.error_page);this.fields.error_page=void 0!==n?this.$store.state.portal.general.error_page:"default",await this.$nextTick(),this.$refs.service_form.commit(),this.$refs.form.commit()},async validate(){return await this.$refs.network_form.validate()&&await this.$refs.service_form.validate()&&await this.$refs.form.validate()},isDirty(){return this.$refs.network_form.isDirty()||this.$refs.service_form.isDirty()||this.$refs.form.isDirty()},commit(){this.$store.commit("portal/UPDATE_SERVICE",this.service),this.$store.commit("portal/UPDATE_GENERAL",this.fields),this.$store.commit("portal/UPDATE_SHORTCUT",this.shortcut)},reset(){this.$store.commit("portal/RESET_GENERAL")},onError(t){this.$refs.network_form.onError(t)},onSelectService(t){if(this.status=t.status,!this.editor){let e=this.$store.state.service.packageList.find(e=>e.id===t.value);void 0!==e&&"plex"===e.type&&(this.fields.based="port")}},async openServicePackageWizard(){if(this.$refs.select.closeDropdown(),this.isServicePackageWizardOpened)return;this.isServicePackageWizardOpened=!0;let{window:t}=this.$appWindow.openModalWindow(ui);t.$on("close",()=>{this.$store.commit("service/RESET_ALL"),this.isServicePackageWizardOpened=!1,this.preload()})},isShortcutDirty(){for(let e of["shortcut","display_name","all_users"]){var t;if(null!==(t=this.$refs.form.findField(e))&&void 0!==t&&t.isDirty)return!0}return this.$refs.network_form.isDirty()},onBasedChanged(){"alias"===this.fields.based&&(this.fields.enable_log=!1)}}},hi=(i(268),f(fi,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"server-portal"},[i("v-scrollbar",[i("v-form",{ref:"service_form",attrs:{"syno-id":"server-form"}},[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","common","service")+t._T("common","colon"),prop:"service",rules:t.serviceRule}},[i("v-single-select",{ref:"select",attrs:{"syno-id":"service",width:260,name:"service",options:this.serviceOptions,readonly:"",hasTooltip:"","custom-icon":t.iconType,customDropdownCls:"ws-service-dropdown"},on:{select:t.onSelectService},scopedSlots:t._u([void 0!==t.serviceIcon?{key:"icon",fn:function(){return[i("v-icon",t._b({},"v-icon",t.serviceIcon,!1))]},proxy:!0}:null,{key:"bottom-actions",fn:function(){return[i("v-select-divider-option"),t._v(" "),i("v-select-action-option",{attrs:{display:t._TT("SYNO.SDS.WebStation.Application","service","create_service")},on:{click:t.openServicePackageWizard}})]},proxy:!0}],null,!0),model:{value:t.service,callback:function(e){t.service=e},expression:"service"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","common","status")+t._T("common","colon"),textonly:""}},[void 0!==t.service?i("font",{class:t.status.class},[t._v(" "+t._s(t.status.message)+" ")]):t._e()],1)],1),t._v(" "),i("network-form",{ref:"network_form",attrs:{type:"server-portal","fqdn-port-list":t.FQDNPortList,"has-alias":!t.editor,"alias-only":t.editor&&t.isAlias},on:{"based-changed":t.onBasedChanged},model:{value:t.fields,callback:function(e){t.fields=e},expression:"fields"}}),t._v(" "),i("v-form",{ref:"form",attrs:{"syno-id":"server-portal-form",rules:t.rules}},[i("v-form-item",{attrs:{label:t._T("app_port_alias","desc_acl")+t._T("common","colon"),prop:"acl"},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","common","no_acl_profile_available"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}])},[i("v-single-select",{attrs:{"syno-id":"acl",width:260,name:"acl",displayField:"name",valueField:"UUID",options:this.aclList,readonly:"",hasTooltip:"","null-value":""},model:{value:t.fields.acl,callback:function(e){t.$set(t.fields,"acl",e)},expression:"fields.acl"}})],1),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","error_page_profile")+t._T("common","colon"),prop:"error_page"},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","common","tip_error_page_profile"),tooltipOptions:{isHtml:!0}}})]},proxy:!0}])},[i("v-single-select",{attrs:{"syno-id":"error_page",width:260,name:"error_page",displayField:"desc",valueField:"id",options:this.errorPageList,readonly:"",hasTooltip:""},model:{value:t.fields.error_page,callback:function(e){t.$set(t.fields,"error_page",e)},expression:"fields.error_page"}})],1),t._v(" "),i("v-form-item",{attrs:{"hide-label":"",prop:"access_log","register-key":"access_log"},scopedSlots:t._u([{key:"after",fn:function(){return[i("v-whitetip",{attrs:{content:t._TT("SYNO.SDS.WebStation.Application","portal","enable_log_tip")}})]},proxy:!0}])},[i("v-checkbox",{attrs:{"syno-id":"access_log",name:"access_log",disabled:t.isAlias},model:{value:t.fields.enable_log,callback:function(e){t.$set(t.fields,"enable_log",e)},expression:"fields.enable_log"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","portal","enable_log")))])],1),t._v(" "),i("v-form-item",{attrs:{"hide-label":"",prop:"shortcut","register-key":"shortcut"}},[i("v-checkbox",{attrs:{"syno-id":"shortcut","subscribe-field":"shortcut",name:"shortcut",disabled:t.isPreserve},model:{value:t.shortcut.enable,callback:function(e){t.$set(t.shortcut,"enable",e)},expression:"shortcut.enable"}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","shortcut","create_on")))])],1),t._v(" "),i("v-form-item",{attrs:{indent:"1",label:t._TT("SYNO.SDS.WebStation.Application","shortcut","shortcut_name")+" "+t._T("common","colon"),prop:"display_name"}},[i("v-input",{staticClass:"server-portal-input",attrs:{"syno-id":"display_name",name:"display_name",disabled:!t.shortcut.enable},model:{value:t.shortcut.display_name,callback:function(e){t.$set(t.shortcut,"display_name",e)},expression:"shortcut.display_name"}})],1),t._v(" "),i("v-form-item",{attrs:{indent:"1",label:t._TT("SYNO.SDS.WebStation.Application","shortcut","access_user")+" "+t._T("common","colon"),prop:"all_users"}},[i("v-single-select",{attrs:{"syno-id":"all_users",width:260,name:"all_users",disabled:!t.shortcut.enable,options:t.shortcutOptions,readonly:""},model:{value:t.shortcut.all_users,callback:function(e){t.$set(t.shortcut,"all_users",e)},expression:"shortcut.all_users"}})],1)],1)],1)],1)}),[],!1,null,null,null).exports),_i=f({name:"StepServerPortal",mixins:[l],components:{"server-portal":hi},props:{nextStepkey:String,stepKey:String},computed:{...Object(m.b)("portal",["IS_ALIAS","ALL_FIELDS"])},methods:{async onActivate(){this.$emit("spinning",!0),await this.$refs.portal.preload(),this.$emit("spinning",!1),this.$emit("enableNextButton",!0)},async finished(){try{if(!await this.$refs.portal.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.portal.commit();let t=this.IS_ALIAS?ti:Xe;if(!await this.sendSetRequest(t))return!1;this.$refs.portal.isShortcutDirty()&&SYNO.SDS.StatusNotifier.fireEvent("thirdpartychanged"),this.$refs.portal.reset(),this.$emit("close")},async sendSetRequest(t){let e;try{this.$emit("spinning",!0);await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Portal",version:1,method:"create",params:{portal:li(t,this.ALL_FIELDS)}})}catch(t){e=t.code,this.$emit("spinning",!1),this.$emit("error","service",t),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(e))}finally{return void 0===e}},onError(t){this.$refs.portal.onError(t)}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-sw-server-portal","step-key":this.stepKey,finished:this.finished,headline:this._TT("SYNO.SDS.WebStation.Application","portal","setup_portal_title_case")},on:{activate:this.onActivate}},[e("server-portal",{ref:"portal",attrs:{"window-type":"wizard"}})],1)}),[],!1,null,null,null).exports,mi={name:"NetworkForm",mixins:[l,qe],props:{type:String,FQDNPortList:Array,value:Object,hasAlias:{type:Boolean,default:!1}},data(){return{rules:{"fields.fqdn":He(this.value,this.FQDNPortList),"fields.name_http_port":ze,"fields.name_https_port":ze,"fields.port_http_port":ze,"fields.port_https_port":ze,"fields.alias":Ve},VALIDATE_NETWORK:Ge,defaultTypeList:[{name:_TT("SYNO.SDS.WebStation.Application","vhost","name_based"),based:"name"},{name:_TT("SYNO.SDS.WebStation.Application","vhost","port_based"),based:"port"}]}},computed:{typeList(){return this.hasAlias&&this.defaultTypeList.push({name:_TT("SYNO.SDS.WebStation.Application","service_wizard","title_alias"),based:"alias"}),this.defaultTypeList},fields(){return U()(this.value)},nameHttpDisabled(){return"name"!==this.fields.based||!1===this.fields.name_http},nameHttpsDisabled(){return"name"!==this.fields.based||!1===this.fields.name_https},portHttpDisabled(){return"port"!==this.fields.based||!1===this.fields.port_http},portHttpsDisabled(){return"port"!==this.fields.based||!1===this.fields.port_https}},methods:{async validate(){return await this.$refs.form.validate()},isDirty(){return this.$refs.form.isDirty()},setHttpFieldInvaid(t){"name"===this.fields.based?this.$refs.itemNameHttpPort.setInvalid(t):this.$refs.itemPortHttpPort.setInvalid(t)},setHttpsFieldInvaid(t){"name"===this.fields.based?this.$refs.itemNameHttpsPort.setInvalid(t):this.$refs.itemPortHttpsPort.setInvalid(t)},onError(t){let e=SYNO.SDS.WebStation.Errors.GetMessage(t.code);switch(t.code){case 1004:case 1009:case 1021:this.handleConflictHost(t.errors.conflict_ports);break;case 1007:this.$refs.itemFqdn.setInvalid(e);break;case 1307:this.setHttpFieldInvaid(e);break;case 1308:this.setHttpsFieldInvaid(e);break;case 1309:this.setHttpFieldInvaid(e),this.setHttpsFieldInvaid(e)}},handleConflictHost(t){let e=this.fields,i="",n=-1,s=-1;"name"===e.based?(!1===this.nameHttpDisabled&&(n=parseInt(e.name_http_port,10)),!1===this.nameHttpsDisabled&&(s=parseInt(e.name_https_port,10)),i=_TT("SYNO.SDS.WebStation.Application","error","err_host_duplicated")):(!1===this.portHttpDisabled&&(n=parseInt(e.port_http_port,10)),!1===this.portHttpsDisabled&&(s=parseInt(e.port_https_port,10)),i=_TT("SYNO.SDS.WebStation.Application","error","err_port_conflict")),"name"===e.based&&!0===e.name_port&&this.$refs.itemFqdn.setInvalid(i),i=_TT("SYNO.SDS.WebStation.Application","error","err_port_conflict"),t.includes(n)&&this.setHttpFieldInvaid(i),t.includes(s)&&this.setHttpsFieldInvaid(i)}}},Si=(i(269),f(mi,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-form",{ref:"form",attrs:{"syno-id":"network-form",rules:t.rules}},[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","portal","portal_type")+t._T("common","colon"),prop:"fields.based","register-key":"select"}},[i("v-single-select",{attrs:{"syno-id":"select-based",name:"based",width:220,displayField:"name",valueField:"based",options:this.typeList,value:t.fields.based,readonly:"",hasTooltip:"","subscribe-field":"select"},on:{input:function(e){return t.update("based",e)}}})],1),t._v(" "),"name"===t.fields.based?[i("v-form-item",{ref:"itemFqdn",staticClass:"potal-type-form-label",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","hostname")+t._T("common","colon"),prop:"fields.fqdn","register-key":"fqdn"}},[i("v-input",{staticClass:"network__name-input",attrs:{"syno-id":"fqdn",name:"fqdn",value:t.fields.fqdn,disabled:"name"!==t.fields.based,mask:t.VALIDATE_NETWORK.FQDN_MASK,"subscribe-field":"fqdn"},on:{input:function(e){return t.update("fqdn",e)}}})],1),t._v(" "),i("v-form-item",{staticClass:"potal-type-form-label",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","port")+t._T("common","colon"),prop:"fields.name_port","register-key":"name_port"}},[i("v-checkbox",{attrs:{"syno-id":"name_port",name:"name_port",value:t.fields.name_port,disabled:"name"!==t.fields.based,"subscribe-field":"name_port"},on:{input:function(e){return t.update("name_port",e)}}},[t._v("\n\t\t\t\t\t80 / 443\n\t\t\t\t")])],1),t._v(" "),i("v-form-multiple-item",{attrs:{"syno-id":"name_based_http_port"}},[i("v-form-item",{attrs:{prop:"fields.name_http","register-key":"name_http"}},[i("v-checkbox",{staticClass:"port-checkbox",attrs:{"syno-id":"name_http",name:"name_http",value:t.fields.name_http,disabled:"name"!==t.fields.based,"subscribe-field":"name_http"},on:{input:function(e){return t.update("name_http",e)}}},[t._v("HTTP")])],1),t._v(" "),i("v-form-item",{ref:"itemNameHttpPort",attrs:{prop:"fields.name_http_port","register-key":"name_http_port"}},[i("v-input",{staticClass:"network__port-input",attrs:{"syno-id":"name_http_port",name:"name_http_port",value:t.fields.name_http_port,"number-only":!0,disabled:t.nameHttpDisabled,"subscribe-field":"name_http_port"},on:{input:function(e){return t.update("name_http_port",e)}}})],1)],1),t._v(" "),i("v-form-multiple-item",{attrs:{"syno-id":"name_based_https_port"}},[i("v-form-item",{attrs:{prop:"fields.name_https","register-key":"name_https"}},[i("v-checkbox",{staticClass:"port-checkbox",attrs:{"syno-id":"name_https",name:"name_https",value:t.fields.name_https,disabled:"name"!==t.fields.based,"subscribe-field":"name_https"},on:{input:function(e){return t.update("name_https",e)}}},[t._v("HTTPS")])],1),t._v(" "),i("v-form-item",{ref:"itemNameHttpsPort",attrs:{prop:"fields.name_https_port","register-key":"name_https_port"}},[i("v-input",{staticClass:"network__port-input",attrs:{"syno-id":"name_https_port",name:"name_https_port",value:t.fields.name_https_port,"number-only":!0,disabled:t.nameHttpsDisabled,"subscribe-field":"name_https_port"},on:{input:function(e){return t.update("name_https_port",e)}}})],1)],1)]:"port"===t.fields.based?[i("v-form-multiple-item",{staticClass:"potal-type-form-label",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","port")+t._T("common","colon")}},[i("v-form-item",{attrs:{prop:"fields.port_http","register-key":"port_http"}},[i("v-checkbox",{staticClass:"port-checkbox",attrs:{"syno-id":"port_http",name:"port_http",value:t.fields.port_http,disabled:"port"!==t.fields.based,"subscribe-field":"port_http"},on:{input:function(e){return t.update("port_http",e)}}},[t._v("HTTP")])],1),t._v(" "),i("v-form-item",{ref:"itemPortHttpPort",attrs:{prop:"fields.port_http_port","register-key":"port_http_port"}},[i("v-input",{staticClass:"network__port-input",attrs:{"syno-id":"port_http_port",name:"port_http_port",value:t.fields.port_http_port,"number-only":!0,disabled:t.portHttpDisabled,"subscribe-field":"port_http_port"},on:{input:function(e){return t.update("port_http_port",e)}}})],1)],1),t._v(" "),i("v-form-multiple-item",{attrs:{"syno-id":"port_based_https_port"}},[i("v-form-item",{attrs:{prop:"fields.port_https","register-key":"port_https"}},[i("v-checkbox",{staticClass:"port-checkbox",attrs:{"syno-id":"port_https",name:"port_https",value:t.fields.port_https,disabled:"port"!==t.fields.based,"subscribe-field":"port_https"},on:{input:function(e){return t.update("port_https",e)}}},[t._v("HTTPS")])],1),t._v(" "),i("v-form-item",{ref:"itemPortHttpsPort",attrs:{prop:"fields.port_https_port","register-key":"port_https_port"}},[i("v-input",{staticClass:"network__port-input",attrs:{"syno-id":"port_https_port",name:"port_https_port",value:t.fields.port_https_port,"number-only":!0,disabled:t.portHttpsDisabled,"subscribe-field":"port_https_port"},on:{input:function(e){return t.update("port_https_port",e)}}})],1)],1)]:"alias"===t.fields.based?["alias"===t.fields.based?i("v-form-item",{ref:"itemAlias",staticClass:"potal-type-form-label",attrs:{label:t._T("app_port_alias","desc_alias")+t._T("common","colon"),prop:"fields.alias","register-key":"alias"}},[i("v-input",{staticClass:"network__name-input",attrs:{"syno-id":"alias",name:"alias",value:t.fields.alias,disabled:"alias"!==t.fields.based,"subscribe-field":"alias"},on:{input:function(e){return t.update("alias",e)}}})],1):t._e()]:t._e(),t._v(" "),"alias"!==t.fields.based?i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","vhost","https_settings")+t._T("common","colon"),prop:"fields.hsts","register-key":"hsts"}},[i("v-checkbox",{attrs:{"syno-id":"hsts",name:"hsts",value:t.fields.hsts,"subscribe-field":"hsts"},on:{input:function(e){return t.update("hsts",e)}}},[t._v("HSTS")])],1):t._e()],2)],1)}),[],!1,null,"12d93c92",null)),vi=f({name:"DefaultServerPortal",components:{"network-form":Si.exports},props:{windowType:String},data(){return{fields:{...this.$store.state.portal.general},FQDNPortList:[]}},methods:{async preload(){this.fields={...this.$store.state.portal.general},this.FQDNPortList=await pi()},async validate(){return await this.$refs.network_form.validate()},isDirty(){return this.$refs.network_form.isDirty()},commit(){this.$store.commit("portal/UPDATE_GENERAL",this.fields)},reset(){this.$store.commit("portal/RESET_ALL")},onError(t){this.$refs.network_form.onError(t)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-scrollbar",[i("network-form",{ref:"network_form",attrs:{type:"default-server-portal","fqdn-port-list":t.FQDNPortList},model:{value:t.fields,callback:function(e){t.fields=e},expression:"fields"}})],1)],1)}),[],!1,null,null,null),gi=f({name:"StepDefaultServerPortal",mixins:[l],components:{"default-server-portal":vi.exports},props:{nextStepkey:String,stepKey:String},computed:{...Object(m.b)("portal",["ALL_FIELDS"])},methods:{async onActivate(){this.$emit("spinning",!0),await this.$refs.portal.preload(),this.$emit("spinning",!1),this.$emit("enableNextButton",!0)},async finished(){try{if(!await this.$refs.portal.validate())return this.$emit("display-error",this._T("common","forminvalid")),!1}catch(t){return this.$emit("display-error",t),!1}this.$refs.portal.commit();let t=this.$store.state.portal.serviceList.find(t=>"WebStation"===t.category&&"default_server"===t.service);if(this.$store.commit("portal/UPDATE_SERVICE",t.id),!await this.sendSetRequest())return!1;this.$refs.portal.reset(),this.$emit("close")},async sendSetRequest(){let t;try{this.$emit("spinning",!0);await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Portal",version:1,method:"create",params:{portal:li(Ze,this.ALL_FIELDS)}})}catch(e){t=e.code,this.$emit("spinning",!1),this.$emit("error","default",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}},onError(t){this.$refs.portal.onError(t)}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-step",{ref:"step",attrs:{"syno-id":"ws-sw-default-server-portal","step-key":this.stepKey,finished:this.finished,headline:""+this._TT("SYNO.SDS.WebStation.Application","portal","setup_alternative_protal_of_default_server")},on:{activate:this.onActivate}},[e("default-server-portal",{ref:"portal",attrs:{"window-type":"wizard"}})],1)}),[],!1,null,null,null),bi=f({mixins:[C],components:{"step-select-portal":Be,"step-server-portal":_i,"step-default-server-portal":gi.exports},data:()=>({showStatusBar:!1,statusBarState:"",statusBarErrorText:"",buttonsGroup:{}}),computed:{activeStepKey(){return""===this.$store.state.portal.category?"select-portal":"server-portal"}},methods:{onEnableNextButton(t,e=!0){this.buttonsGroup={next:{text:e?_T("common","create"):_T("common","next"),disabled:!t}}},async displayError(t){this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,await new Promise(t=>setTimeout(t,5e3)),this.showStatusBar=!1},onError(t,e){switch(t){case"service":this.$refs.serverPortal.onError(e);break;case"default":this.$refs.defaultServer.onError(e)}}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-wizard",{attrs:{"syno-id":"ws-service-wizard","active-step-key":t.activeStepKey,"custom-buttons-group":t.buttonsGroup,refs:"wizard","show-status-bar":t.showStatusBar,"status-bar-state":t.statusBarState,"status-bar-error-text":t.statusBarErrorText},on:{"step-scroll":function(e){return t.$emit("step-scroll",e)}}},[i("step-select-portal",{attrs:{"syno-id":"step-select-portal","step-key":"select-portal"},on:{spinning:function(e){return t.$emit("spinning",e)},"display-error":t.displayError,enableNextButton:t.onEnableNextButton}}),t._v(" "),i("step-server-portal",{ref:"serverPortal",attrs:{"syno-id":"step-server-portal","step-key":"server-portal"},on:{spinning:function(e){return t.$emit("spinning",e)},error:t.onError,"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}}),t._v(" "),i("step-default-server-portal",{ref:"defaultServer",attrs:{"syno-id":"step-default-server-portal","step-key":"default-server-portal"},on:{spinning:function(e){return t.$emit("spinning",e)},error:t.onError,"display-error":t.displayError,enableNextButton:t.onEnableNextButton,close:function(e){return t.$emit("close")}}})],1)}),[],!1,null,null,null),yi=f({mixins:[l],components:{"portal-wizard":bi.exports},methods:{onStepScrolled(t){this.$refs.window.onStepScrolled(t)},onSpinning(t){this.$refs.window.onlyMask=!1,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatusBusy()},onLoading(t){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatusBusy()},onClose(){this.$refs.window.close()}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-wizard-window",{ref:"window",attrs:{"syno-id":"ws-service-wizard-window",title:this._TT("SYNO.SDS.WebStation.Application","service_wizard","service_wizard"),width:600,height:480,"before-close":function(){}}},[e("portal-wizard",{on:{"step-scroll":this.onStepScrolled,spinning:this.onSpinning,loading:this.onLoading,close:this.onClose}})],1)}),[],!1,null,null,null).exports,wi={name:"DefaultServerPortalEditor",mixins:[l],components:{"default-server-portal":f({name:"DefaultServerPortal",components:{"network-form":Je},props:{windowType:String},data(){return{fields:{...this.$store.state.portal.general},FQDNPortList:[]}},methods:{async preload(){this.fields={...this.$store.state.portal.general},this.FQDNPortList=await pi()},async validate(){return await this.$refs.network_form.validate()},isDirty(){return this.$refs.network_form.isDirty()},commit(){this.$store.commit("portal/UPDATE_GENERAL",this.fields)},reset(){this.$store.commit("portal/RESET_ALL")},onError(t){this.$refs.network_form.onError(t)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-scrollbar",[i("network-form",{ref:"network_form",attrs:{type:"default-server-portal","fqdn-port-list":t.FQDNPortList},model:{value:t.fields,callback:function(e){t.fields=e},expression:"fields"}})],1)],1)}),[],!1,null,null,null).exports},data:()=>({showStatusBar:!1,statusBarErrorText:"",isLoading:!1,loadingType:"spin",statusBarState:"loading"}),computed:{...Object(m.b)("portal",["ALL_FIELDS"])},async mounted(){this.onLoading(),await this.$nextTick(),await this.$refs.portal.preload(),this.onLoading(!1)},methods:{async save(){try{if(!await this.$refs.portal.validate())return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}if(this.$refs.portal.commit(),!await this.sendSetRequest())return!1;this.$refs.portal.reset(),this.close()},async sendSetRequest(){let t;try{this.onLoading();await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Portal",version:1,method:"update",params:{portal:li(Ze,this.ALL_FIELDS,{editor:!0})}})}catch(e){t=e.code,this.$refs.portal.onError(e),this.onError(SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}},async cancel(){if(!await this.$refs.portal.isDirty())return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$refs.portal.reset(),this.$refs.window.doClose()},onLoading(t=!0){this.isLoading=t,this.loadingType="spin",this.statusBarState="loading",this.validateStatus=""},onError(t){return this.showStatusBar=!0,this.isLoading=!1,this.loadingType="statusbar",this.statusBarState="error",this.validateStatus="error",this.statusBarErrorText=t,!1}}},Ti=(i(270),f(wi,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"webstation-default-server-portal-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","portal","edit_alternative_portal_title_case"),width:"650",height:"auto",beforeClose:t.cancel}},[i("v-panel",{staticClass:"webstation-editor-panel",attrs:{"syno-id":"webstation-default-server-portal-editor-panel",loading:t.isLoading,"loading-type":t.loadingType,"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,"error-text":t.statusBarErrorText,confirm:t.save,cancel:t.cancel},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e}},scopedSlots:t._u([{key:"body",fn:function(){return[i("default-server-portal",{ref:"portal",attrs:{"window-type":"modal"}})]},proxy:!0}])})],1)}),[],!1,null,"538a1c70",null).exports),xi=f({name:"ServerPortalEditor",mixins:[l],components:{"server-portal":hi},data:()=>({showStatusBar:!1,statusBarErrorText:"",isLoading:!1,loadingType:"spin",statusBarState:"loading"}),computed:{...Object(m.b)("portal",["ALL_FIELDS"])},async mounted(){this.onLoading(),await this.$nextTick(),await this.$refs.portal.preload(),await this.$refs.portal.validate(),this.onLoading(!1)},methods:{async save(){try{if(!await this.$refs.portal.validate())return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}if(this.$refs.portal.commit(),!await this.sendSetRequest())return!1;this.$refs.portal.isShortcutDirty()&&SYNO.SDS.StatusNotifier.fireEvent("thirdpartychanged"),this.$refs.portal.reset(),this.close()},async sendSetRequest(){let t;try{this.onLoading();await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Portal",version:1,method:"update",params:{portal:li("alias"===this.ALL_FIELDS.based?ti:Xe,this.ALL_FIELDS,{editor:!0})}})}catch(e){t=e.code,this.$refs.portal.onError(e),this.onError(SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}},async cancel(){if(!await this.$refs.portal.isDirty())return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$refs.portal.reset(),this.$refs.window.doClose()},onLoading(t=!0){this.isLoading=t,this.loadingType="spin",this.statusBarState="loading",this.validateStatus=""},onError(t){return this.showStatusBar=!0,this.isLoading=!1,this.loadingType="statusbar",this.statusBarState="error",this.validateStatus="error",this.statusBarErrorText=t,!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"webstation-server-portal-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","portal","edit_portal"),width:600,height:480,beforeClose:t.cancel}},[i("v-panel",{attrs:{"syno-id":"webstation-server-portal-editor-panel",loading:t.isLoading,"loading-type":t.loadingType,"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,"error-text":t.statusBarErrorText,confirm:t.save,cancel:t.cancel},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e}},scopedSlots:t._u([{key:"scroll-body",fn:function(){return[i("server-portal",{ref:"portal",attrs:{editor:"","window-type":"modal"}})]},proxy:!0}])})],1)}),[],!1,null,null,null).exports,Ei=i(52),ki=i.n(Ei),Di={mixins:[l],props:{id:String},data:()=>({total:0,pageNum:1,pageSize:100,itemsPerPage:[{label:"50",value:50},{label:"100",value:100},{label:"500",value:500},{label:"1000",value:1e3}],columns:[{title:_T("log","logattr"),width:100,field:"formattedLevel"},{title:_T("log","log_time"),width:160,field:"formattedTime"},{title:_T("common","ip_addr"),width:120,field:"client"},{title:_T("log","log_action"),field:"message"}],data:[],searchForm:{keyword:"",dateRange:"customize",dateFrom:null,dateTo:null,level:"all"},dateRangeOptions:[{label:_TT("SYNO.SDS.WebStation.Application","log","custom"),value:"customize"},{label:_TT("SYNO.SDS.WebStation.Application","log","today"),value:"today"},{label:_TT("SYNO.SDS.WebStation.Application","log","yesterday"),value:"yesterday"},{label:_TT("SYNO.SDS.WebStation.Application","log","last_week"),value:"lastWeek"},{label:_TT("SYNO.SDS.WebStation.Application","log","last_month"),value:"lastMonth"}],levelOptions:[{label:_TT("SYNO.SDS.WebStation.Application","log","all"),value:"all"},{label:_T("log","info_level"),value:"info"},{label:_T("log","warn_level"),value:"warn"},{label:_T("log","error_level"),value:"error"}]}),created(){this._loadDataDebounce=ki()(this.loadData,250)},async mounted(){await this.$nextTick(),await this.loadData()},computed:{showDatePicker(){return"customize"===this.searchForm.dateRange},dateFromTo(){return function(t,e={}){let i,n,s;switch(t){case"customize":let t={from:-1,to:-1};return e.dateFrom&&(i=new Date(e.dateFrom),t.from=Math.floor(+i/1e3)),e.dateTo&&(n=new Date(e.dateTo),n=n.add(Date.DAY,1),t.to=Math.floor(+n/1e3)),t;case"today":return i=(new Date).clearTime(),n=new Date,{from:Math.floor(+i/1e3),to:Math.floor(+n/1e3)};case"yesterday":return i=(new Date).clearTime(),n=(new Date).clearTime(),i=i.add(Date.DAY,-1),{from:Math.floor(+i/1e3),to:Math.floor(+n/1e3)};case"lastWeek":return n=(new Date).clearTime(),s=n.getDay(),n=n.add(Date.DAY,-s),i=n.add(Date.DAY,-7),{from:Math.floor(+i/1e3),to:Math.floor(+n/1e3)};case"lastMonth":return n=(new Date).clearTime(),n.setDate(1),i=n.add(Date.MONTH,-1),{from:Math.floor(+i/1e3),to:Math.floor(+n/1e3)};default:return{from:-1,to:-1}}}(this.searchForm.dateRange,this.searchForm)}},methods:{async loadData(){try{this.onLoading();const t=(this.pageNum-1)*this.pageSize,e=await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Portal.Log",method:"get",version:1,params:{id:this.id,date_from:this.dateFromTo.from,date_to:this.dateFromTo.to,keyword:this.searchForm.keyword,level:this.searchForm.level,limit:this.pageSize,offset:t}});this.data=e.log.map(t=>({formattedTime:this.covertTime(t.time),formattedLevel:_T("log",t.level+"_level"),...t})),this.total=e.total}catch(t){SYNO.Debug.error("GetPortalLog failed",t)}finally{this.onLoading(!1)}},onSwitchPage({pageNumber:t,pageSize:e}){this.pageNum=t,this.pageSize=e,this.loadData()},filter(t){this.searchForm.keyword=t,this._loadDataDebounce()},async exportLog(t){this.onLoading();await synowebapi.promises.download({api:"SYNO.WebStation.WebService.Portal.Log",method:"export",version:1,params:{id:this.id,type:t,date_from:this.dateFromTo.from,date_to:this.dateFromTo.to,keyword:this.searchForm.keyword,level:this.searchForm.level}});this.onLoading(!1)},async clearAll(){this.onLoading();await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Portal.Log",method:"remove",version:1,params:{id:this.id}});await this.loadData(),this.onLoading(!1)},onLoading(t=!0){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatus()},close(){this.$refs.window.doClose()},covertTime:t=>SYNO.SDS.DateTimeFormatter(new Date(1e3*t),{type:"datetimesec"}),async onAdvanceEvent(t=!1){t&&(this.pageNum=1,this.searchForm={level:"all",dateRange:"customize",dateFrom:null,dateTo:null,keyword:null}),this.$refs.search.closeAdvancedPanel(),await this.loadData()}}},Ai=(i(273),f(Di,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"webstation-log-viewer-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","log","log_title"),width:"780",height:"500",beforeClose:t.cancel}},[i("v-panel",{staticClass:"log-viewer-panel",attrs:{"syno-id":"log-viewer-panel",tbar:""},scopedSlots:t._u([{key:"tbar",fn:function(){return[i("v-button",{attrs:{"syno-id":"clear-btn"},on:{click:t.clearAll}},[t._v("\n\t\t\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","actions","clear"))+"\n\t\t\t\t")]),t._v(" "),i("v-button",{attrs:{"syno-id":"export",type:"dropdown"},scopedSlots:t._u([{key:"dropdown",fn:function(){return[i("v-menu",{attrs:{"syno-id":"export-menu"}},[i("v-menu-item",{attrs:{"syno-id":"html-btn",title:t._TT("SYNO.SDS.WebStation.Application","log","html"),id:"html"},on:{click:function(e){return t.exportLog("html")}}}),t._v(" "),i("v-menu-item",{attrs:{"syno-id":"csv-btn",title:t._TT("SYNO.SDS.WebStation.Application","log","csv"),id:"csv"},on:{click:function(e){return t.exportLog("csv")}}})],1)]},proxy:!0}])},[t._v("\n\t\t\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","actions","export"))+"\n\t\t\t\t\t")]),t._v(" "),i("v-single-select",{ref:"search",staticClass:"search",attrs:{"syno-id":"search",width:200,filter:t.filter,"show-dropdown":!1,advanced:""},scopedSlots:t._u([{key:"advanced-panel",fn:function(){return[i("v-panel",{staticClass:"ws-search-panel",attrs:{"syno-id":"search-panel","layout-type":"none",cancel:function(){return t.onAdvanceEvent(!0)},"cancel-text":t._TT("SYNO.SDS.WebStation.Application","actions","reset"),confirm:function(){return t.onAdvanceEvent()},"confirm-text":t._TT("SYNO.SDS.WebStation.Application","actions","search")},scopedSlots:t._u([{key:"body",fn:function(){return[i("v-form",{ref:"searchForm",attrs:{direction:"vertical","syno-id":"search-panel-form",model:t.searchForm}},[i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","log","keyword")+" "+t._T("common","colon"),prop:"keyword"}},[i("v-input",{attrs:{"syno-id":"keyword",name:"keyword"},model:{value:t.searchForm.keyword,callback:function(e){t.$set(t.searchForm,"keyword",e)},expression:"searchForm.keyword"}})],1),t._v(" "),i("v-form-item",{staticClass:"ws-date-range",attrs:{label:t._TT("SYNO.SDS.WebStation.Application","log","date_range")+" "+t._T("common","colon"),prop:"dateRange"}},[i("v-single-select",{attrs:{"syno-id":"search-panel-date-range",width:"312",options:t.dateRangeOptions,placeholder:t._TT("SYNO.SDS.WebStation.Application","log","custom")},model:{value:t.searchForm.dateRange,callback:function(e){t.$set(t.searchForm,"dateRange",e)},expression:"searchForm.dateRange"}})],1),t._v(" "),t.showDatePicker?i("v-form-multiple-item",{attrs:{hideLabel:!0}},[i("v-form-item",{attrs:{prop:"dateTo"}},[i("v-date-picker",{attrs:{"syno-id":"search-panel-date-from","allow-blank":"",placeholder:t._TT("SYNO.SDS.WebStation.Application","log","from"),"max-time":t.searchForm.dateTo?new Date(t.searchForm.dateTo):null},model:{value:t.searchForm.dateFrom,callback:function(e){t.$set(t.searchForm,"dateFrom",e)},expression:"searchForm.dateFrom"}})],1),t._v(" "),i("v-form-item",{attrs:{prop:"dateFrom"}},[i("v-date-picker",{attrs:{"syno-id":"search-panel-date-to","allow-blank":"",placeholder:t._TT("SYNO.SDS.WebStation.Application","log","to"),"min-time":t.searchForm.dateFrom?new Date(t.searchForm.dateFrom):null},model:{value:t.searchForm.dateTo,callback:function(e){t.$set(t.searchForm,"dateTo",e)},expression:"searchForm.dateTo"}})],1)],1):t._e(),t._v(" "),i("v-form-item",{attrs:{label:t._TT("SYNO.SDS.WebStation.Application","log","level")+" "+t._T("common","colon"),prop:"level"}},[i("v-single-select",{attrs:{"syno-id":"search-panel-level",width:"312",options:t.levelOptions},model:{value:t.searchForm.level,callback:function(e){t.$set(t.searchForm,"level",e)},expression:"searchForm.level"}})],1)],1)]},proxy:!0}])})]},proxy:!0}])})]},proxy:!0},{key:"body",fn:function(){return[i("div",{staticClass:"log-table-wrapper"},[i("v-data-table",{ref:"table",staticClass:"log-table",attrs:{"syno-id":"log-data-table","current-data":t.data,columns:t.columns,"page-size":t.pageSize,"page-num":t.pageNum,total:t.total,"items-per-page":t.itemsPerPage,"enable-hd-menu":!1,pagination:!0,"virtual-scroll":""},on:{"switch-page":t.onSwitchPage,"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},refresh:t.loadData},scopedSlots:t._u([{key:"formattedLevel",fn:function(e){var n=e.data,s=e.row;return[i("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:n,overflowOnly:!0},expression:"{ content: data, overflowOnly: true }"}],class:"level-"+s.level},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(n)+"\n\t\t\t\t\t\t\t")])]}},{key:"formattedTime",fn:function(e){var n=e.data;return[i("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:n,overflowOnly:!0},expression:"{ content: data, overflowOnly: true }"}]},[t._v(" "+t._s(n)+" ")])]}},{key:"client",fn:function(e){var n=e.data;return[i("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:n,overflowOnly:!0},expression:"{ content: data, overflowOnly: true }"}]},[t._v(" "+t._s(n)+" ")])]}},{key:"message",fn:function(e){var n=e.data;return[i("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:n,overflowOnly:!0},expression:"{ content: data, overflowOnly: true }"}]},[t._v(" "+t._s(n)+" ")])]}}])})],1)]},proxy:!0},{key:"fbar",fn:function(){return[i("div",{staticClass:"pull-right"},[i("v-button",{attrs:{"syno-id":"close",type:"footbar"},on:{click:t.close}},[t._v("\n\t\t\t\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","actions","close"))+"\n\t\t\t\t\t")])],1)]},proxy:!0}])},[t._v(">\n\t\t\t")])],1)}),[],!1,null,null,null).exports);const Oi="ENABLE",Ni="SERVICE_DISABLE",$i="SERVICE_ERROR",Li="SERVICE_LOADING",Wi="DISABLE",Pi="ERROR",Yi=()=>({[Oi]:{type:Oi,class:"green-status",message:_T("helpbrowser","font_normal")},[Wi]:{type:Wi,class:"syno-webstation-grey-status",message:_T("common","disabled")},[Li]:{type:Li,class:"syno-webstation-loading-status",message:_TT("SYNO.SDS.WebStation.Application","common","service_loading")},[Ni]:{type:Ni,class:"syno-webstation-grey-status",message:_TT("SYNO.SDS.WebStation.Application","common","service_disable")},[$i]:{type:$i,class:"red-status",message:_TT("SYNO.SDS.WebStation.Application","common","service_error")},[Pi]:{type:Pi,class:"red-status",message:_T("common","status_abnormal")}}),Ri="DEFAULT_SERVER",Ci="DEFAULT_SERVER_PORTAL",Ii="SERVER_PORTAL",Bi="ALIAS";function ji(t=[],e=[],i={}){return t.filter(t=>"server"===t.type).map(t=>{const i=e.find(e=>e.id===t.service)||{};return{_type:"WebStation"===i.category&&"default_server"===i.service?Ci:Ii,...t}}).map(t=>{const n=e.find(e=>e.id===t.service);return{preserve:Fi(t),status:Mi(t,n,i),service:qi(t,n),fqdn:t.fqdn||"*",port:Gi(t),alias:"-",primaryLink:SYNO.SDS.WebStation.Util.genPortalLink(t),_originalData:t}})}function Ui(t=[],e=[]){return t.filter(t=>"alias"===t.type).map(t=>({_type:Bi,...t})).map(t=>{const i=e.find(e=>e.id===t.service);return{preserve:Fi(t),status:Mi(t,i),service:qi(t,i),fqdn:t.fqdn||"*",port:"-",alias:t.alias,primaryLink:`https://${window.location.hostname}/${t.alias}`,_originalData:t}})}function Fi(t={}){return t.preserve?_TT("SYNO.SDS.WebStation.Application","portal","header_group_preserve_portal"):_TT("SYNO.SDS.WebStation.Application","portal","header_group_non_preserve_portal")}function Mi(t={},e=null,i={}){const n=Yi();if(t._type===Ci){const t=null===i.php||i.php_profiles.profiles.some(t=>t.uuid===i.php),e=!!i.available_server_backend.includes(i.backend),s=null===i.userdir_php||i.php_profiles.profiles.some(t=>t.uuid===i.userdir_php),a=!!i.available_server_backend.includes(i.userdir_backend);let r=$i;return t&&e&&(!i.userdir||s&&a)&&(r=Oi),n[r]}if(!t.enable)return n[Wi];let s=Wi;return s=e?e.enable?function(t){switch(t){case A.PAUSED:return Ni;case A.ERROR:return $i;case A.LOADING:return Li;default:return Oi}}(e.status.type):Ni:Pi,n[s]}function qi(t={},e=null){if(!t.service)return"";if(!e)return{class:"status-not-avaiable",message:_TT("SYNO.SDS.WebStation.Application","common","status_not_available")};if("WebStation"===e.category&&"default_server"===e.service)return _TT("SYNO.SDS.WebStation.Application","portal","alternative_host");const i=e.display_name_i18n,n=e.display_name;return SYNO.SDS.WebStation.Util.geti18nString(i,n)}function Gi(t={}){return[t.http_port,t.https_port].flat().join(" / ")}function zi(t={}){return{preserve:_TT("SYNO.SDS.WebStation.Application","portal","header_group_preserve_portal"),status:function(){const e=Yi(),i=null===t.php||t.php_profiles.profiles.some(e=>e.uuid===t.php),n=!!t.available_server_backend.includes(t.backend),s=null===t.userdir_php||t.php_profiles.profiles.some(e=>e.uuid===t.userdir_php),a=!!t.available_server_backend.includes(t.userdir_backend);let r=$i;i&&n&&(!t.userdir||s&&a)&&(r=Oi);return e[r]}(),service:_TT("SYNO.SDS.WebStation.Application","portal","default_server"),fqdn:"*",port:"80 / 443",alias:"-",primaryLink:`https://${window.location.hostname}/`,_originalData:{_type:Ri,preserve:!0}}}let Hi=Vue.extend({store:R}).extend(yi),Vi=Vue.extend({store:R}).extend(Ti),Ki=Vue.extend({store:R}).extend(xi),Ji=Vue.extend({store:R}).extend(Ai);var Zi={mixins:[l,_],computed:{allSelectedRows(){var t,e;return this.selectedRows&&(null===(t=this.selectedRows)||void 0===t||null===(e=t.rows)||void 0===e?void 0:e.map(t=>t._originalData))},allSelectedIndexes(){var t;return null===(t=this.selectedRows)||void 0===t?void 0:t.indexes},singleSelectedRowData(){var t;return 1===(null===(t=this.allSelectedRows)||void 0===t?void 0:t.length)&&{index:this.allSelectedIndexes[0],row:this.allSelectedRows[0]}||null},singleSelectedData(){return this.singleSelectedRowData&&this.singleSelectedRowData.row||null},isLogViewable(){return!!this.singleSelectedData&&!["DEFAULT_SERVER","ALIAS","DEFAULT_SERVER_PORTAL"].includes(this.singleSelectedData._type)},isEditable(){return!!this.singleSelectedData&&"DEFAULT_SERVER"!==this.singleSelectedData._type},isActionEnabled(){var t,e;return(null===(t=this.allSelectedRows)||void 0===t?void 0:t.length)>0&&void 0===(null===(e=this.allSelectedRows)||void 0===e?void 0:e.find(t=>t.preserve&&"DEFAULT_SERVER"===t._type))},isDeleteable(){var t;return null===(t=this.allSelectedRows)||void 0===t?void 0:t.every(t=>!t.preserve)},isAvailable(){var t,e,i;return(null===(t=this.allSelectedRows)||void 0===t?void 0:t.every(t=>"DEFAULT_SERVER_PORTAL"!==t._type))&&(null===(e=this.selectedRows)||void 0===e||null===(i=e.rows)||void 0===i?void 0:i.every(t=>t.status.type!==Pi))}},data:()=>({data:[],isLoading:!1,isServiceWizardOpened:!1,selectedRows:[],columns:[{title:_TT("SYNO.SDS.WebStation.Application","common","status"),field:"status",tooltip:t=>t.status.message},{title:_TT("SYNO.SDS.WebStation.Application","common","service"),field:"service",tooltip:t=>"string"==typeof t.service?t.service:t.service.message},{title:_T("service","service_host_name"),field:"fqdn",tooltip:!0},{title:_T("service","service_vhost_port"),field:"port",tooltip:!0,disableSort:!0},{title:_T("app_port_alias","desc_alias"),field:"alias",tooltip:!0,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","common","primary_link"),field:"primaryLink",disableSort:!0}],groupInfo:{category:"preserve",sortCategoryFn:(t,e)=>t.key.localeCompare(e.key)},localSortFunc(t){const{field:e,sort:i}=t,n=(t=>{switch(t){case"status":return e=>e[t].type;case"service":return e=>"string"==typeof e[t]?e[t]:e[t].message;default:return e=>e[t]}})(e);return"ASC"===i?(t,e)=>n(t).localeCompare(n(e)):(t,e)=>n(e).localeCompare(n(t))}}),beforeMount(){SYNO.SDS.StatusNotifier.on("thirdpartychanged",this.onPkgChanged,this),SYNO.SDS.StatusNotifier.on("sharefolderchanged",this.onShareChanged,this)},mounted(){this.$appWindow=this.$options.appWin},beforeDestory(){SYNO.SDS.StatusNotifier.un("thirdpartychanged",this.onPkgChanged,this),SYNO.SDS.StatusNotifier.un("sharefolderchanged",this.onShareChanged,this)},methods:{onPkgChanged(t){[void 0,"WebStation"].includes(t)||this._isDestroyed||this.$refs.dataTable.refresh()},onShareChanged(t){return this._isDestroyed||this.loadData()},async loadData(){const t=await tt([{api:"SYNO.WebStation.Status",method:"get",version:1},{api:"SYNO.WebStation.WebService.Service",method:"list",version:1,params:{all:!0}},{api:"SYNO.WebStation.WebService.Portal",method:"list",version:1}]),e=t.find(t=>"SYNO.WebStation.Status"===t.api).data,i=t.find(t=>"SYNO.WebStation.WebService.Service"===t.api).data.services,n=t.find(t=>"SYNO.WebStation.WebService.Portal"===t.api).data.portals;return{items:[zi(e),...ji(n,i,e),...Ui(n,i)]}},openEditModalByDbClick(t,e){this.singleSelectedRowData&&t===this.singleSelectedRowData.index&&this.openEditModal()},openEditModal(){if(!this.singleSelectedRowData||!this.isEditable)return;const{_type:t}=this.singleSelectedData;let e=function(t,e={}){let i={...e};t===Qe&&(i.id=e.UUID,i.hsts=e.https.hsts);let n=t===Qe?e.port.http:e.http_port,s=t===Qe?e.port.https:e.https_port;return t===ti?i.based="alias":e.fqdn?(i.based="name",i.fqdn=e.fqdn,n.includes(80)&&s.includes(443)?(i.name_port=!0,ii()(n,t=>80===t),ii()(s,t=>443===t)):i.name_port=!1,n.length&&(i.name_http=!0,i.name_http_port=n[0]),s.length&&(i.name_https=!0,i.name_https_port=s[0])):(i.based="port",n&&n.length&&(i.port_http=!0,i.port_http_port=n[0]),s&&s.length&&(i.port_https=!0,i.port_https_port=s[0])),i.shortcut&&(i.shortcut.all_users=i.shortcut.all_users?"all":"admin"),i}(t,this.singleSelectedData);this.$store.commit("portal/UPDATE_TEMPLATE",e),this.$store.commit("portal/UPDATE_GENERAL",e),this.$store.commit("portal/UPDATE_SHORTCUT",e.shortcut),t!==Ii&&t!==Bi||this.openEditerModal(Ki),t===Ci&&this.openEditerModal(Vi)},openEditerModal(t){let{window:e}=this.$appWindow.openModalWindow(t);e.$on("close",()=>{this.$store.commit("portal/RESET_ALL"),this.$refs.dataTable.refresh()})},openAliasEditModal(t={}){const e=new SYNO.SDS.WebStation.Web.AliasPortalEditor({owner:this.$appWindow,module:this.$appWindow,isEditPanel:!0,title:_TT("SYNO.SDS.WebStation.Application","alias","edit_alias_portal"),webapi:{api:"SYNO.WebStation.WebService.Portal",method:"update",version:1},listeners:{close:()=>this.$refs.dataTable.refresh(),scope:this.$appWindow},preserve:t.preserve});e.setData(t),this.$appWindow.openExtWindow(e)},openServiceWizard(){if(this.isServiceWizardOpened)return;this.isServiceWizardOpened=!0;let{window:t}=this.$appWindow.openModalWindow(Hi);t.$on("close",()=>{this.$store.commit("portal/RESET_ALL"),this.isServiceWizardOpened=!1,this.$refs.dataTable.refresh()})},openLogViewerModal(){let{window:t}=this.$appWindow.openModalWindow(Ji,{id:this.singleSelectedData.id});t.$on("close",()=>{this.$refs.dataTable.refresh()})},async activateService(){return await this.changeSelectedServiceEanbleStatus(!0)},async deactivateService(){return await this.changeSelectedServiceEanbleStatus(!1)},async changeSelectedServiceEanbleStatus(t=!0){const e=this.$refs.dataTable;e.currentLoading=!0;const i=this.allSelectedRows.filter(t=>t._type===Ii||t._type===Bi||t._type===Ci).filter(e=>e.enable!==t).map(e=>({...e,enable:t})).map(t=>function(t={}){return{api:"SYNO.WebStation.WebService.Portal",method:"update",version:1,params:{portal:t}}}(t));try{await tt([...i])}catch(t){}e.refresh(),e.currentLoading=!1},async deleteServices(){if("confirm"!==await this.$appWindow.getMsgBox().confirmDelete("",_T("common","remove_cfrmrmv")))return;this.$refs.dataTable.currentLoading=!0;const t=function(t=[]){if(0!==t.length)return{api:"SYNO.WebStation.WebService.Portal",method:"remove",version:1,params:{ids:t}}}(this.allSelectedRows.filter(t=>t._type===Ii||t._type===Bi||t._type===Ci).map(t=>t.id));try{await tt([t].filter(t=>!!t))}catch(t){}SYNO.SDS.StatusNotifier.fireEvent("thirdpartychanged"),this.$refs.dataTable.refresh(),this.$refs.dataTable.currentLoading=!1}}},Qi=(i(274),f(Zi,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-panel",{staticClass:"portal-page",attrs:{"syno-id":"portal-page-panel",tbar:"",fbar:!1},scopedSlots:t._u([{key:"tbar",fn:function(){return[i("v-button",{attrs:{"syno-id":"portal-add-btn"},on:{click:t.openServiceWizard}},[t._v("\n\t\t\t "+t._s(t._T("common","create"))+"\n\t\t")]),t._v(" "),i("v-button",{attrs:{"syno-id":"portal-edit-btn",disabled:!t.isEditable},on:{click:t.openEditModal}},[t._v("\n\t\t\t"+t._s(t._T("common","alt_edit"))+"\n\t\t")]),t._v(" "),i("v-button",{attrs:{"syno-id":"portal-action-btn",disabled:!t.isActionEnabled,type:"dropdown"},scopedSlots:t._u([{key:"dropdown",fn:function(){return[i("v-menu",{attrs:{"syno-id":"portal-action-menu",width:"auto"}},[i("v-menu-item",{attrs:{"syno-id":"portal-action-menu-item-enable",disabled:!t.isAvailable},on:{click:t.activateService}},[t._v("\n\t\t\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","common","enable"))+"\n\t\t\t\t")]),t._v(" "),i("v-menu-item",{attrs:{"syno-id":"portal-action-menu-item-disable",disabled:!t.isAvailable},on:{click:t.deactivateService}},[t._v("\n\t\t\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","common","disable"))+"\n\t\t\t\t")]),t._v(" "),i("v-menu-item",{attrs:{"syno-id":"portal-action-menu-item-delete",disabled:!t.isDeleteable},on:{click:t.deleteServices}},[t._v("\n\t\t\t\t\t"+t._s(t._T("common","delete"))+"\n\t\t\t\t")])],1)]},proxy:!0}])},[t._v("\n\t\t\t"+t._s(t._T("common","action"))+"\n\t\t\t")]),t._v(" "),i("v-button",{attrs:{"syno-id":"portal-edit-btn",disabled:!t.isLogViewable},on:{click:t.openLogViewerModal}},[t._v("\n\t\t\t"+t._s(t._TT("SYNO.SDS.WebStation.Application","log","view_log"))+"\n\t\t")])]},proxy:!0},{key:"body",fn:function(){return[i("v-data-table",{ref:"dataTable",staticClass:"webstation-panel__data-table",attrs:{groupTable:"",multipleSelected:"","syno-id":"portal-data-table","enable-hd-menu":!1,"group-info":t.groupInfo,columns:t.columns,data:t.loadData,"local-sort-func":t.localSortFunc},on:{"selected-change":function(e){t.selectedRows=e},rowdblclick:t.openEditModalByDbClick,dataloaded:function(e){t.selectedRows=[]}},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.data;return[i("span",{class:n.class},[t._v(t._s(n.message))])]}},{key:"service",fn:function(e){var n=e.data;return["string"==typeof n?i("span",[t._v(t._s(n))]):i("span",{class:n.class},[t._v(t._s(n.message))])]}},{key:"primaryLink",fn:function(t){var e=t.data;return[i("a",{staticClass:"syno-webstation-management primary-link",attrs:{target:"_blank",href:e}})]}}])})]},proxy:!0}])})}),[],!1,null,"46e2d2a4",null).exports),Xi=i(120),tn=i.n(Xi),en=i(34),nn=i.n(en),sn=f({name:"ProfileServicetEditor",mixins:[l],components:{general:ae},props:{title:String},data:()=>({activeTabIndex:"network",showStatusBar:!1,statusBarErrorText:"",isLoading:!1,loadingType:"spin",statusBarState:"loading"}),computed:{...Object(m.b)("service",["ALL_FIELDS"])},async mounted(){this.onLoading(),await this.$nextTick(),await this.$refs.general.preload(),await this.$refs.general.validate(),this.onLoading(!1)},methods:{onTabChange(t){this.$refs[t].validate()},async save(){try{if(!await this.$refs.general.validate())return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}this.$refs.general.commit(),this.onLoading();let t=await this.sendSetRequest();if(this.onLoading(!1),!t)return!1;this.$store.commit("service/RESET_ALL"),this.close()},async sendSetRequest(){let t;try{this.onLoading();await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",version:1,method:"update",params:{service:G(this.ALL_FIELDS._type,this.ALL_FIELDS,{editor:!0,forceAcl:this.$store.state.service.forceAcl})}})}catch(e){if(t=e.code,this.onLoading(!1),1022===t){if("confirm"===await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t))){this.$store.commit("service/UPDATE_FORCE_ACL",!0),await this.sendSetRequest()&&(t=void 0)}}else this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}},async cancel(){if(!this.$refs.general.isDirty())return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$store.commit("service/RESET_ALL"),this.$refs.window.doClose()},onLoading(t=!0){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatus()},onError(t){return this.showStatusBar=!0,this.isLoading=!1,this.loadingType="statusbar",this.statusBarState="error",this.validateStatus="error",this.statusBarErrorText=t,!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"profile-service-modal-window",title:t.title,width:700,height:540,beforeClose:t.cancel}},[i("v-panel",{attrs:{"syno-id":"profile-service-editor-panel",loading:t.isLoading,"loading-type":t.loadingType,"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,"error-text":t.statusBarErrorText,confirm:t.save,cancel:t.cancel},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e}},scopedSlots:t._u([{key:"body",fn:function(){return[i("general",{ref:"general",attrs:{editor:!0}})]},proxy:!0}])})],1)}),[],!1,null,"c97e39e0",null).exports,an={name:"EditorFooter",mixins:[l],props:{confirmText:{type:String},cancelText:{type:String},errorText:{type:String},showStatusBar:{type:Boolean,default:!1},statusBarState:{type:String,default:"loading"}},data:()=>({autoHideTimer:5e3}),computed:{},watch:{statusBarState(t){this.delayHideStatusBar()},showStatusBar(t){this.delayHideStatusBar()}},methods:{onClickCancel(){this.$emit("cancel")},onClickConfirm(){this.$emit("confirm")},delayHideStatusBar(){"loading"!==this.statusBarState&&window.setTimeout(()=>{this.$emit("update:showStatusBar",!1)},this.autoHideTimer)}}},rn=(i(275),f(an,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"ws-editor-footer"},[i("v-status-bar",{style:{"padding-left":"16px"},attrs:{state:t.statusBarState,show:t.showStatusBar,"error-text":t.errorText}}),t._v(" "),i("div",{staticClass:"default pull-right button-region"},[i("v-button",{attrs:{"syno-id":"tab-fbar-cancel",type:"footbar",suffix:"cancel"},on:{click:t.onClickCancel}},[t._v(t._s(t.cancelText||t._T("common","cancel")))]),t._v(" "),i("v-button",{attrs:{"syno-id":"tab-fbar-commit",type:"footbar",suffix:"main"},on:{click:t.onClickConfirm}},[t._v(t._s(t.confirmText||t._T("common","commit")))])],1)],1)}),[],!1,null,"61c87b00",null).exports),on=f({name:"DockerPackageEditor",mixins:[l],components:{"editor-footer":rn,general:ae,database:pe,"plex-settings":fe},data:()=>({activeTabIndex:"1",showStatusBar:!1,statusBarErrorText:"",statusBarState:"loading"}),computed:{isPlex(){return"plex"===this.SERVICE_FIELDS.package},...Object(m.b)({PACKAGE_FIELDS:"package/ALL_FIELDS",SERVICE_FIELDS:"service/ALL_FIELDS"})},async mounted(){this.onLoading(),await this.$nextTick(),this.allRefs=this.isPlex?[this.$refs.general,this.$refs.plex]:[this.$refs.general,this.$refs.database],await Promise.all(this.allRefs.map(t=>t.preload())),await Promise.all(this.allRefs.map(t=>t.validate())),this.onLoading(!1)},methods:{async save(){try{if(!(await Promise.all(this.allRefs.map(t=>t.validate()))).every(Boolean))return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}this.onLoading(),this.allRefs.forEach(t=>t.commit());let t=await this.sendSetRequest();if(this.onLoading(!1),!t)return!1;this.$store.commit("package/RESET_ALL"),this.$store.commit("service/RESET_ALL"),this.close()},async sendSetRequest(){let t,e=G(this.SERVICE_FIELDS._type,{...this.SERVICE_FIELDS,_package:this.PACKAGE_FIELDS},{editor:!0,forceAcl:this.$store.state.service.forceAcl,meta:this.$store.state.package.meta});try{this.onLoading(),await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"check",version:1,params:{service:e}})}catch(e){if(t=e.code,this.onLoading(!1),1022===t){if("confirm"!==await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t)))return void 0===t;this.$store.commit("service/UPDATE_FORCE_ACL",!0),t=void 0}}this.$store.state.service.forceAcl&&(e=G(this.SERVICE_FIELDS._type,{...this.SERVICE_FIELDS,_package:this.PACKAGE_FIELDS},{editor:!0,forceAcl:this.$store.state.service.forceAcl,meta:this.$store.state.package.meta}));try{this.onLoading(),e.package.id=e.id,await synowebapi.promises.request({api:"SYNO.WebStation.Package",method:"update",version:1,params:{package:e.package}}),delete e.package,await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"update",version:1,params:{service:e}})}catch(e){t=e.code,this.onLoading(!1),this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}},async cancel(){if(this.allRefs.map(t=>t.isDirty()).every(t=>!1===t))return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$store.commit("package/RESET_ALL"),this.$store.commit("service/RESET_ALL"),this.$refs.window.doClose()},onLoading(t=!0){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatus()},onError(t){return this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"docker-package-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","service","service_editor"),width:700,height:540,beforeClose:t.cancel}},[i("v-tabs",{attrs:{"syno-id":"webstation-package-editor-tabs"},scopedSlots:t._u([{key:"fbar",fn:function(){return[i("editor-footer",{attrs:{"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,"error-text":t.statusBarErrorText},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e},cancel:t.cancel,confirm:t.save}})]},proxy:!0}]),model:{value:t.activeTabIndex,callback:function(e){t.activeTabIndex=e},expression:"activeTabIndex"}},[i("v-tab-pane",{attrs:{"syno-id":"general-tab-pane","tab-key":"1",tab:t._TT("SYNO.SDS.WebStation.Application","service","general")}},[i("general",{ref:"general",attrs:{editor:!0,"package-type":"package"},on:{"display-error":t.onError}})],1),t._v(" "),t.isPlex?i("v-tab-pane",{attrs:{"syno-id":"plex-settings-tab-pane","tab-key":"3",tab:t._TT("SYNO.SDS.WebStation.Application","3rdparty","plex_settings")}},[i("plex-settings",{ref:"plex",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1):i("v-tab-pane",{attrs:{"syno-id":"database-tab-pane","tab-key":"2",tab:t._TT("SYNO.SDS.WebStation.Application","database","database")}},[i("database",{ref:"database",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1)],1)],1)}),[],!1,null,null,null).exports,ln=f({name:"DockerPHPEditor",mixins:[l],components:{"editor-footer":rn,general:ae,database:pe,"php-extensions":Lt,"php-fpm":Yt,"php-core":It,"php-dependency":ye},data:()=>({activeTabIndex:"1",showStatusBar:!1,statusBarErrorText:"",statusBarState:"loading"}),computed:{...Object(m.b)({PHP_FIELDS:"php/ALL_FIELDS",SERVICE_FIELDS:"service/ALL_FIELDS"})},async mounted(){this.onLoading(),await this.$nextTick(),this.allRefs=[this.$refs.general,this.$refs.extension,this.$refs.fpm,this.$refs.core,this.$refs.dependency,this.$refs.database],await Promise.all(this.allRefs.map(t=>t.preload())),await Promise.all(this.allRefs.map(t=>t.validate())),this.onLoading(!1)},methods:{async save(){try{if(!(await Promise.all(this.allRefs.map(t=>t.validate()))).every(Boolean))return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}this.onLoading(),this.allRefs.forEach(t=>t.commit());let t=await this.sendSetRequest();if(this.onLoading(!1),!t)return!1;this.$store.commit("php/RESET_ALL"),this.$store.commit("service/RESET_ALL"),this.close()},async sendSetRequest(){let t;try{this.onLoading();let e=G(this.SERVICE_FIELDS._type,{...this.SERVICE_FIELDS,php:this.PHP_FIELDS},{editor:!0,forceAcl:this.$store.state.service.forceAcl});await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"update",version:1,params:{service:e}})}catch(e){if(t=e.code,this.onLoading(!1),1022===t){if("confirm"===await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t))){this.$store.commit("service/UPDATE_FORCE_ACL",!0),await this.sendSetRequest()&&(t=void 0)}}else this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}},async cancel(){if(this.allRefs.map(t=>t.isDirty()).every(t=>!1===t))return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$store.commit("php/RESET_ALL"),this.$store.commit("service/RESET_ALL"),this.$refs.window.doClose()},onLoading(t=!0){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatus()},onError(t){return this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"docker-php-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","script_language","php_editor"),width:876,height:540,beforeClose:t.cancel}},[i("v-tabs",{attrs:{"syno-id":"webstation-php-editor-tabs"},scopedSlots:t._u([{key:"fbar",fn:function(){return[i("editor-footer",{attrs:{"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,"error-text":t.statusBarErrorText},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e},cancel:t.cancel,confirm:t.save}})]},proxy:!0}]),model:{value:t.activeTabIndex,callback:function(e){t.activeTabIndex=e},expression:"activeTabIndex"}},[i("v-tab-pane",{attrs:{"syno-id":"general-tab-pane","tab-key":"1",tab:t._TT("SYNO.SDS.WebStation.Application","service","general")}},[i("general",{ref:"general",attrs:{editor:!0,"package-type":"php"},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"extension-tab-pane","tab-key":"2",tab:t._TT("SYNO.SDS.WebStation.Application","php","extensions")}},[i("php-extensions",{ref:"extension",attrs:{"window-type":"modal","is-dockerized":"",editor:""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"fpm-tab-pane","tab-key":"3",tab:t._TT("SYNO.SDS.WebStation.Application","php","fpm")}},[i("php-fpm",{ref:"fpm",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"core-tab-pane","tab-key":"4",tab:t._TT("SYNO.SDS.WebStation.Application","php","core")}},[i("php-core",{ref:"core",attrs:{"window-type":"modal","is-dockerized":"",editor:""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"dependency-tab-pane","tab-key":"5",tab:t._TT("SYNO.SDS.WebStation.Application","script_language","dependency")}},[i("php-dependency",{ref:"dependency",attrs:{"window-type":"modal","show-version":""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"database-tab-pane","tab-key":"6",tab:t._TT("SYNO.SDS.WebStation.Application","database","database")}},[i("database",{ref:"database",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1)],1)],1)}),[],!1,null,null,null).exports,pn=f({name:"DockerpythonEditor",mixins:[l],components:{"editor-footer":rn,general:ae,database:pe,"python-uwsgi":ht,"python-modules":wt},data:()=>({activeTabIndex:"1",showStatusBar:!1,statusBarErrorText:"",statusBarState:"loading"}),computed:{...Object(m.b)({PYTHON_FIELDS:"python/ALL_FIELDS",SERVICE_FIELDS:"service/ALL_FIELDS"})},async mounted(){this.onLoading(),await this.$nextTick(),this.allRefs=[this.$refs.general,this.$refs.uwsgi,this.$refs.modules,this.$refs.database],await Promise.all(this.allRefs.map(t=>t.preload())),await Promise.all(this.allRefs.map(t=>t.validate())),this.onLoading(!1)},methods:{async save(){try{if(!(await Promise.all(this.allRefs.map(t=>t.validate()))).every(Boolean))return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}this.onLoading(),this.allRefs.forEach(t=>t.commit());let t=await this.sendSetRequest();if(this.onLoading(!1),!t)return!1;this.$store.commit("python/RESET_ALL"),this.$store.commit("service/RESET_ALL"),this.close()},async sendSetRequest(){let t;try{this.onLoading();let e=G(this.SERVICE_FIELDS._type,{...this.SERVICE_FIELDS,python:this.PYTHON_FIELDS},{editor:!0,forceAcl:this.$store.state.service.forceAcl});await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"update",version:1,params:{service:e}})}catch(e){if(t=e.code,this.onLoading(!1),1022===t){if("confirm"===await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t))){this.$store.commit("service/UPDATE_FORCE_ACL",!0),await this.sendSetRequest()&&(t=void 0)}}else this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}},async cancel(){if(this.allRefs.map(t=>t.isDirty()).every(t=>!1===t))return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$store.commit("python/RESET_ALL"),this.$store.commit("service/RESET_ALL"),this.$refs.window.doClose()},onLoading(t=!0){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatus()},onError(t){return this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"docker-python-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","script_language","python_editor"),width:876,height:540,beforeClose:t.cancel}},[i("v-tabs",{attrs:{"syno-id":"webstation-python-editor-tabs"},scopedSlots:t._u([{key:"fbar",fn:function(){return[i("editor-footer",{attrs:{"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,"error-text":t.statusBarErrorText},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e},cancel:t.cancel,confirm:t.save}})]},proxy:!0}]),model:{value:t.activeTabIndex,callback:function(e){t.activeTabIndex=e},expression:"activeTabIndex"}},[i("v-tab-pane",{attrs:{"syno-id":"general-tab-pane","tab-key":"1",tab:t._TT("SYNO.SDS.WebStation.Application","service","general")}},[i("general",{ref:"general",attrs:{editor:!0,"package-type":"python"},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"uwsgi-tab-pane","tab-key":"2",tab:t._TT("SYNO.SDS.WebStation.Application","python","uwsgi_setting")}},[i("python-uwsgi",{ref:"uwsgi",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"modules-tab-pane","tab-key":"3",tab:t._TT("SYNO.SDS.WebStation.Application","python","module")}},[i("python-modules",{ref:"modules",attrs:{"window-type":"modal","show-version":"","is-dockerized":""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"database-tab-pane","tab-key":"6",tab:t._TT("SYNO.SDS.WebStation.Application","database","database")}},[i("database",{ref:"database",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1)],1)],1)}),[],!1,null,null,null).exports,cn=f({name:"DockerNodeEditor",mixins:[l],components:{"editor-footer":rn,general:ae,database:pe,"node-general":Ae,"node-dependency":$e},data:()=>({activeTabIndex:"1",showStatusBar:!1,statusBarErrorText:"",statusBarState:"loading"}),computed:{...Object(m.b)({NODE_FIELDS:"node/ALL_FIELDS",SERVICE_FIELDS:"service/ALL_FIELDS"})},async mounted(){this.onLoading(),await this.$nextTick(),this.allRefs=[this.$refs.general,this.$refs.node,this.$refs.dependency,this.$refs.database],await Promise.all(this.allRefs.map(t=>t.preload())),await Promise.all(this.allRefs.map(t=>t.validate())),this.onLoading(!1)},methods:{async save(){try{if(!(await Promise.all(this.allRefs.map(t=>t.validate()))).every(Boolean))return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}this.onLoading(),this.allRefs.forEach(t=>t.commit());let t=await this.sendSetRequest();if(this.onLoading(!1),!t)return!1;this.$store.commit("node/RESET_ALL"),this.$store.commit("service/RESET_ALL"),this.close()},async sendSetRequest(){let t,e=G(this.SERVICE_FIELDS._type,{...this.SERVICE_FIELDS,node:this.NODE_FIELDS},{editor:!0});try{this.onLoading(),await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"check",version:1,params:{service:e}})}catch(e){if(t=e.code,this.onLoading(!1),1022===t){if("confirm"!==await this.$root.$refs.window.getMsgBox().confirm("",SYNO.SDS.WebStation.Errors.GetMessage(t)))return void 0===t;this.$store.commit("service/UPDATE_FORCE_ACL",!0),t=void 0}}this.$store.state.service.forceAcl&&(e=G(this.SERVICE_FIELDS._type,{...this.SERVICE_FIELDS,node:this.NODE_FIELDS},{editor:!0,forceAcl:this.$store.state.service.forceAcl}));try{this.onLoading(),e.node.id=e.id,await synowebapi.promises.request({api:"SYNO.WebStation.ScriptLanguage",method:"update",version:1,formData:"upload"===this.NODE_FIELDS.package_json_type?{script:JSON.stringify(e.node),[this.NODE_FIELDS.upload_file]:this.NODE_FIELDS.file}:{script:JSON.stringify(e.node)}}),delete e.node,await synowebapi.promises.request({api:"SYNO.WebStation.WebService.Service",method:"update",version:1,params:{service:e}})}catch(e){t=e.code,this.onLoading(!1),this.$emit("error","vhost",e),this.$emit("display-error",SYNO.SDS.WebStation.Errors.GetMessage(t))}finally{return void 0===t}},async cancel(){if(this.allRefs.map(t=>t.isDirty()).every(t=>!1===t))return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$store.commit("node/RESET_ALL"),this.$store.commit("service/RESET_ALL"),this.$refs.window.doClose()},onLoading(t=!0){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatus()},onError(t){return this.showStatusBar=!0,this.statusBarState="error",this.statusBarErrorText=t,!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"docker-node-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","script_language","node_editor"),width:876,height:540,beforeClose:t.cancel}},[i("v-tabs",{attrs:{"syno-id":"webstation-node-editor-tabs"},scopedSlots:t._u([{key:"fbar",fn:function(){return[i("editor-footer",{attrs:{"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,"error-text":t.statusBarErrorText},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e},cancel:t.cancel,confirm:t.save}})]},proxy:!0}]),model:{value:t.activeTabIndex,callback:function(e){t.activeTabIndex=e},expression:"activeTabIndex"}},[i("v-tab-pane",{attrs:{"syno-id":"general-tab-pane","tab-key":"1",tab:t._TT("SYNO.SDS.WebStation.Application","service","general")}},[i("general",{ref:"general",attrs:{editor:"","package-type":"node"},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"node-general-tab-pane","tab-key":"2",tab:t._TT("SYNO.SDS.WebStation.Application","script_language","node_package_json")}},[i("node-general",{ref:"node",attrs:{editor:"","window-type":"modal"},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"node-dependency-tab-pane","tab-key":"3",tab:t._TT("SYNO.SDS.WebStation.Application","script_language","dependency")}},[i("node-dependency",{ref:"dependency",attrs:{"window-type":"modal","show-version":""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"database-tab-pane","tab-key":"4",tab:t._TT("SYNO.SDS.WebStation.Application","database","database")}},[i("database",{ref:"database",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1)],1)],1)}),[],!1,null,null,null).exports;async function dn(t=[],e={},i=[],n={}){const s=await async function(){try{const t=await synowebapi.promises.request({api:"SYNO.WebStation.Backup",method:"list",version:1});let e={};for(let i of t.repositories)e[i.target_id]=i;return e}catch(t){return null}}();return await Promise.all(t.map(async t=>{t._type=oi(t),t.preserve=[D.DEFAULT,D.PACKAGE].includes(t._type),t.docker_id=function(t={},e={}){if(t._type===D.DOCKERIZED&&t.managed_by_docker){return(t.type.includes("package")?e.packages.find(e=>e.id===t.id):e.scripts.find(e=>e.id===t.id)).docker_id}return null}(t,{scripts:this.$store.state.service.scriptLanguageList,packages:this.$store.state.service.packageList});const a=await async function(t={},e={},i={}){if(t._type!==D.DOCKERIZED)return null;let n=null;if(t.type.includes("package")){let e=i.packages.find(e=>e.id===t.id);void 0!==e&&(n=e,n.docker_service_type="package")}else{let e=i.scripts.find(e=>e.id===t.id);void 0!==e&&(n=e,n.docker_service_type="script_language")}if(null===n)return null;n.image_info=await async function(t){let e=null;if("script_language"===t.docker_service_type)e=function(t){var e;return{service:{image:t.type,version:t.version},db:null!=t&&null!==(e=t.link_settings)&&void 0!==e&&e.db_settings?{image:t.link_settings.db_settings.type,version:t.link_settings.db_settings.version}:null}}(t);else{if("package"!==t.docker_service_type)return null;e=function(t){return{service:{image:t.type,version:t.version},db:null!=t&&t.db_settings?{image:t.db_settings.type,version:t.db_settings.version}:null}}(t)}if(!e)return null;for(const t of["service","db"]){if(!e[t])continue;const i=e[t].version.split("@");if(e[t].hash="",e[t].tag=i[0],2!==i.length)try{const i=await synowebapi.promises.request({api:"SYNO.WebStation.Docker",method:"hash",version:1,params:{image:e.image,tag:e[t].tag}});e[t].hash=i.hash}catch(t){}else e[t].hash=i[1]}return e}(n),n.upgrade_info=await async function(t){if(!t)return null;const e=await SYNO.SDS.WebStation.Util.PackageInfo.GetDockerImageLatest();if(!e)return null;const i=await z(t.service,e),n=await z(t.db,e);let s="";return null===i&&null===n?null:(s=null===i?_TT("SYNO.SDS.WebStation.Application","service","tip_db_upgrade_available"):null===n?_TT("SYNO.SDS.WebStation.Application","service","tip_service_upgrade_available"):_TT("SYNO.SDS.WebStation.Application","service","tip_service_and_db_upgrade_available"),{service:i,db:n,tip_content:s})}(n.image_info),e&&e[n.id]?n.backup_info=e[n.id]:n.backup_info=null;return n}(t,s,{scripts:this.$store.state.service.scriptLanguageList,packages:this.$store.state.service.packageList}),r=function(t={},e={}){switch(t._type){case D.DEFAULT:return{cls:"",text:_TT("SYNO.SDS.WebStation.Application","service","default_service")};case D.STATIC:return{cls:"",text:_TT("SYNO.SDS.WebStation.Application","service","static_website")};case D.PACKAGE:return{cls:t.service.toLowerCase(),text:t.service};case D.SCRIPT_LANGUAGE:for(let e of["php","python"])if(t.type.includes(e))return{cls:e,text:_TT("SYNO.SDS.WebStation.Application","script_language",e)};return{cls:"",text:_TT("SYNO.SDS.WebStation.Application","service","native_website")};case D.DOCKERIZED:if(t.type.includes("package")){let i=e.packages.find(e=>e.id===t.id);if(void 0!==i)return{cls:i.type,text:i.type.charAt(0).toUpperCase()+i.type.slice(1)}}for(let e of["php","python","node"])if(t.type.includes(e))return{cls:e,text:_TT("SYNO.SDS.WebStation.Application","script_language",e)};return{cls:"docker",text:_TT("SYNO.SDS.WebStation.Application","service","docker")};default:return{cls:"",text:_TT("SYNO.SDS.WebStation.Application","service","service")}}}(t,{scripts:this.$store.state.service.scriptLanguageList,packages:this.$store.state.service.packageList}),o=await async function(t,e,i={},n={}){switch(i._type){case D.DEFAULT:case D.STATIC:return{version:" -- ",version_info:{overview_version:" -- "}};case D.PACKAGE:case D.SCRIPT_LANGUAGE:for(let t of["php","python"])if(t in i){var s;if(!("backend"in i[t]))i[t].backend=null===(s=n.profiles[t].find(e=>e.uuid===i[t].id))||void 0===s?void 0:s.backend;let e=await SYNO.SDS.WebStation.Util.PackageInfo.GetPackageNameByIndex(t,i[t].backend)||" -- ";return{version:e,version_info:{overview_version:e}}}return{version:" -- ",version_info:{overview_version:" -- "}};case D.DOCKERIZED:if(null==e||!e.image_info)return{version:" -- ",version_info:{overview_version:" -- "}};const r=e.image_info;let o=[];return r.service&&o.push(t.text+" "+r.service.tag),r.db&&o.push(((a=r.db.image)in H?H[a]:a)+" "+r.db.tag),{version:r.service.tag,version_info:{overview_version:o.join(" / ")}}}var a}(r,a,t,{profiles:this.$store.state.service.builtInScriptLanguageList,scripts:this.$store.state.service.scriptLanguageList,packages:this.$store.state.service.packageList});return{category:si(t),status:un(t,e,i,n),service:t.service,service_type:r,name:t.display_name,version:o.version,description:t.description,_version_info:o.version_info,_rowInfo:{},_originalData:t,_docker_project_data:a,_service_type:r}}))}function un(t={},e={},i=[],n={}){switch(t._type){case D.DEFAULT:{const t=null===e.php||e.php_profiles.profiles.some(t=>t.uuid===e.php),i=!!e.available_server_backend.includes(e.backend),n=null===e.userdir_php||e.php_profiles.profiles.some(t=>t.uuid===e.userdir_php),s=!!e.available_server_backend.includes(e.userdir_backend);let a=A.ERROR;return t&&i&&(!e.userdir||n&&s)&&(a=A.RUNNING),{...ai(a),tip:{show:a===A.ERROR,content:_TT("SYNO.SDS.WebStation.Application","error","err_settings")}}}case D.PACKAGE:if(!t.enable)return{...ai(A.PAUSED),tip:{show:!0,content:_TT("SYNO.SDS.WebStation.Application","service_wizard","tip_enable_package")}};case D.STATIC:case D.SCRIPT_LANGUAGE:return{...ai(t.status.type),tip:{show:t.status.type===A.ERROR,content:_TT("SYNO.SDS.WebStation.Application","error","err_settings")}};case D.DOCKERIZED:{if(!t.enable)return{...ai(A.PAUSED),tip:{show:!1,content:_TT("SYNO.SDS.WebStation.Application","error","err_settings")}};let e=i.includes(t.docker_id)&&t.status.type===A.RUNNING?A.LOADING:t.status.type;return t.id in n&&(e=A.LOADING),{...ai(e),tip:{...ri(t.status.err_code),show:[A.ERROR,A.WARNING].includes(t.status.type)&&!(t.id in n)},docker_err_code:t.status.err_code}}default:return{...ai(A.ERROR),tip:{show:!0,content:_TT("SYNO.SDS.WebStation.Application","error","err_settings")}}}}let fn=Vue.extend({store:R}).extend(Ce),hn=Vue.extend({store:R}).extend(te),_n=Vue.extend({store:R}).extend(sn),mn=Vue.extend({store:R}).extend(on),Sn=Vue.extend({store:R}).extend(ln),vn=Vue.extend({store:R}).extend(pn),gn=Vue.extend({store:R}).extend(cn);var bn={mixins:[l,_],computed:{allSelectedRows(){var t,e;return this.selectedRows&&(null===(t=this.selectedRows)||void 0===t||null===(e=t.rows)||void 0===e?void 0:e.map(t=>({...t._originalData,_service_type:t.service_type,_docker_project_data:t._docker_project_data,_status:t.status})))},singleSelectedRowData(){var t,e;return 1===(null===(t=this.allSelectedRows)||void 0===t?void 0:t.length)&&{index:null===(e=this.selectedRows)||void 0===e?void 0:e.indexes[0],row:this.allSelectedRows[0]}||null},singleSelectedData(){return this.singleSelectedRowData&&this.singleSelectedRowData.row||null},isEditable(){return!!this.singleSelectedData&&this.singleSelectedData._type!==D.PACKAGE&&(this.singleSelectedData._type!==D.DOCKERIZED||this.singleSelectedData.managed_by_docker&&this.singleSelectedData.status.type!==A.LOADING&&!(this.singleSelectedData.id in this.$store.state.service.processTasks))},isActionEnabled(){var t,e;return(null===(t=this.allSelectedRows)||void 0===t?void 0:t.length)>0&&void 0===(null===(e=this.allSelectedRows)||void 0===e?void 0:e.find(t=>t._type===D.DEFAULT||t._type===D.PACKAGE||t._type===D.DOCKERIZED&&!t.managed_by_docker))},isDeleteable(){var t;return null===(t=this.allSelectedRows)||void 0===t?void 0:t.every(t=>!t.preserve)},isAvailable(){var t,e;return null===(t=this.selectedRows)||void 0===t||null===(e=t.rows)||void 0===e?void 0:e.every(t=>!(t.status.type===A.ERROR&&t.status.docker_err_code===O.PROJECT_NOT_FOUND)&&t.status.type!==A.LOADING)},isRebuildable(){var t,e;return null===(t=this.selectedRows)||void 0===t||null===(e=t.rows)||void 0===e?void 0:e.every(t=>t.status.docker_err_code===O.PROJECT_NOT_FOUND)},noAnyDockerized(){var t;return null===(t=this.allSelectedRows)||void 0===t?void 0:t.every(t=>t._type!==D.DOCKERIZED)}},data:()=>({data:[],isLoaded:!1,isServicePackageWizardOpened:!1,isDockerServiceUpdateWizardOpened:!1,selectedRows:[],SERVICE_STATUS:A,columns:[{title:_TT("SYNO.SDS.WebStation.Application","service","service_type"),field:"service_type"},{title:_TT("SYNO.SDS.WebStation.Application","service","name"),field:"name"},{title:_TT("SYNO.SDS.WebStation.Application","common","status"),field:"status"},{title:_TT("SYNO.SDS.WebStation.Application","service","service_db_version"),field:"version",headerTooltip:!0,tooltip:t=>t._version_info.overview_version,disableSort:!0},{title:_TT("SYNO.SDS.WebStation.Application","service","description"),field:"description",disableSort:!0}],groupInfo:{category:"category",sortCategoryFn:(t,e)=>t.key.localeCompare(e.key)},localSortFunc(t){const{field:e,sort:i}=t,n=(t=>{switch(t){case"service_type":return e=>e[t].text;case"status":return e=>e[t].type;default:return e=>e[t]}})(e);return"ASC"===i?(t,e)=>n(t).localeCompare(n(e)):(t,e)=>n(e).localeCompare(n(t))}}),beforeMount(){SYNO.SDS.StatusNotifier.on("thirdpartychanged",this.onPkgChanged,this),SYNO.SDS.StatusNotifier.on("sharefolderchanged",this.onShareChanged,this),SYNO.SDS.SocketInst.registerSDKEvent("docker_project_change",()=>{this.refreshByThrottle()})},async mounted(){this.$appWindow=this.$options.appWin},beforeDestory(){SYNO.SDS.StatusNotifier.un("thirdpartychanged",this.onPkgChanged,this),SYNO.SDS.StatusNotifier.un("sharefolderchanged",this.onShareChanged,this),SYNO.SDS.SocketInst.un("docker_project_change")},methods:{refreshByThrottle(){var t,e;tn()(nn()(null===(t=this.$refs.dataTable)||void 0===t?void 0:t.refresh)?null===(e=this.$refs.dataTable)||void 0===e?void 0:e.refresh:()=>{},5e3,{trailing:!0})()},onPkgChanged(t){[void 0,"WebStation"].includes(t)||this._isDestroyed||this.$refs.dataTable.refresh()},onShareChanged(t){return this._isDestroyed||this.loadData()},async loadData(){this.builtInScriptLanguageList={php:await it(),python:await nt()},this.$store.commit("service/UPDATE_BUILT_IN_SCRIPT_LANGUAGE_LIST",this.builtInScriptLanguageList),this.scriptLanguageList=await st(),this.$store.commit("service/UPDATE_SCRIPT_LANGUAGE_LIST",this.scriptLanguageList),this.packageList=await K(),this.$store.commit("service/UPDATE_PACKAGE_LIST",this.packageList),this.isLoaded=!0;const t=await tt([{api:"SYNO.WebStation.Status",method:"get",version:1},{api:"SYNO.WebStation.WebService.Service",method:"list",version:1,params:{all:!0}},{api:"SYNO.WebStation.Task",method:"list",version:1}]),e=t.find(t=>"SYNO.WebStation.Status"===t.api).data,i=t.find(t=>"SYNO.WebStation.WebService.Service"===t.api).data.services;let n={};t.find(t=>"SYNO.WebStation.Task"===t.api).data.tasks.forEach(t=>{t.finish||"finish"===t.data.status||(n[t.data.resource_id]=t)}),this.$store.state.service.processTasks=n;let s=[];return this.lockEvent?(s=this.$store.state.service.loadingDockerIdList,this.lockEvent=!1):(this.$store.state.service.loadingDockerIdList.forEach(t=>{SYNO.SDS.SocketInst.un(`docker_${t}_done`)}),this.$store.commit("service/RESET_LOADING_DOCKER_ID_LIST"),i.filter(t=>!(![A.LOADING,A.WARNING].includes(t.status.type)||!t.docker_id)||t.id in n).forEach(t=>{SYNO.SDS.SocketInst.registerSDKEvent(`docker_${t.docker_id}_done`,()=>{this.refreshByThrottle()}),this.$store.state.service.loadingDockerIdList.push(t.docker_id)})),{items:await dn.call(this,i,e,s,n)}},openEditModalByDbClick(t,e){this.singleSelectedRowData&&this.isEditable&&t===this.singleSelectedRowData.index&&this.openEditModal()},openEditModal(){if(!this.singleSelectedRowData)return;const{_type:t}=this.singleSelectedData;let e=q(t,this.singleSelectedData);if(this.$store.commit("service/UPDATE_TEMPLATE",e),t===D.DOCKERIZED)switch(e=function(t,e,i={}){let n={...e};if("package"===t){let t=i.package.find(t=>t.id===n.id);n.package=t.type,n._package={version:t.version,project_root:t.project_root,extra_settings:t.extra_settings},"plex"===n.package&&(n.root=t.project_root),n.db_settings={...t.db_settings}}else{let e=i.script.find(t=>t.id===n.id);switch(t){case"php":n.php={version:e.version,project_root:e.project_root,...U()(e.link_settings.script_settings),require:e.profile_settings.composer_settings.require,...U()(e.profile_settings)};break;case"python":n.python={version:e.version,project_root:e.project_root,uwsgi_settings:{...e.link_settings.script_settings.uwsgi_settings},...U()(e.profile_settings)};break;case"node":n.root=e.project_root,n.node={version:e.version,project_root:e.project_root,dependencies:e.profile_settings.dependencies,script_settings:{...U()(e.link_settings.script_settings)}},e.profile_settings.upload_file?(n.node.package_json_type="upload",n.node.upload_file=e.profile_settings.upload_file):(n.node.package_json_type="manual",n.node.package_settings={...U()(e.profile_settings.package_settings)})}n.db_settings={...e.link_settings.db_settings}}return n}(e.package,e,{script:this.scriptLanguageList,package:this.packageList}),this.$store.commit("service/UPDATE_GENERAL",e),this.$store.commit("service/UPDATE_DATABASE",e),e.package){case"php":return this.$store.commit("php/UPDATE_GENERAL",e.php),this.$store.commit("php/UPDATE_FPM",e.php),this.$store.commit("php/UPDATE_EXTENSIONS",e.php),this.$store.commit("php/UPDATE_CORE_SETTINGS",e.php),this.$store.commit("php/UPDATE_REQUIRE",e.php),this.openEditerModal(Sn);case"python":return this.$store.commit("python/UPDATE_GENERAL",e.python),this.$store.commit("python/UPDATE_UWSGI",e.python),this.$store.commit("python/UPDATE_MODULES",e.python),this.openEditerModal(vn);case"node":return this.$store.commit("service/UPDATE_ROOT",e.root),this.$store.commit("node/UPDATE_GENERAL",e.node),this.$store.commit("node/UPDATE_PACKAGE_JSON",e.node),this.$store.commit("node/UPDATE_DEPENDENCIES",e.node),this.openEditerModal(gn);default:return"plex"===e.package&&(this.$store.commit("service/UPDATE_ROOT",e.root),this.$store.commit("package/UPDATE_PLEX",e._package.extra_settings)),this.$store.state.package.meta.type="plex"!==e.package?"php":"proxy",this.$store.commit("package/UPDATE_GENERAL",e._package),this.openEditerModal(mn)}else{if(this.$store.commit("service/UPDATE_GENERAL",e),t===D.DEFAULT)return this.openDefaultServerEditModal();if(t===D.STATIC)return this.openEditerModal(_n,{title:_TT("SYNO.SDS.WebStation.Application","service","static_website_editor")});if(t===D.SCRIPT_LANGUAGE)return this.openEditerModal(_n,{title:_TT("SYNO.SDS.WebStation.Application","service","native_website_editor")})}},openDefaultServerEditModal(){const t=new SYNO.SDS.WebStation.Dialog.DefaultServer({owner:this.$appWindow,module:this.$appWindow,title:_TT("SYNO.SDS.WebStation.Application","portal","edit_default_server_title_case"),listeners:{close:()=>{this.$store.commit("service/RESET_ALL"),this.$refs.dataTable.refresh()},scope:this.$appWindow}});this.$appWindow.openExtWindow(t)},openEditerModal(t,e){let{window:i}=this.$appWindow.openModalWindow(t,e);i.$on("close",()=>{this.$store.commit("service/RESET_ALL"),this.$store.commit("php/RESET_ALL"),this.$store.commit("python/RESET_ALL"),this.$store.commit("node/RESET_ALL"),this.$store.commit("package/RESET_ALL"),this.$refs.dataTable.refresh()})},openServicePackageWizard(){if(this.isServicePackageWizardOpened)return;this.isServicePackageWizardOpened=!0;let{window:t}=this.$appWindow.openModalWindow(fn);t.$on("close",()=>{this.$store.commit("service/RESET_ALL"),this.$store.commit("php/RESET_ALL"),this.$store.commit("python/RESET_ALL"),this.$store.commit("node/RESET_ALL"),this.$store.commit("package/RESET_ALL"),this.isServicePackageWizardOpened=!1,this.$refs.dataTable.refresh()})},async onAction(t="start"){this.$refs.dataTable.setLoading(!0);const e=this.allSelectedRows.filter(t=>t._type===D.DOCKERIZED),i=e.filter(t=>t.type.includes("package")).map(t=>t.id),n=e.filter(t=>!t.type.includes("package")).map(t=>t.id);try{await tt([i.length?Z(t,i):null,n.length?at(t,n):null])}catch(t){}e.forEach(t=>{SYNO.SDS.SocketInst.registerSDKEvent(`docker_${t.docker_id}_done`,()=>{this.$refs.dataTable.refresh()}),this.$store.state.service.loadingDockerIdList.push(t.docker_id)}),this.lockEvent=!0,this.$refs.dataTable.refresh()},async onDelete(){if("confirm"!==await this.$appWindow.getMsgBox().confirmDelete("",_T("common","remove_cfrmrmv")))return;this.$refs.dataTable.setLoading(!0);const t=this.allSelectedRows.map(t=>t.id),e=this.allSelectedRows.filter(t=>t.type.includes("package")).map(t=>t.id),i=this.allSelectedRows.filter(t=>t.type.includes("node")).map(t=>t.id);try{await tt([Q(t),e.length?X(e):null,i.length?rt(i):null])}catch(t){}this.$refs.dataTable.refresh()},onOpenDocker(t){let e=t._originalData;if(e._type==D.DOCKERIZED&&t.status.type==A.LOADING){let t=e.type.includes("package")?this.packageList.find(t=>t.id===e.id):this.scriptLanguageList.find(t=>t.id===e.id);this.$appWindow.openModalWindow(SYNO.SDS.Docker.Project.ProjectActionLogDialog,{projectId:t.docker_id,projectName:t.project_name})}},onOpenUpdataDockerProject(t){if(t._docker_project_data&&!this.isDockerServiceUpdateWizardOpened){this.isDockerServiceUpdateWizardOpened=!0;const{_type:e}=t;let i=q(e,t);this.$store.commit("service/UPDATE_TEMPLATE",i),this.openEditerModal(hn),this.isDockerServiceUpdateWizardOpened=!1}}}},yn=(i(276),f(bn,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-panel",{attrs:{"syno-id":"service-package-page-panel",tbar:"",fbar:!1},scopedSlots:t._u([{key:"tbar",fn:function(){return[i("v-button",{attrs:{"syno-id":"service-package-add-btn",disabled:!t.isLoaded},on:{click:t.openServicePackageWizard}},[t._v("\n "+t._s(t._T("common","create"))+"\n ")]),t._v(" "),i("v-button",{attrs:{"syno-id":"service-package-edit-btn",disabled:!t.isEditable},on:{click:t.openEditModal}},[t._v("\n "+t._s(t._T("common","alt_edit"))+"\n ")]),t._v(" "),i("v-button",{attrs:{"syno-id":"service-package-action-btn",disabled:!t.isActionEnabled,type:"dropdown"},scopedSlots:t._u([{key:"dropdown",fn:function(){return[i("v-menu",{attrs:{"syno-id":"service-package-action-menu",width:"auto"}},[i("v-menu-item",{attrs:{"syno-id":"service-package-action-menu-item-start",disabled:t.noAnyDockerized||!t.isAvailable},on:{click:function(e){return t.onAction("start")}}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","actions","start"))+"\n ")]),t._v(" "),i("v-menu-item",{attrs:{"syno-id":"service-package-action-menu-item-pause",disabled:t.noAnyDockerized||!t.isAvailable},on:{click:function(e){return t.onAction("pause")}}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","actions","pause"))+"\n ")]),t._v(" "),i("v-menu-item",{attrs:{"syno-id":"service-package-action-menu-item-rebuild",disabled:t.noAnyDockerized||!t.isRebuildable},on:{click:function(e){return t.onAction("rebuild")}}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","actions","rebuild"))+"\n ")]),t._v(" "),i("v-menu-item",{attrs:{"syno-id":"service-package-action-menu-item-delete",disabled:!t.isDeleteable},on:{click:t.onDelete}},[t._v("\n "+t._s(t._T("common","delete"))+"\n ")])],1)]},proxy:!0}])},[t._v("\n "+t._s(t._T("common","action"))+"\n ")])]},proxy:!0},{key:"body",fn:function(){return[i("v-data-table",{ref:"dataTable",staticClass:"webstation-panel__data-table ws-package-data-table",attrs:{groupTable:"",multipleSelected:"","syno-id":"service-package-data-table","custom-row-classes":["ws-package-data-table__custom-row"],"enable-hd-menu":!1,groupInfo:t.groupInfo,"local-sort-func":t.localSortFunc,columns:t.columns,data:t.loadData},on:{"selected-change":function(e){t.selectedRows=e},rowdblclick:t.openEditModalByDbClick,dataloaded:function(e){t.selectedRows=[]}},scopedSlots:t._u([{key:"service_type",fn:function(e){var n=e.data;return[i("i",{class:"ws-package-data-table__service-icon ws-package-data-table__service-icon__"+n.cls}),t._v(" "),i("p",{staticClass:"ws-package-data-table__service-text"},[t._v(t._s(n.text))])]}},{key:"status",fn:function(e){var n=e.data,s=e.row;return[i("div",{staticStyle:{display:"flex",overflow:"hidden"}},[i("span",{class:n.class,staticStyle:{display:"1 1 auto",overflow:"hidden","text-overflow":"ellipsis"},on:{click:function(e){return t.onOpenDocker(s)}}},[t._v(t._s(n.message))]),t._v(" "),s._docker_project_data&&s._docker_project_data.upgrade_info&&s.status.type!==t.SERVICE_STATUS.LOADING?i("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:s._docker_project_data.upgrade_info.tip_content,placement:"bottom",isHtml:!0},expression:"{\n content: row._docker_project_data.upgrade_info.tip_content,\n placement: 'bottom',\n isHtml: true,\n }"}],staticStyle:{display:"1 1 auto",overflow:"hidden","text-overflow":"ellipsis"}},[t._v(" ("),i("span",{staticClass:"syno-webstation-loading-status",on:{click:function(e){return t.onOpenUpdataDockerProject(s)}}},[t._v(t._s(t._TT("SYNO.SDS.WebStation.Application","service","upgrade_available")))]),t._v(")\n ")]):t._e(),t._v(" "),i("div",{staticClass:"v-whitetip-wrapper normal",staticStyle:{flex:"0 0 auto"},attrs:{tabindex:"-1"}},[n.tip.show?i("v-whitetip",{attrs:{tooltipOptions:{isHtml:!0}}},[i("v-rich-text",{attrs:{text:n.tip.content}}),t._v(" "),n.tip.detail?i("span",{staticClass:"syno-webstation-loading-status",on:{click:function(e){return n.tip.detail.onClick(t.$appWindow,s)}}},[t._v(" "+t._s(n.tip.detail.text)+" ")]):t._e()],1):t._e()],1)])]}},{key:"version",fn:function(e){var i=e.row;return[t._v("\n "+t._s(i._version_info.overview_version)+"\n ")]}}])})]},proxy:!0}])})}),[],!1,null,null,null).exports),wn={mixins:[_,l],props:{isEmpty:Boolean,emptyText:String,columns:Array,data:Function,type:String,groupInfo:Object,createProfile:Function,editProfile:Function,deleteProfile:Function},mounted(){this.$appWindow=this.$options.appWin},data:()=>({selectedRows:[],localSortFunc(t){const{field:e,sort:i}=t,n=(t=>{switch(t){case"status":return e=>e[t].text;default:return e=>e[t]}})(e);return"ASC"===i?(t,e)=>n(t).localeCompare(n(e)):(t,e)=>n(e).localeCompare(n(t))}}),computed:{allSelectedRows(){var t;return(null===(t=this.selectedRows)||void 0===t?void 0:t.rows)||null},singleSelectRowData(){return this.isEditable&&this.allSelectedRows[0]||null},isEditable(){var t;return 1===(null===(t=this.allSelectedRows)||void 0===t?void 0:t.length)},isDeleteable(){var t,e;return(null===(t=this.allSelectedRows)||void 0===t?void 0:t.length)>0&&(null===(e=this.allSelectedRows)||void 0===e?void 0:e.every(t=>null===t.default_profile))}}},Tn=(i(277),f(wn,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-panel",{staticClass:"script-language-tab",attrs:{tbar:!t.isEmpty,fbar:!1,"syno-id":"webstation-script-language-"+t.type+"-panel"},scopedSlots:t._u([{key:"tbar",fn:function(){return[i("v-button",{attrs:{"syno-id":"webstation-script-language-add-button"},on:{click:function(e){return t.createProfile()}}},[t._v("\n\t\t\t"+t._s(t._T("common","create"))+"\n\t\t")]),t._v(" "),i("v-button",{attrs:{"syno-id":"webstation-script-language-edit-button",disabled:!t.isEditable},on:{click:function(e){return t.editProfile()}}},[t._v("\n\t\t\t"+t._s(t._T("common","alt_edit"))+"\n\t\t")]),t._v(" "),i("v-button",{attrs:{"syno-id":"webstation-script-language-delete-button",disabled:!t.isDeleteable},on:{click:function(e){return t.deleteProfile()}}},[t._v("\n\t\t\t"+t._s(t._T("common","delete"))+"\n\t\t")])]},proxy:!0},{key:"body",fn:function(){return[t.isEmpty?[i("v-empty-view",{attrs:{text:t.emptyText,"hide-action":""}})]:[i("v-data-table",{ref:"table",attrs:{groupTable:"","multiple-selected":"","syno-id":"webstation-script-language-data-table",columns:t.columns,"enable-hd-menu":!1,data:t.data,"group-info":t.groupInfo,"local-sort-func":t.localSortFunc},on:{"selected-change":function(e){t.selectedRows=e},rowdblclick:function(e){return t.editProfile()},dataloaded:function(e){t.selectedRows=[]}},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.data;return[i("font",{class:n.class},[t._v(" "+t._s(n.text)+" ")])]}}])})]]},proxy:!0}])})}),[],!1,null,"77fd418e",null).exports),xn=f({name:"PHPEditor",mixins:[l],components:{"php-general":Ot,"php-extensions":Lt,"php-fpm":Yt,"php-core-settings":It},data:()=>({activeTabIndex:"1",showStatusBar:!1,statusBarErrorText:"",isLoading:!1,loadingType:"spin",statusBarState:"loading"}),computed:{...Object(m.b)("php",["ALL_FIELDS"])},async mounted(){this.onLoading(),await this.$nextTick(),this.allRefs=[this.$refs.general,this.$refs.extensions,this.$refs.fpm,this.$refs.core],await Promise.all(this.allRefs.map(t=>t.preload())),this.onLoading(!1)},methods:{async save(){try{if(!(await Promise.all(this.allRefs.map(t=>t.validate()))).every(Boolean))return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}this.onLoading(),this.allRefs.forEach(t=>t.commit());let t=await this.sendSetRequest();if(this.onLoading(!1),!t)return!1;this.$store.commit("php/RESET_ALL"),this.close()},async sendSetRequest(){let t=!0;try{this.onLoading();await synowebapi.promises.request({api:"SYNO.WebStation.PHP.Profile",version:1,method:"update",params:{profile:this.ALL_FIELDS}})}catch(e){let i=1628===e.code?e.errors.error:_T("error","error_error_system");await this.$root.$refs.window.getMsgBox().alert("",i),t=!1}return this.$emit("loading",!1),t},async cancel(){if(this.allRefs.map(t=>t.isDirty()).every(t=>!1===t))return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$store.commit("php/RESET_ALL"),this.$refs.window.doClose()},onLoading(t=!0){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatus()},onError(t){return this.showStatusBar=!0,this.isLoading=!1,this.loadingType="statusbar",this.statusBarState="error",this.validateStatus="error",this.statusBarErrorText=t,!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"webstation-php-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","php","edit_php_profile"),width:876,height:540,beforeClose:t.cancel}},[i("v-tabs",{attrs:{"syno-id":"webstation-php-editor-tabs"},on:{confirm:t.save,cancel:t.cancel},model:{value:t.activeTabIndex,callback:function(e){t.activeTabIndex=e},expression:"activeTabIndex"}},[i("v-tab-pane",{attrs:{"syno-id":"webstation-php-general-tab-pane","tab-key":"1",tab:t._TT("SYNO.SDS.WebStation.Application","php","settings")}},[i("php-general",{ref:"general",attrs:{"window-type":"modal"},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"webstation-php-extensions-tab-pane","tab-key":"2",tab:t._TT("SYNO.SDS.WebStation.Application","php","extensions")}},[i("php-extensions",{ref:"extensions",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"webstation-php-fpm-tab-pane","tab-key":"3",tab:t._TT("SYNO.SDS.WebStation.Application","php_advanced_setting","fpm_setting")}},[i("php-fpm",{ref:"fpm",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"webstation-php-core-settings-tab-pane","tab-key":"4",tab:t._TT("SYNO.SDS.WebStation.Application","php_advanced_setting","core_setting")}},[i("php-core-settings",{ref:"core",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1)],1)],1)}),[],!1,null,null,null).exports;async function En(){let{hasFail:t,result:e}=await synowebapi.promises.request({compound:{stopwhenerror:!0,params:[{api:"SYNO.WebStation.PHP.Profile",version:1,method:"list"},{api:"SYNO.WebStation.WebService.Service",method:"list",version:1}]}}),i=e.find(t=>"SYNO.WebStation.PHP.Profile"===t.api).data.profiles,n=e.find(t=>"SYNO.WebStation.WebService.Service"===t.api).data.services,s={};n.forEach(t=>{s[t.id]=t});for(let t of i){t.preserve=t.default_profile?_TT("SYNO.SDS.WebStation.Application","php","header_group_default_profile"):_TT("SYNO.SDS.WebStation.Application","php","header_group_custom_profile"),t.service=void 0===s[t.uuid]||void 0===s[t.uuid].display_name?_TT("SYNO.SDS.WebStation.Application","common","user_defined"):SYNO.SDS.WebStation.Util.geti18nString(s[t.uuid].display_name_i18n,s[t.uuid].display_name);let e=t.default_profile?t.default_profile.enable:t.enable;t.status=e?{class:"green-status",text:_TT("SYNO.SDS.WebStation.Application","common","status_available")}:{class:"red-status",text:_TT("SYNO.SDS.WebStation.Application","common","status_not_available")};let i=t.default_profile?t.default_profile.backend:t.backend;t.backend_name=await SYNO.SDS.WebStation.Util.PackageInfo.GetPackageNameByIndex("php",i)||t.profile_desc.split(" ").slice(1,3).join(" ")}return{items:i}}function kn(){let t=r.a.extend({store:R}).extend(Ft),{window:e}=this.$appWindow.openModalWindow(t,{type:"php"});e.$on("close",()=>{this.$store.commit("php/RESET_ALL"),this.$refs.table.refresh()})}async function Dn(){if(!this.isEditable)return;null!==this.singleSelectRowData.default_profile&&(this.singleSelectRowData.backend=this.singleSelectRowData.default_profile.backend,this.singleSelectRowData.default_profile.installed=!0),this.$store.commit("php/UPDATE_TEMPLATE",this.singleSelectRowData),this.$store.commit("php/UPDATE_GENERAL",this.singleSelectRowData),this.$store.commit("php/UPDATE_FPM",this.singleSelectRowData),this.$store.commit("php/UPDATE_EXTENSIONS",this.singleSelectRowData),this.$store.commit("php/UPDATE_CORE_SETTINGS",this.singleSelectRowData),this.$store.commit("php/UPDATE_DEFAULT_PROFILE",this.singleSelectRowData.default_profile);let t=r.a.extend({store:R}).extend(xn),{window:e}=this.$appWindow.openModalWindow(t);e.$on("close",()=>{this.$store.commit("php/RESET_ALL"),this.$refs.table.refresh()})}async function An(){if(!this.isDeleteable)return;if("confirm"!==await this.$appWindow.getMsgBox().confirmDelete("",_T("common","remove_cfrmrmv")))return;this.$refs.table.currentLoading=!0;const t=this.allSelectedRows.map(t=>t.uuid);await synowebapi.promises.request({api:"SYNO.WebStation.PHP.Profile",method:"delete",version:1,params:{uuids:t}}),this.$refs.table.refresh(),this.$refs.table.currentLoading=!1}let On=Vue.extend(Et);var Nn=f({name:"PythonEditor",mixins:[l],components:{"python-general":ct,"python-uwsgi":ht,"python-modules":wt},data:()=>({activeTabIndex:"1",showStatusBar:!1,statusBarErrorText:"",isLoading:!1,loadingType:"spin",statusBarState:"loading"}),computed:{...Object(m.b)("python",["ALL_FIELDS"])},async mounted(){this.onLoading(),await this.$nextTick(),this.allRefs=[this.$refs.general,this.$refs.uwsgi,this.$refs.modules],await Promise.all(this.allRefs.map(t=>t.preload())),this.onLoading(!1)},methods:{async save(){try{if(!(await Promise.all(this.allRefs.map(t=>t.validate()))).every(Boolean))return this.onError(this._T("common","forminvalid")),!1}catch(t){return this.onError(t),!1}this.onLoading(),this.allRefs.forEach(t=>t.commit());let t=await this.sendSetRequest();if(this.onLoading(!1),!t)return!1;this.$store.commit("python/RESET_ALL"),this.close()},async sendSetRequest(){let t=!0;try{this.onLoading();await synowebapi.promises.request({api:"SYNO.WebStation.Python.Profile",version:1,method:"update",params:{profile:this.ALL_FIELDS}})}catch(e){let i=1628===e.code?e.errors.error:_T("error","error_error_system");await this.$root.$refs.window.openModalWindow(On,{content:i,title:_TT("SYNO.SDS.WebStation.Application","python","error_window_title")}),t=!1}return this.$emit("loading",!1),t},async cancel(){if(this.allRefs.map(t=>t.isDirty()).every(t=>!1===t))return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$store.commit("python/RESET_ALL"),this.$refs.window.doClose()},onLoading(t=!0){this.$refs.window.onlyMask=!0,t?this.$refs.window.setStatusBusy():this.$refs.window.clearStatus()},onError(t){return this.showStatusBar=!0,this.isLoading=!1,this.loadingType="statusbar",this.statusBarState="error",this.validateStatus="error",this.statusBarErrorText=t,!1}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"webstation-python-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","python","edit_python_profile"),width:876,height:540,beforeClose:t.cancel}},[i("v-tabs",{attrs:{"syno-id":"webstation-python-editor-tabs"},on:{confirm:t.save,cancel:t.cancel},model:{value:t.activeTabIndex,callback:function(e){t.activeTabIndex=e},expression:"activeTabIndex"}},[i("v-tab-pane",{attrs:{"syno-id":"webstation-python-general-tab-pane","tab-key":"1",tab:t._TT("SYNO.SDS.WebStation.Application","php","settings")}},[i("python-general",{ref:"general",attrs:{"window-type":"modal"},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"webstation-python-uwsgi-tab-pane","tab-key":"2",tab:"uWSGI"}},[i("python-uwsgi",{ref:"uwsgi",attrs:{"window-type":"modal",editor:""},on:{"display-error":t.onError}})],1),t._v(" "),i("v-tab-pane",{attrs:{"syno-id":"webstation-python-modules-tab-pane","tab-key":"3",tab:t._TT("SYNO.SDS.WebStation.Application","python","module")}},[i("python-modules",{ref:"modules",attrs:{"window-type":"modal","show-version":""},on:{"display-error":t.onError}})],1)],1)],1)}),[],!1,null,null,null).exports;async function $n(){let{hasFail:t,result:e}=await synowebapi.promises.request({compound:{stopwhenerror:!0,params:[{api:"SYNO.WebStation.Python.Profile",version:1,method:"list"},{api:"SYNO.WebStation.WebService.Service",method:"list",version:1}]}}),i=e.find(t=>"SYNO.WebStation.Python.Profile"===t.api).data.profiles,n=e.find(t=>"SYNO.WebStation.WebService.Service"===t.api).data.services,s={};n.forEach(t=>{s[t.id]=t});for(let t of i){t.preserve=t.default_profile?_TT("SYNO.SDS.WebStation.Application","php","header_group_default_profile"):_TT("SYNO.SDS.WebStation.Application","php","header_group_custom_profile"),t.service=void 0===s[t.uuid]||void 0===s[t.uuid].display_name?_TT("SYNO.SDS.WebStation.Application","common","user_defined"):SYNO.SDS.WebStation.Util.geti18nString(s[t.uuid].display_name_i18n,s[t.uuid].display_name);let e=t.default_profile?t.default_profile.enable:t.enable;t.status=e?{class:"green-status",text:_TT("SYNO.SDS.WebStation.Application","common","status_available")}:{class:"red-status",text:_TT("SYNO.SDS.WebStation.Application","common","status_not_available")};let i=t.default_profile?t.default_profile.backend:t.backend;t.backend_name=await SYNO.SDS.WebStation.Util.PackageInfo.GetPackageNameByIndex("python",i)||t.profile_desc.split(" ").slice(1,3).join(" ")}return{items:i}}function Ln(){let t=r.a.extend({store:R}).extend(Ft),{window:e}=this.$appWindow.openModalWindow(t,{type:"python"});e.$on("close",()=>{this.$store.commit("python/RESET_ALL"),this.$refs.table.refresh()})}async function Wn(){if(!this.isEditable)return;this.$store.commit("python/UPDATE_TEMPLATE",this.singleSelectRowData),this.$store.commit("python/UPDATE_GENERAL",this.singleSelectRowData),this.$store.commit("python/UPDATE_UWSGI",this.singleSelectRowData),this.$store.commit("python/UPDATE_MODULES",this.singleSelectRowData);let t=r.a.extend({store:R}).extend(Nn),{window:e}=this.$appWindow.openModalWindow(t);e.$on("close",()=>{this.$store.commit("python/RESET_ALL"),this.$refs.table.refresh()})}async function Pn(){if(!this.isDeleteable)return;if("confirm"!==await this.$appWindow.getMsgBox().confirmDelete("",_T("common","remove_cfrmrmv")))return;this.$refs.table.currentLoading=!0;const t=this.allSelectedRows.map(t=>t.uuid);await synowebapi.promises.request({api:"SYNO.WebStation.Python.Profile",method:"delete",version:1,params:{uuids:t}}),this.$refs.table.refresh(),this.$refs.table.currentLoading=!1}var Yn=f({mixins:[_,l],components:{scriptLanguageTab:Tn},beforeMount(){SYNO.SDS.StatusNotifier.on("thirdpartychanged",this.onPkgChanged,this)},beforeDestory(){SYNO.SDS.StatusNotifier.un("thirdpartychanged",this.onPkgChanged,this)},mounted(){this.$appWindow=this.$options.appWin,this.checkScriptLanguageexist()},data:()=>({activeTabIndex:"1",scriptLanguageGroup:[{type:"php",tab:"PHP",tabKey:"1",isEmpty:!0,emptyText:_TT("SYNO.SDS.WebStation.Application","php","php_no_backend"),columns:[{title:_TT("SYNO.SDS.WebStation.Application","common","service"),field:"service",tooltip:!0},{title:_TT("SYNO.SDS.WebStation.Application","common","status"),field:"status",tooltip:t=>t.status.text},{title:_TT("SYNO.SDS.WebStation.Application","php","profile_name"),field:"profile_name",tooltip:!0},{title:_TT("SYNO.SDS.WebStation.Application","php","version"),field:"backend_name",tooltip:!0},{title:_TT("SYNO.SDS.WebStation.Application","php","profile_desc"),field:"profile_desc",tooltip:!0,disableSort:!0}],groupInfo:{category:"preserve",sortCategoryFn:(t,e)=>t.key.localeCompare(e.key)},data:En,createProfile:kn,editProfile:Dn,deleteProfile:An},{type:"python",tab:"Python",tabKey:"2",isEmpty:!0,emptyText:_TT("SYNO.SDS.WebStation.Application","python","python_no_backend"),columns:[{title:_TT("SYNO.SDS.WebStation.Application","common","service"),field:"service",tooltip:!0},{title:_TT("SYNO.SDS.WebStation.Application","common","status"),field:"status",tooltip:t=>t.status.text},{title:_TT("SYNO.SDS.WebStation.Application","php","profile_name"),field:"profile_name",tooltip:!0},{title:_TT("SYNO.SDS.WebStation.Application","python","version"),field:"backend_name",tooltip:!0},{title:_TT("SYNO.SDS.WebStation.Application","php","profile_desc"),field:"profile_desc",tooltip:!0,disableSort:!0}],groupInfo:{category:"preserve",sortCategoryFn:(t,e)=>t.key.localeCompare(e.key)},data:$n,createProfile:Ln,editProfile:Wn,deleteProfile:Pn}]}),methods:{onPkgChanged(t){[void 0,"WebStation"].includes(t)||this._isDestroyed||this.checkScriptLanguageexist()},async checkScriptLanguageexist(){this.$appWindow.setStatusBusy();let{available_php_backend:t}=await SYNO.SDS.WebStation.Util.PackageInfo.GetPhpData();this.scriptLanguageGroup[0].isEmpty=null===t||Array.isArray(t)&&0===t.length;let{available_python_backend:e}=await SYNO.SDS.WebStation.Util.PackageInfo.GetPythonData();this.scriptLanguageGroup[1].isEmpty=null===e||Array.isArray(e)&&0===e.length,this.$appWindow.clearStatus()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-tabs",{attrs:{"syno-id":"webstation-script-language-tabs",fbar:!1},model:{value:t.activeTabIndex,callback:function(e){t.activeTabIndex=e},expression:"activeTabIndex"}},t._l(t.scriptLanguageGroup,(function(e){return i("v-tab-pane",{key:e.type,attrs:{"syno-id":"webstation-script-lanuage-"+e.type+"-tab",tab:e.tab,"tab-key":e.tabKey}},[i("script-language-tab",t._b({},"script-language-tab",e,!1))],1)})),1)}),[],!1,null,null,null).exports;var Rn={props:{value:[File,String],name:String,placeholder:String,accept:String},data:()=>({isHovering:!1,isFocusing:!1}),computed:{labelFor:()=>`${Date.now().toString(36)}-${Math.random().toString(36).substr(2,9)}`,filename(){return"string"==typeof this.value?this.value:this.value&&this.value.name||null}},methods:{onInputChange(t){const e=t.target.files[0];e&&this.$emit("input",e)}}},Cn=(i(278),f(Rn,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("label",{class:{"webstation-file-input":!0,"webstation-file-input--hover":t.isHovering,"webstation-file-input--focus":t.isFocusing},attrs:{tabindex:"0",for:t.labelFor},on:{mouseover:function(e){t.isHovering=!0},mouseleave:function(e){t.isHovering=!1},click:function(e){t.isFocusing=!0},blur:function(e){t.isFocusing=!1}}},[i("span",{class:["webstation-file-input__text",{"webstation-file-input__text--primary":t.filename}]},[t._v("\n "+t._s(t.filename||t.placeholder)+"\n ")]),t._v(" "),i("span",{staticClass:"webstation-file-input__btn"}),t._v(" "),i("input",{staticClass:"webstation-file-input__input",attrs:{id:t.labelFor,type:"file",accept:t.accept,name:t.name},on:{change:function(e){return t.onInputChange(e)}}})])}),[],!1,null,null,null).exports);function In(t){if(!t)return new Error(_JSLIBSTR("extlang","fieldblank"))}const Bn=[{type:"string",required:!0,validator:(t,e,i)=>i(function(t=""){if(""===t)return new Error(_JSLIBSTR("extlang","fieldblank"))}(e))}],jn=(t=[])=>[{type:"string",required:!0,validator:(e,i,n)=>n(function(t="",e=[]){if(void 0===t||""===t)return new Error(_JSLIBSTR("extlang","fieldblank"));if("default"===t)return;const i=parseInt(t,10);return Number.isNaN(i)||i<400||600<=i?new Error(_TT("SYNO.SDS.WebStation.Application","custom_error_page","error_code_valid")):e.some((i,n)=>e.indexOf(i)!==n&&t===i)?new Error(_TT("SYNO.SDS.WebStation.Application","custom_error_page","error_code_duplicated")):void 0}(i,t))}],Un=[{required:!0,validator:(t,e,i)=>i(function(t){let e;if(e=In(t))return e;if(!(t instanceof File))return;return["image/","html","text"].some(e=>t.type.includes(e))?void 0:new Error(_TT("SYNO.SDS.WebStation.Application","custom_error_page","error_file_page"))}(e))}],Fn=[{required:!0,validator:(t,e,i)=>i(function(t){let e;if(e=In(t))return e;if(!(t instanceof File))return;return"dat"===t.name.split(".").lastItem?void 0:new Error(_TT("SYNO.SDS.WebStation.Application","custom_error_page","error_file_imported"))}(e))}],Mn=[{type:"string",required:!0,validator:(t,e,i)=>i(function(t=""){return""===t?new Error(_JSLIBSTR("extlang","fieldblank")):t.startsWith("/")?void 0:new Error(_TT("SYNO.SDS.WebStation.Application","custom_error_page","error_relative_url"))}(e))}],qn=[{type:"string",required:!0,validator:(t,e,i)=>i(function(t=""){return""===t?new Error(_JSLIBSTR("extlang","fieldblank")):["https://","http://"].some(e=>t.startsWith(e))?void 0:new Error(_TT("SYNO.SDS.WebStation.Application","custom_error_page","error_absolute_url"))}(e))}];var Gn={components:{FileInput:Cn},mixins:[l],props:{profile:{type:Object,required:!0}},data:()=>({RESPONSE_ACTIONS:p,RESPONSE_ACTION_SELECTS:c(),RULES:s})},zn=(i(279),f(Gn,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-fieldset",{staticClass:"profile-form-fieldset",attrs:{"syno-id":"webstation-profile-fieldset",title:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","default_page_title_case"),collapsible:!1}},["default"===t.profile.id?i("v-form-item",{attrs:{"syno-id":"webstation-profile-desc-form-item",prop:"profile-desc",label:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","profile_name")+t._T("common","colon")}},[i("p",{staticClass:"custom-settings__paragraph"},[t._v("\n "+t._s(t.profile.desc)+"\n ")])]):i("v-form-item",{attrs:{"syno-id":"webstation-profile-desc-form-item",prop:"profile-desc",label:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","profile_name")+t._T("common","colon"),rules:t.RULES.descRules}},[i("v-input",{staticClass:"error-page-profile-form__v-input",attrs:{"syno-id":"webstation-profile-desc-input",name:"profile-desc"},model:{value:t.profile.desc,callback:function(e){t.$set(t.profile,"desc",e)},expression:"profile.desc"}})],1),t._v(" "),i("v-form-item",{attrs:{"syno-id":"webstation-profile-page-default-type-form-item",label:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","response_action")+t._T("common","colon")}},[i("v-single-select",{staticClass:"error-page-profile-form__v-single-select",attrs:{readonly:"","syno-id":"webstation-profile-page-default-type-select",width:"",hasTooltip:"",options:t.RESPONSE_ACTION_SELECTS},model:{value:t.profile.defaultPage.type,callback:function(e){t.$set(t.profile.defaultPage,"type",e)},expression:"profile.defaultPage.type"}})],1),t._v(" "),t.profile.defaultPage.type===t.RESPONSE_ACTIONS.STATIC?i("v-form-item",{key:"webstation-profile-page-default-file-form-item",attrs:{"syno-id":"webstation-profile-page-default-file-form-item",label:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","file_path")+t._T("common","colon"),prop:"profile-page-default-file",rules:t.RULES.errorPageStaticFileRules}},[i("FileInput",{directives:[{name:"form-component",rawName:"v-form-component"}],staticClass:"error-page-profile-form__file-input",attrs:{name:"profile-page-default-file",placeholder:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","select_file"),accept:".html,image/*",value:"string"==typeof t.profile.defaultPage.file?t.profile.defaultPage.desc:t.profile.defaultPage.file},on:{input:function(e){t.profile.defaultPage.file=e}}})],1):t._e(),t._v(" "),t.profile.defaultPage.type===t.RESPONSE_ACTIONS.RELATIVE_URL?i("v-form-item",{key:"webstation-profile-page-default-relative-url-form-item",attrs:{"syno-id":"webstation-profile-page-default-relative-url-form-item",label:t._TT("SYNO.SDS.WebStation.Application","common","url")+t._T("common","colon"),prop:"profile-page-default-relative-url",rules:t.RULES.relativeUrlRules}},[i("v-input",{staticClass:"error-page-profile-form__v-input",attrs:{"syno-id":"webstation-profile-page-default-relative-url-input",name:"profile-page-default-relative-url",placeholder:""+t._TT("SYNO.SDS.WebStation.Application","custom_error_page","example")+t._T("common","colon")+" /ErrorPages/404.aspx"},model:{value:t.profile.defaultPage.relative_url,callback:function(e){t.$set(t.profile.defaultPage,"relative_url",e)},expression:"profile.defaultPage.relative_url"}})],1):t._e(),t._v(" "),t.profile.defaultPage.type===t.RESPONSE_ACTIONS.REDIRECT_302?i("v-form-item",{key:"webstation-profile-page-default-absolute-url-form-item",attrs:{"syno-id":"webstation-profile-page-default-absolute-url-form-item",label:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","absolute_url")+t._T("common","colon"),prop:"profile-page-default-absolute-url",rules:t.RULES.absoluteUrlRules}},[i("v-input",{staticClass:"error-page-profile-form__v-input",attrs:{"syno-id":"webstation-profile-page-default-absolute-url-input",name:"profile-page-default-absolute-url",placeholder:""+t._TT("SYNO.SDS.WebStation.Application","custom_error_page","example")+t._T("common","colon")+" http://www.test.com/404.aspx"},model:{value:t.profile.defaultPage.absolute_url,callback:function(e){t.$set(t.profile.defaultPage,"absolute_url",e)},expression:"profile.defaultPage.absolute_url"}})],1):t._e()],1)}),[],!1,null,null,null).exports),Hn={components:{FileInput:Cn},mixins:[l],props:{page:{type:Object,required:!0}},data:()=>({RESPONSE_ACTIONS:p,RESPONSE_ACTION_SELECTS:c(),RULES:s})},Vn=(i(280),{components:{ResponseActionTd:f(Hn,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"response-actions",on:{keydown:function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;e.preventDefault()}}},[i("v-form-item",{staticClass:"response-actions__form-item response-actions__form-item--select",attrs:{"syno-id":"webstation-profile-page-"+t.page.id+"-type-select-form-item"}},[i("v-single-select",{staticClass:"response-actions__select",attrs:{readonly:"","syno-id":"webstation-profile-page-"+t.page.id+"-type-select",width:"",hasTooltip:"",options:t.RESPONSE_ACTION_SELECTS},model:{value:t.page.type,callback:function(e){t.$set(t.page,"type",e)},expression:"page.type"}})],1),t._v(" "),t.page.type===t.RESPONSE_ACTIONS.STATIC?i("v-form-item",{key:"webstation-profile-page-"+t.page.id+"-file-form-item",staticClass:"response-actions__form-item response-actions__form-item--action",attrs:{"syno-id":"webstation-profile-page-"+t.page.id+"-file-form-item",prop:"file",rules:t.RULES.errorPageStaticFileRules}},[i("FileInput",{directives:[{name:"form-component",rawName:"v-form-component"}],attrs:{name:"file",placeholder:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","select_file"),accept:".html,image/*",value:"string"==typeof t.page.file?t.page.desc:t.page.file},on:{input:function(e){t.page.file=e}}})],1):t._e(),t._v(" "),t.page.type===t.RESPONSE_ACTIONS.RELATIVE_URL?i("v-form-item",{key:"webstation-profile-page-"+t.page.id+"-relative-url-form-item",staticClass:"response-actions__form-item response-actions__form-item--action",attrs:{"syno-id":"webstation-profile-page-"+t.page.id+"-relative-url-form-item",prop:"relative-url",rules:t.RULES.relativeUrlRules}},[i("v-input",{attrs:{"syno-id":"webstation-profile-page-"+t.page.id+"-relative-url-input",name:"relative-url",placeholder:""+t._TT("SYNO.SDS.WebStation.Application","custom_error_page","example")+t._T("common","colon")+" /ErrorPages/404.aspx"},model:{value:t.page.relative_url,callback:function(e){t.$set(t.page,"relative_url",e)},expression:"page.relative_url"}})],1):t._e(),t._v(" "),t.page.type===t.RESPONSE_ACTIONS.REDIRECT_302?i("v-form-item",{key:"webstation-profile-page-"+t.page.id+"-absolute-url-form-item",staticClass:"response-actions__form-item response-actions__form-item--action",attrs:{"syno-id":"webstation-profile-page-"+t.page.id+"-absolute-url-form-item",prop:"absolute-url",rules:t.RULES.absoluteUrlRules}},[i("v-input",{attrs:{"syno-id":"webstation-profile-page-"+t.page.id+"-absolute-url-input",name:"absolute-url",placeholder:""+t._TT("SYNO.SDS.WebStation.Application","custom_error_page","example")+t._T("common","colon")+" http://www.test.com/404.aspx"},model:{value:t.page.absolute_url,callback:function(e){t.$set(t.page,"absolute_url",e)},expression:"page.absolute_url"}})],1):t._e(),t._v(" "),i("button",{staticClass:"response-actions__delete-btn",on:{click:function(e){return t.$emit("profile:delete-page",t.page)}}})],1)}),[],!1,null,null,null).exports},mixins:[l],props:{profile:{type:Object,required:!0}},data:()=>({isDragging:!1,offsetHeight:205}),mounted(){this.$nextTick(()=>{this.offsetHeight=152-this.$parent.$children[0].$el.offsetHeight+275-this.$refs.paragraph.offsetHeight})},computed:{columns:()=>[{title:_TT("SYNO.SDS.WebStation.Application","custom_error_page","status_code"),field:"code",width:152},{title:_TT("SYNO.SDS.WebStation.Application","custom_error_page","response_action_title_case"),field:"type",className:"data-table__response_actions_column"}],customPageCodes(){return this.profile.otherPages.map(t=>t.code)},codeRules(){return jn(this.customPageCodes)}},methods:{async onAddPageDone(){const t=this.$refs.dataTable;await this.$nextTick(),t.buildCols({applyHeadersWidth:!0,forceFit:!0}),this.scrollAfterAdd(1)},async onDrop(t){this.isDragging=!1,Array.from(t.dataTransfer.files).forEach(t=>{this.$emit("profile:add-page",{type:p.STATIC,file:t},()=>this.onAddPageDone())}),await this.$nextTick();const e=t.dataTransfer.files.length,i=this.$root.$refs.window,n=(1===e?_TT("SYNO.SDS.WebStation.Application","custom_error_page","item_added"):_TT("SYNO.SDS.WebStation.Application","custom_error_page","items_added")).replace("{0}",e);i.getToastBox(n,{textCls:"toast-text"}),this.scrollAfterAdd(e)},scrollAfterAdd(t){let e=this.$refs.dataTable.currentTotal-t;this.scrollToRow(e)},scrollToRow(t){this.$refs.dataTable.selectRow(t)}}}),Kn=(i(281),f(Vn,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("v-fieldset",{staticClass:"custom-settings",attrs:{"syno-id":"webstation-profile-custom-settings-fieldset",title:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","custom_settings_title_case"),collapsible:!1}},[i("div",{ref:"paragraph"},[i("p",{staticClass:"custom-settings__paragraph",domProps:{innerHTML:t._s(t._TT("SYNO.SDS.WebStation.Application","custom_error_page","custom_settings_description"))}}),t._v(" "),i("v-button",{staticClass:"custom-settings__add-page-btn",attrs:{"syno-id":"webstation-profile-custom-page-add-button"},on:{click:function(e){return t.$emit("profile:add-page",{},t.onAddPageDone)}}},[t._v("\n "+t._s(t._T("common","add"))+"\n ")])],1),t._v(" "),i("div",{ref:"fileDragger",class:{"file-dragger":!0,"file-dragger--dragging":t.isDragging},attrs:{id:"file-dragger"},on:{dragenter:function(e){e.stopPropagation(),e.preventDefault(),t.isDragging=!0}}},[i("div",{class:{"file-dragger__cover":!0,"file-dragger__cover--hidden":!t.isDragging},on:{dragover:function(t){t.stopPropagation(),t.preventDefault()},dragleave:function(e){e.stopPropagation(),e.preventDefault(),t.isDragging=!1},drop:function(e){return e.stopPropagation(),e.preventDefault(),t.onDrop(e)}}},[i("div",{staticClass:"file-dragger__cover__content"},[i("div",{staticClass:"file-dragger__cover__content__img"}),t._v(" "),i("div",{staticClass:"file-dragger__cover__content__text"},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","custom_error_page","drag_file_here"))+"\n ")])])]),t._v(" "),i("v-data-table",{ref:"dataTable",staticClass:"custom-settings__data-table",style:{height:t.offsetHeight+"px"},attrs:{"hide-refresh-btn":"","syno-id":"webstation-profile-custom-page-data-table",columns:t.columns,"current-data":t.profile.otherPages},scopedSlots:t._u([{key:"code",fn:function(e){e.data;var n=e.row;return[i("v-form-item",{attrs:{"syno-id":"webstation-profile-page-"+n.id+"-code-form-item",prop:"code",rules:t.codeRules}},[i("v-input",{attrs:{"syno-id":"webstation-profile-page-"+n.id+"-code-input",name:"code",maxlength:3},on:{keydown:function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;e.preventDefault()}},model:{value:n.code,callback:function(e){t.$set(n,"code",e)},expression:"page.code"}})],1)]}},{key:"type",fn:function(e){var n=e.row;return[i("ResponseActionTd",t._g({attrs:{page:n}},t.$listeners))]}},{key:"empty-area",fn:function(){return[i("div",{staticClass:"custom-settings__data-table__empty-text"},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","custom_error_page","no_customize_error_page"))+"\n ")])]},proxy:!0}])})],1)])],1)}),[],!1,null,null,null).exports),Jn={mixins:[l],props:{error:{type:Boolean,default:!1},text:{type:String,default:""}}};i(282);function Zn(t={}){const e=(t.pages||[]).find(t=>"default"===t.code),i=(t.pages||[]).filter(t=>t!==e);return{id:t.id,desc:t.desc||"",defaultPage:Qn(e||{code:"default"}),otherPages:i.map(t=>Qn(t))}}function Qn(t={}){return{id:t.id||`\n tmp-\n ${Date.now().toString(36)}-\n ${Math.random().toString(36).substr(2,9)}\n `.replace(/\s/g,""),code:t.code||"",desc:t.desc||"",type:t.type||p.STATIC,absolute_url:t.absolute_url||"",relative_url:t.relative_url||"",file:t.file||"",modified_time:t.modified_time}}function Xn(t={},e={}){const i={},n={};e.needsId&&t.id&&(i.id=t.id),e.needsRemovePageIds&&(i.remove_pages=t.remove_pages),i.desc="default"===t.id?"default":t.desc,i.pages=t.otherPages.map(t=>a(t));const s=a(t.defaultPage);return s&&i.pages.unshift(s),{profile:JSON.stringify(i),...n};function a(t={}){if(Pe()(t))return;const e={};return e.type=t.type,e.code=t.code,t.id&&!t.id.startsWith("tmp")&&(e.id=t.id),t.modified_time&&(e.modified_time=t.modified_time),t.type===p.RELATIVE_URL&&(e.relative_url=t.relative_url),t.type===p.REDIRECT_302&&(e.absolute_url=t.absolute_url),t.type===p.STATIC&&(e.file=null,t.file instanceof File&&(e.desc=t.file.name,n[t.id]=t.file,e.file=t.id)),e}}var ts={components:{ProfileForm:zn,CustomSettings:Kn,Footer:f(Jn,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"modal-footer"},[i("div",{class:[{"modal-footer__left-text":!0},{"modal-footer__left-text--error":t.error}]},[t._v("\n "+t._s(t.text)+"\n ")]),t._v(" "),i("div",{staticClass:"modal-footer__right-actions"},[i("v-button",{staticClass:"modal-footer__right-actions__btn",attrs:{type:"footbar"},on:{click:function(e){return t.$emit("cancel",e)}}},[t._v("\n "+t._s(t._T("common","cancel"))+"\n ")]),t._v(" "),i("v-button",{staticClass:"modal-footer__right-actions__btn",attrs:{type:"footbar",suffix:"blue"},on:{click:function(e){return t.$emit("save",e)}}},[t._v("\n "+t._s(t._T("common","save"))+"\n ")])],1)])}),[],!1,null,"a1cafcba",null).exports},mixins:[l],props:{cancelText:{type:String,required:!0},confirmText:{type:String,required:!0},profile:{type:Object,required:!0}},data(){return{currentProfile:U()(this.profile),showStatusBar:!1,isLoading:!1,loadingType:"spin",statusBarState:"loading"}},methods:{async save(){if(!await this.validate())return this.onError();this.onLoading(),this.$emit("save",this.currentProfile,()=>this.onError())},async cancel(){if(!await this.isDirty())return this.$emit("cancel");const t=await this.$root.$refs.window.getMsgBox().confirmLostChange("",this.cancelText);return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.$emit("cancel"):void 0)},onLoading(){this.isLoading=!0,this.loadingType="spin",this.statusBarState="loading"},async onError(){this.showStatusBar=!0,this.isLoading=!1,this.loadingType="statusbar",this.statusBarState="error";const t=this.$refs.form.fields.filter(t=>["code","file","relative-url","absolute-url"].includes(t.prop)).map(t=>(t.index="code"!==t.prop?t.$parent._uid:t._uid,t)).sort((t,e)=>t.index-e.index),e=await Promise.all(t.map(t=>t.validate()));await this.$nextTick();const i=e.findIndex(t=>""!==t);return-1!==i&&this.$refs.customSettings.scrollToRow(Math.floor(i/2)),!1},addPage(t={},e){const i=this.currentProfile.otherPages.find(t=>void 0===t.file);if(!Pe()(t)&&i)i.file=t.file;else{const e=Qn(t);this.currentProfile.otherPages.push(e)}e()},async deletePage(t){const e=this.currentProfile.otherPages.find(e=>e.id===t.id);if(!e)return;if(!await this.confirmDelete(e))return;const i=this.currentProfile.otherPages.indexOf(e);this.currentProfile.otherPages.splice(i,1)},async confirmDelete(t={}){if(!t)return!0;if(!(t.code||t.file||t.absolute_url||t.relative_url))return!0;return"confirm"===await this.$root.$refs.window.getMsgBox().confirmDelete("",_TT("SYNO.SDS.WebStation.Application","custom_error_page","confirm_delete_page"))},async validate(){const t=this.$refs.form;return await t.validate()},async isDirty(){const t=this.$refs.form;return await t.isDirty()}}},es=(i(283),f(ts,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-panel",{staticClass:"profile-dialog",attrs:{"syno-id":"webstation-profile-panel",loading:t.isLoading,"loading-type":t.loadingType,"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,errorText:t._T("common","forminvalid"),confirmText:this.confirmText,confirm:t.save,cancel:t.cancel},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e}},scopedSlots:t._u([{key:"body",fn:function(){return[i("v-form",{ref:"form",attrs:{"syno-id":"webstation-profile-form"}},[i("ProfileForm",{ref:"profileForm",attrs:{profile:t.currentProfile}}),t._v(" "),i("CustomSettings",{ref:"customSettings",attrs:{profile:t.currentProfile},on:{"profile:add-page":t.addPage,"profile:delete-page":t.deletePage}})],1)]},proxy:!0}])})}),[],!1,null,null,null).exports);async function is(t={}){const e=function(t={}){return Xn(t)}(t);return await synowebapi.promises.request({api:"SYNO.WebStation.ErrorPage",method:"create",version:1,formData:e})}async function ns(t={},e={}){const i=function(t={},e={}){return Xn({id:t.id,desc:t.desc,defaultPage:i(t.defaultPage,e.defaultPage)?t.defaultPage:void 0,otherPages:function(t=[],e=[]){return t.filter(t=>{const n=e.find(e=>e.id===t.id);return!n||i(t,n)})}(t.otherPages,e.otherPages),remove_pages:function(t=[],e=[]){const i=e.map(t=>t.id),n=t.map(t=>t.id);return i.filter(t=>!n.find(e=>e===t))}(t.otherPages,e.otherPages)},{needsId:!0,needsRemovePageIds:!0});function i(t={},e={}){return t.code!==e.code||(t.type===p.REDIRECT_302&&t.absolute_url!==e.absolute_url||(t.type===p.RELATIVE_URL&&t.relative_url!==e.relative_url||t.type===p.STATIC&&t.file!==e.file))}}(t,e);return await synowebapi.promises.request({api:"SYNO.WebStation.ErrorPage",method:"update",version:1,formData:i})}async function ss(t={}){return await async function(t=""){return await synowebapi.promises.download({api:"SYNO.WebStation.ErrorPage",method:"export",version:1,params:{id:t}})}(t.id)}var as=f({components:{Profile:es},mixins:[l],data:()=>({profile:Zn()}),methods:{async createProfile(t={},e){try{await is(t),this.close()}catch(i){SYNO.Debug.error("CreateProfileDialog:createProfile",i,t),e()}},async cancel(){return await this.$refs.profile.cancel()},close(){this.$refs.window.doClose()}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"webstation-create-profile-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","create_profile"),width:"795",height:"auto",beforeClose:t.cancel}},[i("Profile",{ref:"profile",attrs:{profile:t.profile,"cancel-text":t._TT("SYNO.SDS.WebStation.Application","common","confirm_create_page"),confirmText:t._T("common","create")},on:{save:t.createProfile,cancel:function(e){return t.close()}}})],1)}),[],!1,null,null,null).exports,rs={components:{FileInput:Cn},mixins:[l],data:()=>({showStatusBar:!1,file:"",isLoading:!1,loadingType:"spin",statusBarState:"loading",RULES:s,validateStatus:""}),methods:{async save(){if(!await this.validate())return this.onError();this.onLoading();try{await async function(t){return await synowebapi.promises.request({api:"SYNO.WebStation.ErrorPage",method:"import",version:1,formData:{file:t}})}(this.file),this.close()}catch(t){return this.onError()}},onLoading(){this.isLoading=!0,this.loadingType="spin",this.statusBarState="loading",this.validateStatus=""},onError(){return this.showStatusBar=!0,this.isLoading=!1,this.loadingType="statusbar",this.statusBarState="error",this.validateStatus="error",!1},async validate(){const t=this.$refs.form;return await t.validate()},async cancel(){if(!await this.isDirty())return this.close();const t=await this.$refs.window.getMsgBox().confirmLostChange("",_TT("SYNO.SDS.WebStation.Application","common","confirm_create_page"));return"save"===t?this.save():"cancel"!==t&&("dont_save"===t?this.close():void 0)},close(){this.$refs.window.doClose()},async isDirty(){const t=this.$refs.form;return await t.isDirty()}}},os=(i(284),f(rs,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-modal-window",{ref:"window",attrs:{"syno-id":"webstation-import-profile-modal-window",title:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","select_file_to_import"),width:"550",height:"auto",beforeClose:t.cancel}},[i("v-panel",{attrs:{"syno-id":"webstation-import-profile-panel",loading:t.isLoading,"loading-type":t.loadingType,"status-bar-state":t.statusBarState,"show-status-bar":t.showStatusBar,errorText:t._T("common","forminvalid"),confirmText:t._T("helptoc","user_import"),confirm:t.save,cancel:t.cancel},on:{"update:showStatusBar":function(e){t.showStatusBar=e},"update:show-status-bar":function(e){t.showStatusBar=e}},scopedSlots:t._u([{key:"body",fn:function(){return[i("div",{staticClass:"profile-dialog__content"},[i("v-form",{ref:"form",attrs:{"syno-id":"webstation-import-profile-form"}},[i("v-form-item",{attrs:{textonly:"","hide-label":""}},[t._v("\n "+t._s(t._TT("SYNO.SDS.WebStation.Application","custom_error_page","select_file_to_import_description"))+"\n ")]),t._v(" "),i("v-form-item",{attrs:{"syno-id":"webstation-import-profile-form-item",label:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","import_file")+t._T("common","colon"),prop:"webstation-import-file",rules:t.RULES.importErrorProfileFileRules,validateStatus:t.validateStatus}},[i("FileInput",{directives:[{name:"form-component",rawName:"v-form-component"}],staticClass:"profile-dialog__file-input",attrs:{name:"webstation-import-file",accept:".dat",placeholder:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","select_file")},model:{value:t.file,callback:function(e){t.file=e},expression:"file"}})],1)],1)],1)]},proxy:!0}])})],1)}),[],!1,null,"187d1294",null).exports),ls=f({components:{Profile:es},mixins:[l],props:{profile:{type:Object,required:!0}},methods:{async updateProfile(t={},e){try{await ns(t,this.profile),this.close()}catch(i){SYNO.Debug.error("EditProfileDialog:updateProfile",i,t),e()}},async cancel(){return await this.$refs.profile.cancel()},close(){this.$refs.window.doClose()}}},(function(){var t=this.$createElement,e=this._self._c||t;return e("v-modal-window",{ref:"window",staticClass:"webstation-vue-modal",attrs:{"syno-id":"webstation-edit-profile-modal-window",title:this._TT("SYNO.SDS.WebStation.Application","custom_error_page","edit_profile"),width:"795",height:"auto",beforeClose:this.cancel}},[e("Profile",{ref:"profile",attrs:{profile:this.profile,"cancel-text":this._TT("SYNO.SDS.WebStation.Application","common","confirm_edit_page"),confirmText:this._T("common","save")},on:{save:this.updateProfile,cancel:this.close}})],1)}),[],!1,null,null,null).exports;let ps=Vue.extend({store:R}).extend(as),cs=Vue.extend({store:R}).extend(os),ds=Vue.extend({store:R}).extend(ls);var us=f({mixins:[l,_],data:()=>({selectedProfiles:{},columns:[{title:_TT("SYNO.SDS.WebStation.Application","custom_error_page","profile_name_title_case"),field:"desc"}],groupInfo:{category:"preserve",sortCategoryFn:(t,e)=>t.key.localeCompare(e.key)}}),computed:{singleSelectedProfile(){var t,e,i,n;return 1===(null===(t=this.selectedProfiles)||void 0===t||null===(e=t.rows)||void 0===e?void 0:e.length)&&{index:null===(i=this.selectedProfiles)||void 0===i?void 0:i.indexes[0],row:null===(n=this.selectedProfiles)||void 0===n?void 0:n.rows[0]}||null},singleSelectedData(){var t;return(null===(t=this.singleSelectedProfile)||void 0===t?void 0:t.row)||null},isEditable(){return!!this.singleSelectedData},isDeletable(){var t,e,i;return(null===(t=this.selectedProfiles)||void 0===t||null===(e=t.rows)||void 0===e?void 0:e.length)>0&&(null===(i=this.selectedProfiles)||void 0===i?void 0:i.rows.every(t=>"default"!==t.id))},isExportable(){return!!this.singleSelectedData}},methods:{async loadData(){const t=await async function(){return(await synowebapi.promises.request({api:"SYNO.WebStation.ErrorPage",method:"list",version:1})).profiles.map(t=>Zn(t))}();return t.forEach(t=>{"default"===t.id?(t.preserve=_TT("SYNO.SDS.WebStation.Application","custom_error_page","default_settings"),t.desc=_TT("SYNO.SDS.WebStation.Application","custom_error_page","default_profile")):t.preserve=_TT("SYNO.SDS.WebStation.Application","custom_error_page","custom_settings")}),{items:Object.values(t)}},openCreateProfileModal(){this.$options.appWin.openModalWindow(ps).window.$on("close",()=>this.$refs.dataTable.refresh())},openImportProfileDialog(){this.$options.appWin.openModalWindow(cs).window.$on("close",()=>this.$refs.dataTable.refresh())},openEditProfileModalByDbClick(t,e){this.singleSelectedProfile&&t===this.singleSelectedProfile.index&&this.openEditProfileModal()},openEditProfileModal(){if(!this.isEditable)return;this.$options.appWin.openModalWindow(ds,{profile:this.singleSelectedData}).window.$on("close",()=>this.$refs.dataTable.refresh())},async deleteProfiles(){var t;if(!this.isDeletable)return;if("confirm"!==await this.$options.appWin.getMsgBox().confirmDelete("",_T("common","remove_cfrmrmv")))return;const e=null===(t=this.selectedProfiles)||void 0===t?void 0:t.rows;await async function(t=[]){const e=t.map(t=>t.id);return await synowebapi.promises.request({api:"SYNO.WebStation.ErrorPage",method:"remove",version:1,params:{ids:e}})}(e),this.$refs.dataTable.refresh()},async exportProfile(){this.isExportable&&await ss(this.singleSelectedData)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-panel",{attrs:{"syno-id":"webstation-error-page-panel",tbar:"",fbar:!1},scopedSlots:t._u([{key:"tbar",fn:function(){return[i("v-button",{attrs:{"syno-id":"webstation-error-page-add-button",type:"dropdown"},scopedSlots:t._u([{key:"dropdown",fn:function(){return[i("v-menu",{attrs:{"syno-id":"webstation-error-page-add-menu"}},[i("v-menu-item",{attrs:{"syno-id":"webstation-error-page-add-menu-item-profile",title:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","create_profile_title_case")},on:{click:t.openCreateProfileModal}}),t._v(" "),i("v-menu-item",{attrs:{"syno-id":"webstation-error-page-add-menu-item-import",title:t._T("helptoc","user_import")},on:{click:t.openImportProfileDialog}})],1)]},proxy:!0}])},[t._v("\n "+t._s(t._T("common","create"))+"\n ")]),t._v(" "),i("v-button",{attrs:{"syno-id":"webstation-error-page-edit-button",disabled:!t.isEditable},on:{click:t.openEditProfileModal}},[t._v("\n "+t._s(t._T("common","alt_edit"))+"\n ")]),t._v(" "),i("v-button",{attrs:{"syno-id":"webstation-error-page-delete-button",disabled:!t.isDeletable},on:{click:function(e){return t.deleteProfiles()}}},[t._v("\n "+t._s(t._T("common","delete"))+"\n ")]),t._v(" "),i("v-button",{attrs:{"syno-id":"webstation-error-page-export-button",disabled:!t.isExportable},on:{click:function(e){return t.exportProfile()}}},[t._v("\n "+t._s(t._T("delegation","export"))+"\n ")])]},proxy:!0},{key:"body",fn:function(){return[i("v-data-table",{ref:"dataTable",staticClass:"webstation-panel__data-table",attrs:{groupTable:"",multipleSelected:"","syno-id":"webstation-error-page-data-table","enable-hd-menu":!1,groupInfo:t.groupInfo,columns:t.columns,data:t.loadData},on:{"selected-change":function(e){t.selectedProfiles=e},rowdblclick:t.openEditProfileModalByDbClick,dataloaded:function(e){t.selectedProfiles=[]}}})]},proxy:!0}])})}),[],!1,null,null,null).exports,fs={props:{hasIntro:{type:Boolean,default:!0},title:{type:String,default:""},descText:{type:String,default:""},confirmText:{type:String,default:""},finish:{type:Boolean,default:!1},rect:{type:Object,default:{top:0,left:0,width:0,height:0}},iconCls:{type:String,default:""}}},hs=(i(285),{mixins:[l,_],components:{"overview-page":h,"portal-page":Qi,"service-package-page":yn,"script-language-page":Yn,"custom-error-page":us,tutorial:f(fs,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"tutorial-mask"},[t.hasIntro?i("div",{staticClass:"intro",style:{top:t.rect.top+"px",left:t.rect.left+"px",width:t.rect.width+"px",height:t.rect.height+"px"}},[i("div",{staticClass:"cancel-icon",on:{click:function(e){return t.$emit("confirm",!0)}}}),t._v(" "),i("div",{staticClass:"body"},[i("div",{staticClass:"title"},[i("div",{staticClass:"text"},[t._v(" "+t._s(t.title))]),t._v(" "),i("div",{staticClass:"new"})]),t._v(" "),i("div",{staticClass:"desc"},[t._v(" "+t._s(t.descText)+" ")])]),t._v(" "),i("div",{staticClass:"fbar"},[i("v-button",{attrs:{"syno-id":"ws-tutorial-intro-btn",type:"footbar",suffix:"blue"},on:{click:function(e){return t.$emit("confirm",t.finish)}}},[t._v(" "+t._s(t.confirmText)+" ")])],1)]):t._e(),t._v(" "),t.hasIntro?t._e():i("div",{staticClass:"target-reveal-wrapper",style:{top:t.rect.top+"px",left:t.rect.left+"px",width:t.rect.width+"px",height:t.rect.height+"px"}},[i("div",{staticClass:"target-reveal"},[i("i",{class:"icon "+t.iconCls}),t._v(" "),i("div",{staticClass:"text"},[t._v(t._s(t.title))])])]),t._v(" "),t.hasIntro?t._e():i("div",{ref:"tooltip",staticClass:"tip-tooltip",style:{top:t.rect.top+t.rect.height+15+"px",left:t.rect.left+t.rect.width/2+"px"}},[i("div",{staticClass:"tip-tooltip-body"},[t._v("\n\t\t\t"+t._s(t.descText)+"\n\t\t")]),t._v(" "),i("div",{staticClass:"tip-tooltip-fbar"},[i("div",{staticClass:"pull-right"},[i("v-button",{staticClass:"tip-tooltip-btn",attrs:{"syno-id":"ws-tutorial-tip-btn",type:"footbar",suffix:"blue"},on:{click:function(e){return t.$emit("confirm",t.finish)}}},[t._v(" "+t._s(t.confirmText)+" ")])],1)])])])}),[],!1,null,"50a655d2",null).exports},beforeMount(){SYNO.SDS.WebStation.Util.CreatePackageInfo(),SYNO.SDS.StatusNotifier.on("thirdpartychanged",this.onPkgChanged,this)},beforeDestory(){SYNO.SDS.WebStation.Util.DestructPackageInfo(),SYNO.SDS.StatusNotifier.un("thirdpartychanged",this.onPkgChanged,this)},async mounted(){if(!SYNO.SDS.UserSettings.getProperty("SYNO.SDS.WebStation.Application","showTutorial")){await this.$nextTick();let t=this.$refs.window.$el.getBoundingClientRect();t.width<=1048&&(this.$refs.window.showModules=!0),this.rect={top:(t.height-244)/2,left:(t.width-496)/2,height:244,width:496},this.showTutorial=!0}},data:()=>({module:"overview",rect:{},title:_TT("SYNO.SDS.WebStation.Application","welcomepage","tutorial_title"),descText:_TT("SYNO.SDS.WebStation.Application","welcomepage","description"),confirmText:_TT("SYNO.SDS.WebStation.Application","welcomepage","start"),finish:!1,showTutorial:!1,hasIntro:!0,iconCls:""}),methods:{onPkgChanged(t){[void 0,"WebStation"].includes(t)||SYNO.SDS.WebStation.Util.PackageInfo.Update()},async handleParams(t,e){var i;e.wizard&&"create_service_portal"===e.wizard&&(this.$store.commit("portal/UPDATE_CATEGORY",e.category),this.$store.commit("portal/UPDATE_SERVICE_BY_APPLAUNCH_LIST",e.services),this.$refs.portal.activated?null===(i=this.$refs.portalPage)||void 0===i||i.openServiceWizard():(this.openFromDocker=!0,this.module="portal-page"));e.fn&&"web_service"===e.fn&&(this.module="service-package-page")},async onPortalActivated(t,e){this.openFromDocker&&(await this.$nextTick(),this.$refs.portalPage.openServiceWizard(),this.openFromDocker=!1)},onConfirm(t){let e=this.$refs.window.$el.getBoundingClientRect();if(t)return e.width<=1048&&(this.$refs.window.showModules="auto"),this.showTutorial=!1,void SYNO.SDS.UserSettings.setProperty("SYNO.SDS.WebStation.Application","showTutorial",!0);let i=this.hasIntro?"service":"portal",{top:n,left:s,width:a,height:r}=this.$refs[i].$el.getBoundingClientRect();this.rect={top:n-e.top,left:s-e.left,width:a,height:r},this.title=_TT("SYNO.SDS.WebStation.Application","title",i),this.descText=_TT("SYNO.SDS.WebStation.Application","welcomepage","tutorial_"+i),this.iconCls="synowebstation-tutorial synowebstation-tutorial__"+i,this.hasIntro?(this.confirmText=_TT("SYNO.SDS.WebStation.Application","welcomepage","next"),this.module="service-package-page",this.hasIntro=!1):(this.finish=!0,this.module="portal-page",this.confirmText=_TT("SYNO.SDS.WebStation.Application","welcomepage","finish"))}}}),_s=(i(286),f(hs,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-app-instance",{attrs:{"class-name":"SYNO.SDS.WebStation.Application"},on:{openparamchanged:t.handleParams}},[i("v-page-list-app-window",{ref:"window",attrs:{"syno-id":"webstation-window","window-name":"SYNO.SDS.WebStation.Application.AppWindow",width:"1200",minWidth:"1200",height:"580",minHeight:"580",resizable:"",module:t.module},scopedSlots:t._u([{key:"wrapper-mask",fn:function(){return[t.showTutorial?i("tutorial",{attrs:{hasIntro:t.hasIntro,finish:t.finish,rect:t.rect,title:t.title,descText:t.descText,confirmText:t.confirmText,"icon-cls":t.iconCls},on:{confirm:t.onConfirm}}):t._e()]},proxy:!0},{key:"module-options",fn:function(){return[i("v-module-list-option",{attrs:{value:"overview",display:t._TT("SYNO.SDS.WebStation.Application","title","overview"),icon:{name:"syno-webstation-overview",type:"bkg-img"}}}),t._v(" "),i("v-module-list-option",{ref:"portal",attrs:{value:"portal-page",display:t._TT("SYNO.SDS.WebStation.Application","title","portal"),icon:{name:"syno-webstation-portal",type:"bkg-img"}}}),t._v(" "),i("v-module-list-option",{ref:"service",attrs:{value:"service-package-page",display:t._TT("SYNO.SDS.WebStation.Application","title","service"),icon:{name:"syno-webstation-service",type:"bkg-img"}}}),t._v(" "),i("v-module-list-option",{attrs:{value:"script-language-page",display:t._TT("SYNO.SDS.WebStation.Application","title","script_lang_setting"),icon:{name:"syno-webstation-php",type:"bkg-img"}}}),t._v(" "),i("v-module-list-option",{attrs:{value:"custom-error-page",display:t._TT("SYNO.SDS.WebStation.Application","custom_error_page","custom_error_page"),icon:{name:"syno-webstation-custom-error-page",type:"bkg-img"}}})]},proxy:!0}])},[t._v(" "),t._v(" "),i("v-page-list-module",{attrs:{value:"overview"}},[i("overview-page")],1),t._v(" "),i("v-page-list-module",{attrs:{value:"portal-page"},on:{activated:t.onPortalActivated}},[i("portal-page",{ref:"portalPage"})],1),t._v(" "),i("v-page-list-module",{attrs:{value:"service-package-page"}},[i("service-package-page")],1),t._v(" "),i("v-page-list-module",{attrs:{value:"script-language-page"}},[i("script-language-page")],1),t._v(" "),i("v-page-list-module",{attrs:{value:"custom-error-page"}},[i("custom-error-page")],1)],1)],1)}),[],!1,null,null,null).exports);i(287),i(288);Ext.ns("SYNO.SDS.WebStation"),SYNO.SDS.WebStation.Application=r.a.extend({store:R}).extend(_s)}]);