관리-도구
편집 파일: Import_Customers.1a5c97a32ce998b7.js
/*! For license information please see Import_Customers.1a5c97a32ce998b7.js.LICENSE.txt */ "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8238],{63307:(t,e,r)=>{r.d(e,{A:()=>i});var a=r(76314),n=r.n(a)()((function(t){return t[1]}));n.push([t.id,".hero[data-v-3a9ec273]{border-radius:12px;overflow:hidden;position:relative}.hero-bg[data-v-3a9ec273]{background:linear-gradient(135deg,#e6f0ff,#f7fbff 60%,#fff);inset:0;opacity:.9;position:absolute}.hero-body[data-v-3a9ec273]{padding:1.1rem;position:relative}.hero-icon[data-v-3a9ec273]{background:#2667ff10;border-radius:12px;color:#2667ff;display:inline-grid;font-size:20px;height:44px;place-items:center;width:44px}.dropzone[data-v-3a9ec273]{background:#fbfdff;border:2px dashed #cfd8e3;border-radius:14px;cursor:pointer;padding:28px 18px;transition:all .15s ease}.dropzone[data-v-3a9ec273]:hover{background:#f7fbff;border-color:#9cb4ff;box-shadow:0 1px 6px rgba(38,103,255,.08)}.dropzone.is-dragover[data-v-3a9ec273]{background:#f1f6ff;border-color:#2667ff}.dropzone.has-file[data-v-3a9ec273]{border-color:#cfd8e3}.dz-icon[data-v-3a9ec273]{color:#2667ff;font-size:28px}.file-pill[data-v-3a9ec273]{background:#fff;border:1px solid #e6ebf2;border-radius:999px;padding:8px 12px}.file-dot[data-v-3a9ec273]{background:#2667ff;border-radius:999px;height:10px;width:10px}.file-name[data-v-3a9ec273]{font-weight:600}.badge-success-soft[data-v-3a9ec273]{background:#eaf7ef;border:1px solid #cdebd7;color:#0a7a2d;font-weight:600}.example-table th.req[data-v-3a9ec273]{background:#eaf7ef;border-color:#cdebd7}.example-table thead th[data-v-3a9ec273]{font-weight:600}.chip-grid[data-v-3a9ec273]{grid-gap:8px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}@media (min-width:992px){.chip-grid[data-v-3a9ec273]{grid-template-columns:repeat(3,minmax(0,1fr))}}.chip[data-v-3a9ec273]{border:1px solid transparent;border-radius:999px;display:inline-block;font-size:.85rem;font-weight:600;overflow:hidden;padding:6px 10px;text-overflow:ellipsis;white-space:nowrap}.chip-req[data-v-3a9ec273]{background:#eaf7ef;border-color:#cdebd7;color:#0a7a2d}.chip-opt[data-v-3a9ec273]{background:#f5f7fb;border-color:#e6e9f2;color:#475569}.mini-notes[data-v-3a9ec273]{margin:0;padding-left:18px}.mini-notes li[data-v-3a9ec273]{margin-bottom:6px}.tip-badge[data-v-3a9ec273]{background:#f1f5ff;border-radius:8px;color:#2667ff;display:inline-grid;font-size:14px;height:28px;place-items:center;width:28px}",""]);const i=n},46712:(t,e,r)=>{r.r(e),r.d(e,{default:()=>h});var a=r(5947),n=r.n(a);function i(){i=function(){return e};var t,e={},r=Object.prototype,a=r.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,r){return t[e]=r}}function f(t,e,r,a){var i=e&&e.prototype instanceof b?e:b,s=Object.create(i.prototype),o=new j(a||[]);return n(s,"_invoke",{value:A(t,r,o)}),s}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var v="suspendedStart",h="suspendedYield",m="executing",g="completed",y={};function b(){}function _(){}function x(){}var w={};d(w,o,(function(){return this}));var C=Object.getPrototypeOf,k=C&&C(C(F([])));k&&k!==r&&a.call(k,o)&&(w=k);var S=x.prototype=b.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(n,i,s,o){var l=p(t[n],t,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==c(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,o)}))}o(l.arg)}var i;n(this,"_invoke",{value:function(t,a){function n(){return new e((function(e,n){r(t,a,e,n)}))}return i=i?i.then(n,n):n()}})}function A(e,r,a){var n=v;return function(i,s){if(n===m)throw Error("Generator is already running");if(n===g){if("throw"===i)throw s;return{value:t,done:!0}}for(a.method=i,a.arg=s;;){var o=a.delegate;if(o){var l=z(o,a);if(l){if(l===y)continue;return l}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(n===v)throw n=g,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);n=m;var c=p(e,r,a);if("normal"===c.type){if(n=a.done?g:h,c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(n=g,a.method="throw",a.arg=c.arg)}}}function z(e,r){var a=r.method,n=e.iterator[a];if(n===t)return r.delegate=null,"throw"===a&&e.iterator.return&&(r.method="return",r.arg=t,z(e,r),"throw"===r.method)||"return"!==a&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+a+"' method")),y;var i=p(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(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 M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function r(){for(;++n<e.length;)if(a.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(c(e)+" is not iterable")}return _.prototype=x,n(S,"constructor",{value:x,configurable:!0}),n(x,"constructor",{value:_,configurable:!0}),_.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(L.prototype),d(L.prototype,l,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,a,n,i){void 0===i&&(i=Promise);var s=new L(f(t,r,a,n),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},E(S),d(S,u,"Generator"),d(S,o,(function(){return this})),d(S,"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=F,j.prototype={constructor:j,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(M),!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 n(a,n){return o.type="throw",o.arg=e,r.next=a,n&&(r.method="next",r.arg=t),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=a.call(s,"catchLoc"),c=a.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(s)},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),y},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),M(r),y}},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 n=a.arg;M(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,a){return this.delegate={iterator:F(e),resultName:r,nextLoc:a},"next"===this.method&&(this.arg=t),y}},e}function s(t,e,r,a,n,i,s){try{var o=t[i](s),l=o.value}catch(t){return void r(t)}o.done?e(l):Promise.resolve(l).then(a,n)}function o(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return l(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)?l(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(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}function c(t){return c="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},c(t)}const u={name:"ImportCustomersPage",data:function(){return{endpoint:"customers/import",file:null,fileName:"",fileSize:0,uploading:!1,progress:0,errorMessages:[],warningMessages:[],isDragOver:!1,maxSize:20971520,accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,.xlsx,.xls",columnsGuide:[{key:"name",label:"name",required:!0},{key:"code",label:"code (integer)",required:!0},{key:"email",label:"email",required:!1},{key:"phone",label:"phone",required:!1},{key:"tax_number",label:"tax_number",required:!1},{key:"country",label:"country",required:!1},{key:"city",label:"city",required:!1},{key:"adresse",label:"adresse",required:!1}]}},computed:{canSubmit:function(){return!!this.file&&0===this.errorMessages.length},prettySize:function(){return this.formatBytes(this.fileSize)},exampleHref:function(){return"/import/exemples/customers.xlsx"}},methods:{toast:function(t,e,r){this.$root&&this.$root.$bvToast&&this.$root.$bvToast.toast(t,{title:e,variant:r,solid:!0})},onDragOver:function(){this.isDragOver=!0},onDragLeave:function(){this.isDragOver=!1},onDrop:function(t){this.isDragOver=!1;var e=t&&t.dataTransfer&&t.dataTransfer.files&&t.dataTransfer.files[0]?t.dataTransfer.files[0]:null;e&&this.loadFile(e)},browse:function(){this.uploading||this.$refs&&this.$refs.file&&this.$refs.file.click()},onFileSelected:function(t){var e=t&&t.target&&t.target.files&&t.target.files[0]?t.target.files[0]:null;e&&this.loadFile(e)},loadFile:function(t){this.clearErrors();var e=[];t.size>this.maxSize&&e.push("File is too large. Please upload a file under the 20MB limit.");var r=(t.name||"").split(".").pop().toLowerCase();if(-1===["xlsx","xls"].indexOf(r)&&e.push("Unsupported file type. Please upload an .xlsx or .xls file."),e.length)return this.errorMessages=e,void this.clearFile(!1);this.file=t,this.fileName=t.name,this.fileSize=t.size},clearFile:function(t){void 0===t&&(t=!0),this.file=null,this.fileName="",this.fileSize=0,t&&this.$refs&&this.$refs.file&&(this.$refs.file.value="")},clearErrors:function(){this.errorMessages=[],this.warningMessages=[]},formatBytes:function(t){if(!t||t<=0)return"0 B";var e=Math.floor(Math.log(t)/Math.log(1024));return(t/Math.pow(1024,e)).toFixed(2)+" "+["B","KB","MB","GB","TB"][e]},flattenLaravelErrors:function(t){var e=[];if(!t)return e;if(Array.isArray(t)){for(var r=0;r<t.length;r++){var a=t[r];null!=a&&""!==a&&e.push(String(a))}return e}if("object"===c(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var i=t[n];if(Array.isArray(i))for(var s=0;s<i.length;s++){var o=i[s];null!=o&&""!==o&&e.push(String(o))}else null!=i&&""!==i&&e.push(String(i))}return e}return"string"==typeof t?[t]:e},collectErrorsFromResponse:function(t){var e=[];if(!t)return e;if("string"==typeof t){var r=t.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return r&&"validation failed"!==r.toLowerCase()&&e.push(r),e}if(t.errors){var a=this.flattenLaravelErrors(t.errors);if(a.length)return a}if(Array.isArray(t.messages)&&e.push.apply(e,o(t.messages)),t.details&&(Array.isArray(t.details)?e.push.apply(e,o(t.details)):"string"==typeof t.details&&e.push(t.details)),"string"==typeof t.error&&e.push(t.error),!e.length&&"string"==typeof t.message){var n=t.message.trim();"validation failed"!==n.toLowerCase()&&e.push(n)}for(var i={},s=[],l=0;l<e.length;l++){var c=String(e[l]).trim();c&&!i[c]&&(i[c]=!0,s.push(c))}return s},collectErrorsFromAxios:function(t){if(t&&t.response&&422===t.response.status){var e=t.response.data||{},r=this.flattenLaravelErrors(e.errors);if(r.length)return r;var a=this.collectErrorsFromResponse(e);return a.length?a:["Validation failed. Please check your file and try again."]}var n=t&&t.response?t.response.data:null,i=this.collectErrorsFromResponse(n);return i.length?i:t&&t.message?[String(t.message)]:["Something went wrong while uploading. Please try again."]},onlyErrorsArray:function(t){if(!t||!t.errors)return[];var e=t.errors,r=[];if(Array.isArray(e))for(var a=0;a<e.length;a++)e[a]&&r.push(String(e[a]));else"object"===c(e)?Object.keys(e).forEach((function(t){var a=e[t];Array.isArray(a)?a.forEach((function(t){t&&r.push(String(t))})):a&&r.push(String(a))})):"string"==typeof e&&r.push(e);var n={};return r.map((function(t){return String(t).trim()})).filter((function(t){return t&&!n[t]&&(n[t]=1)}))},submit:function(){var t,e=this;return(t=i().mark((function t(){var r,a,s,o,l,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.file){t.next=3;break}return e.errorMessages=["Please choose a file to import."],t.abrupt("return");case 3:return e.clearErrors(),e.uploading=!0,e.progress=0,n().start(),n().set(.2),t.prev=8,(r=new FormData).append("customers",e.file),t.next=13,axios.post(e.endpoint,r,{headers:{"Content-Type":"multipart/form-data",Accept:"application/json"},onUploadProgress:function(t){t&&t.total&&(e.progress=Math.round(100*t.loaded/t.total))},validateStatus:function(){return!0}});case 13:if(a=t.sent,s=a&&a.data?a.data:{},422!==(a&&a.status?a.status:0)&&!1!==s.status){t.next=21;break}return o=e.onlyErrorsArray(s),e.errorMessages=o.length?o:s.message&&"validation failed"!==s.message.trim().toLowerCase()?[s.message]:["Please fix the highlighted errors in your file and try again."],e.toast("Check the error list and fix your file.","Import failed","danger"),t.abrupt("return");case 21:Array.isArray(s.warnings)&&s.warnings.length&&(e.warningMessages=s.warnings),l=s.imported||0,e.toast(l+" customers imported successfully.","Success","success"),e.$router.push({name:"Customers"}),t.next=32;break;case 27:t.prev=27,t.t0=t.catch(8),c=t.t0&&t.t0.message?String(t.t0.message):"Network error. Please try again.",e.errorMessages=[c],e.toast("Upload failed due to a network error.","Error","danger");case 32:return t.prev=32,n().done(),e.uploading=!1,e.progress=0,t.finish(32);case 37:case"end":return t.stop()}}),t,null,[[8,27,32,37]])})),function(){var e=this,r=arguments;return new Promise((function(a,n){var i=t.apply(e,r);function o(t){s(i,a,n,o,l,"next",t)}function l(t){s(i,a,n,o,l,"throw",t)}o(void 0)}))})()}}};var d=r(85072),f=r.n(d),p=r(63307),v={insert:"head",singleton:!1};f()(p.A,v);p.A.locals;const h=(0,r(14486).A)(u,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-content import-customers"},[e("div",{staticClass:"hero shadow-sm mb-4"},[e("div",{staticClass:"hero-bg"}),t._v(" "),e("div",{staticClass:"hero-body d-flex align-items-center justify-content-between flex-wrap"},[t._m(0),t._v(" "),e("router-link",{staticClass:"btn btn-outline-secondary btn-sm mt-3 mt-sm-0",attrs:{to:{name:"Customers"}}},[e("i",{staticClass:"i-Left"}),t._v(" Back to list\n ")])],1)]),t._v(" "),e("b-card",{staticClass:"shadow-sm"},[e("b-row",[e("b-col",{staticClass:"mb-4",attrs:{md:"7"}},[e("div",{staticClass:"dropzone",class:{"is-dragover":t.isDragOver,"has-file":!!t.file},on:{dragover:function(e){return e.preventDefault(),t.onDragOver.apply(null,arguments)},dragleave:function(e){return e.preventDefault(),t.onDragLeave.apply(null,arguments)},drop:function(e){return e.preventDefault(),t.onDrop.apply(null,arguments)},click:t.browse}},[e("input",{ref:"file",staticClass:"d-none",attrs:{type:"file",accept:t.accept},on:{change:t.onFileSelected}}),t._v(" "),e("div",{staticClass:"dz-inner text-center"},[e("div",{staticClass:"dz-icon mb-2"},[e("i",{staticClass:"i-Download-Window"})]),t._v(" "),e("h5",{staticClass:"mb-2"},[t._v("Click or drop your Excel file here")]),t._v(" "),e("div",{staticClass:"text-muted small"},[t._v("\n Allowed formats: XLSX, XLS · Max size: 20MB\n ")]),t._v(" "),t.file?e("div",{staticClass:"file-pill mt-3 d-inline-flex align-items-center"},[e("div",{staticClass:"file-dot mr-2"}),t._v(" "),e("div",{staticClass:"file-meta mr-3"},[e("div",{staticClass:"file-name"},[t._v(t._s(t.fileName))]),t._v(" "),e("div",{staticClass:"file-size text-muted small"},[t._v(t._s(t.prettySize))])]),t._v(" "),e("b-button",{attrs:{size:"sm",variant:"outline-danger"},on:{click:function(e){return e.stopPropagation(),t.clearFile.apply(null,arguments)}}},[t._v("\n Remove\n ")])],1):t._e()])]),t._v(" "),e("b-card",{staticClass:"mt-3"},[e("div",{staticClass:"d-flex align-items-center mb-2"},[e("i",{staticClass:"i-Information mr-2 text-primary"}),t._v(" "),e("h6",{staticClass:"mb-0"},[t._v("Example format")])]),t._v(" "),e("p",{staticClass:"small text-muted mb-2"},[t._v("\n Create one row per customer. Columns in "),e("span",{staticClass:"badge badge-success-soft"},[t._v("green")]),t._v(" are required.\n ")]),t._v(" "),e("div",{staticClass:"table-responsive"},[e("table",{staticClass:"table table-sm table-bordered example-table"},[e("thead",{staticClass:"thead-light"},[e("tr",[e("th",{staticClass:"req"},[t._v("name")]),t._v(" "),e("th",{staticClass:"req"},[t._v("code (integer)")]),t._v(" "),e("th",[t._v("email")]),t._v(" "),e("th",[t._v("phone")]),t._v(" "),e("th",[t._v("tax_number")]),t._v(" "),e("th",[t._v("country")]),t._v(" "),e("th",[t._v("city")]),t._v(" "),e("th",[t._v("adresse")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("Acme Trading")]),t._v(" "),e("td",[t._v("10001")]),t._v(" "),e("td",[t._v("info@acme.com")]),t._v(" "),e("td",[t._v("+1 555 0123")]),t._v(" "),e("td",[t._v("TAX-9988")]),t._v(" "),e("td",[t._v("USA")]),t._v(" "),e("td",[t._v("New York")]),t._v(" "),e("td",[t._v("5th Ave, Suite 2")])]),t._v(" "),e("tr",[e("td",[t._v("Jane Smith")]),t._v(" "),e("td",[t._v("10002")]),t._v(" "),e("td",[t._v("jane@example.com")]),t._v(" "),e("td",[t._v("+44 20 7946 0958")]),t._v(" "),e("td"),t._v(" "),e("td",[t._v("UK")]),t._v(" "),e("td",[t._v("London")]),t._v(" "),e("td",[t._v("221B Baker Street")])])])])]),t._v(" "),e("ul",{staticClass:"mini-notes mt-2"},[e("li",[e("strong",[t._v("code")]),t._v(" must be an integer and unique (the database column is INT).")]),t._v(" "),e("li",[e("strong",[t._v("name")]),t._v(" is required.")]),t._v(" "),e("li",[e("strong",[t._v("adresse")]),t._v(" is the address field name expected by the backend.")]),t._v(" "),e("li",[t._v("You can leave optional columns empty if not applicable.")])])]),t._v(" "),t.errorMessages.length?e("b-alert",{staticClass:"mt-3",attrs:{show:"",variant:"danger"}},[e("div",{staticClass:"d-flex align-items-start"},[e("i",{staticClass:"i-Close-Window mr-2 mt-1"}),t._v(" "),e("div",[e("div",{staticClass:"font-weight-bold mb-1"},[t._v("Import failed. Fix the issues below:")]),t._v(" "),e("ul",{staticClass:"mb-0 pl-3"},t._l(t.errorMessages,(function(r,a){return e("li",{key:"err-"+a},[t._v(t._s(r))])})),0)])])]):t._e(),t._v(" "),t.warningMessages.length?e("b-alert",{staticClass:"mt-3",attrs:{show:"",variant:"warning"}},[e("div",{staticClass:"d-flex align-items-start"},[e("i",{staticClass:"i-Information mr-2 mt-1"}),t._v(" "),e("div",[e("div",{staticClass:"font-weight-bold mb-1"},[t._v("Warnings")]),t._v(" "),e("ul",{staticClass:"mb-0 pl-3"},t._l(t.warningMessages,(function(r,a){return e("li",{key:"warn-"+a},[t._v(t._s(r))])})),0)])])]):t._e(),t._v(" "),t.uploading?e("div",{staticClass:"mt-3"},[e("div",{staticClass:"d-flex justify-content-between mb-1"},[e("small",{staticClass:"text-muted"},[t._v("Uploading")]),t._v(" "),e("small",[t._v(t._s(t.progress)+"%")])]),t._v(" "),e("b-progress",{attrs:{value:t.progress,height:"8px"}})],1):t._e(),t._v(" "),e("div",{staticClass:"d-flex flex-wrap align-items-center mt-3"},[e("b-button",{staticClass:"mr-2 mb-2",attrs:{variant:"primary",size:"sm",disabled:!t.canSubmit||t.uploading},on:{click:t.submit}},[t.uploading?e("span",{staticClass:"d-inline-flex align-items-center"},[e("span",{staticClass:"spinner sm spinner-white mr-2"}),t._v("Processing…\n ")]):e("span",[e("i",{staticClass:"i-Upload mr-1"}),t._v("Import now")])]),t._v(" "),e("a",{staticClass:"btn btn-outline-info btn-sm mr-2 mb-2",attrs:{href:t.exampleHref,target:"_blank",rel:"noopener"}},[e("i",{staticClass:"i-File-Excel mr-1"}),t._v("Download example\n ")]),t._v(" "),e("b-button",{staticClass:"mb-2",attrs:{variant:"outline-secondary",size:"sm",disabled:!t.file||t.uploading},on:{click:t.clearFile}},[e("i",{staticClass:"i-Power-2 mr-1"}),t._v("Reset\n ")])],1)],1),t._v(" "),e("b-col",{staticClass:"mb-4",attrs:{md:"5"}},[e("b-card",{staticClass:"mb-3"},[e("h6",{staticClass:"mb-2"},[t._v("Required & optional columns")]),t._v(" "),e("div",{staticClass:"chip-grid"},t._l(t.columnsGuide,(function(r){return e("span",{key:r.key,staticClass:"chip",class:r.required?"chip-req":"chip-opt"},[t._v("\n "+t._s(r.label)+"\n ")])})),0),t._v(" "),e("ul",{staticClass:"mini-notes mt-3"},[e("li",[e("strong",[t._v("code")]),t._v(" — Integer only (no letters or punctuation).")]),t._v(" "),e("li",[e("strong",[t._v("email")]),t._v(" — Should be a valid email address if provided.")]),t._v(" "),e("li",[e("strong",[t._v("phone")]),t._v(" — Include country code when possible.")])])]),t._v(" "),e("b-alert",{staticClass:"border",attrs:{show:"",variant:"light"}},[e("div",{staticClass:"d-flex"},[e("div",{staticClass:"tip-badge mr-2"},[e("i",{staticClass:"i-Information"})]),t._v(" "),e("div",[e("strong",[t._v("Heads up")]),t._v(" "),e("div",{staticClass:"small text-muted"},[t._v("Large files may take longer to process.")])])])])],1)],1)],1)],1)}),[function(){var t=this,e=t._self._c;return e("div",{staticClass:"d-flex align-items-center"},[e("div",{staticClass:"hero-icon mr-3"},[e("i",{staticClass:"i-Cloud-Upload"})]),t._v(" "),e("div",[e("h3",{staticClass:"mb-1"},[t._v("Import Customers")]),t._v(" "),e("div",{staticClass:"text-muted small"},[t._v("Bulk add customers from an Excel file.")])])])}],!1,null,"3a9ec273",null).exports}}]);