관리-도구
편집 파일: StoreSettings.1a5c97a32ce998b7.js
/*! For license information please see StoreSettings.1a5c97a32ce998b7.js.LICENSE.txt */ "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5473],{52149:(t,e,r)=>{r.d(e,{A:()=>n});var a=r(76314),o=r.n(a)()((function(t){return t[1]}));o.push([t.id,".settings-card .card-header[data-v-cca12116]{background:#f8fafc;border-bottom:1px solid #e5e7eb}.settings-card .card-body[data-v-cca12116]{background:#fff}.section-row[data-v-cca12116]{background:#f8fafc;border:1px dashed #e2e8f0;border-radius:.5rem;padding:.5rem}.pill-type[data-v-cca12116]{background:#fff;border:1px solid #e5e7eb;border-radius:999px;font-size:.85rem;padding:.15rem .5rem}.empty-state[data-v-cca12116]{background:#fafafa;border:2px dashed #e2e8f0;border-radius:1rem;color:#6b7280;padding:1.25rem;text-align:center}.empty-state .emoji[data-v-cca12116]{font-size:1.6rem}.empty-state .title[data-v-cca12116]{font-weight:700;margin-top:.2rem}.simple-row[data-v-cca12116]{align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:.9rem;display:flex;justify-content:space-between;margin-bottom:.6rem;padding:.75rem .8rem}.simple-row .left[data-v-cca12116]{min-width:0}.muted-row[data-v-cca12116]{font-size:.85rem}.a-muted[data-v-cca12116],.muted-row[data-v-cca12116]{color:#6b7280}.a-muted[data-v-cca12116]:hover{color:#111827;text-decoration:none}.fade-enter-active[data-v-cca12116],.fade-leave-active[data-v-cca12116]{transition:all .15s ease}.fade-enter[data-v-cca12116],.fade-leave-to[data-v-cca12116]{opacity:0;transform:translateY(-4px)}.savebar[data-v-cca12116]{background:linear-gradient(180deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.95) 20%);border-radius:.75rem;border-top:1px solid #e5e7eb;bottom:0;padding:.75rem 1rem;position:sticky}",""]);const n=o},2382:(t,e,r)=>{r.r(e),r.d(e,{default:()=>g});var a=r(72505),o=r.n(a);function n(){n=function(){return e};var t,e={},r=Object.prototype,a=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function f(t,e,r,a){var n=e&&e.prototype instanceof g?e:g,i=Object.create(n.prototype),s=new P(a||[]);return o(i,"_invoke",{value:A(t,r,s)}),i}function m(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",h="suspendedYield",v="executing",_="completed",b={};function g(){}function y(){}function w(){}var x={};u(x,s,(function(){return this}));var k=Object.getPrototypeOf,C=k&&k(k(N([])));C&&C!==r&&a.call(C,s)&&(x=C);var $=w.prototype=g.prototype=Object.create(x);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,n,i,s){var c=m(t[o],t,n);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==d(u)&&a.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(u).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,s)}))}s(c.arg)}var n;o(this,"_invoke",{value:function(t,a){function o(){return new e((function(e,o){r(t,a,e,o)}))}return n=n?n.then(o,o):o()}})}function A(e,r,a){var o=p;return function(n,i){if(o===v)throw Error("Generator is already running");if(o===_){if("throw"===n)throw i;return{value:t,done:!0}}for(a.method=n,a.arg=i;;){var s=a.delegate;if(s){var c=S(s,a);if(c){if(c===b)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(o===p)throw o=_,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);o=v;var l=m(e,r,a);if("normal"===l.type){if(o=a.done?_:h,l.arg===b)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(o=_,a.method="throw",a.arg=l.arg)}}}function S(e,r){var a=r.method,o=e.iterator[a];if(o===t)return r.delegate=null,"throw"===a&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==a&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+a+"' method")),b;var n=m(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,b;var i=n.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,n=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return n.next=n}}throw new TypeError(d(e)+" is not iterable")}return y.prototype=w,o($,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:y,configurable:!0}),y.displayName=u(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,l,"GeneratorFunction")),t.prototype=Object.create($),t},e.awrap=function(t){return{__await:t}},j(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,a,o,n){void 0===n&&(n=Promise);var i=new O(f(t,r,a,o),n);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j($),u($,l,"Generator"),u($,s,(function(){return this})),u($,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var a in e)r.push(a);return r.reverse(),function t(){for(;r.length;){var a=r.pop();if(a in e)return t.value=a,t.done=!1,t}return t.done=!0,t}},e.values=N,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(a,o){return s.type="throw",s.arg=e,r.next=a,o&&(r.method="next",r.arg=t),!!o}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc&&(n=null);var i=n?n.completion:{};return i.type=t,i.arg=e,n?(this.method="next",this.next=n.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var a=r.completion;if("throw"===a.type){var o=a.arg;E(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,a){return this.delegate={iterator:N(e),resultName:r,nextLoc:a},"next"===this.method&&(this.arg=t),b}},e}function i(t,e,r,a,o,n,i){try{var s=t[n](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(a,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(a,o){var n=t.apply(e,r);function s(t){i(n,a,o,s,c,"next",t)}function c(t){i(n,a,o,s,c,"throw",t)}s(void 0)}))}}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,e||"default");if("object"!=d(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==d(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var a,o,n,i,s=[],c=!0,l=!1;try{if(n=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(a=n.call(r)).done)&&(s.push(a.value),s.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}const p={metaInfo:{title:"Store Settings"},data:function(){return{isLoading:!0,saving:!1,settings:{},collections:[],homeRows:[],warehouses:[],currencies:[],form:{enabled:!0,store_name:"",primary_color:"#6c5ce7",secondary_color:"#00c2ff",font_family:"Arial, sans-serif",language:"en",default_warehouse_id:"",default_currency_id:"",contact_email:"",contact_phone:"",contact_address:"",hero_title:"",hero_subtitle:"",seo_meta_title:"",seo_meta_description:"",topbar_text_left:"",topbar_text_right:"",footer_text:"",homepage_lineup:[],menus:{header:[],footer_shop:[],footer_support:[]},social_links:[],custom_css:"",custom_js:"",store_slug:"online_store"},files:{},langs:[{value:"en",text:"English"},{value:"fr",text:"Français"},{value:"ar",text:"العربية"}]}},computed:{warehouseOptions:function(){return(Array.isArray(this.warehouses)?this.warehouses:[]).map((function(t){return{label:t.name,value:Number(t.id)}}))},warehouseOptionsBV:function(){return(Array.isArray(this.warehouses)?this.warehouses:[]).map((function(t){return{text:t.name,value:Number(t.id)}}))}},mounted:function(){this.fetch()},methods:{makeToast:function(t,e,r){var a;null===(a=this.$root.$bvToast)||void 0===a||a.toast(e,{title:r,variant:t,solid:!0})},asset:function(t){return t?t.startsWith("images/")?"/".concat(t):t.startsWith("/")?t:"/storage/".concat(t):""},pick:function(t,e){this.files[t]=e.target.files[0]},badgeVariant:function(t){return"collection"===t?"info":"hero"===t?"primary":"newsletter"===t?"success":"light"},labelFor:function(t){return"collection"===t?this.$t("Collection"):"hero"===t?this.$t("Hero"):"newsletter"===t?this.$t("Newsletter"):t},move:function(t,e){var r=t+e;if(!(r<0||r>=this.homeRows.length)){var a=this.homeRows,o=f(a.splice(t,1),1)[0];a.splice(r,0,o)}},collectionUrl:function(t){return"/".concat(this.form.store_slug?this.form.store_slug+"/":"","collections/").concat(t)},tryParseJson:function(t){if(!t||"string"!=typeof t)return null;try{return JSON.parse(t)}catch(t){return null}},normalizeBool:function(t){return"boolean"==typeof t?t:1===t||"1"===t||"true"===t||"on"===t},normalizeMenus:function(t){var e="string"==typeof t?this.tryParseJson(t):t;return!e||"object"!==d(e)||Array.isArray(e)?{header:[],footer_shop:[],footer_support:[]}:{header:Array.isArray(e.header)?e.header:[],footer_shop:Array.isArray(e.footer_shop)?e.footer_shop:[],footer_support:Array.isArray(e.footer_support)?e.footer_support:[]}},normalizeSocialLinks:function(t){var e="string"==typeof t?this.tryParseJson(t):t;return e?Array.isArray(e)?e.map((function(t){return{platform:t.platform||"",url:t.url||""}})):"object"===d(e)?Object.entries(e).map((function(t){var e=f(t,2);return{platform:e[0],url:e[1]}})):[]:[]},normalizeCollectionsArray:function(t){var e=this;return(t||[]).map((function(t){var r,a,o,n,i;return{id:null!==(r=t.id)&&void 0!==r?r:null,key:"collection:".concat(String(t.slug||t.handle||"").trim()),kind:"collection",slug:String(t.slug||t.handle||"").trim(),title:t.title||t.slug||e.$t("Untitled"),products_count:null!==(a=t.products_count)&&void 0!==a?a:null,limit:Number(null!==(o=t.limit)&&void 0!==o?o:8),is_active:e.normalizeBool(null!==(n=t.is_active)&&void 0!==n&&n),sort_order:Number(null!==(i=t.sort_order)&&void 0!==i?i:9999)}})).filter((function(t){return!!t.slug}))},buildHomeRows:function(){var t=this,e=[],r=Array.isArray(this.form.homepage_lineup)?this.form.homepage_lineup:[],a=!(!this.form.hero_title&&!this.settings.hero_image_path),o={key:"hero",kind:"hero",title:this.form.hero_title||this.$t("Hero"),active:!1,warning:!a},n={key:"newsletter",kind:"newsletter",title:this.$t("Newsletter"),active:!1,warning:!1},i=new Map(this.collections.map((function(t){return[t.slug,t]}))),s=new Set;r.length?(r.forEach((function(t){if(t&&t.type)if("hero"===t.type)e.push(l(l({},o),{},{active:!0})),s.add("hero");else if("newsletter"===t.type)e.push(l(l({},n),{},{active:!0})),s.add("newsletter");else if("collection"===t.type&&t.slug){var r=i.get(String(t.slug));r&&(e.push(l(l({},r),{},{key:"collection:".concat(r.slug),kind:"collection",active:!0})),s.add("collection:".concat(r.slug)))}})),s.has("hero")||e.push(o),s.has("newsletter")||e.push(n),this.collections.filter((function(t){return!s.has("collection:".concat(t.slug))})).sort((function(t,e){return t.sort_order-e.sort_order||t.title.localeCompare(e.title)})).forEach((function(r){return e.push(l(l({},r),{},{key:"collection:".concat(r.slug),kind:"collection",active:t.normalizeBool(r.is_active)}))}))):(e.push(l(l({},o),{},{active:!1})),this.collections.slice().sort((function(t,e){return t.sort_order-e.sort_order||t.title.localeCompare(e.title)})).forEach((function(r){return e.push(l(l({},r),{},{key:"collection:".concat(r.slug),kind:"collection",active:t.normalizeBool(r.is_active)}))})),e.push(l(l({},n),{},{active:!1}))),this.homeRows=e},fetch:function(){var t=this;return s(n().mark((function e(){var r,a,i,s,c,l,u,d,f,m;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.isLoading=!0,e.next=4,o().get("/admin/store/settings");case 4:if(r=e.sent,a=r&&r.data?r.data:{},i=a&&a.settings?a.settings:a,s=Array.isArray(a&&a.warehouses)?a.warehouses:[],c=Array.isArray(a&&a.currencies)?a.currencies:[],t.settings=i||{},t.warehouses=s,t.currencies=c,(l=Object.assign({},t.form,i)).enabled=t.normalizeBool(i&&i.enabled),l.menus=t.normalizeMenus(i&&i.menus),l.social_links=t.normalizeSocialLinks(i&&i.social_links),l.store_slug=i&&i.store_slug?i.store_slug:t.form.store_slug,u=i&&i.homepage_lineup,l.homepage_lineup=Array.isArray(u)?u:t.tryParseJson(u)||[],null!=l.default_warehouse_id?l.default_warehouse_id=Number(l.default_warehouse_id):t.warehouses.length?l.default_warehouse_id=Number(t.warehouses[0].id):l.default_warehouse_id=null,null!=l.default_currency_id?l.default_currency_id=Number(l.default_currency_id):t.currencies.length?l.default_currency_id=Number(t.currencies[0].id):l.default_currency_id=null,t.form=l,d=[],f=i&&i.collections,!Array.isArray(f)||!f.length){e.next=28;break}d=f,e.next=38;break;case 28:return e.prev=28,e.next=31,o().get("/admin/store/collections?include_counts=1");case 31:m=e.sent,d=Array.isArray(m&&m.data)?m.data:[],e.next=38;break;case 35:e.prev=35,e.t0=e.catch(28),d=[];case 38:t.collections=t.normalizeCollectionsArray(d),t.buildHomeRows(),e.next=45;break;case 42:e.prev=42,e.t1=e.catch(0),t.makeToast("danger",t.$t("InvalidData"),t.$t("Failed"));case 45:return e.prev=45,t.isLoading=!1,e.finish(45);case 48:case"end":return e.stop()}}),e,null,[[0,42,45,48],[28,35]])})))()},save:function(){var t=this;return s(n().mark((function e(){var r,a,i,s,c,l,u,d,f;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.saving=!0,e.prev=1,r=[],a=0;case 4:if(!(a<t.homeRows.length)){e.next=12;break}if((i=t.homeRows[a])&&i.active){e.next=8;break}return e.abrupt("continue",9);case 8:"hero"===i.kind?r.push({type:"hero"}):"newsletter"===i.kind?r.push({type:"newsletter"}):r.push({type:"collection",slug:i.slug,limit:i.limit?Number(i.limit):8,layout:"grid",title_override:""});case 9:a++,e.next=4;break;case 12:t.form.homepage_lineup=r,null!=t.form.default_warehouse_id&&""!==t.form.default_warehouse_id?t.form.default_warehouse_id=Number(t.form.default_warehouse_id):t.form.default_warehouse_id=null,null!=t.form.default_currency_id&&""!==t.form.default_currency_id?t.form.default_currency_id=Number(t.form.default_currency_id):t.form.default_currency_id=null,s=new FormData,c=["menus","social_links","homepage_lineup"],e.t0=n().keys(t.form);case 18:if((e.t1=e.t0()).done){e.next=35;break}if(l=e.t1.value,Object.prototype.hasOwnProperty.call(t.form,l)){e.next=22;break}return e.abrupt("continue",18);case 22:if("boolean"!=typeof(u=t.form[l])){e.next=26;break}return s.append(l,u?1:0),e.abrupt("continue",18);case 26:if(-1===c.indexOf(l)){e.next=29;break}try{s.append(l,JSON.stringify(u||[]))}catch(t){s.append(l,"[]")}return e.abrupt("continue",18);case 29:if(null!=u){e.next=32;break}return s.append(l,""),e.abrupt("continue",18);case 32:s.append(l,u),e.next=18;break;case 35:e.t2=n().keys(t.files);case 36:if((e.t3=e.t2()).done){e.next=44;break}if(d=e.t3.value,Object.prototype.hasOwnProperty.call(t.files,d)){e.next=40;break}return e.abrupt("continue",36);case 40:(f=t.files[d])&&s.append(d,f),e.next=36;break;case 44:return e.next=46,o().post("/admin/store/settings",s,{headers:{"Content-Type":"multipart/form-data"}});case 46:return t.makeToast("success",t.$t("Successfully_Created"),t.$t("Success")),e.next=49,t.fetch();case 49:t.files={},e.next=55;break;case 52:e.prev=52,e.t4=e.catch(1),t.makeToast("danger",t.$t("InvalidData"),t.$t("Failed"));case 55:return e.prev=55,t.saving=!1,e.finish(55);case 58:case"end":return e.stop()}}),e,null,[[1,52,55,58]])})))()}}};var h=r(85072),v=r.n(h),_=r(52149),b={insert:"head",singleton:!1};v()(_.A,b);_.A.locals;const g=(0,r(14486).A)(p,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-content"},[e("breadcumb",{attrs:{page:t.$t("Settings"),folder:t.$t("Store")}}),t._v(" "),t.isLoading?e("div",{staticClass:"loading_page spinner spinner-primary mr-3"}):e("div",{staticClass:"wrapper"},[e("b-form",{on:{submit:function(e){return e.preventDefault(),t.save.apply(null,arguments)}}},[e("b-card",{staticClass:"settings-card shadow-sm mb-3",attrs:{"no-body":""}},[e("div",{staticClass:"card-header d-flex align-items-center justify-content-between"},[e("div",{staticClass:"h6 mb-0"},[t._v(t._s(t.$t("Store_Basics")))]),t._v(" "),e("b-badge",{attrs:{pill:"",variant:"light"}},[t._v("#1")])],1),t._v(" "),e("div",{staticClass:"card-body"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Store_Name")}},[e("b-form-input",{model:{value:t.form.store_name,callback:function(e){t.$set(t.form,"store_name",e)},expression:"form.store_name"}})],1)],1),t._v(" "),e("b-col",{attrs:{lg:"4",md:"4",sm:"12"}},[e("b-form-group",{attrs:{label:t.$t("Currency")}},[e("v-select",{attrs:{reduce:function(t){return t.value},options:t.currencies.map((function(t){return{label:t.name+" ("+t.symbol+")",value:t.id}})),placeholder:t.$t("Choose_Currency"),clearable:!1},model:{value:t.form.default_currency_id,callback:function(e){t.$set(t.form,"default_currency_id",e)},expression:"form.default_currency_id"}}),t._v(" "),e("small",{staticClass:"text-warning d-block mt-1"},[t._v("\n ⚠️ Changing currency will affect both system and online store\n ")])],1)],1),t._v(" "),e("b-col",{attrs:{lg:"4",md:"4",sm:"12"}},[e("b-form-group",{attrs:{label:t.$t("DefaultWarehouse")}},[e("v-select",{attrs:{options:t.warehouseOptions,reduce:function(t){return t.value},placeholder:t.$t("Choose_Warehouse"),clearable:!1},model:{value:t.form.default_warehouse_id,callback:function(e){t.$set(t.form,"default_warehouse_id",e)},expression:"form.default_warehouse_id"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Primary_Color")}},[e("b-form-input",{attrs:{type:"color"},model:{value:t.form.primary_color,callback:function(e){t.$set(t.form,"primary_color",e)},expression:"form.primary_color"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Secondary_Color")}},[e("b-form-input",{attrs:{type:"color"},model:{value:t.form.secondary_color,callback:function(e){t.$set(t.form,"secondary_color",e)},expression:"form.secondary_color"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Font_Family")}},[e("b-form-input",{model:{value:t.form.font_family,callback:function(e){t.$set(t.form,"font_family",e)},expression:"form.font_family"}})],1)],1)],1)])]),t._v(" "),e("b-card",{staticClass:"settings-card shadow-sm mb-3",attrs:{"no-body":""}},[e("div",{staticClass:"card-header d-flex align-items-center justify-content-between"},[e("div",{staticClass:"h6 mb-0"},[t._v(t._s(t.$t("Contact")))]),t._v(" "),e("b-badge",{attrs:{pill:"",variant:"light"}},[t._v("#2")])],1),t._v(" "),e("div",{staticClass:"card-body"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Contact_Email")}},[e("b-form-input",{model:{value:t.form.contact_email,callback:function(e){t.$set(t.form,"contact_email",e)},expression:"form.contact_email"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Contact_Phone")}},[e("b-form-input",{model:{value:t.form.contact_phone,callback:function(e){t.$set(t.form,"contact_phone",e)},expression:"form.contact_phone"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Contact_Address")}},[e("b-form-input",{model:{value:t.form.contact_address,callback:function(e){t.$set(t.form,"contact_address",e)},expression:"form.contact_address"}})],1)],1)])])]),t._v(" "),e("b-card",{staticClass:"settings-card shadow-sm mb-3",attrs:{"no-body":""}},[e("div",{staticClass:"card-header d-flex align-items-center justify-content-between"},[e("div",{staticClass:"h6 mb-0"},[t._v(t._s(t.$t("Branding")))]),t._v(" "),e("b-badge",{attrs:{pill:"",variant:"light"}},[t._v("#3")])],1),t._v(" "),e("div",{staticClass:"card-body"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Logo")}},[e("b-form-file",{attrs:{accept:"image/*"},on:{change:function(e){return t.pick("logo",e)}}}),t._v(" "),t.settings.logo_path?e("img",{staticClass:"mt-2 rounded shadow-sm",attrs:{src:t.asset(t.settings.logo_path),height:"40"}}):t._e()],1)],1),t._v(" "),e("div",{staticClass:"col-md-4"},[e("b-form-group",{attrs:{label:t.$t("Favicon")}},[e("b-form-file",{attrs:{accept:"image/*"},on:{change:function(e){return t.pick("favicon",e)}}}),t._v(" "),t.settings.favicon_path?e("img",{staticClass:"mt-2 rounded shadow-sm",attrs:{src:t.asset(t.settings.favicon_path),height:"24"}}):t._e()],1)],1)])])]),t._v(" "),e("b-card",{staticClass:"settings-card shadow-sm mb-3",attrs:{"no-body":""}},[e("div",{staticClass:"card-header d-flex align-items-center justify-content-between"},[e("div",{staticClass:"h6 mb-0"},[t._v(t._s(t.$t("Hero_Header")))]),t._v(" "),e("b-badge",{attrs:{pill:"",variant:"light"}},[t._v("#4")])],1),t._v(" "),e("div",{staticClass:"card-body"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-12"},[e("b-form-group",{attrs:{label:t.$t("Hero_Title")}},[e("b-form-input",{model:{value:t.form.hero_title,callback:function(e){t.$set(t.form,"hero_title",e)},expression:"form.hero_title"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-12"},[e("b-form-group",{attrs:{label:t.$t("Hero_Subtitle")}},[e("b-form-textarea",{attrs:{rows:"2"},model:{value:t.form.hero_subtitle,callback:function(e){t.$set(t.form,"hero_subtitle",e)},expression:"form.hero_subtitle"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-6"},[e("b-form-group",{attrs:{label:t.$t("Hero_Image")}},[e("b-form-file",{attrs:{accept:"image/*"},on:{change:function(e){return t.pick("hero_image",e)}}}),t._v(" "),t.settings.hero_image_path?e("img",{staticClass:"mt-2 rounded shadow-sm",attrs:{src:t.asset(t.settings.hero_image_path),height:"64"}}):t._e()],1)],1)])])]),t._v(" "),e("b-card",{staticClass:"settings-card shadow-sm mb-3",attrs:{"no-body":""}},[e("div",{staticClass:"card-header d-flex align-items-center justify-content-between"},[e("div",{staticClass:"h6 mb-0"},[t._v("SEO")]),t._v(" "),e("b-badge",{attrs:{pill:"",variant:"light"}},[t._v("#5")])],1),t._v(" "),e("div",{staticClass:"card-body"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-12"},[e("b-form-group",{attrs:{label:t.$t("SEO_Title")}},[e("b-form-input",{model:{value:t.form.seo_meta_title,callback:function(e){t.$set(t.form,"seo_meta_title",e)},expression:"form.seo_meta_title"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-12"},[e("b-form-group",{attrs:{label:t.$t("SEO_Description")}},[e("b-form-textarea",{attrs:{rows:"2"},model:{value:t.form.seo_meta_description,callback:function(e){t.$set(t.form,"seo_meta_description",e)},expression:"form.seo_meta_description"}})],1)],1)])])]),t._v(" "),e("b-card",{staticClass:"settings-card shadow-sm mb-3",attrs:{"no-body":""}},[e("div",{staticClass:"card-header d-flex align-items-center justify-content-between"},[e("div",{staticClass:"h6 mb-0"},[t._v(t._s(t.$t("Topbar_and_Footer")))]),t._v(" "),e("b-badge",{attrs:{pill:"",variant:"light"}},[t._v("#6")])],1),t._v(" "),e("div",{staticClass:"card-body"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-6"},[e("b-form-group",{attrs:{label:t.$t("Topbar_Text_Left")}},[e("b-form-input",{model:{value:t.form.topbar_text_left,callback:function(e){t.$set(t.form,"topbar_text_left",e)},expression:"form.topbar_text_left"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-6"},[e("b-form-group",{attrs:{label:t.$t("Topbar_Text_Right")}},[e("b-form-input",{model:{value:t.form.topbar_text_right,callback:function(e){t.$set(t.form,"topbar_text_right",e)},expression:"form.topbar_text_right"}})],1)],1),t._v(" "),e("div",{staticClass:"col-md-12"},[e("b-form-group",{attrs:{label:t.$t("Footer_Text")}},[e("b-form-textarea",{attrs:{rows:"2"},model:{value:t.form.footer_text,callback:function(e){t.$set(t.form,"footer_text",e)},expression:"form.footer_text"}})],1)],1)])])]),t._v(" "),e("b-card",{staticClass:"settings-card shadow-sm mb-3",attrs:{"no-body":""}},[e("div",{staticClass:"card-header d-flex align-items-center justify-content-between"},[e("div",{staticClass:"h6 mb-0"},[t._v(t._s(t.$t("Social_Links")))]),t._v(" "),e("b-button",{attrs:{size:"sm",variant:"outline-success"},on:{click:function(e){return t.form.social_links.push({platform:"",url:""})}}},[t._v("\n + "+t._s(t.$t("Add_Link"))+"\n ")])],1),t._v(" "),e("div",{staticClass:"card-body"},[t.form.social_links.length?t._e():e("div",{staticClass:"text-muted small mb-2"},[t._v(t._s(t.$t("No_items")))]),t._v(" "),t._l(t.form.social_links,(function(r,a){return e("div",{key:"soc-"+a,staticClass:"d-flex mb-2 align-items-center section-row"},[e("span",{staticClass:"pill-type mr-2"},[t._v("🔗")]),t._v(" "),e("b-form-input",{staticClass:"mr-2",attrs:{placeholder:"Platform (e.g. facebook)"},model:{value:r.platform,callback:function(e){t.$set(r,"platform",e)},expression:"link.platform"}}),t._v(" "),e("b-form-input",{staticClass:"mr-2",attrs:{placeholder:"URL (https://…)"},model:{value:r.url,callback:function(e){t.$set(r,"url",e)},expression:"link.url"}}),t._v(" "),e("b-button",{attrs:{size:"sm",variant:"danger"},on:{click:function(e){return t.form.social_links.splice(a,1)}}},[t._v("×")])],1)}))],2)]),t._v(" "),e("b-card",{staticClass:"settings-card shadow-sm mb-3",attrs:{"no-body":""}},[e("div",{staticClass:"card-header d-flex align-items-center justify-content-between"},[e("div",{staticClass:"h6 mb-0"},[t._v(t._s(t.$t("Homepage_Blocks")))]),t._v(" "),e("small",{staticClass:"text-muted"},[t._v(t._s(t.$t("Toggle_to_show_on_home_and_use_arrows_to_reorder")))])]),t._v(" "),e("div",{staticClass:"card-body"},[t.homeRows.length?t._e():e("div",{staticClass:"empty-state my-2"},[e("div",{staticClass:"emoji"},[t._v("🧩")]),t._v(" "),e("div",{staticClass:"title"},[t._v(t._s(t.$t("No_items")))])]),t._v(" "),e("transition-group",{attrs:{name:"fade",tag:"div"}},t._l(t.homeRows,(function(r,a){return e("div",{key:r.key,staticClass:"simple-row"},[e("div",{staticClass:"left"},[e("div",{staticClass:"d-flex align-items-center",staticStyle:{gap:".4rem"}},[e("strong",{staticClass:"text-dark text-truncate",attrs:{title:r.title}},[t._v(t._s(r.title))]),t._v(" "),e("b-badge",{attrs:{pill:"",variant:t.badgeVariant(r.kind)}},[t._v(t._s(t.labelFor(r.kind)))]),t._v(" "),"collection"===r.kind&&null!=r.products_count?e("b-badge",{attrs:{variant:"light",pill:""}},[t._v("\n "+t._s(t.$t("Products"))+": "+t._s(r.products_count)+"\n ")]):t._e(),t._v(" "),"collection"!==r.kind&&r.warning?e("b-badge",{attrs:{variant:"warning",pill:""}},[t._v("⚠︎ "+t._s(t.$t("Incomplete")))]):t._e()],1)]),t._v(" "),e("div",{staticClass:"right"},[e("b-form-checkbox",{staticClass:"mr-2",attrs:{switch:""},model:{value:r.active,callback:function(e){t.$set(r,"active",e)},expression:"row.active"}},[t._v("\n "+t._s(r.active?t.$t("Active"):t.$t("Inactive"))+"\n ")]),t._v(" "),e("div",{staticClass:"btn-group"},[e("b-button",{attrs:{size:"sm",variant:"light",disabled:0===a},on:{click:function(e){return t.move(a,-1)}}},[t._v("↑")]),t._v(" "),e("b-button",{attrs:{size:"sm",variant:"light",disabled:a===t.homeRows.length-1},on:{click:function(e){return t.move(a,1)}}},[t._v("↓")])],1)],1)])})),0)],1)]),t._v(" "),e("div",{staticClass:"savebar shadow-sm"},[e("div",{staticClass:"d-flex align-items-center justify-content-between"},[e("small",{staticClass:"text-muted"},[t._v(t._s(t.$t("Unsaved_changes_may_be_lost")))]),t._v(" "),e("b-button",{attrs:{disabled:t.saving,type:"submit",variant:"btn btn-primary"}},[t.saving?e("span",{staticClass:"spinner-border spinner-border-sm mr-2"}):t._e(),t._v(" "),e("i",{staticClass:"i-Yes"}),t._v(" "+t._s(t.$t("Save"))+"\n ")])],1)])],1)],1)],1)}),[],!1,null,"cca12116",null).exports}}]);