From 782ad5d22539fc48d08f17be8010c4fcbf4ef653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Zu=CC=81brik?= Date: Sun, 7 Jun 2020 16:38:05 +0200 Subject: [PATCH] frontend update - v0.4.0 --- public/css/chunk-029e64c6.ee03cbc8.css | 1 - public/css/chunk-02b9cd01.e42d293d.css | 1 - public/css/chunk-1f7eff4e.5a599b2f.css | 1 + public/css/chunk-2ec11e8f.c7be19c9.css | 1 + public/css/chunk-54e6d611.d8ce3adc.css | 1 - public/css/chunk-78619b25.d70cc0ab.css | 1 + public/index.html | 2 +- public/js/{app.226b04f4.js => app.8dd7c6cf.js} | 4 ++-- public/js/chunk-029e64c6.d7f76ec2.js | 2 -- public/js/chunk-02b9cd01.63c0f110.js | 2 -- public/js/chunk-1f7eff4e.03f7672f.js | 2 ++ public/js/chunk-2ec11e8f.850313d5.js | 2 ++ public/js/chunk-54e6d611.9551f3e2.js | 2 -- public/js/chunk-78619b25.cec71534.js | 2 ++ 14 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 public/css/chunk-029e64c6.ee03cbc8.css delete mode 100644 public/css/chunk-02b9cd01.e42d293d.css create mode 100644 public/css/chunk-1f7eff4e.5a599b2f.css create mode 100644 public/css/chunk-2ec11e8f.c7be19c9.css delete mode 100644 public/css/chunk-54e6d611.d8ce3adc.css create mode 100644 public/css/chunk-78619b25.d70cc0ab.css rename public/js/{app.226b04f4.js => app.8dd7c6cf.js} (91%) delete mode 100644 public/js/chunk-029e64c6.d7f76ec2.js delete mode 100644 public/js/chunk-02b9cd01.63c0f110.js create mode 100644 public/js/chunk-1f7eff4e.03f7672f.js create mode 100644 public/js/chunk-2ec11e8f.850313d5.js delete mode 100644 public/js/chunk-54e6d611.9551f3e2.js create mode 100644 public/js/chunk-78619b25.cec71534.js diff --git a/public/css/chunk-029e64c6.ee03cbc8.css b/public/css/chunk-029e64c6.ee03cbc8.css deleted file mode 100644 index 07c4876..0000000 --- a/public/css/chunk-029e64c6.ee03cbc8.css +++ /dev/null @@ -1 +0,0 @@ -.product-hidden-properties[data-v-366eb4a8]{background:rgba(87,163,213,.25)}.product-hidden-properties h3[data-v-366eb4a8]{padding-top:1.5rem}.product-edit-language[data-v-366eb4a8]{position:fixed;top:449px;left:10px}.product-image-wrapper[data-v-366eb4a8]{position:relative}.product-image-wrapper .action[data-v-366eb4a8]{position:absolute;top:5px;height:3rem;background:hsla(0,0%,100%,.5);color:#555;font-size:2em}.product-image-wrapper .action.edit[data-v-366eb4a8]{right:5px}.product-image-wrapper .action.edit .button[data-v-366eb4a8]{height:3rem;font-size:2em}.product-image-wrapper .action.remove[data-v-366eb4a8]{left:5px}.product-image-wrapper .action[data-v-366eb4a8]:hover{color:#ff3860;background:hsla(0,0%,100%,.9)}.product-image-wrapper .action span[data-v-366eb4a8]{font-size:.5em}.product-image-wrapper .uploadProductMainImage .upload .upload-draggable[data-v-366eb4a8]{width:100%!important}.data-main .field[data-v-366eb4a8]{position:relative}.data-main .field .label[data-v-366eb4a8]{position:absolute;left:4px;top:0;z-index:4;font-size:.6rem;opacity:.2}.data-main .field:hover .label[data-v-366eb4a8]{opacity:.5}.data-main .field input[data-v-366eb4a8],.data-main .field textarea[data-v-366eb4a8]{-webkit-appearance:none;appearance:none;-webkit-box-shadow:none;-moz-appearance:none;box-shadow:none;padding:0;border:0;line-height:0}.data-main .field input.is-size-1[data-v-366eb4a8],.data-main .field textarea.is-size-1[data-v-366eb4a8]{height:3.6rem}.data-main .field input.is-size-2[data-v-366eb4a8],.data-main .field textarea.is-size-2[data-v-366eb4a8]{height:3rem}.data-main .field input.is-size-5[data-v-366eb4a8],.data-main .field textarea.is-size-5[data-v-366eb4a8]{height:2rem}.data-main .field input[data-v-366eb4a8]:focus,.data-main .field input[data-v-366eb4a8]:hover,.data-main .field textarea[data-v-366eb4a8]:focus,.data-main .field textarea[data-v-366eb4a8]:hover{border:2px solid #167df0}.columns.product-descriptions.reversed-desktop[data-v-366eb4a8]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.product-properties .product-add-property[data-v-366eb4a8]{padding:15px;background:#fff;border-radius:5px}.product-properties .table td .field[data-v-366eb4a8],.product-properties .table th .field[data-v-366eb4a8]{position:relative}.product-properties .table td .field .label[data-v-366eb4a8],.product-properties .table th .field .label[data-v-366eb4a8]{position:absolute;top:-5px;left:5px;z-index:4;font-size:10px;background:#fff;padding:0 3px}.product-properties .table td .field .control input[type=text][data-v-366eb4a8]:not(:disabled):focus,.product-properties .table td .field .control input[type=text][data-v-366eb4a8]:not(:disabled):hover,.product-properties .table th .field .control input[type=text][data-v-366eb4a8]:not(:disabled):focus,.product-properties .table th .field .control input[type=text][data-v-366eb4a8]:not(:disabled):hover{border:1px solid #167df0}.product-properties .table td .field .control .switch[data-v-366eb4a8],.product-properties .table th .field .control .switch[data-v-366eb4a8]{position:absolute;right:5px;top:7px;font-size:.9rem;background:#fff}.product-properties .table td .field .control .switch .control-label[data-v-366eb4a8],.product-properties .table th .field .control .switch .control-label[data-v-366eb4a8]{font-size:.7rem}.product-gallery[data-v-366eb4a8]{margin-top:30px}[data-editable][data-v-366eb4a8]{background:#fff;border-radius:5px;margin-top:5px}[data-editable][data-v-366eb4a8]:focus,[data-editable][data-v-366eb4a8]:hover{border:1px solid #167df0}[data-editable] [data-ce-tag=img][data-v-366eb4a8],[data-editable] iframe[data-v-366eb4a8],[data-editable] image[data-v-366eb4a8],[data-editable] img[data-v-366eb4a8],[data-editable] video[data-v-366eb4a8]{clear:both;display:block;margin-left:auto;margin-right:auto;max-width:100%}[data-editable] .align-left[data-v-366eb4a8]{clear:none;float:left;margin-right:.5em}[data-editable].align-right[data-v-366eb4a8]{clear:none;float:right;margin-left:.5em}[data-editable] .text-center[data-v-366eb4a8]{text-align:center}[data-editable] .text-left[data-v-366eb4a8]{text-align:left}[data-editable] .text-right[data-v-366eb4a8]{text-align:right}table.table[data-v-366eb4a8]{width:100%;background:none}.product-delete[data-v-366eb4a8]{background:rgba(87,163,213,.25);margin-top:2rem} \ No newline at end of file diff --git a/public/css/chunk-02b9cd01.e42d293d.css b/public/css/chunk-02b9cd01.e42d293d.css deleted file mode 100644 index 9379b37..0000000 --- a/public/css/chunk-02b9cd01.e42d293d.css +++ /dev/null @@ -1 +0,0 @@ -.page-hidden-properties[data-v-06e97b26]{background:rgba(87,163,213,.25)}.page-hidden-properties h3[data-v-06e97b26]{padding-top:1.5rem}.page-detail .page-body[data-v-06e97b26]{text-align:left}.page-detail .page-body [data-editable][data-v-06e97b26]{background:#fff;border-radius:5px;margin-top:5px}.page-detail .page-body [data-editable][data-v-06e97b26]:focus,.page-detail .page-body [data-editable][data-v-06e97b26]:hover{border:1px solid #167df0}.page-detail .page-body [data-editable] [data-ce-tag=img][data-v-06e97b26],.page-detail .page-body [data-editable] iframe[data-v-06e97b26],.page-detail .page-body [data-editable] image[data-v-06e97b26],.page-detail .page-body [data-editable] img[data-v-06e97b26],.page-detail .page-body [data-editable] video[data-v-06e97b26]{clear:both;display:block;margin-left:auto;margin-right:auto;max-width:100%}.page-detail .page-body [data-editable] .align-left[data-v-06e97b26]{clear:none;float:left;margin-right:.5em}.page-detail .page-body [data-editable].align-right[data-v-06e97b26]{clear:none;float:right;margin-left:.5em}.page-detail .page-body [data-editable] .text-center[data-v-06e97b26]{text-align:center}.page-detail .page-body [data-editable] .text-left[data-v-06e97b26]{text-align:left}.page-detail .page-body [data-editable] .text-right[data-v-06e97b26]{text-align:right}.product-edit-language[data-v-06e97b26]{position:fixed;top:449px;left:10px}table.table[data-v-06e97b26]{width:100%;background:none}.data-main .field[data-v-06e97b26]{position:relative}.data-main .field .label[data-v-06e97b26]{position:absolute;left:4px;top:0;z-index:4;font-size:.6rem;opacity:.2}.data-main .field:hover .label[data-v-06e97b26]{opacity:.5}.data-main .field input[data-v-06e97b26],.data-main .field textarea[data-v-06e97b26]{-webkit-appearance:none;appearance:none;-webkit-box-shadow:none;-moz-appearance:none;box-shadow:none;padding:0;border:0;line-height:0}.data-main .field input.is-size-1[data-v-06e97b26],.data-main .field textarea.is-size-1[data-v-06e97b26]{height:3.6rem}.data-main .field input.is-size-2[data-v-06e97b26],.data-main .field textarea.is-size-2[data-v-06e97b26]{height:3rem}.data-main .field input.is-size-5[data-v-06e97b26],.data-main .field textarea.is-size-5[data-v-06e97b26]{height:2rem}.data-main .field input[data-v-06e97b26]:focus,.data-main .field input[data-v-06e97b26]:hover,.data-main .field textarea[data-v-06e97b26]:focus,.data-main .field textarea[data-v-06e97b26]:hover{border:2px solid #167df0}.page-delete[data-v-06e97b26]{background:rgba(87,163,213,.25);margin-top:2rem} \ No newline at end of file diff --git a/public/css/chunk-1f7eff4e.5a599b2f.css b/public/css/chunk-1f7eff4e.5a599b2f.css new file mode 100644 index 0000000..ab21512 --- /dev/null +++ b/public/css/chunk-1f7eff4e.5a599b2f.css @@ -0,0 +1 @@ +.edit-area .editor-button.confirm-button[data-v-ec750884]{background:#27ae60}.edit-area .editor-button.confirm-button[data-v-ec750884]:hover{background:#2cc36b}.edit-area .editor-button.delete-button[data-v-ec750884]{left:60px;background:#e74c3c;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.edit-area .editor-button.delete-button[data-v-ec750884]:hover{background:#ea6153}.edit-area .product-edit-language[data-v-ec750884]{position:absolute;top:60px}.category-hidden-properties[data-v-ec750884]{background:rgba(87,163,213,.25)}.category-hidden-properties h3[data-v-ec750884]{padding-top:1.5rem}.category-image-wrapper .field.file.action.edit[data-v-ec750884]{float:right}.category-image-wrapper .action.remove.button.is-danger[data-v-ec750884]{float:left}.category-list .field[data-v-ec750884]{position:relative}.category-list .field .label[data-v-ec750884]{position:absolute;left:4px;top:0;z-index:4;font-size:.6rem;opacity:.2}.category-list .field:hover .label[data-v-ec750884]{opacity:.5}.category-list .field input[data-v-ec750884],.category-list .field textarea[data-v-ec750884]{padding:0;border:0;border:1px solid #167df0;line-height:0}.category-list .field input.is-size-1[data-v-ec750884],.category-list .field textarea.is-size-1[data-v-ec750884]{height:3.6rem}.category-list .field input.is-size-2[data-v-ec750884],.category-list .field textarea.is-size-2[data-v-ec750884]{height:3rem}.category-list .field input.is-size-5[data-v-ec750884],.category-list .field textarea.is-size-5[data-v-ec750884]{height:2rem}.category-list .field input[data-v-ec750884]:focus,.category-list .field textarea[data-v-ec750884]:focus{border:2px solid #167df0}.category-delete[data-v-ec750884]{background:rgba(87,163,213,.25);margin-top:2rem} \ No newline at end of file diff --git a/public/css/chunk-2ec11e8f.c7be19c9.css b/public/css/chunk-2ec11e8f.c7be19c9.css new file mode 100644 index 0000000..439765e --- /dev/null +++ b/public/css/chunk-2ec11e8f.c7be19c9.css @@ -0,0 +1 @@ +.product-hidden-properties[data-v-441455fe]{background:rgba(87,163,213,.25)}.product-hidden-properties h3[data-v-441455fe]{padding-top:1.5rem}.product-edit-language[data-v-441455fe]{position:fixed;top:449px;left:10px}.product-image-wrapper[data-v-441455fe]{position:relative}.product-image-wrapper .action[data-v-441455fe]{position:absolute;top:5px;height:3rem;background:hsla(0,0%,100%,.5);color:#555;font-size:2em}.product-image-wrapper .action.edit[data-v-441455fe]{right:5px}.product-image-wrapper .action.edit .button[data-v-441455fe]{height:3rem;font-size:2em}.product-image-wrapper .action.remove[data-v-441455fe]{left:5px}.product-image-wrapper .action[data-v-441455fe]:hover{color:#ff3860;background:hsla(0,0%,100%,.9)}.product-image-wrapper .action span[data-v-441455fe]{font-size:.5em}.product-image-wrapper .uploadProductMainImage .upload .upload-draggable[data-v-441455fe]{width:100%!important}.data-main .field[data-v-441455fe]{position:relative}.data-main .field .label[data-v-441455fe]{position:absolute;left:4px;top:0;z-index:4;font-size:.6rem;opacity:.2}.data-main .field:hover .label[data-v-441455fe]{opacity:.5}.data-main .field input[data-v-441455fe],.data-main .field textarea[data-v-441455fe]{-webkit-appearance:none;appearance:none;-webkit-box-shadow:none;-moz-appearance:none;box-shadow:none;padding:0;border:2px solid hsla(0,0%,100%,0);line-height:0}.data-main .field input.is-size-1[data-v-441455fe],.data-main .field textarea.is-size-1[data-v-441455fe]{height:3.6rem}.data-main .field input.is-size-2[data-v-441455fe],.data-main .field textarea.is-size-2[data-v-441455fe]{height:3rem}.data-main .field input.is-size-5[data-v-441455fe],.data-main .field textarea.is-size-5[data-v-441455fe]{height:2rem}.data-main .field input[data-v-441455fe]:focus,.data-main .field input[data-v-441455fe]:hover,.data-main .field textarea[data-v-441455fe]:focus,.data-main .field textarea[data-v-441455fe]:hover{border:2px solid #167df0}.columns.product-descriptions.reversed-desktop[data-v-441455fe]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.product-properties .product-add-property[data-v-441455fe]{padding:15px;background:#fff;border-radius:5px}.product-properties .table td .field[data-v-441455fe],.product-properties .table th .field[data-v-441455fe]{position:relative}.product-properties .table td .field .label[data-v-441455fe],.product-properties .table th .field .label[data-v-441455fe]{position:absolute;top:-5px;left:5px;z-index:4;font-size:10px;background:#fff;padding:0 3px}.product-properties .table td .field .control input[type=text][data-v-441455fe]:not(:disabled),.product-properties .table th .field .control input[type=text][data-v-441455fe]:not(:disabled){border:1px solid hsla(0,0%,100%,0)}.product-properties .table td .field .control input[type=text][data-v-441455fe]:not(:disabled):focus,.product-properties .table td .field .control input[type=text][data-v-441455fe]:not(:disabled):hover,.product-properties .table th .field .control input[type=text][data-v-441455fe]:not(:disabled):focus,.product-properties .table th .field .control input[type=text][data-v-441455fe]:not(:disabled):hover{border:1px solid #167df0}.product-properties .table td .field .control .switch[data-v-441455fe],.product-properties .table th .field .control .switch[data-v-441455fe]{position:absolute;right:5px;top:7px;font-size:.9rem;background:#fff}.product-properties .table td .field .control .switch .control-label[data-v-441455fe],.product-properties .table th .field .control .switch .control-label[data-v-441455fe]{font-size:.7rem}.product-gallery[data-v-441455fe]{margin-top:30px}[data-editable][data-v-441455fe]{background:#fff;border-radius:5px;margin-top:5px;border:1px solid hsla(0,0%,100%,0)}[data-editable][data-v-441455fe]:focus,[data-editable][data-v-441455fe]:hover{border:1px solid #167df0}[data-editable] [data-ce-tag=img][data-v-441455fe],[data-editable] iframe[data-v-441455fe],[data-editable] image[data-v-441455fe],[data-editable] img[data-v-441455fe],[data-editable] video[data-v-441455fe]{clear:both;display:block;margin-left:auto;margin-right:auto;max-width:100%}[data-editable] .align-left[data-v-441455fe]{clear:none;float:left;margin-right:.5em}[data-editable].align-right[data-v-441455fe]{clear:none;float:right;margin-left:.5em}[data-editable] .text-center[data-v-441455fe]{text-align:center}[data-editable] .text-left[data-v-441455fe]{text-align:left}[data-editable] .text-right[data-v-441455fe]{text-align:right}table.table[data-v-441455fe]{width:100%;background:none}.product-delete[data-v-441455fe]{background:rgba(87,163,213,.25);margin-top:2rem} \ No newline at end of file diff --git a/public/css/chunk-54e6d611.d8ce3adc.css b/public/css/chunk-54e6d611.d8ce3adc.css deleted file mode 100644 index 6f7c2b8..0000000 --- a/public/css/chunk-54e6d611.d8ce3adc.css +++ /dev/null @@ -1 +0,0 @@ -.edit-area .editor-button.confirm-button[data-v-41d914f6]{background:#27ae60}.edit-area .editor-button.confirm-button[data-v-41d914f6]:hover{background:#2cc36b}.edit-area .editor-button.delete-button[data-v-41d914f6]{left:60px;background:#e74c3c;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.edit-area .editor-button.delete-button[data-v-41d914f6]:hover{background:#ea6153}.edit-area .product-edit-language[data-v-41d914f6]{position:absolute;top:60px}.category-hidden-properties[data-v-41d914f6]{background:rgba(87,163,213,.25)}.category-hidden-properties h3[data-v-41d914f6]{padding-top:1.5rem}.category-image-wrapper .field.file.action.edit[data-v-41d914f6]{float:right}.category-image-wrapper .action.remove.button.is-danger[data-v-41d914f6]{float:left}.category-list .field[data-v-41d914f6]{position:relative}.category-list .field .label[data-v-41d914f6]{position:absolute;left:4px;top:0;z-index:4;font-size:.6rem;opacity:.2}.category-list .field:hover .label[data-v-41d914f6]{opacity:.5}.category-list .field input[data-v-41d914f6],.category-list .field textarea[data-v-41d914f6]{padding:0;border:0;border:1px solid #167df0;line-height:0}.category-list .field input.is-size-1[data-v-41d914f6],.category-list .field textarea.is-size-1[data-v-41d914f6]{height:3.6rem}.category-list .field input.is-size-2[data-v-41d914f6],.category-list .field textarea.is-size-2[data-v-41d914f6]{height:3rem}.category-list .field input.is-size-5[data-v-41d914f6],.category-list .field textarea.is-size-5[data-v-41d914f6]{height:2rem}.category-list .field input[data-v-41d914f6]:focus,.category-list .field textarea[data-v-41d914f6]:focus{border:2px solid #167df0}.category-delete[data-v-41d914f6]{background:rgba(87,163,213,.25);margin-top:2rem} \ No newline at end of file diff --git a/public/css/chunk-78619b25.d70cc0ab.css b/public/css/chunk-78619b25.d70cc0ab.css new file mode 100644 index 0000000..6c5bd6b --- /dev/null +++ b/public/css/chunk-78619b25.d70cc0ab.css @@ -0,0 +1 @@ +.page-hidden-properties[data-v-f57b8758]{background:rgba(87,163,213,.25)}.page-hidden-properties h3[data-v-f57b8758]{padding-top:1.5rem}.page-detail .page-body[data-v-f57b8758]{text-align:left}.page-detail .page-body [data-editable][data-v-f57b8758]{background:#fff;border-radius:5px;margin-top:5px}.page-detail .page-body [data-editable][data-v-f57b8758]:focus,.page-detail .page-body [data-editable][data-v-f57b8758]:hover{border:1px solid #167df0}.page-detail .page-body [data-editable] [data-ce-tag=img][data-v-f57b8758],.page-detail .page-body [data-editable] iframe[data-v-f57b8758],.page-detail .page-body [data-editable] image[data-v-f57b8758],.page-detail .page-body [data-editable] img[data-v-f57b8758],.page-detail .page-body [data-editable] video[data-v-f57b8758]{clear:both;display:block;margin-left:auto;margin-right:auto;max-width:100%}.page-detail .page-body [data-editable] .align-left[data-v-f57b8758]{clear:none;float:left;margin-right:.5em}.page-detail .page-body [data-editable].align-right[data-v-f57b8758]{clear:none;float:right;margin-left:.5em}.page-detail .page-body [data-editable] .text-center[data-v-f57b8758]{text-align:center}.page-detail .page-body [data-editable] .text-left[data-v-f57b8758]{text-align:left}.page-detail .page-body [data-editable] .text-right[data-v-f57b8758]{text-align:right}.product-edit-language[data-v-f57b8758]{position:fixed;top:449px;left:10px}table.table[data-v-f57b8758]{width:100%;background:none}.data-main .field[data-v-f57b8758]{position:relative}.data-main .field .label[data-v-f57b8758]{position:absolute;left:4px;top:0;z-index:4;font-size:.6rem;opacity:.2}.data-main .field:hover .label[data-v-f57b8758]{opacity:.5}.data-main .field input[data-v-f57b8758],.data-main .field textarea[data-v-f57b8758]{-webkit-appearance:none;appearance:none;-webkit-box-shadow:none;-moz-appearance:none;box-shadow:none;padding:0;border:0;line-height:0}.data-main .field input.is-size-1[data-v-f57b8758],.data-main .field textarea.is-size-1[data-v-f57b8758]{height:3.6rem}.data-main .field input.is-size-2[data-v-f57b8758],.data-main .field textarea.is-size-2[data-v-f57b8758]{height:3rem}.data-main .field input.is-size-5[data-v-f57b8758],.data-main .field textarea.is-size-5[data-v-f57b8758]{height:2rem}.data-main .field input[data-v-f57b8758]:focus,.data-main .field input[data-v-f57b8758]:hover,.data-main .field textarea[data-v-f57b8758]:focus,.data-main .field textarea[data-v-f57b8758]:hover{border:2px solid #167df0}.page-delete[data-v-f57b8758]{background:rgba(87,163,213,.25);margin-top:2rem} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 01192db..bde0f0d 100644 --- a/public/index.html +++ b/public/index.html @@ -1 +1 @@ -StretchShop
\ No newline at end of file +StretchShop
\ No newline at end of file diff --git a/public/js/app.226b04f4.js b/public/js/app.8dd7c6cf.js similarity index 91% rename from public/js/app.226b04f4.js rename to public/js/app.8dd7c6cf.js index c7a94db..2ccfacf 100644 --- a/public/js/app.226b04f4.js +++ b/public/js/app.8dd7c6cf.js @@ -1,2 +1,2 @@ -(function(t){function e(e){for(var s,r,o=e[0],l=e[1],c=e[2],d=0,u=[];d1?a("div",{staticClass:"navbar-item has-dropdown is-hoverable"},[t.$store.state.language?a("router-link",{staticClass:"navbar-link",attrs:{to:"#",tag:"a","active-class":"is-active"}},[t._v(" "+t._s(t.$store.state.language&&t.$store.state.language.code?t.$store.state.language.code:"")+" / "+t._s(t.$store.state.currency&&t.$store.state.currency.symbol?t.$store.state.currency.symbol:"")+" ")]):t._e(),t.$store.state.coredata&&t.$store.state.coredata.langs?a("div",{staticClass:"navbar-dropdown"},[t._l(t.$store.state.coredata.langs,(function(e,s){return a("a",{key:s+"langs",staticClass:"navbar-item",on:{click:function(a){return a.stopPropagation(),a.preventDefault(),t.setLang(e.code)}}},[t._v(" "+t._s(e.name)+" ")])})),a("hr",{staticClass:"navbar-divider"}),t._l(t.$store.state.coredata.currencies,(function(e,s){return a("a",{key:s+"-currecies",staticClass:"navbar-item",on:{click:function(a){return a.stopPropagation(),a.preventDefault(),t.setCurrency(e.code)}}},[t._v(" "+t._s(e.code)+" ")])}))],2):t._e()],1):t._e(),a("div",{staticClass:"navbar-item userCart",class:{"has-dropdown":t.hasCart,"is-hoverable":t.hasCart}},[null!=t.$store.state.cart?a("router-link",{staticClass:"navbar-link userCartLink",attrs:{to:{name:"cart"},tag:"a","active-class":"is-active"}},[a("span",{attrs:{translate:"yes"}},[t._v("Cart")]),t.cartItemsAmountCount?a("span",{key:t.cartItemsAmountCount,staticClass:"cartItemsCount"},[t._v(" "+t._s(t.cartItemsAmountCount)+" ")]):a("span",{staticClass:"cartItemsCount"},[t._v(" 0 ")]),null!=t.$store.state.cart?a("div",{staticClass:"navbar-dropdown",attrs:{id:"header-cart-dropdown"}},[a("div",{staticClass:"navbar-item"},[a("table",{staticClass:"table"},[a("tbody",t._l(t.$store.state.cart.items,(function(e,s){return a("tr",{key:s+"-cart"},[a("th",[t._v(t._s(e.name[t.$store.state.language.code]))]),a("td",[t._v("x"+t._s(e.amount))]),a("td",[a("span",[t._v(t._s(t.$store.state.numeral(e.price).format("0 0.00")))]),a("span",[t._v(t._s(t.$store.state.currency.symbol))])]),a("td",[a("a",{on:{click:function(a){return a.stopPropagation(),a.preventDefault(),t.clearCart(e._id)}}},[a("font-awesome-icon",{attrs:{icon:"trash"}})],1)])])})),0)])]),a("div",[a("strong",{attrs:{translate:"yes"}},[t._v("Total price")]),t._v(" "),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.pricePayment?a("span",[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceTotal).format("0.00")))]),t._v(" "+t._s(t.$store.state.currency.symbol)+" ")]):t.$store.state.cart&&null!=t.$store.state.cart.priceTotal?a("span",[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.cart.priceTotal).format("0 0.00")))]),t._v(" "+t._s(t.$store.state.currency.symbol)+" ")]):t._e()]),a("hr",{staticClass:"navbar-divider"}),null!=t.$store.state.cart?a("router-link",{staticClass:"button is-success",attrs:{to:{name:"cart"},tag:"a","active-class":"is-active",id:"header-gotocart",translate:"yes"},nativeOn:{click:function(e){return t.hideCartNavbar()}}},[t._v("Go to Cart")]):t._e()],1):t._e()]):t._e()],1),a("div",{staticClass:"navbar-item has-dropdown is-hoverable"},[t.$store.state.user.logged?a("router-link",{staticClass:"navbar-link",attrs:{to:{name:"me"},tag:"a","active-class":"is-active"}},[a("div",{staticClass:"user--avatar-wrapper",style:{"background-image":"url("+t.userProfileImage+")"}}),a("span",{attrs:{id:"header-user-profile"}},[t._v(" "+t._s(t.$store.state.user&&t.$store.state.user.profile&&null!=t.$store.state.user.profile&&t.$store.state.user.profile.username&&""!=t.$store.state.user.profile.username.toString().trim()?t.$store.state.user.profile.username:"Profile")+" ")])]):t._e(),t.$store.state.user.logged?a("div",{staticClass:"navbar-dropdown"},[a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"me"},tag:"a","active-class":"is-active"}},[a("span",{attrs:{translate:"yes",id:"header-profile"}},[t._v("Profile")])]),a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"userOrders"},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-orders",translate:"yes"}},[t._v("Orders")])]),a("hr",{staticClass:"navbar-divider"}),a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"pageNewEdit",params:{slug:"---new"}},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-newpage",translate:"yes"}},[t._v("New Page")])]),a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"productNewEdit",params:{category:"---none",slug:"---new",product:"---new"}},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-newproduct",translate:"yes"}},[t._v("New Product")])]),a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"categoryNewEdit",params:{category:"---new"}},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-newcategory",translate:"yes"}},[t._v("New Category")])])],1):t._e()],1),a("div",{staticClass:"buttons"},[t.$store.state.user.logged&&1==t.$store.state.user.logged?t._e():a("router-link",{staticClass:"navbar-item button is-primary",attrs:{to:{name:"register"},tag:"a","active-class":"is-active"}},[a("strong",{attrs:{id:"header-signup",translate:"yes"}},[t._v("Sign up")])]),t.$store.state.user.logged&&1==t.$store.state.user.logged?t._e():a("router-link",{staticClass:"navbar-item button is-light",attrs:{to:{name:"login"},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-login",translate:"yes"}},[t._v("Log in")])]),t.$store.state.user.logged&&1==t.$store.state.user.logged?a("a",{staticClass:"button is-light",attrs:{id:"header-logout",translate:"yes"},on:{click:t.userLogout}},[t._v("Logout")]):t._e()],1)])])])])])}),u=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a",{staticClass:"navbar-burger burger",attrs:{role:"button","aria-label":"menu","aria-expanded":"false","data-target":"navbarBasicExample"}},[a("span",{attrs:{"aria-hidden":"true"}}),a("span",{attrs:{"aria-hidden":"true"}}),a("span",{attrs:{"aria-hidden":"true"}})])}],m={name:"appHeader",data:function(){return{userLogged:!1,cartItemsCount:0}},computed:{cartItemsAmountCount:function(){return this.$store.getters.getCartItemsAmountCount},userProfileImage:function(){return this.$store.getters.getProfileImage()},hasNavigation:function(){return!!(this.$store&&this.$store.state&&this.$store.state.coredata&&this.$store.state.coredata.navigation)},navigationMain:function(){if(this.hasNavigation){var t=this.$store.getters.getNavigation("main")["main"];if(t&&t.items&&t.items.length>0)return t.items}return null}},mounted:function(){this.getCart(),this.navbarBurgerEvents()},methods:{navbarBurgerEvents:function(){var t=this,e=Array.prototype.slice.call(this.$el.querySelectorAll(".navbar-burger"),0);e.length>0&&e.forEach((function(e){e.addEventListener("click",(function(){var a=e.dataset.target,s=t.$refs[a];e.classList.toggle("is-active"),s.classList.toggle("is-active")}))}))},getNavLink:function(t){if(t&&t.typeName)return"--link"==t.typeName?t.slugParams:t.slugParams?{name:t.typeName,params:t.slugParams}:{name:t.typeName}},userLogout:function(){var t=this;this.$store.state.user.logged=!1,this.$store.state.user.profile=null,this.$httpc.defaults.headers.common["Authorization"]=null,this.$cookies.remove("token"),this.$httpc.get("users/logout").then((function(e){console.log("userLogout DONE"),t.$router.push({name:"login"})}))},getCart:function(){var t=this;this.$httpc.get("cart").then((function(e){e.data&&t.$store.dispatch("setCart",e.data)})).catch((function(t){return console.log(t),null})).then((function(){return null}))},hasCart:function(){return this.$store.state.cart&&null!=this.$store.state.cart&&this.$store.state.cart.items&&this.$store.state.cart.items.length>0},clearCart:function(t){var e=this;t="undefined"!==typeof t?t:null;var a="";null!=t&&""!=t.toString().trim()&&(a="/"+t),this.$httpc.delete("cart"+a).then((function(t){t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){return console.log(t),null})).then((function(){return null}))},setLang:function(t){var e=this,a=this;this.$store.state.coredata&&this.$store.state.coredata.lang&&this.$store.state.coredata.lang.code&&(!this.$store.state.translates||this.$store.state.translates&&"undefined"==typeof this.$store.state.translates[t]||this.$store.state.translates[t].length<1)&&t!=this.$store.state.coredata.lang.code?this.$httpc.get("/coredata/translation?lang="+t).then((function(s){s.data&&(a.$store.dispatch("setTranslates",s.data),a.$store.dispatch("setLanguage",t),localStorage.setItem("language",t),a.$parent.translateContent(e.$store.getters.getTranslates),Qe.$emit("languageChanged",t),a.setNewHistoryPath(t))})):(this.$store.dispatch("setLanguage",t),localStorage.setItem("language",t),this.$parent.translateContent(this.$store.getters.getTranslates),Qe.$emit("languageChanged",t),this.setNewHistoryPath(t))},setCurrency:function(t){this.$store.dispatch("setCurrency",t)},setNewHistoryPath:function(t){var e=window.location,a=e.pathname.split("/");a=a.filter((function(t){return""!=t})),a.length>0&&(a[0]=t),history.pushState({},null,e.origin+"/"+a.join("/"))},hideCartNavbar:function(){this.$el.querySelector("#header-cart-dropdown").style.display="none"},linkType:function(t){var e="router-link";if(t&&t.slugParams&&"string"===typeof t.slugParams){var a=t.slugParams.split("/");if(a&&a.constructor===Array&&a[0]&&""!=a[0].trim()){var s=a[0].trim();e=["https","http"].indexOf(s)?"a":"router-link"}}return e},linkDef:function(t){var e=this.linkType(t);return"a"==e?{is:"a",href:t.slugParams,target:"_blank",rel:"noopener"}:{is:"router-link",to:this.getNavLink(t)}}}},p=m,g=(a("df4c"),a("2877")),v=Object(g["a"])(p,d,u,!1,null,null,null),h=v.exports,f=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("footer",{staticClass:"footer"},[a("div",{staticClass:"container"},[t.$store&&t.$store.state&&t.$store.state.coredata&&t.$store.state.coredata.settings&&t.$store.state.coredata.settings.business?a("div",{staticClass:"columns has-text-left"},[t._m(0),t._m(1),a("div",{staticClass:"column is-3"},[a("h6",{staticClass:"title is-6",attrs:{translate:"yes"}},[t._v("Menu")]),t.hasNavigation?a("ul",t._l(t.navigationMain,(function(e,s){return a("li",{key:e.codename+s},[a("router-link",{staticClass:"navbar-item",attrs:{to:t.getNavLink(e),tag:"a","active-class":"is-active",exact:""}},[t._v(" "+t._s(e.langs[t.$store.state.language.code].name)+" ")])],1)})),0):t._e()]),a("div",{staticClass:"column is-3"},[a("h6",{staticClass:"title is-6",attrs:{translate:"yes"}},[t._v("Company")]),t.hasNavigation?a("ul",t._l(t.navigationFooter,(function(e,s){return a("li",{key:e.codename+s},[a("router-link",{staticClass:"navbar-item",attrs:{to:t.getNavLink(e),tag:"a","active-class":"is-active",exact:""}},[e.langs[t.$store.state.language.code]?a("span",[t._v(" "+t._s(e.langs[t.$store.state.language.code].name)+" ")]):t._e()])],1)})),0):t._e()]),a("div",{staticClass:"column is-3"},[a("h6",{staticClass:"title is-6",attrs:{translate:"yes"}},[t._v("Links")]),t.hasNavigation?a("ul",t._l(t.navigationFooterLinks,(function(e,s){return a("li",{key:e.codename+s},[a("router-link",{staticClass:"navbar-item",attrs:{to:t.getNavLink(e),tag:"a","active-class":"is-active",exact:""}},[e.langs[t.$store.state.language.code]?a("span",[t._v(" "+t._s(e.langs[t.$store.state.language.code].name)+" ")]):t._e()])],1)})),0):t._e()])]):t._e(),a("div",{staticClass:"columns is-size-7"},[a("div",{staticClass:"column"},[t._v(" © "+t._s(t.getYear)+" "),t.$store&&t.$store.state&&t.$store.state.coredata&&t.$store.state.coredata.settings&&t.$store.state.coredata.settings.business?a("span",[t._v(" "+t._s(t.$store.state.coredata.settings.business.name)+" ")]):t._e()])])])])},y=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-1"},[a("img",{attrs:{src:"/assets/_site/logo-words-vertical.svg",width:"80",alt:""}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-3"},[a("p",[t._v(" Created with "),a("strong",[t._v("StretchShop")]),a("br"),t._v(" Fast & Scalable e-business"),a("br"),a("a",{attrs:{href:"https://stretchshop.app/"}},[t._v("https://stretchshop.app/")])])])}],C={name:"appFooter",data:function(){return{userLogged:!1,cartItemsCount:0}},computed:{cartItemsAmountCount:function(){return this.$store.getters.getCartItemsAmountCount},userProfileImage:function(){return this.$store.getters.getProfileImage()},hasNavigation:function(){return!!(this.$store&&this.$store.state&&this.$store.state.coredata&&this.$store.state.coredata.navigation)},navigationFooter:function(){return this.getNavigation("footer")},navigationFooterLinks:function(){return this.getNavigation("footer","links")},navigationMain:function(){return this.getNavigation("main")},getYear:function(){var t=new Date;return t.getFullYear()}},mounted:function(){},methods:{getNavigation:function(t,e){var a="undefined"!=typeof e?e:"main";if(this.hasNavigation){var s=this.$store.getters.getNavigation(t)[a];if(s&&s.items&&s.items.length>0)return s.items}return null},getNavLink:function(t){if(t&&t.typeName)return"--link"==t.typeName?t.slugParams:t.slugParams?{name:t.typeName,params:t.slugParams}:{name:t.typeName}}}},_=C,$=(a("3c12"),Object(g["a"])(_,f,y,!1,null,null,null)),b=$.exports,P={name:"app",components:{"app-header":h,"app-footer":b},created:function(){var t=this;Qe.$on("translateContent",(function(e){t.translateContent(e)}))},watch:{$route:function(t,e){"undefined"!==typeof translateContent&&this.$store.state.language.code==this.$store.state.coredata.lang.code&&translateContent(this.$store.getters.getTranslates)}},events:{changeRouterLanguageEvent:function(t){return this.changeRouterLanguage(newLanguage)},translateContentEvent:function(){return this.translateContent(this.$store.getters.getTranslates)}},methods:{changeRouterLanguage:function(t){if(this.$router.options&&this.$router.options.routes&&this.$router.options.routes.length>0)for(var e=0;e1&&(a[1]=t,this.$router.options.routes[e].path=a.join("/"))}},translateContent:function(t){var e=this.$store.getters.getLanguage,a="";if(this.$store.state.coredata&&this.$store.state.coredata.langs)for(var s=0;s0||e==a)){var r=!1;null!=e&&e==a&&(e=Object.keys(t)[0],r=!0);for(var i=0;i router-link.","> a.").replace("> template > ",""),o=this.$el.querySelector(n);o&&null!=o&&(o.textContent=r?t[e][i].original:t[e][i].string)}}}}},x=P,w=(a("5c0b"),Object(g["a"])(x,l,c,!1,null,null,null)),D=w.exports,I=a("2f62"),T=a("6612"),k=a.n(T);s["a"].use(I["a"]);var A=new I["a"].Store({namespace:!0,state:{user:{logged:!1,token:null,remember:!1,profile:null,avatar:null},language:{code:"en",longCode:"en-US",name:"English"},currency:{code:"EUR",symbol:"€",ratio:1},coredata:null,cart:null,order:null,chunk:function(t,e){for(var a=[],s=0;s0){var s=!1;e.addresses.forEach((function(t){null!=t&&t.type&&"invoice"===t.type&&!s?a.addressInvoice=t:t.type&&"delivery"===t.type&&a.addressesDelivery.push(t)}))}e.bio&&(a.bio=e.bio),e.company&&(a.company=e.company),e.settings&&(a.settings=e.settings),e.dates&&(a.dates=e.dates),t.user.profile={},Object.keys(a).forEach((function(e){a[e]&&null!==a[e]&&(t.user.profile[e]=a[e])}))},setUserProfileImage:function(t,e){var a="https://stretchshop.app/static";t.coredata&&t.coredata.settings&&t.coredata.settings.assets&&t.coredata.settings.assets.url&&(a=t.coredata.settings.assets.url),e&&(t.user&&t.user.profile&&t.user.profile.image&&(t.user.profile.image=e),t.user.avatar=a+"/users/profile/"+e+"?"+(new Date).getTime())},setCoreData:function(t,e){t.language=e.language,t.coredata=e.coredata},setOrder:function(t,e){t.order=e},addNewDeliveryAddress:function(t,e){t.user.profile.addressesDelivery.unshift(e)},removeDeliveryAddress:function(t,e){t.user.profile.addressesDelivery.splice(e,1)},setLanguage:function(t,e){t.language=e},setCurrency:function(t,e){t.currency=e},setTranslates:function(t,e){t.translates=e}},actions:{setCart:function(t,e){if(console.log("setting cart"),e&&null!=e){e.priceTotal=0;var a=0,s=0,r=0,i={types:[],subtypes:[]};e.items&&e.items.length>0&&e.items.forEach((function(t){a++,s+=t.amount,r+=t.price*t.amount,i.types.indexOf(t.type)<0&&i.types.push(t.type),i.subtypes.indexOf(t.subtype)<0&&i.subtypes.push(t.subtype)})),e.itemsCount=a,e.itemsAmountCount=s,e.priceTotal=r,e.cartItemTypology=i,t.commit("setCart",e)}else if(null===e){var n={_id:null,user:null,ip:null,hash:null,order:null,dateCreated:null,dateUpdated:null,items:[],priceTotal:0,itemsCount:0,itemsAmountCount:0,cartItemTypology:{types:[],subtypes:[]}};t.commit("setCart",n)}},setCoreData:function(t,e){if(e&&null!=e){var a=JSON.parse(JSON.stringify(e));e.coredata=a,e.coredata.lang&&(e.language=e.coredata.lang);var s=[];if(e.coredata.langs)for(var r=0;r0&&(e.order.settings.deliveryMethods.forEach((function(t){s[t.type]||(s[t.type]=[]),s[t.type].push(t)})),e.order.settings.deliveryMethodsTypes=s),a("setOrder",e)}else null===e&&a("setOrder",null)},updateUser:function(t,e){var a=t.commit;t.state;e&&null!=e&&this._vm.$httpc.put("user",{user:e},{needsAuth:!0}).then((function(t){t.data.user&&a("setUserProfile",t.data.user)}))},addNewDeliveryAddress:function(t,e){e&&null!=e&&t.commit("addNewDeliveryAddress",e)},removeDeliveryAddress:function(t,e){"undefined"!==typeof e&&e>-1&&t.commit("removeDeliveryAddress",e)},checkLanguage:function(t,e){t.commit;var a=t.state;if("undefined"!==typeof e&&""!==e.toString().trim()){var s=null;if(a.coredata&&a.coredata.langs&&a.coredata.langs.length>0)for(var r=0;r0)for(var n=0;n0)for(var n=0;n-1:t.remember},on:{change:function(e){var a=t.remember,s=e.target,r=!!s.checked;if(Array.isArray(a)){var i=null,n=t._i(a,i);s.checked?n<0&&(t.remember=a.concat([i])):n>-1&&(t.remember=a.slice(0,n).concat(a.slice(n+1)))}else t.remember=r}}})]),a("button",{staticClass:"button is-medium is-primary",attrs:{type:"submit",translate:"yes"}},[t._v("Login")]),t._m(3)])]),a("div",{staticClass:"column is-4 is-offset-4"},[a("p",{attrs:{translate:"yes"}},[t._v("Forgot your password? "),a("router-link",{attrs:{to:{name:"reset"},tag:"a"}},[t._v("Reset your password")])],1)])])},q=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1"},[t._v("Login")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"wrong credentials",translate:"yes"}},[t._v("Wrong credentials")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not activated",translate:"yes"}},[t._v("Account not activated. Check your mailbox for activation email.")]),a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v(" This site is protected by reCAPTCHA and the Google"),a("br"),a("a",{attrs:{href:"https://policies.google.com/privacy"}},[t._v("Privacy Policy")]),t._v(" and "),a("a",{attrs:{href:"https://policies.google.com/terms"}},[t._v("Terms of Service")]),t._v(" apply. ")])}],R=a("5b55"),U={name:"UsersLogin",data:function(){return{email:"",password:"",remember:!1}},created:function(){},methods:{userLogin:function(){var t=this,e=this,a=this.$helpers.propertiesRequiredConfirm({email:this.email,password:this.password},["email","password"]);a.result&&""!=this.email&&""!=this.password?this.$helpers.recaptcha(this,"login").then((function(e){return t.$httpc.post("helpers/recaptcha",{token:e},{timeout:3e3}).then((function(t){return t}))})).catch((function(t){if(console.log("RECAPTCHA NOT WORKING! Make sure you have RECAPTCHA variables set in backend enviroment."),confirm("RECAPTCHA NOT WORKING\nAre you sure you want to Login?\n\nSee console for more information"))return{data:!0}})).then((function(a){a&&1==a.data&&t.$httpc.post("users/login",{user:{email:t.email,password:t.password}}).then((function(t){if(t.data.user&&t.data.user._id){R["a"].COOKIE_TIME;1==e.remember&&R["a"].COOKIE_TIME_REMEMBER;e.$store.state.user.logged=!0,e.$store.state.user.remember=e.remember;var a=t.data.user;e.$store.dispatch("setUser",a),e.$router.push({name:"me"})}})).catch((function(t){t.response&&t.response.data&&t.response.data.errors&&Object.keys(t.response.data.errors).length>0&&Object.keys(t.response.data.errors).forEach((function(a){var s=e.$el.querySelector(".field."+a);if(s){var r=s.querySelector('.form-messages .form-message[data-message="'+t.response.data.errors[a]+'"]');if(r&&null!=r){e.$helpers.undecorateFormField(s,"danger");var i=r.innerText;e.$helpers.decorateFormField(s,i,"danger")}}}))})).then((function(t){}))})):this.$helpers.formUndecorateAndDecorateFields(a.fields,a.errors)}}},j=U,V=Object(g["a"])(j,M,q,!1,null,"311a8338",null),z=V.exports,G=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container users-login"},[t._m(0),a("div",{staticClass:"columns"},[t.sent?a("div",{staticClass:"column is-half is-offset-one-quarter"},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Your registration was successfull, we are sending you email")]),a("p",{attrs:{translate:"yes"}},[t._v("Check your mailbox for verification email (if not found check, also you spam folder).")])]):a("div",{staticClass:"column is-half is-offset-one-quarter"},[a("form",{on:{submit:function(e){return e.preventDefault(),t.userRegister(e)}}},[a("div",{staticClass:"simple-wrapper"},[t._m(1),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field username"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Username")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.username,expression:"user.username"}],staticClass:"input",attrs:{type:"text",placeholder:"Username"},domProps:{value:t.user.username},on:{input:function(e){e.target.composing||t.$set(t.user,"username",e.target.value)}}})]),t._m(2)])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field email"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Email")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.email,expression:"user.email"}],staticClass:"input",attrs:{type:"email",placeholder:"Email"},domProps:{value:t.user.email},on:{input:function(e){e.target.composing||t.$set(t.user,"email",e.target.value)}}})]),t._m(3)])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field email2"},[a("label",{staticClass:"label"},[t._v("Email Confirm")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.email2,expression:"user.email2"}],staticClass:"input",attrs:{type:"email",placeholder:"Email Confirm"},domProps:{value:t.user.email2},on:{input:function(e){e.target.composing||t.$set(t.user,"email2",e.target.value)}}})]),t._m(4)])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field password"},[a("label",{staticClass:"label"},[t._v("Password")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.password,expression:"user.password"}],staticClass:"input",attrs:{type:"password",placeholder:"Password"},domProps:{value:t.user.password},on:{input:function(e){e.target.composing||t.$set(t.user,"password",e.target.value)}}})]),t._m(5)])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field password2"},[a("label",{staticClass:"label"},[t._v("Password Confirm")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.password2,expression:"user.password2"}],staticClass:"input",attrs:{type:"password",placeholder:"Password Confirm"},domProps:{value:t.user.password2},on:{input:function(e){e.target.composing||t.$set(t.user,"password2",e.target.value)}}})]),t._m(6)])])])]),t._m(7),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("First Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.nameFirst,expression:"user.nameFirst"}],staticClass:"input",attrs:{type:"text",placeholder:"First Name"},domProps:{value:t.user.nameFirst},on:{input:function(e){e.target.composing||t.$set(t.user,"nameFirst",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Last Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.nameLast,expression:"user.nameLast"}],staticClass:"input",attrs:{type:"text",placeholder:"Last Name"},domProps:{value:t.user.nameLast},on:{input:function(e){e.target.composing||t.$set(t.user,"nameLast",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Street")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.street,expression:"user.street"}],staticClass:"input",attrs:{type:"text",placeholder:"Street"},domProps:{value:t.user.street},on:{input:function(e){e.target.composing||t.$set(t.user,"street",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Street 2")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.street2,expression:"user.street2"}],staticClass:"input",attrs:{type:"text",placeholder:"Street 2"},domProps:{value:t.user.street2},on:{input:function(e){e.target.composing||t.$set(t.user,"street2",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-4"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("ZIP")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.zip,expression:"user.zip"}],staticClass:"input",attrs:{type:"text",placeholder:"ZIP"},domProps:{value:t.user.zip},on:{input:function(e){e.target.composing||t.$set(t.user,"zip",e.target.value)}}})])])]),a("div",{staticClass:"column is-8"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("City")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.city,expression:"user.city"}],staticClass:"input",attrs:{type:"text",placeholder:"City"},domProps:{value:t.user.city},on:{input:function(e){e.target.composing||t.$set(t.user,"city",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("State")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.state,expression:"user.state"}],staticClass:"input",attrs:{type:"text",placeholder:"State"},domProps:{value:t.user.state},on:{input:function(e){e.target.composing||t.$set(t.user,"state",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Country")]),a("div",{staticClass:"control select"},[t.$store.state.coredata&&t.$store.state.coredata.countries?a("select",{directives:[{name:"model",rawName:"v-model",value:t.user.country,expression:"user.country"}],on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.user,"country",e.target.multiple?a:a[0])}}},t._l(t.$store.state.coredata.countries,(function(e){return a("option",{key:e.code,domProps:{value:e.code}},[t._v(" "+t._s(e.name)+" ")])})),0):t._e()])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Phone")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.phone,expression:"user.phone"}],staticClass:"input",attrs:{type:"text",placeholder:"Phone"},domProps:{value:t.user.phone},on:{input:function(e){e.target.composing||t.$set(t.user,"phone",e.target.value)}}})])])])]),a("div",{staticClass:"simple-wrapper"},[t._m(8),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field companyName"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Company Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.companyName,expression:"user.companyName"}],staticClass:"input",attrs:{type:"text",placeholder:"Company Name"},domProps:{value:t.user.companyName},on:{input:function(e){e.target.composing||t.$set(t.user,"companyName",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyOrgId"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Organisation ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.companyOrgId,expression:"user.companyOrgId"}],staticClass:"input",attrs:{type:"text",placeholder:"Organisation ID"},domProps:{value:t.user.companyOrgId},on:{input:function(e){e.target.composing||t.$set(t.user,"companyOrgId",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyTaxId"},[a("label",{staticClass:"label"},[t._v("Company Tax ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.companyTaxId,expression:"user.companyTaxId"}],staticClass:"input",attrs:{type:"text",placeholder:"Company Tax ID"},domProps:{value:t.user.companyTaxId},on:{input:function(e){e.target.composing||t.$set(t.user,"companyTaxId",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyTaxVatId"},[a("label",{staticClass:"label"},[t._v("Company VAT ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.companyTaxVatId,expression:"user.companyTaxVatId"}],staticClass:"input",attrs:{type:"text",placeholder:"Company VAT ID"},domProps:{value:t.user.companyTaxVatId},on:{input:function(e){e.target.composing||t.$set(t.user,"companyTaxVatId",e.target.value)}}})])])])])]),a("hr"),a("button",{staticClass:"button is-success"},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" Register ")],1),t._m(9)])])])])},B=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns"},[a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1",attrs:{translate:"yes"}},[t._v("Register")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12",attrs:{translate:"yes"}},[t._v(" Required Fields ")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"exists",translate:"yes"}},[t._v("This email already exists")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not confirmed",translate:"yes"}},[t._v("Values do not match")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not confirmed",translate:"yes"}},[t._v("Values do not match")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[a("hr")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12",attrs:{translate:"yes"}},[t._v(" If you are company ")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v(" This site is protected by reCAPTCHA and the Google"),a("br"),a("a",{attrs:{href:"https://policies.google.com/privacy"}},[t._v("Privacy Policy")]),t._v(" and "),a("a",{attrs:{href:"https://policies.google.com/terms"}},[t._v("Terms of Service")]),t._v(" apply. ")])}],H={name:"UsersRegister",data:function(){return{sent:!1,user:{username:"",email:"",email2:"",password:"",password2:"",nameFirst:"",nameLast:"",street:"",street2:"",zip:"",city:"",state:"",country:"",phone:"",companyName:"",companyOrgId:"",companyTaxId:"",companyTaxVatId:""}}},created:function(){},methods:{userRegister:function(){var t=this,e=null,a=["username","email","password"],s=["email","password"],r=this;if(e=this.$helpers.propertiesRequiredConfirm(this.user,a,s),e.result){var i={user:{username:this.user.username,email:this.user.email,password:this.user.password}};this.$store.state.language&&this.$store.state.language.code&&this.$store.state.currency&&this.$store.state.currency.code&&(i.user["settings"]={language:this.$store.state.language.code,currency:this.$store.state.currency.code});var n=this.checkFillAddress();n&&(i.user["addresses"]=[],i.user["addresses"].push(n));var o=this.checkFillCompany();o&&(i.user["company"]=[],i.user["company"].push(o)),this.$helpers.recaptcha(this,"register").then((function(e){return t.$httpc.post("helpers/recaptcha",{token:e},{timeout:3e3}).then((function(t){return t}))})).catch((function(t){if(console.log("RECAPTCHA NOT WORKING! Make sure you have RECAPTCHA variables set in backend enviroment."),confirm("RECAPTCHA NOT WORKING\nAre you sure you want to Login?\n\nSee console for more information"))return{data:!0}})).then((function(e){e&&1==e.data&&t.$httpc.post("users/register",i,{timeout:5e3}).then((function(t){r.sent=!0;var e=r.$el.querySelector(".field.");Object.keys(e).forEach((function(t){r.$helpers.undecorateFormField(t,"danger")}))})).catch((function(t){t.response&&t.response.data&&t.response.data.errors&&Object.keys(t.response.data.errors).length>0&&Object.keys(t.response.data.errors).forEach((function(e){var a=r.$el.querySelector(".field."+e);if(a){var s=a.querySelector('.form-messages .form-message[data-message="'+t.response.data.errors[e]+'"]');if(s&&null!=s){var i=s.innerText;r.$helpers.decorateFormField(a,i,"danger")}}}))})).then((function(){}))}))}else e&&e.fields&&e.errors?(this.$scrollTo(this.$el.querySelector(".field."+e.fields[0]),500,{offset:-100}),this.$helpers.formUndecorateAndDecorateFields(e.fields,e.errors)):(this.$scrollTo(this.$el.querySelector(".field."+a.fields[0]),500,{offset:-100}),this.$helpers.formUndecorateAndDecorateFields(a,[]))},checkFillAddress:function(){var t=null,e=["nameFirst","nameLast","street","street2","zip","city","state","country","phone"],a={},s=!1,r=this;return e.forEach((function(t){""!=r.user[t].trim()&&(a[t]=r.user[t].trim(),s=!0)})),s&&(a["type"]="invoice",t=a),t},checkFillCompany:function(){var t=null,e=["companyName","companyOrgId","companyTaxId","companyTaxVatId"],a={},s=!1,r=this;return e.forEach((function(t){""!=r.user[t].trim()&&(a[t]=r.user[t].trim(),s=!0)})),s&&(t=a),t}}},W=H,Y=(a("5bc8"),Object(g["a"])(W,G,B,!1,null,null,null)),K=Y.exports,J=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container users-me"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1",attrs:{translate:"yes"}},[t._v("Verify")]),a("p",{},[t._v(t._s(t.email))]),t.error?a("div",[a("p",{staticClass:"has-text-danger",attrs:{translate:"yes"}},[t._v("Activation link is not valid anymore (valid only for 2 hours)")]),a("p",[a("span",{attrs:{translate:"yes"}},[t._v("If more than 2 hours passed, try to")]),t._v(" "),a("router-link",{attrs:{to:{name:"reset"},tag:"a",translate:"yes"}},[t._v("reset your password")])],1)]):t._e()])])])},Z=[],Q=(a("3b2b"),{name:"UsersVerify",data:function(){return{error:!1}},computed:{email:function(){var t=new RegExp("--","g"),e=this.$route.params.id.toString().replace("---","@").replace(t,".");return e}},mounted:function(){console.log("verify"),this.sendVerifycation()},methods:{sendVerifycation:function(){var t=this,e=decodeURIComponent(this.$route.params.id),a=decodeURIComponent(this.$route.params.hash);this.$httpc.post("user/verify",{email:e,hash:a},{timeout:7e3}).then((function(e){if(e.data.user){t.$store.state.user.logged=!0,t.$store.state.user.remember=t.remember;var a=e.data.user;t.$store.dispatch("setUser",a);t.$router.push({name:"me"})}})).catch((function(e){console.log(e),t.error=!0})).then((function(){t.$store.state.user.logged?t.$router.push({name:"me"}):t.error=!0}))}}}),X=Q,tt=Object(g["a"])(X,J,Z,!1,null,null,null),et=tt.exports,at=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container users-me"},[t._m(0),a("div",{staticClass:"columns"},[t.sent?a("div",{staticClass:"column is-half is-offset-one-quarter"},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("We are sending you email")]),a("p",{attrs:{translate:"yes"}},[t._v("Check your mailbox for verification email (if not found check, also you spam folder).")])]):a("div",{staticClass:"column is-half is-offset-one-quarter"},[a("form",{on:{submit:function(e){return e.preventDefault(),t.resetPassword(e)}}},[a("div",{},[t._m(1),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field email"},[a("label",{staticClass:"label"},[t._v("Email")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.email,expression:"email"}],staticClass:"input",attrs:{type:"email",placeholder:"Email"},domProps:{value:t.email},on:{input:function(e){e.target.composing||(t.email=e.target.value)}}})]),t._m(2)])])]),a("button",{staticClass:"button is-success"},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" Reset ")],1),t._m(3)])])])])])},st=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns"},[a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1",attrs:{translate:"yes"}},[t._v("Reset password")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12"},[t._v(" Required Field ")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"not found",translate:"yes"}},[t._v("This email couldn't be found")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v(" This site is protected by reCAPTCHA and the Google"),a("br"),a("a",{attrs:{href:"https://policies.google.com/privacy"}},[t._v("Privacy Policy")]),t._v(" and "),a("a",{attrs:{href:"https://policies.google.com/terms"}},[t._v("Terms of Service")]),t._v(" apply. ")])}],rt={name:"UsersVerify",data:function(){return{email:null,sent:!1}},computed:{},mounted:function(){},methods:{resetPassword:function(){var t=this,e=this;this.$helpers.recaptcha(this,"reset").then((function(e){return t.$httpc.post("helpers/recaptcha",{token:e},{timeout:3e3}).then((function(t){return t}))})).catch((function(t){if(console.log("RECAPTCHA NOT WORKING! Make sure you have RECAPTCHA variables set in backend enviroment."),confirm("RECAPTCHA NOT WORKING\nAre you sure you want to Login?\n\nSee console for more information"))return{data:!0}})).then((function(a){a&&1==a.data&&t.$httpc.post("user/reset",{email:t.email},{timeout:7e3}).then((function(t){e.sent=!0})).catch((function(t){t.response&&t.response.data&&t.response.data.errors&&Object.keys(t.response.data.errors).length>0&&Object.keys(t.response.data.errors).forEach((function(a){var s=e.$el.querySelector(".field."+a);if(s){var r=s.querySelector('.form-messages .form-message[data-message="'+t.response.data.errors[a]+'"]');if(r&&null!=r){e.$helpers.undecorateFormField(s,"danger");var i=r.innerText;e.$helpers.decorateFormField(s,i,"danger")}}}))})).then((function(){}))}))}}},it=rt,nt=Object(g["a"])(it,at,st,!1,null,null,null),ot=nt.exports,lt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container category-list"},[t.userCanEdit&&(t.categoryDetail&&t.categoryDetail.pathSlug||t.page)?a("div",{staticClass:"edit-area"},[t.categoryDetail&&t.categoryDetail.pathSlug?a("router-link",{staticClass:"editor-button edit-button",attrs:{to:{name:"categoryNewEdit",params:{category:t.categoryDetail.pathSlug}}}},[a("font-awesome-icon",{attrs:{icon:"edit"}})],1):t._e(),t.page&&t.page.slug?a("router-link",{staticClass:"editor-button edit-button",attrs:{to:{name:"pageNewEdit",params:{slug:t.page.slug}}}},[a("font-awesome-icon",{attrs:{icon:"edit"}})],1):t._e()],1):t._e(),a("div",{staticClass:"columns category-header",style:{backgroundImage:"url("+t.getCategoryBackground()+")"}},[a("div",{staticClass:"column"},[t.categoryDetail?a("h1",{staticClass:"title is-1"},[t._v(t._s(t.categoryDetail.name[t.$store.state.language.code]))]):t._e(),t.categoryDetail?a("h2",{staticClass:"title is-3"},[t._v(t._s(t.categoryDetail.descriptionShort[t.$store.state.language.code]))]):t._e(),t.categoryDetail?a("p",{},[t._v(t._s(t.categoryDetail.descriptionLong[t.$store.state.language.code]))]):a("h1",{staticClass:"title is-1 title-products",attrs:{translate:"yes"}},[t._v("Products")])])]),a("div",{staticClass:"columns",attrs:{id:"category-main-content"}},[a("div",{staticClass:"column is-3"},[t.categories&&t.categories.length>0?a("nav",{staticClass:"panel"},[a("aside",{staticClass:"menu"},[a("p",{staticClass:"menu-label",attrs:{translate:"yes"}},[t._v(" Sub-Categories ")]),a("ul",{staticClass:"menu-list"},t._l(this.categories,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),0)])]):t._e(),a("category-filter",{ref:"categoryFilter",attrs:{filter:t.filter,categoryMinMaxPrice:t.categoryMinMax,categoryType:t.getCategoryType()}})],1),a("div",{staticClass:"column is-9"},[t.breadcrumbs&&null!=t.breadcrumbs&&t.breadcrumbs.length>0?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[a("ul",[t._l(t.breadcrumbs,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.$store.state.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),a("li",{staticClass:"is-active"},[a("router-link",{attrs:{title:t.categoryDetail.name[t.$store.state.language.code],to:{name:"categoryList",params:{category:t.categoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.categoryDetail.name[t.$store.state.language.code])+" ")])],1)],2)]):t._e(),t.products&&t.products.length>0?a("div",[a("category-paging",{ref:"categoryPaging",attrs:{total:t.categoryProductsTotalForPaging}}),"product"==t.itemsToListType?a("div",t._l(t.products,(function(e,s){return a("div",{key:t.groupsLastRefresh+s,staticClass:"tile is-ancestor"},t._l(e,(function(e,r){return a("router-link",{key:t.groupsLastRefresh+e._id+(s+r),staticClass:"tile is-parent is-4",attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"productDetail",params:{category:t.categoryDetail.pathSlug,product:e._id,slug:e.slug}}}},[a("product-box",{attrs:{product:e}})],1)})),1)})),0):t._e(),"page"==t.itemsToListType?a("div",t._l(t.products,(function(e,s){return a("div",{key:t.groupsLastRefresh+s,staticClass:"tile is-ancestor"},t._l(e,(function(e,r){return a("router-link",{key:t.groupsLastRefresh+e._id+(s+r),staticClass:"tile is-parent is-4",attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"pageDetail",params:{category:t.categoryDetail.pathSlug,slug:e.slug}}}},[a("product-box",{attrs:{product:e}})],1)})),1)})),0):t._e(),a("category-paging",{ref:"categoryPaging",attrs:{bottom:!0,total:t.categoryProductsTotalForPaging}})],1):t.page&&t.page.data?a("div",[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.page.data&&t.page.data.name?a("h1",{staticClass:"title is-1"},[t._v(t._s(t.page.data.name[t.$store.state.language.code]))]):t._e(),a("page-detail-content",{attrs:{content:t.categoryTypePageContent,contentData:t.categoryTypePageData,contentLang:t.language.code}})],1)])]):a("div",[a("h2",{attrs:{translate:"yes"}},[t._v("Nothing found")])])])])])},ct=[],dt=(a("55dd"),a("5ac7")),ut=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("nav",{staticClass:"panel categoryFilter"},[a("p",{staticClass:"panel-heading",attrs:{translate:"yes"}},[t._v(" Filter ")]),a("div",{staticClass:"panel-block"},[a("p",{staticClass:"control has-text-centered is-size-7"},[t.countsDoNotMatch?a("span",[a("span",{attrs:{translate:"yes"}},[t._v("Filtered")]),t._v(": "),a("span",[t._v(t._s(t.filteredCount))]),t._v(" / ")]):t._e(),a("span",{attrs:{translate:"yes"}},[t._v("Total")]),t._v(": "),a("span",[t._v(t._s(t.categoryTotalCount))])])]),a("div",{staticClass:"panel-block"},[a("p",{staticClass:"control has-icons-left"},[a("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.tempFilter.stringFilter,expression:"tempFilter.stringFilter",modifiers:{trim:!0}}],staticClass:"input is-small",attrs:{type:"text",translate:"yes",placeholder:"search"},domProps:{value:t.tempFilter.stringFilter},on:{keyup:t.stringFilterChange,input:function(e){e.target.composing||t.$set(t.tempFilter,"stringFilter",e.target.value.trim())},blur:function(e){return t.$forceUpdate()}}}),t._m(0)])]),"products"==t.categoryType?a("div",{staticClass:"panel-block"},[a("div",{staticClass:"panel-block-multiwrapper"},[t._m(1),a("div",{staticClass:"slider-range",attrs:{slider:""}},[a("div",{staticClass:"slider-range-controls"},[a("div",{staticStyle:{width:"0%"},attrs:{"inverse-left":""}}),a("div",{staticStyle:{width:"0%"},attrs:{"inverse-right":""}}),a("div",{staticStyle:{left:"0%",right:"0%"},attrs:{range:""}}),a("span",{staticStyle:{left:"0%"},attrs:{thumb:"left"}}),a("span",{staticStyle:{left:"100%"},attrs:{thumb:"right"}}),a("div",{staticStyle:{left:"0%"},attrs:{sign:"left"}},[a("span",{staticClass:"value"},[t._v(t._s(t.categoryPriceMin))])]),a("div",{staticStyle:{left:"100%"},attrs:{sign:"right"}},[a("span",{staticClass:"value"},[t._v(t._s(t.categoryPriceMax))])])]),a("input",{attrs:{type:"range",position:"left",tabindex:"0",max:t.categoryPriceMax,min:t.categoryPriceMin,step:"1"},domProps:{value:t.filterPriceMin},on:{input:t.priceSliderChange}}),a("input",{attrs:{type:"range",position:"right",tabindex:"0",max:t.categoryPriceMax,min:t.categoryPriceMin,step:"1"},domProps:{value:t.filterPriceMax},on:{input:t.priceSliderChange}})])])]):t._e(),"products"==t.categoryType?a("div",{staticClass:"panel-block"},[a("div",{staticClass:"panel-block-multiwrapper"},[t._m(2),a("div",[a("div",{staticClass:"control has-text-centered"},[a("div",{staticClass:"select is-centered"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.tempFilter.sort,expression:"tempFilter.sort"}],on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.tempFilter,"sort",e.target.multiple?a:a[0])},t.changeSorting]}},[a("option",{attrs:{value:"price"}},[t._v("Price Ascending")]),a("option",{attrs:{value:"-price"}},[t._v("Price Descending")]),a("option",{attrs:{value:"-dates.dateCreated"}},[t._v("Latest")]),a("option",{attrs:{value:"stockAmount"}},[t._v("On Stock Amount")])])])])])])]):t._e(),"pages"==t.categoryType?a("div",{staticClass:"panel-block"},[a("div",{staticClass:"panel-block-multiwrapper"},[t._m(3),a("div",[a("div",{staticClass:"control has-text-centered"},[a("div",{staticClass:"select is-centered"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.tempFilter.sort,expression:"tempFilter.sort"}],on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.tempFilter,"sort",e.target.multiple?a:a[0])},t.changeSorting]}},[a("option",{attrs:{value:"-dates.dateCreated"}},[t._v("Latest")]),a("option",{attrs:{value:"dates.dateCreated"}},[t._v("Oldest")])])])])])])]):t._e()])},mt=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",{staticClass:"icon is-small is-left"},[a("i",{staticClass:"fas fa-search",attrs:{"aria-hidden":"true"}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Price")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("label",{staticClass:"label"},[a("span",{attrs:{translate:"yes"}},[t._v("Sort by")]),t._v(":")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("label",{staticClass:"label"},[a("span",{attrs:{translate:"yes"}},[t._v("Sort by")]),t._v(":")])])}],pt={data:function(){return{eventTimeoutId:null,tempFilter:{page:1,minMaxPrice:{min:0,max:0},stringFilter:"",sort:this.getDefaultSorting()},introMinMaxPrice:{min:null,max:null}}},mounted:function(){console.log("getCategoryType:",this.getCategoryType()),Qe.$emit("translateContent",this.$store.getters.getTranslates)},props:["filter","categoryMinMaxPrice","categoryType"],computed:{filterPriceMin:function(){return 0!=this.tempFilter.minMaxPrice.min?this.tempFilter.minMaxPrice.min:this.categoryPriceMin},filterPriceMax:function(){return 0!=this.tempFilter.minMaxPrice.max?this.tempFilter.minMaxPrice.max:this.categoryPriceMax},categoryPriceMin:function(){return"undefined"!==typeof this.categoryMinMaxPrice&&this.categoryMinMaxPrice.minthis.categoryMinMaxPrice.min?this.categoryMinMaxPrice.max:0},filteredCount:function(){return"undefined"!==typeof this.$parent?this.$parent.getCategoryFilteredCount():0},categoryTotalCount:function(){return"undefined"!==typeof this.$parent&&"undefined"!==typeof this.$parent.categoryDetail&&this.$parent.categoryDetail&&this.$parent.categoryDetail.count&&this.$parent.categoryDetail.count>0?this.$parent.categoryDetail.count:0},countsDoNotMatch:function(){return this.filteredCount>0&&this.filteredCount!=this.categoryTotalCount}},methods:{stringFilterChange:function(t){var e=t.target;this.filter.stringFilter=e.value,this.requestFilteredProductList()},priceSliderChange:function(t){var e="undefined"!==typeof t.forceValue?t.forceValue:null,a=t.target,s=a.getAttribute("position"),r="",i=0,n=null;"left"===s?(r="right",i=-1,n=a.parentNode.querySelector("input[type=range][position="+r+"]"),a.value=Math.min(a.value,parseInt(n.value)+i)):(s="right",r="left",i=1,n=a.parentNode.querySelector("input[type=range][position="+r+"]"),a.value=Math.max(a.value,parseInt(n.value)+i));var o=null,l=this.$parent.getCategoryMinMax();null!==e?(0==a.min&&"undefined"!==typeof l.min&&(a.min=l.min),0==a.max&&"undefined"!==typeof l.max&&(a.max=l.max),o=100/(parseInt(a.max)-parseInt(a.min))*parseInt(e)-100/(parseInt(a.max)-parseInt(a.min))*parseInt(a.min),a.value=e):(0==a.value&&("left"===s&&l&&(a.value=l.min),"right"===s&&l&&(a.value=l.max)),o=100/(parseInt(a.max)-parseInt(a.min))*parseInt(a.value)-100/(parseInt(a.max)-parseInt(a.min))*parseInt(a.min));var c=a.parentNode.querySelector(".slider-range-controls");"left"===s?(c.querySelector("[inverse-"+s+"]").style.width=o+"%",c.querySelector("[range]").style.left=o+"%"):(c.querySelector("[inverse-"+s+"]").style.width=100-o+"%",c.querySelector("[range]").style.right=100-o+"%"),c.querySelector("[thumb="+s+"]").style.left=o+"%",c.querySelector("[sign="+s+"]").style.left=o+"%",0==a.value?("right"===s&&"undefined"!==typeof l.max&&l.max>0&&(c.querySelector("[sign="+s+"] .value").innerText=l.max),"left"===s&&"undefined"!==typeof l.min&&l.min>0&&(c.querySelector("[sign="+s+"] .value").innerText=l.min)):c.querySelector("[sign="+s+"] .value").innerText=a.value;var d={};"left"===s?(d.min=a.value,d.max=n.value):(d.min=n.value,d.max=a.value),this.tempFilter.minMaxPrice=d,null==e&&0==this.$parent.introLoading&&this.requestFilteredProductList()},requestFilteredProductList:function(){var t=this;clearTimeout(this.eventTimeoutId),this.eventTimeoutId=setTimeout((function(){t.$root.loadingShow(),t.$httpc.post(t.getCategoryType()+"/filter",t.buildFilterRequestObject(),{timeout:7e3}).then((function(e){var a=t.$parent.categoryDetail;e["data"]={categories:t.$parent.categories,categoryDetail:a,filter:e.data.filter,results:e.data.results,filteredProductsCount:e.data.filteredProductsCount},t.changeFilterUrl(),t.$parent.processCategoryResponse(e)})).catch((function(t){console.log(t)}))}),1e3)},buildFilterRequestObject:function(t){var e=this.tempFilter;"undefined"!==typeof t&&t&&(e=t);var a=null;if("undefined"!==typeof this.$parent.categoryDetail&&this.$parent.categoryDetail){e["category"]={_id:this.$parent.categoryDetail._id,pathSlug:this.$parent.categoryDetail.pathSlug,subsSlugs:this.$parent.categoryDetail.subsSlugs};var s=e.category.subsSlugs;s.unshift(e.category.pathSlug),a={$in:s}}var r={query:{categories:a},limit:R["a"].PER_PAGE,sort:e.sort};if(e.page>1){var i=Math.abs(e.page-1)*R["a"].PER_PAGE;i>0&&(r.offset=i)}e.stringFilter&&""!==e.stringFilter.trim()&&(r.query["name."+this.$store.state.language.code]={$regex:e.stringFilter});var n="undefined"!==typeof e.minMaxPrice&&"undefined"!==typeof e.minMaxPrice.min?e.minMaxPrice.min:0,o="undefined"!==typeof e.minMaxPrice&&"undefined"!==typeof e.minMaxPrice.max?e.minMaxPrice.max:0;return(n>this.categoryPriceMin||o0&&(r.query["price"]={$gte:parseFloat(n),$lte:parseFloat(o)}),r},changeFilterUrl:function(){var t=this.filterObjectToQueryString();""!==t&&history.pushState({},null,t)},filterObjectToQueryString:function(){var t=[],e="";return this.tempFilter.page>1&&t.push("page="+encodeURIComponent(parseInt(this.tempFilter.page))),this.tempFilter.minMaxPrice.min>this.categoryPriceMin&&t.push("price-min="+encodeURIComponent(this.tempFilter.minMaxPrice.min)),this.tempFilter.minMaxPrice.max0&&(e=this.$route.path+"?"+t.join("&")),e},setActivePage:function(t){this.tempFilter.page=t,this.requestFilteredProductList()},changeSorting:function(t){this.tempFilter.sort=t.target.value,this.requestFilteredProductList()},setTempFilter:function(t){var e=this,a=!1,s={target:this.$el.querySelector("input[type=range][position=left]")},r={target:this.$el.querySelector("input[type=range][position=right]")};Object.keys(t).forEach((function(i){"undefined"!==typeof e.tempFilter[i]&&(e.tempFilter[i]=t[i],"minMaxPrice"==i&&(s["forceValue"]=e.tempFilter.minMaxPrice.min,r["forceValue"]=e.tempFilter.minMaxPrice.max,a=!0))})),a&&(this.priceSliderChange(s),this.priceSliderChange(r))},getCategoryType:function(){return this.categoryType?this.categoryType:"products"},getDefaultSorting:function(){return"pages"==this.getCategoryType()?R["a"].PRODUCT_DEFAULT_SORTING:R["a"].PAGE_DEFAULT_SORTING}}},gt=pt,vt=(a("a906"),Object(g["a"])(gt,ut,mt,!1,null,null,null)),ht=vt.exports,ft=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.total>t.perPage?a("section",[a("b-pagination",{attrs:{total:t.total,current:t.current,order:t.order,size:t.size,simple:t.isSimple,rounded:t.isRounded,"per-page":t.perPage,"aria-next-label":"Next page","aria-previous-label":"Previous page","aria-page-label":"Page","aria-current-label":"Current page"},on:{"update:current":function(e){t.current=e},change:t.pagingChanged}}),1==t.bottom?a("div",[a("button",{staticClass:"button"},[t._v("Load More ...")])]):t._e()],1):t._e()},yt=[],Ct=(a("c5f6"),{data:function(){return{current:1,perPage:R["a"].PER_PAGE,order:"is-centered",size:"",isSimple:!1,isRounded:!1}},props:{bottom:!1,total:{type:Number,required:!0}},methods:{pagingChanged:function(t){this.current=t,this.$parent.$refs.categoryFilter.setActivePage(t),console.log("value:",t)}}}),_t=Ct,$t=Object(g["a"])(_t,ft,yt,!1,null,null,null),bt=$t.exports,Pt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"pagecontent",staticClass:"page-body",domProps:{innerHTML:t._s(t.content)}})},xt=[],wt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.contentData?a("div",[a("div",{staticClass:"tile is-ancestor"},t._l(t.contentData.data,(function(e,s){return a("router-link",{key:e._id+s,staticClass:"tile is-parent is-4",attrs:{title:e.descriptionShort[t.language],to:{name:"productDetail",params:{category:t.getSlugForCategory(e),product:e._id,slug:e.slug}}}},[a("product-box",{attrs:{product:e,hideBuyButton:"true"}})],1)})),1)]):t._e()},Dt=[],It={name:"ProductSlide",data:function(){return{products:[],itemsToListType:"product",introLoading:!1}},components:{"product-box":dt["a"]},props:{language:"en",contentData:null},computed:{},mounted:function(){},methods:{getSlugForCategory:function(t){return t&&t.categoriesData&&t.categoriesData[t.categories[0]]&&t.categoriesData[t.categories[0]].pathSlug?t.categoriesData[t.categories[0]].pathSlug:t.slug}}},Tt=It,kt=(a("20da"),Object(g["a"])(Tt,wt,Dt,!1,null,null,null)),At=kt.exports,St={name:"PageDetailContent",data:function(){return{page:null,parentCategoryDetail:null}},props:{contentLang:{default:"en"},content:{default:""},contentData:{default:null}},mounted:function(){var t=this;Qe.$on("pageDetailLoaded",(function(){setTimeout((function(){t.processData()}),500)}))},computed:{something:function(){}},methods:{processData:function(){if(this.contentData&&this.$refs.pagecontent)for(var t=this.$helpers.getPageFunctions(this.$refs.pagecontent.innerHTML),e=0;e0?this.page.functions:null}},components:{"product-box":dt["a"],"category-filter":ht,"category-paging":bt,"page-detail-content":Ot},mounted:function(){var t=this;this.$store&&this.$store.state&&this.$store.state.language&&this.$store.state.language.code&&this.$store.state.user?this.listCategoryItems(!0):Qe.$on("coreDataLoaded",(function(){t.listCategoryItems(!0)}))},methods:{processCategoryResponse:function(t){var e=new Date,a=this;this.groupsLastRefresh=e.getTime();var s=null;if(t.data.categoryDetail&&(this.categoryDetail=t.data.categoryDetail,t.data.categoryDetail.parentCategories&&(this.breadcrumbs=t.data.categoryDetail.parentCategories),s=this.categoryDetail.taxData?this.categoryDetail.taxData:a.$store.state.coredata.settings),t.data.categories&&(this.categories=t.data.categories),t.data.filteredProductsCount&&(this.filteredProductsCount=t.data.filteredProductsCount),t.data.results){var r=t.data.results;t.data.categoryDetail&&t.data.categoryDetail.pathSlug&&r.forEach((function(e){e=a.$helpers.getProductTaxData(e,s),e.activeParentCategoryUrl=t.data.categoryDetail.pathSlug})),r&&r[0]&&r[0].type&&(this.itemsToListType=r[0].type),this.products=this.$store.state.chunk(r,R["a"].PER_ROW)}if(t.data.filter){var i=Object.assign({},this.filter);this.filter=t.data.filter;var n=this;Object.keys(i).forEach((function(t){"undefined"!==typeof n.filter[t]&&null!=n.filter[t]||(n.filter[t]=i[t])}))}this.$root.loadingClose()},listCategoryItems:function(t){t=!("undefined"===typeof t&&!t);var e=this,a=this.$route.path.split("/").filter(Boolean),s="undefined"!==typeof a[1]?a[1]:"products";if(this.$route.params&&this.$route.params.category&&""!=this.$route.params.category.toString().trim())if(this.$root.loadingShow(),t&&Object.keys(this.$route.query).length>0){this.queryStringtoFilter();var r=this.categoryDetail&&"pages"==this.categoryDetail.type?"pageCategoryFilter":"categoryFilter";e.$httpc.post(s+"/"+this.$route.params.category,{filter:this.$refs[r].buildFilterRequestObject(this.filter)},{timeout:7e3}).then((function(t){e.processCategoryResponse(t),"undefined"!==typeof e.$refs[r]&&(e.introLoading=!0,e.$refs[r].setTempFilter(e.filter),e.introLoading=!1)})).catch((function(t){console.log(t)})).then((function(){Qe.$emit("translateContent",e.$store.getters.getTranslates)}))}else console.log("listCategoryItems no need to analyse"),this.$httpc.get(s+"/"+this.$route.params.category,{timeout:7e3}).then((function(t){e.processCategoryResponse(t)})).catch((function(t){console.log(t)})).then((function(){Qe.$emit("translateContent",e.$store.getters.getTranslates)}));else{console.log("listCategoryItems no slug");var i=this.$route.path,n=i.split("/"),o=e.$store.state.language.code;n.length>1&&(o=n[1],n.splice(0,2),i=n.join("/"));var l=i;this.$httpc.post("categories/find",{query:{parentPathSlug:"",type:l},lang:o}).then((function(t){t.data&&(e.categories=t.data.categories,t.data.page&&t.data.page.data&&(e.page=t.data.page.data))})).catch((function(t){console.log(t)})).then((function(){Qe.$emit("pageDetailLoaded")}))}},queryStringtoFilter:function(){var t={minMaxPrice:{}};if("undefined"!==typeof this.$route.query["price-min"]){var e=parseFloat(this.$route.query["price-min"]);e>0&&(t.minMaxPrice["min"]=e)}if("undefined"!==typeof this.$route.query["price-max"]){var a=parseFloat(this.$route.query["price-max"]);a>0&&(t.minMaxPrice["max"]=a)}if("undefined"!==typeof this.$route.query["string"]){var s=decodeURIComponent(this.$route.query["string"]).trim();""!==s&&(t["stringFilter"]=s)}if("undefined"!==typeof this.$route.query["sort"]){var r=decodeURIComponent(this.$route.query["sort"]).trim();""!==r&&(t["sort"]=r)}this.filter=t},getCategoryMinMax:function(){return this.categoryDetail&&this.categoryDetail.minMaxPrice?this.categoryDetail.minMaxPrice:null},getCategoryFilteredCount:function(){return this.filteredProductsCount&&this.filteredProductsCount>0?this.filteredProductsCount:0},getCategoryType:function(){return this.categoryDetail&&this.categoryDetail.type?this.categoryDetail.type:"products"},getCategoryBackground:function(){return this.categoryDetail&&this.categoryDetail.slug&&this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getImagePath("categories",this.$store.state.coredata,this.categoryDetail.slug,this.categoryDetail.slug+".jpg"):""}}}),Lt=Ft,Mt=(a("3a0c"),Object(g["a"])(Lt,lt,ct,!1,null,null,null)),qt=Mt.exports,Rt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.product?a("div",{staticClass:"container product-detail"},[t.userCanEdit&&t.parentCategoryDetail&&null!=t.parentCategoryDetail.pathSlug&&t.product.slug&&t.product._id?a("div",{staticClass:"edit-area"},[a("router-link",{staticClass:"editor-button edit-button",attrs:{to:{name:"productNewEdit",params:{category:t.parentCategoryDetail.pathSlug,slug:t.product.slug,id:t.product._id}}}},[a("font-awesome-icon",{attrs:{icon:"edit"}})],1)],1):t._e(),a("div",{staticClass:"columns reversed"},[a("div",{staticClass:"column is-7"},[a("div",{staticClass:"product-image-wrapper"},[a("img",{staticClass:"image-main",attrs:{src:t.getProductImagePath(t.product.orderCode),alt:t.product.name[t.$store.state.language.code],onerror:"this.src='/assets/_site/logo-product.svg'"}})])]),a("div",{staticClass:"column is-5 data-main"},[t.parentCategoryDetail?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[t.parentCategoryDetail.parentCategories?a("ul",[t._l(t.parentCategoryDetail.parentCategories,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.$store.state.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),a("li",[a("router-link",{attrs:{title:t.parentCategoryDetail.name[t.$store.state.language.code],to:{name:"categoryList",params:{category:t.parentCategoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.parentCategoryDetail.name[t.$store.state.language.code])+" ")])],1)],2):t._e()]):t._e(),t.product&&null!=t.product?a("div",[a("h1",{staticClass:"title is-1"},[t._v(t._s(t.product.name[t.$store.state.language.code]))]),a("div",{staticClass:"content"},[a("p",[a("span",{attrs:{translate:"yes"}},[t._v("Order Code")]),t._v(": "+t._s(t.product.orderCode))]),a("p",[a("span",{attrs:{translate:"yes"}},[t._v("In stock")]),t._v(" "+t._s(t.product&&t.product.stockAmount?t.product.stockAmount:0))]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-6"},[a("p",{staticClass:"detail-price is-size-2"},[t._v(" "+t._s(t.$store.state.numeral(t.product.price).format("0 0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]),t.product.tax&&t.product.tax>0?a("div",{staticClass:"detail-price is-size-8"},[a("span",{attrs:{translate:"yes"}},[t._v("Without Tax")]),t._v(" ("+t._s(100*t.product.tax)+"%): "+t._s(t.$store.state.numeral(t.product.price-t.product.price*t.product.tax).format("0 0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]):t._e()]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"columns"},["product"!=t.product.type&&"digital"!=t.product.subtype?a("div",{staticClass:"column is-3 product-detail-amount"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.toCartAmount,expression:"toCartAmount"}],staticClass:"input",attrs:{type:"number"},domProps:{value:t.toCartAmount},on:{input:function(e){e.target.composing||(t.toCartAmount=e.target.value)}}})]):t._e(),a("div",{staticClass:"column is-9"},[a("button",{staticClass:"button add-to-cart is-primary",attrs:{"data-id":t.product._id,disabled:t.checkIfBuyButtonEnabled(),"data-amount":t.toCartAmount},on:{click:function(e){return e.preventDefault(),t.addToCart(e)}}},[a("font-awesome-icon",{attrs:{icon:"cart-plus"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add to Cart")])],1)])])])])])]):t._e()])]),t.product&&null!=t.product?a("div",{staticClass:"columns product-descriptions reversed-desktop"},[a("div",{staticClass:"column is-5"},[a("h2",{staticClass:"subtitle"},[t._v(t._s(t.product.descriptionShort[t.$store.state.language.code]))]),t.product.data&&t.product.data.variations?a("div",[a("section",[a("b-collapse",{staticClass:"card",attrs:{"aria-id":"contentIdForA11y3",open:!1},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("div",{staticClass:"card-header",attrs:{role:"button","aria-controls":"contentIdForA11y3"}},[a("p",{staticClass:"card-header-title",attrs:{translate:"yes"}},[t._v(" Variations ")]),a("a",{staticClass:"card-header-icon"},[a("b-icon",{attrs:{icon:e.open?"angle-up":"angle-down"}})],1)])}}],null,!1,4060768951)},[a("div",{staticClass:"card-content"},t._l(t.product.data.variations,(function(e,s){return a("router-link",{key:e._id+s,staticClass:"content",attrs:{title:e.name[t.$store.state.language.code],to:{name:"productDetail",params:{category:e.categories[0],product:e._id,slug:e.slug}}}},[a("figure",{staticClass:"image is-32x32"},[a("img",{attrs:{src:t.getProductImagePath(e.orderCode),alt:e.name[t.$store.state.language.code]}})]),t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])})),1)])],1)]):t._e(),t.product&&t.product.data&&t.product.data.requirements&&t.product.data.requirements.inputs&&t.product.data.requirements.inputs.length>0?a("div",{staticClass:"product-requirements"},[t._m(0),t._l(t.product.data.requirements.inputs,(function(e,s){return a("div",{key:e.codename+s},[a("p",[t._v(t._s(e.description[t.$store.state.language.code]))]),a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v(t._s(e.name[t.$store.state.language.code]))]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.data.requirements.inputs[s].value,expression:"product.data.requirements.inputs[r].value"}],class:t.productReqInputsCheckClasses(s),attrs:{type:"text",placeholder:e.name[t.$store.state.language.code]},domProps:{value:t.product.data.requirements.inputs[s].value},on:{input:function(e){e.target.composing||t.$set(t.product.data.requirements.inputs[s],"value",e.target.value)}}})])])])}))],2):t._e()]),a("div",{staticClass:"column is-7"},[a("div",{staticClass:"productContent",domProps:{innerHTML:t._s(t.product.descriptionLong[t.$store.state.language.code])}})])]):t._e(),t.product&&null!=t.product&&t.product.properties?a("div",{staticClass:"columns product-properties bg-grey"},[a("div",{staticClass:"column is-12"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Properties")]),a("ul",t._l(t.product.properties,(function(e,s){return a("li",{key:s},[a("span",[t._v(t._s(t.getPropertyStrings(e,s).name)+": ")]),a("strong",[t._v(t._s(t.getPropertyStrings(e,s).value))])])})),0)])]):t._e(),a("slider-carousel",{attrs:{product:t.product,editable:!1}}),t.product&&null!=t.product&&t.product.data&&t.product.data.related&&t.product.data.related.productResults&&t.product.data.related.productResults.length>0&&t.$store&&t.$store.state&&t.$store.state.coredata?a("div",{staticClass:"columns product-related"},[a("div",{staticClass:"column is-12"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Related")]),a("div",{staticClass:"tile is-ancestor"},t._l(t.product.data.related.productResults,(function(e,s){return a("router-link",{key:e._id+s,staticClass:"tile is-parent is-3",attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"productDetail",params:{category:e.activeParentCategoryUrl,product:e._id,slug:e.slug}}}},[a("product-box",{attrs:{product:e}})],1)})),1)])]):t._e()],1):t._e()},Ut=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h3",{staticClass:"title is-3"},[a("span",{attrs:{translate:"yes"}},[t._v("Requirements")]),t._v(":")])}],jt=a("7618"),Vt=(a("7f7f"),a("7918")),zt={name:"ProductDetail",data:function(){return{product:null,parentCategoryDetail:null,language:"en",variationModel:null,toCartAmount:1}},components:{"slider-carousel":Vt["a"],"product-box":dt["a"]},created:function(){this.getProductDetail()},computed:{userCanEdit:function(){return!!(this.$store.state&&this.$store.state.user&&this.$store.state.user.logged&&this.$store.state.user.profile&&this.$store.state.user.profile.type&&"admin"==this.$store.state.user.profile.type)}},methods:{getProductDetail:function(){var t=this;this.$route.params&&this.$route.params.category&&""!=this.$route.params.category.toString().trim()&&this.$route.params.product&&""!=this.$route.params.product.toString().trim()&&this.$httpc.get("products/"+this.$route.params.category+"/detail/"+this.$route.params.product).then((function(e){e.data&&(e.data=t.checkProductTax(e.data),t.product=e.data,t.product.name&&t.$store.state&&void 0!==Object(jt["a"])(t.product.name[t.$store.state.language.code])&&(document.title=t.product.name[t.$store.state.language.code]+" - StretchShop"),console.log(e.data)),e.data.products&&(t.products=e.data.products),e.data.parentCategoryDetail&&(t.parentCategoryDetail=e.data.parentCategoryDetail)})).catch((function(t){console.log(t)})).then((function(){}))},addToCart:function(t){var e=this;if(t.currentTarget){var a=t.currentTarget.getAttribute("data-id"),s=parseInt(t.currentTarget.getAttribute("data-amount")),r=this.$el.querySelector(".product-detail img.image-main");this.$helpers.animateAddToCart(t.currentTarget,r),s||(s=1);var i={itemId:a,amount:s};if(this.product.data&&this.product.data.requirements&&this.product.data.requirements.inputs&&this.product.data.requirements.inputs.length>0){var n=[];this.product.data.requirements.inputs.some((function(t){n.push({codename:t.codename,value:t.value})})),n.length>0&&(i["requirements"]=n)}this.$httpc.put("cart",i).then((function(t){console.log(t),t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){console.log(t)})).then((function(){}))}},getProductImagePath:function(t){return this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getProductImagePath(this.$store.state.coredata,t):null},getProductGalleryImagePath:function(t,e){return this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getProductImagePath(this.$store.state.coredata,t,e):null},getPropertyStrings:function(t,e){if(t.constructor===Array)return{name:e,value:t.join(", ")};if(t.constructor===Object){if("undefined"!==typeof t["name"]&&"undefined"!==typeof t["value"]&&this.$store&&this.$store.state&&this.$store.state.language){var a=this.getPropertyNameResult(t),s=this.getPropertyValueResult(t,e);if(""!==a&&""!==s)return{name:a,value:s}}else if("undefined"!==typeof t["value"]&&this.$store&&this.$store.state&&this.$store.state.language){var r=e,i=this.getPropertyValueResult(t);if(""!==r&&""!==i)return{name:r,value:i}}return{name:e,value:t}}return{name:e,value:t}},getPropertyNameResult:function(t,e){return"undefined"!==typeof t["name"][this.$store.state.language.code]?t["name"][this.$store.state.language.code]:e["name"]},getPropertyValueResult:function(t){return"undefined"!==typeof t["value"][this.$store.state.language.code]?t["value"][this.$store.state.language.code].constructor===Array?t["value"][this.$store.state.language.code].join(", "):t["value"][this.$store.state.language.code]:t["value"]},checkProductTax:function(t){return!t||!t.taxData||t.tax&&null!=t.tax||(taxSettings=t.taxData?t.taxData:this.$store.state.coredata.settings,t=this.$helpers.checkProductTax(t,t.taxData)),t},productReqInputsCheckClasses:function(t){var e="input is-size-5 has-text-weight-normal has-text-centered";return this.product.data.requirements.inputs[t].value&&this.product.data.requirements.inputs[t].value.length>2&&""!=this.product.data.requirements.inputs[t].value.trim()?e+=" is-success":e+=" is-danger",e},checkIfBuyButtonEnabled:function(){if(this.product&&this.product.data&&this.product.data.requirements&&this.product.data.requirements.inputs&&this.product.data.requirements.inputs.length){var t=!1;if(this.product.data.requirements.inputs.some((function(e){if(e&&e.value&&null!=e.value)return t=!0,!0})),t)return!1}return!0}}},Gt=zt,Bt=(a("6f35"),Object(g["a"])(Gt,Rt,Ut,!1,null,null,null)),Ht=Bt.exports,Wt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"order-step-1 cart-detail",attrs:{id:"orderCart"}},[a("div",{staticClass:"container"},[t.orderStateNumber<4?a("div",{staticClass:"columns"},[t._m(0)]):t._e()]),a("div",{staticClass:"container"},[t.orderStateNumber<4?a("div",{staticClass:"columns is-variable is-centered orderProgressVisual"},[a("div",{staticClass:"column is-8"},[a("div",{staticClass:"b-steps"},[a("nav",{staticClass:"steps is-rounded"},[a("ul",{staticClass:"step-items"},[a("li",{class:t.getActiveStateClasses(1)},[a("a",{class:t.getClickableStateClasses(1),on:{click:function(e){return t.setViewCoponentId(1,e)}}},[a("div",{staticClass:"step-marker"}),t._m(1)])]),a("li",{class:t.getActiveStateClasses(2)},[a("a",{class:t.getClickableStateClasses(2),on:{click:function(e){return t.setViewCoponentId(2,e)}}},[a("div",{staticClass:"step-marker"}),t._m(2)])]),a("li",{class:t.getActiveStateClasses(3)},[a("a",{class:t.getClickableStateClasses(3),on:{click:function(e){return t.setViewCoponentId(3,e)}}},[a("div",{staticClass:"step-marker"}),t._m(3)])])])])])])]):t._e()]),a("div",{staticClass:"container"},[a("div",{staticClass:"columns is-variable"},[t.orderStateNumber<4?a("div",{staticClass:"column is-6"},[null!=t.$store.state.cart&&t.$store.state.cart.items&&t.$store.state.cart.items.length>0?a("div",[a("div",{staticClass:"columns is-variable"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"b-table"},[a("div",{staticClass:"table-wrapper"},[a("table",{staticClass:"table is-hoverable is-striped is-fullwidth"},[t._m(4),a("tbody",t._l(t.$store.state.cart.items,(function(e,s){return a("tr",{key:s},[a("th",[a("router-link",{attrs:{to:{name:"productDetail",params:{category:e.categories[0],product:e._id,slug:e.slug}}}},[a("img",{attrs:{src:t.getProductImagePath(e.orderCode),alt:e.name[t.$store.state.language.code],onerror:"this.src='/assets/_site/logo-product.svg'"}}),t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1),a("td",{staticClass:"cartItemAmount has-text-right"},["product"!=e.type||"digital"!=e.subtype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.itemAmount[e._id],expression:"itemAmount[item._id]"}],staticClass:"input",attrs:{type:"number",run:!!t.itemAmount[e._id]||(t.itemAmount[e._id]=e.amount)},domProps:{value:t.itemAmount[e._id]},on:{change:function(a){return t.updateCartItemAmount(e._id)},input:function(a){a.target.composing||t.$set(t.itemAmount,e._id,a.target.value)}}}):t._e(),"product"==e.type&&"digital"==e.subtype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.itemAmount[e._id],expression:"itemAmount[item._id]"}],staticClass:"input",attrs:{type:"number",disabled:"disabled",run:!!t.itemAmount[e._id]||(t.itemAmount[e._id]=e.amount)},domProps:{value:t.itemAmount[e._id]},on:{input:function(a){a.target.composing||t.$set(t.itemAmount,e._id,a.target.value)}}}):t._e()]),a("td",{staticClass:"has-text-right"},[a("span",[t._v(t._s(t.$store.state.numeral(e.price).format("0.00")))]),a("span",[t._v(t._s(t.$store.state.currency.symbol))])]),a("td",{staticClass:"has-text-right"},[a("a",{on:{click:function(a){return t.clearCart(e._id)}}},[a("font-awesome-icon",{attrs:{icon:"trash"}})],1)])])})),0),a("tfoot",[t.$store.state.cart&&t.$store.state.cart.priceTotal?a("tr",{attrs:{id:"cart__products-total"}},[a("td"),t._m(5),a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.cart.priceTotal).format("0.00"))+" "+t._s(t.$store.state.currency.symbol))])]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceItemsNoTax?a("tr",{attrs:{id:"cart__products-notax"}},[a("td"),t._m(6),a("td",{staticClass:"has-text-right"},[t._v(" "+t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceItemsNoTax).format("0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceDelivery?a("tr",{attrs:{id:"order__delivery"}},[a("td"),t._m(7),a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceDelivery).format("0.00"))+" "+t._s(t.$store.state.currency.symbol))])]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.pricePayment?a("tr",{attrs:{id:"order__payment"}},[a("td"),t._m(8),a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.order.order.prices.pricePayment).format("0.00"))+" "+t._s(t.$store.state.currency.symbol))])]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceTaxTotal?a("tr",{attrs:{id:"cart__tax"}},[a("td"),t._m(9),a("td",{staticClass:"has-text-right"},[t._v(" "+t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceTaxTotal).format("0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceTotal?a("tr",[a("td"),t._m(10),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceTotal?a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceTotal).format("0.00")))]),t._v(" "+t._s(t.$store.state.currency.symbol)+" ")]):t.$store.state.cart&&null!=t.$store.state.cart.priceTotal?a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.cart.priceTotal).format("0.00")))]),t._v(" "+t._s(t.$store.state.currency.symbol)+" ")]):t._e(),a("td")]):t._e()])])])])])]),a("div",{staticClass:"columns is-variable"},[a("div",{staticClass:"column is-12"},[a("button",{staticClass:"button is-danger",on:{click:function(e){return t.clearCart()}}},[a("font-awesome-icon",{attrs:{icon:"trash"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Clear Cart")])],1)])])]):a("div",[t._m(11)])]):t._e(),a("div",{staticClass:"column is-6"},[a(t.orderStateComponent,{tag:"component"})],1)])])])},Yt=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1",attrs:{translate:"yes"}},[t._v("Cart")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"step-details"},[a("span",{staticClass:"step-title",attrs:{translate:"yes"}},[t._v("User")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"step-details"},[a("span",{staticClass:"step-title",attrs:{translate:"yes"}},[t._v("Delivery & Payment")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"step-details"},[a("span",{staticClass:"step-title",attrs:{translate:"yes"}},[t._v("Summary")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("thead",[a("tr",[a("th",{},[a("div",{staticClass:"th-wrap",attrs:{translate:"yes"}},[t._v("Name")])]),a("th",{},[a("div",{staticClass:"th-wrap is-pulled-right",attrs:{translate:"yes"}},[t._v("Qty")])]),a("th",{},[a("div",{staticClass:"th-wrap is-pulled-right",attrs:{translate:"yes"}},[t._v("Price/pcs")])]),a("th",{})])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("strong",{attrs:{translate:"yes"}},[t._v("Products Total")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("span",{attrs:{translate:"yes"}},[t._v("Products Without Tax")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("strong",{attrs:{translate:"yes"}},[t._v("Price delivery")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("strong",{attrs:{translate:"yes"}},[t._v("Price payment")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("span",{attrs:{translate:"yes"}},[t._v("Tax total")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("strong",{attrs:{translate:"yes"}},[t._v("Total price")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h3",{staticClass:"title is-3"},[a("span",{attrs:{translate:"yes"}},[t._v("Your cart is empty")])])}],Kt=(a("6762"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"orderUser"}},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Your Address")]),a("form",{on:{submit:function(e){return e.preventDefault(),t.updateUserData(e)}}},[t.$store.state.user.logged&&!0===t.$store.state.user.logged?a("div",[a("span",{attrs:{translate:"yes"}},[t._v("Logged in as")]),t._v(" "),t.user.username?a("span",[t._v(t._s(t.user.username))]):t.user.email?a("span",[t._v(t._s(t.user.email)+" "),a("br"),a("span",{attrs:{translate:"yes"}},[t._v("Please check your email to verify your email")])]):t._e()]):a("div",[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[a("span",{attrs:{translate:"yes"}},[t._v("Already registered?")]),a("router-link",{attrs:{to:{name:"login"},tag:"a","active-class":"is-active",translate:"yes"}},[t._v("Log in")])],1)]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6",attrs:{id:"cart-user-email"}},[a("div",{staticClass:"field email"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Email")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newUserEmail,expression:"newUserEmail"}],staticClass:"input",attrs:{type:"email",translate:"yes",placeholder:"Email"},domProps:{value:t.newUserEmail},on:{input:function(e){e.target.composing||(t.newUserEmail=e.target.value)}}})]),t._m(0)])]),a("div",{staticClass:"column is-6",attrs:{id:"cart-user-email2"}},[a("div",{staticClass:"field email2"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Email Confirm")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newUserEmail2,expression:"newUserEmail2"}],staticClass:"input",attrs:{type:"email",translate:"yes",placeholder:"Email Confirm"},domProps:{value:t.newUserEmail2},on:{input:function(e){e.target.composing||(t.newUserEmail2=e.target.value)}}})]),t._m(1)])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6",attrs:{id:"cart-user-password"}},[a("div",{staticClass:"field password"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Password")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newUserPassword,expression:"newUserPassword"}],staticClass:"input",attrs:{type:"password",translate:"yes",placeholder:"Password"},domProps:{value:t.newUserPassword},on:{input:function(e){e.target.composing||(t.newUserPassword=e.target.value)}}})]),t._m(2)])]),a("div",{staticClass:"column is-6",attrs:{id:"cart-user-password2"}},[a("div",{staticClass:"field password2"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Password Confirm")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newUserPassword2,expression:"newUserPassword2"}],staticClass:"input",attrs:{type:"password",translate:"yes",placeholder:"Password Confirm"},domProps:{value:t.newUserPassword2},on:{input:function(e){e.target.composing||(t.newUserPassword2=e.target.value)}}})]),t._m(3)])])]),t._m(4)]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6",attrs:{id:"cart-user-name-first"}},[a("div",{staticClass:"field nameFirst"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("First Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.nameFirst,expression:"user.addressInvoice.nameFirst"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"First Name"},domProps:{value:t.user.addressInvoice.nameFirst},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"nameFirst",e.target.value)}}})]),t._m(5)])]),a("div",{staticClass:"column is-6",attrs:{id:"cart-user-name-last"}},[a("div",{staticClass:"field nameLast"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Last Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.nameLast,expression:"user.addressInvoice.nameLast"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Last Name"},domProps:{value:t.user.addressInvoice.nameLast},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"nameLast",e.target.value)}}})]),t._m(6)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12",attrs:{id:"cart-user-street"}},[a("div",{staticClass:"field street"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Street")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.street,expression:"user.addressInvoice.street"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Street"},domProps:{value:t.user.addressInvoice.street},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"street",e.target.value)}}})]),t._m(7)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12",attrs:{id:"cart-user-street2"}},[a("div",{staticClass:"field street2"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Street 2")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.street2,expression:"user.addressInvoice.street2"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Street 2"},domProps:{value:t.user.addressInvoice.street2},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"street2",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-4",attrs:{id:"cart-user-zip"}},[a("div",{staticClass:"field zip"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("ZIP")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.zip,expression:"user.addressInvoice.zip"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"ZIP"},domProps:{value:t.user.addressInvoice.zip},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"zip",e.target.value)}}})]),t._m(8)])]),a("div",{staticClass:"column is-8",attrs:{id:"cart-user-city"}},[a("div",{staticClass:"field city"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("City")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.city,expression:"user.addressInvoice.city"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"City"},domProps:{value:t.user.addressInvoice.city},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"city",e.target.value)}}})]),t._m(9)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6",attrs:{id:"cart-user-state"}},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("State")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.state,expression:"user.addressInvoice.state"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"State"},domProps:{value:t.user.addressInvoice.state},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"state",e.target.value)}}})])])]),a("div",{staticClass:"column is-6",attrs:{id:"cart-user-country"}},[a("div",{staticClass:"field country"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Country")]),a("div",{staticClass:"control select"},[t.$store.state.coredata&&t.$store.state.coredata.countries?a("select",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.country,expression:"user.addressInvoice.country"}],on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.user.addressInvoice,"country",e.target.multiple?a:a[0])}}},t._l(t.$store.state.coredata.countries,(function(e){return a("option",{key:e.code,domProps:{value:e.code}},[t._v(" "+t._s(e.name)+" ")])})),0):t._e()]),t._m(10)])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field phone"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Phone")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.phone,expression:"user.addressInvoice.phone"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Phone"},domProps:{value:t.user.addressInvoice.phone},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"phone",e.target.value)}}})]),t._m(11)])])]),a("hr"),t.user.company?a("div",{staticClass:"simple-wrapper"},[a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field companyName"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Company Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.company.name,expression:"user.company.name"}],staticClass:"input",attrs:{type:"text",placeholder:"Company Name"},domProps:{value:t.user.company.name},on:{input:function(e){e.target.composing||t.$set(t.user.company,"name",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyOrgId"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Organisation ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.company.orgId,expression:"user.company.orgId"}],staticClass:"input",attrs:{type:"text",placeholder:"Organisation ID"},domProps:{value:t.user.company.orgId},on:{input:function(e){e.target.composing||t.$set(t.user.company,"orgId",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyTaxId"},[a("label",{staticClass:"label"},[t._v("Company Tax ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.company.taxId,expression:"user.company.taxId"}],staticClass:"input",attrs:{type:"text",placeholder:"Company Tax ID"},domProps:{value:t.user.company.taxId},on:{input:function(e){e.target.composing||t.$set(t.user.company,"taxId",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyTaxVatId"},[a("label",{staticClass:"label"},[t._v("Company VAT ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.company.taxVatId,expression:"user.company.taxVatId"}],staticClass:"input",attrs:{type:"text",placeholder:"Company VAT ID"},domProps:{value:t.user.company.taxVatId},on:{input:function(e){e.target.composing||t.$set(t.user.company,"taxVatId",e.target.value)}}})])])])])]):t._e(),a("button",{staticClass:"button is-success",attrs:{type:"submit"}},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Set user order data")])],1)])])}),Jt=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"exists",translate:"yes"}},[t._v("This email already exists")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not confirmed",translate:"yes"}},[t._v("Values do not match")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not confirmed",translate:"yes"}},[t._v("Values do not match")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[a("hr")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])}],Zt=(a("8e6e"),a("bd86"));function Qt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function Xt(t){for(var e=1;e0){var s={fields:[],errors:[]};console.log("responseResult",s),this.$parent.orderParams.errors.userErrors.forEach((function(t){s.fields.push(t.value),s.errors.push({name:t.value,action:t.desc})})),this.$helpers.formUndecorateAndDecorateFields(s.fields,s.errors),this.$scrollTo(this.$el.querySelector(".field."+s.fields[0]),500,{offset:-100})}}}}},ee=te,ae=(a("b41b"),Object(g["a"])(ee,Kt,Jt,!1,null,null,null)),se=ae.exports,re=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"orderDeliveryPayment",attrs:{id:"orderDeliveryPayment"}},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Delivery Payment")]),a("form",{on:{submit:function(e){return e.preventDefault(),t.updateDeliveryPaymentData(e)}}},[a("div",[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Delivery")]),t.$store.state.order.order.settings.deliveryMethodsTypes&&Object.keys(t.$store.state.order.order.settings.deliveryMethodsTypes).length>0?a("div",{staticClass:"deliveryType optionControlList"},[t._l(Object.keys(t.$store.state.order.order.settings.deliveryMethodsTypes),(function(e,s){return a("div",{key:s,staticClass:"control"},[t.$store.state.cart&&t.$store.state.cart.cartItemTypology&&t.$store.state.cart.cartItemTypology.subtypes.indexOf(e)>-1?a("div",[a("h4",{staticClass:"title is-4 has-text-left"},[a("span",[t._v(t._s(e))]),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("goods")])]),t._l(t.$store.state.order.order.settings.deliveryMethodsTypes[e],(function(s,r){return a("div",{key:r,staticClass:"field"},[a("label",{staticClass:"b-radio radio radio-button"},[a("input",{attrs:{type:"radio",name:"type-"+e},domProps:{value:s.codename,checked:t.$parent.orderParams.order.data.deliveryData&&t.$parent.orderParams.order.data.deliveryData.codename[e]&&t.$parent.orderParams.order.data.deliveryData.codename[e].value==s.codename},on:{click:function(a){return t.setDelivery(e,s.codename)}}}),a("span",{staticClass:"check"}),a("span",{staticClass:"control-label"},[t._v(" "+t._s(s.name[t.$store.state.language.code])+" ("+t._s(s.prices[0].price)+" "+t._s(t.$store.state.currency.symbol)+") ")])])])}))],2):t._e()])})),t._m(0)],2):t._e()]),t.$store.state.cart&&t.$store.state.cart.cartItemTypology&&t.$store.state.cart.cartItemTypology.subtypes.indexOf("physical")>-1?a("div",{staticClass:"deliveryAddressBlock"},[a("section",[a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field has-text-centered"},[a("label",{staticClass:"switch is-rounded"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.showDeliveryAddress,expression:"showDeliveryAddress"}],staticClass:"checkbox",attrs:{type:"checkbox","true-value":"true",value:"false"},domProps:{checked:Array.isArray(t.showDeliveryAddress)?t._i(t.showDeliveryAddress,"false")>-1:t._q(t.showDeliveryAddress,"true")},on:{change:function(e){var a=t.showDeliveryAddress,s=e.target,r=!!s.checked&&"true";if(Array.isArray(a)){var i="false",n=t._i(a,i);s.checked?n<0&&(t.showDeliveryAddress=a.concat([i])):n>-1&&(t.showDeliveryAddress=a.slice(0,n).concat(a.slice(n+1)))}else t.showDeliveryAddress=r}}}),a("span",{staticClass:"check"}),a("span",{staticClass:"control-label",attrs:{translate:"yes"}},[t._v("Use custom delivery address")])])])])])]),a("section",[t.showDeliveryAddress?a("div",{staticClass:"deliveryAddressWrapper is-clearfix"},[t.$store.state.user.profile.addressesDelivery&&t.$store.state.user.profile.addressesDelivery.length>0?a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field for-select"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Previously used addresses:")]),a("div",{staticClass:"control has-text-centered"},[a("span",{staticClass:"select is-empty"},[a("select",{staticClass:"select",on:{change:t.fillWithSelectedDeliveryAddress}},[a("option",{attrs:{value:"",translate:"yes"}},[t._v("Please select")]),t._l(t.$store.state.user.profile.addressesDelivery,(function(e,s){return a("option",{key:s,domProps:{value:s}},[t._v(" "+t._s(e.street)+", "+t._s(e.zip)+" ")])}))],2)])])])])]):t._e(),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field nameFirst"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("First Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.nameFirst,expression:"deliveryAddress.nameFirst"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"First Name"},domProps:{value:t.deliveryAddress.nameFirst},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"nameFirst",e.target.value)}}})]),t._m(1)])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field nameLast"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Last Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.nameLast,expression:"deliveryAddress.nameLast"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Last Name"},domProps:{value:t.deliveryAddress.nameLast},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"nameLast",e.target.value)}}})]),t._m(2)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field street"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Street")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.street,expression:"deliveryAddress.street"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Street"},domProps:{value:t.deliveryAddress.street},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"street",e.target.value)}}})]),t._m(3)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Street 2")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.street2,expression:"deliveryAddress.street2"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Street 2"},domProps:{value:t.deliveryAddress.street2},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"street2",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-4"},[a("div",{staticClass:"field zip"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("ZIP")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.zip,expression:"deliveryAddress.zip"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"ZIP"},domProps:{value:t.deliveryAddress.zip},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"zip",e.target.value)}}})]),t._m(4)])]),a("div",{staticClass:"column is-8"},[a("div",{staticClass:"field city"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("City")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.city,expression:"deliveryAddress.city"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"City"},domProps:{value:t.deliveryAddress.city},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"city",e.target.value)}}})]),t._m(5)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("State")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.state,expression:"deliveryAddress.state"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"State"},domProps:{value:t.deliveryAddress.state},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"state",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field country"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Country")]),a("div",{staticClass:"control select"},[t.$store.state.coredata&&t.$store.state.coredata.countries?a("select",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.country,expression:"deliveryAddress.country"}],on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.deliveryAddress,"country",e.target.multiple?a:a[0])}}},t._l(t.$store.state.coredata.countries,(function(e){return a("option",{key:e.code,domProps:{value:e.code}},[t._v(" "+t._s(e.name)+" ")])})),0):t._e()]),t._m(6)])])]),a("div",{staticClass:"columns is-variable is-1 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field phone"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Phone")]),a("div",{staticClass:"control is-clearfix"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.phone,expression:"deliveryAddress.phone"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Phone"},domProps:{value:t.deliveryAddress.phone},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"phone",e.target.value)}}})]),t._m(7)])])])]):t._e()])]):t._e(),a("div",[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Payment")]),t.$store.state.order.order.settings.paymentMethods&&Object.keys(t.$store.state.order.order.settings.paymentMethods).length>0?a("div",{staticClass:"paymentType optionControlList"},[t._l(t.$store.state.order.order.settings.paymentMethods,(function(e,s){return a("div",{key:s,staticClass:"field"},[a("div",{staticClass:"control"},[t.checkUsePaymentType(e)?a("div",{class:"payment-"+e.codename},[a("label",{staticClass:"b-radio radio"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.paymentData,expression:"paymentData"}],attrs:{type:"radio",name:"paymentType"},domProps:{value:e.codename,checked:t._q(t.paymentData,e.codename)},on:{change:function(a){t.paymentData=e.codename}}}),a("span",{staticClass:"check"}),a("span",{staticClass:"control-label"},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ("+t._s(t.getPaymentPrice(e))+" "+t._s(t.$store.state.currency.symbol)+") ")])])]):t._e()])])})),t._m(8)],2):t._e()]),t.$store.state.cart&&t.$store.state.cart.cartItemTypology&&t.$store.state.cart.cartItemTypology.types.indexOf("subscription")>-1?a("div",{staticClass:"subscriptionBlock"},[a("label",[a("span",{attrs:{translate:"yes"}},[t._v("Renew my subscription")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.renewSubscription,expression:"renewSubscription"}],staticClass:"checkbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.renewSubscription)?t._i(t.renewSubscription,null)>-1:t.renewSubscription},on:{change:function(e){var a=t.renewSubscription,s=e.target,r=!!s.checked;if(Array.isArray(a)){var i=null,n=t._i(a,i);s.checked?n<0&&(t.renewSubscription=a.concat([i])):n>-1&&(t.renewSubscription=a.slice(0,n).concat(a.slice(n+1)))}else t.renewSubscription=r}}})])]):t._e(),a("button",{staticClass:"button is-success"},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Set delivery and payment")])],1)])])},ie=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages"},[a("p",{staticClass:"form-message has-text-danger has-text-left is-hidden",attrs:{"data-message":"is empty"}},[a("span",{staticClass:"icon has-text-danger is-pulled-left"},[a("i",{staticClass:"fa fa-exclamation-circle"})]),a("span",{attrs:{translate:"yes"}},[t._v("Please select value")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages"},[a("p",{staticClass:"form-message has-text-danger has-text-left is-hidden",attrs:{"data-message":"is empty"}},[a("span",{staticClass:"icon has-text-danger is-pulled-left"},[a("i",{staticClass:"fa fa-exclamation-circle"})]),a("span",{attrs:{translate:"yes"}},[t._v("Please select value")])])])}],ne=void 0,oe={name:"OrderDeliveryPayment",data:function(){return{deliveryData:{physical:null,digital:null},paymentData:null,showDeliveryAddress:!1,renewSubscription:!1,deliveryAddress:{type:"delivery",nameFirst:"",nameLast:"",street:"",street2:"",zip:"",city:"",state:"",country:"",phone:""}}},computed:{},created:function(){this.$parent&&this.$parent.orderParams&&(this.$parent.orderParams.order.data&&(this.$parent.orderParams.order.data.deliveryData&&this.$parent.orderParams.order.data.deliveryData.codename&&(this.deliveryData=this.$parent.orderParams.order.data.deliveryData.codename),this.$parent.orderParams.order.data.paymentData&&this.$parent.orderParams.order.data.paymentData.codename&&(this.paymentData=this.$parent.orderParams.order.data.paymentData.codename)),this.$parent.orderParams.order.addresses&&this.$parent.orderParams.order.addresses.deliveryAddress&&(this.deliveryAddress=this.$parent.orderParams.order.addresses.deliveryAddress,this.showDeliveryAddress=!0))},mounted:function(){Qe.$emit("translateContent",this.$store.getters.getTranslates)},methods:{updateDeliveryPaymentData:function(){var t=!1,e=this.$el.querySelector(".deliveryType .form-messages .form-message[data-message='is empty']"),a=this.$el.querySelector(".paymentType .form-messages .form-message[data-message='is empty']");if(e&&e.classList.add("is-hidden"),a&&a.classList.add("is-hidden"),this.showDeliveryAddress){this.$parent.orderParams.order.addresses||(this.$parent.orderParams.order.addresses={}),this.$parent.orderParams.order.addresses.deliveryAddress||(this.$parent.orderParams.order.addresses.deliveryAddress=[]);var s=this.$helpers.propertiesRequiredConfirm(this.deliveryAddress,["nameFirst","nameLast","street","zip","city","country","phone"],[]);s.result?this.$parent.orderParams.order.addresses.deliveryAddress=this.deliveryAddress:(this.$helpers.formUndecorateAndDecorateFields(s.fields,s.errors),t=!0)}else this.$parent.orderParams.order.addresses&&this.$parent.orderParams.order.addresses.deliveryAddress&&(this.$parent.orderParams.order.addresses.deliveryAddress=null);this.$parent.orderParams.order.data||(this.$parent.orderParams.order.data={}),!this.deliveryData||"undefined"===typeof this.deliveryData.physical||"undefined"===typeof this.deliveryData.digital||null==this.deliveryData.physical&&null==this.deliveryData.digital?(console.log(this.deliveryData,this.deliveryData.physical,this.deliveryData.digital,null!=this.deliveryData.physical||null!=this.deliveryData.digital),t=!0,console.log("missing deliveryData"),e&&e.classList.remove("is-hidden")):(this.$parent.orderParams.order.data.deliveryData||(this.$parent.orderParams.order.data.deliveryData={codename:null}),this.$parent.orderParams.order.data.deliveryData.codename=this.deliveryData),this.paymentData&&null!=this.paymentData?(this.$parent.orderParams.order.data.paymentData||(this.$parent.orderParams.order.data.paymentData={codename:null}),this.$parent.orderParams.order.data.paymentData.codename=this.paymentData):(t=!0,console.log("missing paymentData"),a&&a.classList.remove("is-hidden")),t||this.$parent.updateOrder()},checkIfDeliveryAddressExists:function(){if(!ne.$parent.orderParams.order.addresses.deliveryAddress&&ne.$parent.orderParams.order.addresses.deliveryAddress.length>0){var t=JSON.stringify(deliveryAddress);ne.$parent.orderParams.order.addresses.deliveryAddress.forEach((function(e){var a=JSON.stringify(e);if(a==t)return!0}))}return!1},fillWithSelectedDeliveryAddress:function(t){t.target.value&&""!=t.target.value&&t.target.value>-1&&(this.deliveryAddress=this.$store.state.user.profile.addressesDelivery[t.target.value])},getPaymentPrice:function(t){if(t&&t.prices&&this.$store.state&&this.$store.state.cart&&this.$store.state.cart.priceTotal)for(var e=0;e=t.prices[e].range.from&&this.$store.state.cart.priceTotal<=t.prices[e].range.to)return t.prices[e].price;return 0},setDelivery:function(t,e){this.deliveryData[t]=e},checkUsePaymentType:function(t){return!!(this.$store.state.cart&&this.$store.state.cart.cartItemTypology&&("undefined"===typeof t.type||this.$store.state.cart.cartItemTypology.subtypes.length>1&&-1==this.$store.state.cart.cartItemTypology.subtypes.indexOf(t.type)))}}},le=oe,ce=(a("4b7e"),Object(g["a"])(le,re,ie,!1,null,null,null)),de=ce.exports,ue=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"summary"}},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Order summary")]),a("form",{on:{submit:function(e){return e.preventDefault(),t.submitOrder(e)}}},[a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-5",attrs:{translate:"yes"}},[t._v("You are ordering to:")]),a("div",{staticClass:"summary-block with-pre-whitespace"},[t._v(t._s(t.invoiceAddress()))])]),t.checkDeliveryAddress()?a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-5",attrs:{translate:"yes"}},[t._v("With delivery to:")]),a("div",{staticClass:"summary-block with-pre-whitespace"},[t._v(t._s(t.deliveryAddress()))])]):a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-5",attrs:{translate:"yes"}},[t._v("With delivery to:")]),a("div",{staticClass:"summary-block",attrs:{translate:"yes"}},[t._v("same as invoice address")])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-5",attrs:{translate:"yes"}},[t._v("Your Delivery settings:")]),t.checkDeliveryData()?a("div",{staticClass:"content summary-block"},t._l(t.deliveryData(),(function(e,s){return a("div",{key:s},[a("p",[a("span",{staticClass:"capitalize"},[t._v(t._s(e.type))]),t._v(" - "),a("strong",[t._v(t._s(e.name))]),t._v(": "+t._s(t.$store.state.numeral(e.price).format("0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")])])})),0):t._e()]),t.checkPaymentData()?a("div",{staticClass:"column is-6"},[a("div",[a("h3",{staticClass:"title is-5"},[t._v("Your Payment settings:")]),t.paymentData()?a("div",{staticClass:"content summary-block"},[a("p",[a("strong",[t._v(t._s(t.paymentData().name))]),t._v(": "+t._s(t.$store.state.numeral(t.paymentData().price).format("0.00"))+" "+t._s(t.$store.state.currency.symbol))])]):t._e()])]):t._e()]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field has-text-centered"},[a("h3",{staticClass:"title is-5"},[a("span",{attrs:{translate:"yes"}},[t._v("Total price")]),t._v(": "),a("span",[t._v(" "+t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceTotal).format("0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")])])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field confirm has-text-centered"},[a("label",{staticClass:"b-checkbox checkbox"},[a("input",{attrs:{type:"checkbox"},on:{click:function(e){return t.setConfirmationDate(e)}}}),a("span",{staticClass:"check is-success"}),t._m(0)]),t._m(1)])])]),a("button",{staticClass:"button is-success"},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Submit order")])],1)])])},me=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",[a("span",{staticClass:"control-label",attrs:{translate:"yes"}},[t._v("I agree to the")]),t._v(" "),a("a",{attrs:{href:"#",translate:"yes"}},[t._v("terms and conditions")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"unconfirmed",translate:"yes"}},[t._v("Check this to enable sending order")])])}],pe={name:"OrderDeliveryPayment",data:function(){return{userConfirmation:null}},computed:{},mounted:function(){Qe.$emit("translateContent",this.$store.getters.getTranslates)},methods:{submitOrder:function(){var t=this.$el.querySelector("#summary .field.confirm .check");t.classList.remove("is-danger"),t&&t.parentElement.querySelector(".control-label").classList.add("has-text-danger"),this.userConfirmation?(this.$parent.orderParams.order.dates.userConfirmation=this.userConfirmation,this.$parent.updateOrder()):(this.$helpers.formUndecorateAndDecorateFields(["confirm"],[{name:"confirm",action:"unconfirmed"}]),t.classList.remove("is-success"),t.classList.remove("is-dang"),t.classList.add("is-danger"),t&&t.parentElement.querySelector(".control-label").classList.add("has-text-danger"))},setConfirmationDate:function(t){if(t.target.checked){var e=new Date;this.userConfirmation=e.getTime()}},checkDeliveryAddress:function(){return!!(this.$parent.orderParams&&this.$parent.orderParams.order&&this.$parent.orderParams.order.addresses&&this.$parent.orderParams.order.addresses.deliveryAddress&&Object.keys(this.$parent.orderParams.order.addresses.deliveryAddress).length>0)},invoiceAddress:function(){if(this.$store.state.coredata)return this.$helpers.addressToString(this.$parent.orderParams.order.addresses.invoiceAddress,this.$store.state.coredata.countries,["type"])},deliveryAddress:function(){return this.$parent.orderParams.order.addresses.deliveryAddress?this.$helpers.addressToString(this.$parent.orderParams.order.addresses.deliveryAddress,this.$store.state.coredata.countries,["type"]):null},checkDeliveryData:function(){return!!(this.$parent.orderParams.order&&this.$parent.orderParams.order.data.deliveryData&&this.$parent.orderParams.order.data.deliveryData.codename)},deliveryData:function(){var t=this,e=[];if(this.$parent.orderParams.order&&this.$parent.orderParams.order.data.deliveryData&&this.$parent.orderParams.order.data.deliveryData.codename){var a=this.$parent.orderParams.order.data.deliveryData.codename,s=this.$parent.orderParams.order.settings.deliveryMethodsTypes;return Object.keys(a).forEach((function(r){if(a&&s&&a[r]&&null!=a[r]){var i=a[r];i["type"]=r,i["name"]=i.value,s[r]&&s[r].forEach((function(e){e.type&&e.codename&&e.type==r&&e.codename==i["value"]&&(i["name"]=e.name[t.$store.getters.getLanguage])})),e.push(i)}})),e}},checkPaymentData:function(){return!!(this.$parent.orderParams&&this.$parent.orderParams.order&&this.$parent.orderParams.order.data.paymentData)},paymentData:function(){var t=this,e=null;if(this.$parent.orderParams&&this.$parent.orderParams.order&&this.$parent.orderParams.order.data.paymentData){var a="undefined"!==typeof this.$parent.orderParams.order.data.paymentData.name[t.$store.getters.getLanguage]?this.$parent.orderParams.order.data.paymentData.name[t.$store.getters.getLanguage]:this.$parent.orderParams.order.data.paymentData.codename;e={name:a,price:this.$parent.orderParams.order.data.paymentData.price}}return e}}},ge=pe,ve=(a("9e2b"),Object(g["a"])(ge,ue,me,!1,null,null,null)),he=ve.exports,fe=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("h1",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Order Finished")]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("p",[a("span",{attrs:{translate:"yes"}},[t._v("Thank you for your order. ID of your order is")]),t._v(" "),a("strong",[t._v(t._s(t.getOrderId()))]),t._v(", "),a("span",{attrs:{translate:"yes"}},[t._v("we've sent you email about it.")])]),t.isOrderPaymentCodename("online_paypal_paypal")?a("div",[a("b-loading",{attrs:{"is-full-page":!1,active:t.isLoading,"can-cancel":!1},on:{"update:active":function(e){t.isLoading=e}}}),a("p",{attrs:{translate:"yes"}},[t._v("You are being redicted to PayPal, please wait.")])],1):t._e()])])])},ye=[],Ce={name:"OrderFinished",data:function(){return{isLoading:!0,orderId:null}},mounted:function(){this.$parent.orderParams&&this.$parent.orderParams.order&&(this.orderId=this.$parent.orderParams.order._id,this.$parent.orderParams.order.data.paymentData.codename.indexOf("online_paypal")>-1&&this.paymentPayPalCall(),"cod"==this.$parent.orderParams.order.data.paymentData.codename&&this.clearFinishedOrder())},computed:{},methods:{isOrderPaymentCodename:function(t){return!!(this.$parent&&this.$parent.orderParams&&this.$parent.orderParams.order&&this.$parent.orderParams.order.data&&this.$parent.orderParams.order.data.paymentData&&this.$parent.orderParams.order.data.paymentData.codename&&this.$parent.orderParams.order.data.paymentData.codename==t)},getOrderId:function(){return this.orderId},paymentPayPalCall:function(){var t=this;t.$httpc.post("/order/paypalcheckout",{orderId:t.$parent.orderParams.order._id,checkoutData:null},{timeout:5e3}).then((function(e){e&&e.data&&e.data.url&&""!=e.data.url.trim()&&(t.clearFinishedOrder(),window.location.href=e.data.url)}))},clearFinishedOrder:function(){var t=this;setTimeout((function(){t.$parent.orderParams={},t.$store.dispatch("setOrder",null),t.$store.state.user&&null==t.$store.state.user.profile&&1==t.$store.state.user.logged&&""!=t.$store.state.user.email.toString().trim()&&(t.$store.state.user.logged=!1,t.$store.state.user.profile=null,t.$httpc.defaults.headers.common["Authorization"]=null,t.$cookies.remove("token"))}),2e3)}}},_e=Ce,$e=Object(g["a"])(_e,fe,ye,!1,null,null,null),be=$e.exports,Pe={name:"OrderCart",components:{componentOrderUser:se,componentOrderDeliveryPayment:de,componentOrderSummary:he,componentOrderFinished:be},data:function(){return{itemAmount:{},orderStateNumber:1,orderParams:{},viewComponentId:null}},computed:{orderStateComponent:function(){var t=this.$store.getters.getOrder;this.orderParams=t,t&&t.result&&t.result.id&&(this.orderStateNumber=t.result.id);var e=null!=this.viewComponentId&&this.viewComponentId<=this.orderStateNumber?this.viewComponentId:this.orderStateNumber;return 2==e?de:3==e?he:4==e?be:se}},updated:function(){document.querySelector("#header-cart-dropdown").style.display=""},created:function(){this.orderParams.order&&this.orderParams.order.addresses&&this.orderParams.order.addresses.invoiceAddress||this.updateOrder()},methods:{updateOrder:function(){var t=this,e={timeout:15e3,needsAuth:!0};this.viewComponentId=null,this.$httpc.post("order/progress",{orderParams:"undefined"!==typeof this.orderParams.order?this.orderParams.order:this.orderParams},e).then((function(e){if(e.data&&e.data.order){if(e.data.order&&e.data.order.user&&e.data.order.user.id&&null!=e.data.order.user.id&&(t.$store.state.user.logged=!0,t.$store.state.cart.user=e.data.order.user.id,t.orderStateNumber=e.data.result.id,t.$forceUpdate()),"saved"==e.data.order.status||"sent"==e.data.order.status){t.$store.dispatch("setCart",null);var a=document.querySelector(".userCartLink .cartItemsCount");a.textContent=0,console.log("cart set to NULL"),e.data.result.id=4}t.$store.dispatch("setOrder",e.data),e.data&&e.data.result&&e.data.result.id&&e.data.result.id>1&&(t.orderStateNumber=e.data.result.id)}})).catch((function(e){console.log("Cart error:",e),t.$store.dispatch("setCart",null),t.orderStateNumber=0,t.$store.dispatch("setOrder",null)})).then((function(){Qe.$emit("translateContent",t.$store.getters.getTranslates)}))},updateCartItemAmount:function(t){var e=this;this.$httpc.post("cart",{itemId:t,amount:parseInt(this.itemAmount[t])}).then((function(t){t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){return console.log(t),null})).then((function(){return null}))},clearCart:function(t){var e=this;t="undefined"!==typeof t?t:null;var a=null;a=null!=t&&""!=t.toString().trim()?this.$httpc.delete("cart?itemId="+t):this.$httpc.delete("cart"),a.then((function(t){console.log(t.data),t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){return console.log(t),null})).then((function(){return null}))},getClickableStateClasses:function(t){return t<=this.orderStateNumber?"step-link is-clickable":"step-link"},getActiveStateClasses:function(t){var e="step-item",a="";return t<=this.orderStateNumber&&(a=" is-previous"),(this.viewComponentId&&t==this.viewComponentId||t==this.orderStateNumber)&&(a=" is-active"),e+=a,e},getStateClass:function(t){return t==this.orderStateNumber?"has-text-danger":""},setViewCoponentId:function(t,e){if(t<=this.orderStateNumber){if(this.$el){var a=this.$el.querySelectorAll("#orderCart .b-steps .step-item");a.forEach((function(t){t.classList.remove("is-active")}))}e&&e.target&&!e.target.parentElement.parentElement.classList.contains("is-active")&&e.target.parentElement.parentElement.classList.add("is-active"),this.viewComponentId=t,this.$forceUpdate()}},getProductImagePath:function(t){return this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getProductImagePath(this.$store.state.coredata,t):null},countPrices:function(t){var e=["all","items","totals"];t="undefined"!==typeof t&&e.includes(t)?t:"all";var a=this,s=a.settings.defaultConstants.tax;if("all"!=t&&"items"!=t||(this.orderParams.prices.priceItems=0,this.orderParams.prices.priceItemsNoTax=0,this.orderParams.items.forEach((function(t){if(t.taxData)a.orderParams.prices.priceItems+=t.taxData.priceWithTax*t.amount,t.tax&&null!=t.tax&&(s=t.tax),a.orderParams.prices.priceItemsNoTax+=t.taxData.priceWithoutTax*t.amount,a.orderParams.prices.priceTaxTotal+=t.taxData.tax*t.amount;else{a.orderParams.prices.priceItems+=t.price*t.amount,t.tax&&null!=t.tax&&(s=t.tax);var e=t.price/(1+s);a.orderParams.prices.priceItemsNoTax+=e;var r=t.price/(1+s);a.orderParams.prices.priceTaxTotal+=r}})),this.orderParams.prices.priceItems=this.$helpers.formatPrice(this.orderParams.prices.priceItems),this.orderParams.prices.priceItemsNoTax=this.$helpers.formatPrice(this.orderParams.prices.priceItemsNoTax),this.orderParams.prices.priceTaxTotal=this.$helpers.formatPrice(this.orderParams.prices.priceTaxTotal)),"all"==t||"totals"==t){this.orderParams.prices.priceTotal=this.orderParams.prices.priceItems+this.orderParams.prices.priceDelivery+this.orderParams.prices.pricePayment,this.orderParams.prices.priceTotal=this.formatPrice.formatPrice(this.orderParams.prices.priceTotal);var r=this.orderParams.prices.priceDelivery/(1+s),i=this.orderParams.prices.pricePayment/(1+s);this.orderParams.prices.priceTotalNoTax=this.orderParams.prices.priceItemsNoTax+r+i,this.orderParams.prices.priceTotalNoTax=this.formatPrice.formatPrice(this.orderParams.prices.priceTotalNoTax)}}}},xe=Pe,we=(a("4f16"),Object(g["a"])(xe,Wt,Yt,!1,null,null,null)),De=we.exports,Ie=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.page?a("div",{staticClass:"container page-detail"},[t.userCanEdit&&t.page.data&&t.page.data.slug?a("div",{staticClass:"edit-area"},[a("router-link",{staticClass:"editor-button edit-button",attrs:{to:{name:"pageNewEdit",params:{slug:t.page.data.slug}}}},[a("font-awesome-icon",{attrs:{icon:"edit"}})],1)],1):t._e(),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3",attrs:{id:"page-detail-related"}},[t.page&&t.page.global&&t.page.global.relatedPageObjects&&t.page.global.relatedPageObjects.length>0?a("nav",{staticClass:"panel"},[a("aside",{staticClass:"menu"},[a("p",{staticClass:"menu-label",attrs:{translate:"yes"}},[t._v(" Related Pages ")]),a("ul",{staticClass:"menu-list"},t._l(t.page.global.relatedPageObjects,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"pageDetail",params:{category:e.categories[0],slug:e.slug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),0)])]):t._e()]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.parentCategoryDetail?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[t.parentCategoryDetail.parentCategories?a("ul",[t._l(t.parentCategoryDetail.parentCategories,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.$store.state.language.code],to:{name:"categoryListPage",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),a("li",[a("router-link",{attrs:{title:t.parentCategoryDetail.name[t.$store.state.language.code],to:{name:"categoryListPage",params:{category:t.parentCategoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.parentCategoryDetail.name[t.$store.state.language.code])+" ")])],1)],2):t._e()]):t._e()])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.page.data&&t.page.data.name?a("h1",{staticClass:"title is-1"},[t._v(t._s(t.page.data.name[t.$store.state.language.code]))]):t._e(),a("page-detail-content",{attrs:{content:t.page.body,contentData:t.pageData,contentLang:t.$store.state.language.code}})],1)])])])]):t._e()},Te=[],ke={name:"PageDetail",data:function(){return{page:null,parentCategoryDetail:null,language:"en"}},created:function(){var t=this;this.$store&&this.$store.state&&this.$store.state.language&&this.$store.state.language.code&&this.$store.state.user?this.getPageDetail(this.$store.state.language.code):Qe.$on("coreDataLoaded",(function(){t.getPageDetail(t.$store.state.language.code)})),Qe.$on("languageChanged",(function(e){t.getPageDetail(e)}))},computed:{userCanEdit:function(){return!!(this.$store.state&&this.$store.state.user&&this.$store.state.user.logged&&this.$store.state.user.profile&&this.$store.state.user.profile.type&&"admin"==this.$store.state.user.profile.type)},pageData:function(){return this.page&&this.page.data&&this.page.data.functions&&this.page.data.functions.length?this.page.data.functions:null}},components:{"page-detail-content":Ot},methods:{getPageDetail:function(t){var e=this,a="undefined"!==typeof t?t:e.$store.state.language.code;"undefined"==typeof this.$route.params.category&&(this.$route.params.category="-"),this.$route.params&&this.$route.params.slug&&""!=this.$route.params.slug.toString().trim()&&this.$httpc.get("pages/"+this.$route.params.category+"/detail/"+this.$route.params.slug+"?lang="+a).then((function(t){t.data&&(e.page=t.data,e.page&&e.page.data&&e.page.data.name&&e.$store.state&&void 0!==Object(jt["a"])(e.page.data.name[a])&&(document.title=e.page.data.name[a]+" - StretchShop")),e.page&&e.page.data&&e.page.data.parentCategoryDetail&&(e.parentCategoryDetail=e.page.data.parentCategoryDetail)})).catch((function(t){console.log(t)})).then((function(){Qe.$emit("pageDetailLoaded")}))}}},Ae=ke,Se=(a("e182"),Object(g["a"])(Ae,Ie,Te,!1,null,null,null)),Ee=Se.exports,Ne=function(t){a.e("chunk-0924bbfc").then(function(){t(a("f1d3"))}.bind(null,a)).catch(a.oe)},Oe=function(t){a.e("chunk-950c9ebe").then(function(){t(a("8161"),"userOrders")}.bind(null,a)).catch(a.oe)},Fe=function(t){a.e("chunk-d95965c2").then(function(){t(a("836a"),"userOrders")}.bind(null,a)).catch(a.oe)},Le=function(t){Promise.all([a.e("chunk-689a3ebc"),a.e("chunk-029e64c6")]).then(function(){t(a("3c98"))}.bind(null,a)).catch(a.oe)},Me=function(t){Promise.all([a.e("chunk-689a3ebc"),a.e("chunk-02b9cd01")]).then(function(){t(a("df24"))}.bind(null,a)).catch(a.oe)},qe=function(t){a.e("chunk-54e6d611").then(function(){t(a("5627"))}.bind(null,a)).catch(a.oe)},Re="/"+A.state.language.code,Ue="/:lang",je="StretchShop",Ve=[{path:"/",redirect:Re},{path:Ue+"/",name:"homepage",component:L,meta:{title:"Home - "+je,metaTags:[{name:"description",content:"The about page of our example app."},{property:"og:description",content:"The about page of our example app."}]}},{path:Ue+"/login",name:"login",component:z,meta:{title:"Login - "+je,metaTags:[{name:"description",content:"The about page of our example app."},{property:"og:description",content:"The about page of our example app."}]}},{path:Ue+"/register",name:"register",component:K,meta:{title:"Register - "+je,metaTags:[{name:"description",content:"The about page of our example app."},{property:"og:description",content:"The about page of our example app."}]}},{path:Ue+"/user",name:"me",component:Ne},{path:Ue+"/user/company",name:"meCompany",component:Ne},{path:Ue+"/user/address",name:"meAddress",component:Ne},{path:Ue+"/user/delivery",name:"meDelivery",component:Ne},{path:Ue+"/user/reset",name:"reset",component:ot},{path:Ue+"/user/verify/:id/:hash",name:"verify",component:et},{path:Ue+"/user/orders",name:"userOrders",component:Oe},{path:Ue+"/user/orders/:id",name:"userOrderDetail",component:Fe},{path:Ue+"/products",name:"productsHome",component:qt},{path:Ue+"/services",name:"servicesHome",component:qt},{path:Ue+"/products/:category",name:"categoryList",component:qt},{path:Ue+"/products/:category/product/:slug/:product",name:"productDetail",component:Ht},{path:Ue+"/products/:category/product/:slug/:product/edit",name:"productNewEdit",component:Le},{path:Ue+"/cart",name:"cart",component:De},{path:Ue+"/pages/:category",name:"categoryListPage",component:qt},{path:Ue+"/pages/:category/page/:slug",name:"pageDetail",component:Ee},{path:Ue+"/page/:slug",name:"pageDetailShort",component:Ee},{path:Ue+"/page/:slug/edit",name:"pageNewEdit",component:Me},{path:Ue+"/category/:category/edit",name:"categoryNewEdit",component:qe}],ze=a("bc3a"),Ge=a.n(ze);console.log("production");var Be=Ge.a.create({baseURL:"/api/v1/",timeout:5e3,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});Be.interceptors.request.use((function(t){if(t.needsAuth&&1==t.needsAuth&&Be.$parentVue&&Be.$parentVue.$cookies.isKey("token")){var e=Be.$parentVue.$cookies.get("token");""!=e.trim()&&(t.headers["Authorization"]="Token "+e)}return t}),(function(t){return console.log("test request interceptor error",t),Promise.reject({error:!0,code:408,message:t})})),Be.interceptors.response.use((function(t){return t}),(function(t){return console.log("test response interceptor error",t),Promise.reject(t)}));var He=a("ecee"),We=a("c074"),Ye=a("ad3d"),Ke=a("760d"),Je={checkIfObjectInArray:function(t,e){if(t&&null!=t&&e&&e instanceof Array&&e.length>0)for(var a=0;a',r.appendChild(n)}var o=document.createElement("p");o.className="help is-"+a,o.innerText=e,t.appendChild(o)}},undecorateFormField:function(t,e){var a=t.querySelector(".control");if(a&&null!=a){a.classList.remove("has-icons-right");var s=a.querySelector(".input");s&&s.classList.remove("is-"+e);var r=a.querySelector("span.icon.is-right.has-text-"+e);r&&null!=r&&a.removeChild(r)}var i=t.querySelector("p.help.is-"+e);i&&null!=i&&t.removeChild(i)},stringChunk:function(t,e){e="undefined"===typeof e?2:e;var a="";if(t&&t.length>0){for(var s=[],r="",i=0;i0&&this.formUndecorateAndDecorateFields(e,a)},verifyAddress:function(t){var e=["nameFirst","nameLast","street","zip","city","country","phone"],a=[],s=[],r=!0;return Object.keys(t).forEach((function(i){if(a.push(i),""==t[i].trim()&&e.indexOf(i)>-1){var n=i;s.push({name:n,action:"is empty"}),r=!1}})),a.length>0&&this.formUndecorateAndDecorateFields(a,s),r},propertiesRequiredConfirm:function(t,e,a){var s="undefined"!==typeof t&&t?t:null,r="undefined"!==typeof e&&e?e:null,i="undefined"!==typeof a&&a?a:[],n=0,o={result:!1,fields:[],errors:[]};return s&&null!=s?(r.forEach((function(e){o.fields.push(e),"undefined"!==typeof t[e]&&null!=t[e]&&""!=t[e].toString().trim()?i.indexOf(e)>-1?t[e]===t[e+"2"]?n++:o.errors.push({name:e+"2",action:"not confirmed"}):n++:o.errors.push({name:e,action:"is empty"})})),i.forEach((function(t){o.fields.push(t+"2")})),n==r.length&&(o.result=!0),o):o},getValueByCode:function(t,e,a){for(var s=0;s0&&r.indexOf(o)<0&&""!=t[o].trim()&&(n=n.replace("{{"+o+"}}",t[o]));return n},getProductUrl:function(t,e){var a={category:null,slug:null,id:null};if(e){a.category=e.categories[0],a.slug=e.slug,a.id=e.id;var s=t.$router.resolve({name:"productDetail",params:a});return s.href}return null},getProductImagePath:function(t,e,a){var s="undefined"!==typeof a?a:null,r=this.stringChunk(e,3),i=r;return s||(i=i+"/"+e),this.getImagePath("products",t,i,a)},getImagePath:function(t,e,a,s){var r="undefined"!==typeof s?s:null,i="https://stretchshop.app/static/",n=["products","categories"];return n.indexOf(t)<0&&(t="products"),e&&e.settings&&e.settings.assets&&e.settings.assets.url&&(i=e.settings.assets.url),null!==r?i+"/"+t+"/"+a+"/"+r:i+"/"+t+"/"+a+"-default.jpg"},animateAddToCart:function(t,e){function a(t){var e=t.timing,a=t.draw,s=t.duration,r=performance.now();requestAnimationFrame((function t(i){var n=(i-r)/s;n>1&&(n=1);var o=e(n);a(o),n<1&&requestAnimationFrame(t)}))}var s=document.querySelector(".userCartLink"),r=document.querySelector(".userCartLink .cartItemsCount"),i="undefined"!==typeof r&&r?parseInt(r.textContent,10):0,n=s.getBoundingClientRect().left+document.body.scrollLeft,o=s.getBoundingClientRect().top+document.body.scrollTop;n=Math.max(n,0),o=Math.max(o,0);var l=t,c=l.closest(".tile"),d=null;c?d=c.querySelector(".tile-image img"):"undefined"!=typeof d&&d||"undefined"===typeof e||(d=e);var u=d.getAttribute("src"),m=d,p=document.createElement("img");p.className="b-flying-img",p.setAttribute("src",u);var g=d.getBoundingClientRect();p.style.width=g.width,p.style.height=g.height;var v=m.getBoundingClientRect().left+document.body.scrollLeft;v=Math.max(v,0);var h=m.getBoundingClientRect().top+document.body.scrollTop;h=Math.max(h,0);var f=(v-n)/100/100,y=(h-o)/100/100;function C(t){return 1-Math.sin(Math.acos(t))}i+=1,a({duration:500,timing:C,draw:function(t){p.style.top=1e4*(1-t)*y-h+o+"px",p.style.left=1e4*(1-t)*f-v+n+"px",p.style.opacity=1-t,p.style.transform="scale("+(1-t)+")",1===t&&p.remove()}}),l.parentNode.appendChild(p),r.textContent=i},getObjectFromArrayByParamValue:function(t,e,a,s){return s="undefined"!==typeof s&&s,t.some((function(t){if(Object.prototype.hasOwnProperty.call(t,e)&&t[e]==a)return t})),s&&t.length>0?t[0]:null},getLangsEmptyObject:function(t){var e={};return t.forEach((function(t){e[t]=null})),e},recaptcha:function(t,e){return t.$recaptchaLoaded().then((function(){return t.$recaptcha("register")})).then((function(t){return t}))},getPageFunctions:function(t){var e,a=/\{\{\{(.*)\((.*)\)\}\}\}/g,s=[];if(t)do{if(e=a.exec(t),e){var r={method:e[1],params:e[2]};r.params.indexOf(";")>-1&&(r.params=r.params.split(";")),s.push(r)}}while(e);return s},formatPrice:function(t){return parseFloat(this.roundNumber(t).toFixed(2))},getProductTaxData:function(t,e){var a={taxDecimal:0,tax:0,taxType:"VAT",priceWithoutTax:null,priceWithTax:null};return e&&e.global&&e.global.taxDecimal&&(a.taxDecimal=e.global.taxDecimal),t&&t.tax&&null!==t.tax&&(a.taxDecimal=t.tax),a.taxDecimal>0&&t&&t.price&&(a.tax=a.taxDecimal*t.price,a.taxType=e.taxType,"IT"==e.taxType?(a.priceWithoutTax=t.price,a.priceWithTax=t.price+a.taxDecimal*t.price):(a.priceWithTax=t.price,a.priceWithoutTax=t.price-a.taxDecimal*t.price)),t.taxData=a,t.tax=a.taxDecimal,t}};He["d"].add(We["o"],We["e"],We["h"],We["f"],We["i"],We["j"],We["m"],We["f"],We["b"],We["c"],We["d"],We["a"],We["l"],We["n"],We["k"],We["g"]),He["b"].watch(),s["a"].component("font-awesome-icon",Ye["a"]),s["a"].config.productionTip=!1;var Ze=a("f13c"),Qe=new s["a"];s["a"].use(o.a),o.a.config("7d"),s["a"].use(r["a"]),s["a"].use(i["a"],{defaultIconPack:"fa"}),s["a"].use(Ke["VueReCaptcha"],{siteKey:"6LdAMsgUAAAAADJR3XOi_1P3RxRQ3EtLAb960GBw"});var Xe={install:function(){s["a"].helpers=Je,s["a"].prototype.$helpers=Je}};s["a"].use(Xe),s["a"].use(Ze),s["a"].config.productionTip=!1,s["a"].prototype.$httpc=Be;var ta=new r["a"]({mode:"history",routes:Ve});window.router=ta,ta.beforeEach((function(t,e,a){var s=t.matched.slice().reverse().find((function(t){return t.meta&&t.meta.title})),r=t.matched.slice().reverse().find((function(t){return t.meta&&t.meta.metaTags}));e.matched.slice().reverse().find((function(t){return t.meta&&t.meta.metaTags}));return s&&(document.title=s.meta.title),Array.from(document.querySelectorAll("[data-vue-router-controlled]")).map((function(t){return t.parentNode.removeChild(t)})),r&&r.meta.metaTags.map((function(t){var e=document.createElement("meta");return Object.keys(t).forEach((function(a){e.setAttribute(a,t[a])})),e.setAttribute("data-vue-router-controlled",""),e})).forEach((function(t){return document.head.appendChild(t)})),a()}));var ea=new s["a"]({render:function(t){return t(D)},router:ta,store:A,data:function(){return{loadingIsShowing:!1,loadingIsFullPage:!0,loadingComponent:null}},created:function(){var t=this,e=null,a=!1,s=null,r=this.$store.getters.getLanguage;e=this.$cookies.get("token"),null!=e&&(a=!0),this.$httpc.$cookies=o.a,this.$httpc.$parentVue=this,r=t.manageLanguageFirstTime(),this.$httpc.get("/coredata?transLang="+r,{needsAuth:!0}).then((function(e){if(e.data){var i=e.data.user;if(delete e.data.user,s=e.data.translation,delete e.data.translation,e.data.lang&&e.data.lang.code!=r){var n=t.$helpers.getObjectFromArrayByParamValue(e.data.langs,"code",r,!0);e.data.lang=n}t.$store.dispatch("setCoreData",e.data),i&&(t.$store.dispatch("setUser",i),i&&i._id&&""!==i._id.toString().trim()?(t.$store.state.user.logged=!0,t.$store.state.user.remember=a):(t.$store.state.user.logged=!1,t.$store.state.user.remember=!1)),s&&null!=s&&t.$store.dispatch("setTranslates",s),Qe.$emit("coreDataLoaded")}})).catch((function(t){console.log("coredata error:",t)})).then((function(){t.$nextTick((function(){this.$children[0].translateContent(t.$store.getters.getTranslates)}))}))},methods:{manageLanguageFirstTime:function(){var t=this,e=t.$store.state.language.code;if(window.navigator.languages&&window.navigator.languages.length>0||window.navigator.language||window.navigator.userLanguage){var a=window.navigator.language;if(window.navigator.languages&&window.navigator.languages.length>0){var s=window.navigator.languages[0].split("-");s.length>0&&(a=s[0])}else window.navigator.userLanguage&&(a=window.navigator.userLanguage);e=a}var r=localStorage.getItem("language");if(r&&t.$store&&t.$store.state.coredata&&null!=t.$store.state.coredata){var i=t.$helpers.checkIfObjectInArray(r,t.$store.state.coredata.langs);null!=i&&(e=r)}t.$store.state.user&&t.$store.state.user.profile&&t.$store.state.user.profile.settings&&t.$store.state.user.profile.settings.language&&(e=t.$store.state.user.profile.settings.language);var n=window.location.pathname.split("/");return n&&n.length>1&&(e=n[1]),console.log("final language",e),t.$store.dispatch("setLanguage",e),localStorage.setItem("language",e),e},loadingShow:function(){this.$buefy.loading&&(this.loadingComponent=this.$buefy.loading.open({container:this.loadingIsFullPage?null:this.$refs.element.$el}))},loadingClose:function(){this.loadingComponent&&this.loadingComponent.close()}}}).$mount("#app");ta.beforeEach((function(t,e,a){var s=t.fullPath.split("/");if(s.length>1&&s[1]!=ea.$store.state.language.code&&s.length>0){var r=e.fullPath.split("/"),i=ea.$store.state.language.code;if(r.length>1&&(i=r[1]),i!==ea.$store.state.language.code){s[1]=ea.$store.state.language.code;var n=s.join("/");return a({path:n})}var o=t.fullPath;return s.length>1&&(s[1]=ea.$store.state.language.code,o=s.join("/")),console.log("newUrl:",o),a({path:o})}return a()}))},"578f":function(t,e,a){},"5ac7":function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("article",{staticClass:"tile is-child box"},[a("p",{staticClass:"title"},[t._v(t._s(t.product.name[t.getLang]))]),a("p",{staticClass:"subtitle"},[t._v(t._s(t.product.descriptionShort[t.getLang]))]),a("div",{staticClass:"tile-image"},[a("img",{attrs:{src:t.getProductImagePath(t.product.orderCode),alt:t.product.name[t.getLang],onerror:"this.src='/assets/_site/logo-product.svg'"}})]),"product"==t.product.type?a("div",{staticClass:"bottom-part"},[a("p",{staticClass:"stock"},[a("span",{attrs:{translate:"yes"}},[t._v("In stock")]),t._v(" "+t._s(t.product.stockAmount))]),a("p",{staticClass:"price"},[a("span",{attrs:{translate:"yes"}},[t._v("Price")]),t._v(" "+t._s(t.$store.state.numeral(t.product.price).format("0 0.00"))+" "+t._s(t.$store.state.currency.symbol))]),t.product.tax&&t.product.tax>0?a("div",{staticClass:"product-price-tax"},[a("span",{attrs:{translate:"yes"}},[t._v("Without Tax")]),t._v(" ("+t._s(t.$store.state.numeral(100*t.product.tax).format("0 0.00"))+"%): "+t._s(t.$store.state.numeral(t.product.price-t.product.price*t.product.tax).format("0 0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]):a("div",{staticClass:"product-price-tax"}),!this.hideBuyButton||"false"==this.hideBuyButton||this.requirementsCheckShow(t.product)?a("div",{staticClass:"buy-button"},[a("button",{staticClass:"button is-primary",attrs:{"data-id":t.product._id},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.addToCart(e)}}},[a("font-awesome-icon",{attrs:{icon:"cart-plus"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add to Cart")])],1)]):a("div",{staticClass:"buy-button"},[a("button",{staticClass:"button is-primary"},[a("font-awesome-icon",{attrs:{icon:"plus"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("See detail")])],1)])]):t._e()])},r=[],i={props:["product","propLang","hideBuyButton"],computed:{getLang:function(){return this.$store&&this.$store.state&&this.$store.state.language.code?this.$store.state.language.code:this.propLang?propLang:"en"}},methods:{addToCart:function(t){var e=this,a=t.currentTarget.getAttribute("data-id"),s=t.currentTarget.getAttribute("data-amount");this.$helpers.animateAddToCart(t.currentTarget),s||(s=1),console.log(a),this.$httpc.put("cart",{itemId:a,amount:s}).then((function(t){console.log(t),t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){console.log(t)})).then((function(){}))},getProductImagePath:function(t){return this.$store&&this.$store.state&&this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getProductImagePath(this.$store.state.coredata,t):null},requirementsCheckShow:function(t){return!(t&&t.data&&t.data.requirements&&t.data.requirements.inputs&&t.data.requirements.inputs.length>0)}}},n=i,o=(a("10a8"),a("2877")),l=Object(o["a"])(n,s,r,!1,null,null,null);e["a"]=l.exports},"5b55":function(t,e,a){"use strict";var s=100,r=3,i="price",n=["price","-price","-dates.dateCreated","-stockAmount"],o="-dates.dateCreated",l=["-dates.dateCreated","-stockAmount"],c="{{nameFirst}} {{nameLast}}\n{{addressFull}}\n{{city}}\n{{zip}}\n{{country}}",d="{{nameFirst}} {{nameLast}}\n{{companyName}}\n{{addressFull}}\n{{city}}\n{{zip}}\n{{country}}\n{{companyOrgId}}\n{{companyTaxId}}, {{companyTaxVatId}}",u="1d",m="30d";e["a"]={PER_PAGE:s,PER_ROW:r,PRODUCT_DEFAULT_SORTING:i,PRODUCT_SORTING_VALUES:n,PAGE_DEFAULT_SORTING:o,PAGE_SORTING_VALUES:l,ADDRESS_FORMAT:c,ADDRESS_FORMAT_COMPANY:d,COOKIE_TIME:u,COOKIE_TIME_REMEMBER:m}},"5bc8":function(t,e,a){"use strict";var s=a("578f"),r=a.n(s);r.a},"5c0b":function(t,e,a){"use strict";var s=a("9c0c"),r=a.n(s);r.a},"5e51":function(t,e,a){},6400:function(t,e,a){},"6f35":function(t,e,a){"use strict";var s=a("2a7d"),r=a.n(s);r.a},"750f":function(t,e,a){},7918:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.product&&null!=t.product&&t.product.data&&t.product.data.gallery&&t.product.data.gallery.images&&t.$store&&t.$store.state&&t.$store.state.coredata?a("div",{staticClass:"columns product-gallery"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"columns"},[t._m(0),t.editable?a("div",{staticClass:"column is-6 has-text-right"},[a("b-field",{staticClass:"file action edit"},[a("b-upload",{on:{input:function(e){t.editGalleryImage(t.countProductGalleryPictures())}},model:{value:t.galleryImages["galleryImage_"+t.countProductGalleryPictures()],callback:function(e){t.$set(t.galleryImages,"galleryImage_"+t.countProductGalleryPictures(),e)},expression:"galleryImages['galleryImage_'+countProductGalleryPictures()]"}},[a("a",{staticClass:"button is-primary is-info"},[a("i",{staticClass:"fa fa-plus"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add Image to Gallery")])])])],1)],1):t._e()]),a("div",[t.$store.state.language?a("hooper",{staticClass:"hooper200",attrs:{settings:t.hooperSettings}},[t._l(t.product.data.gallery.images,(function(e,s){return a("slide",{key:s,attrs:{index:s}},[a("a",{staticClass:"image-overlay",attrs:{href:"#"+s,"data-id":"product/"+t.product.orderCode+"/"+e},on:{click:function(e){return e.preventDefault(),t.getImageModal(e)}}},[a("img",{attrs:{src:t.$parent.getProductGalleryImagePath(t.product.orderCode,e),"data-index":s,alt:""}})]),t.editable?a("div",{staticClass:"slider__actions-wrapper"},[a("b-field",{staticClass:"file action edit"},[a("b-upload",{on:{input:function(e){return t.editGalleryImage(s)}},model:{value:t.galleryImages["galleryImage_"+s],callback:function(e){t.$set(t.galleryImages,"galleryImage_"+s,e)},expression:"galleryImages['galleryImage_'+i]"}},[a("a",{staticClass:"button is-primary is-info"},[a("i",{staticClass:"fa fa-file-upload"})])])],1),a("a",{staticClass:"action remove",on:{click:function(e){return e.preventDefault(),t.deleteGalleryImage(s)}}},[a("i",{staticClass:"fa fa-trash"})])],1):t._e()])})),a("hooper-navigation",{attrs:{slot:"hooper-addons"},slot:"hooper-addons"})],2):t._e(),t.modal.image?a("b-modal",{attrs:{active:t.modal.isImageModalActive},on:{"update:active":function(e){return t.$set(t.modal,"isImageModalActive",e)}}},[a("div",{staticClass:"my-modal-image",style:{"background-image":"url("+t.modal.image+")","background-size":t.modal.cssSize}})]):t._e()],1)])]):t._e()},r=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Gallery")])])}],i=(a("7f7f"),a("7e04")),n=(a("955f"),{props:["product","editable"],name:"SliderCarousel",data:function(){return{hooperSettings:{infiniteScroll:!0,itemsToShow:this.getItemsToShow()},modal:{isImageModalActive:!1,image:null,cssSize:"contain"},galleryImages:{}}},components:{Hooper:i["a"],Slide:i["c"],HooperNavigation:i["b"]},methods:{getItemsToShow:function(){return document.body.clientWidth<=768?3:5},getImageModal:function(t){if(t.currentTarget){var e=this,a=t.currentTarget,s=a.querySelector("img");a.parentElement.parentElement;if(s){var r=s.getAttribute("src");if(r&&""!==r.trim()){var i=new Image;return i.src=r,i.onload=function(){i.width0&&a.data.files[0].path&&""!=a.data.files[0].path.trim()){var r=e.$el.querySelectorAll('.product-gallery .hooper .hooper-list .hooper-slide img[data-index="'+t+'"]');if(r&&r.length)for(var i=0;i=e.countProductGalleryPictures()&&""!=a.data.files[0].name.trim()&&e.product.data.gallery.images.push(a.data.files[0].name)}}}))},deleteGalleryImage:function(t){console.log("deleteGalleryImage index:",t,this.$parent.product.orderCode);var e=this;if(confirm("Are you sure?")){var a={timeout:15e3,needsAuth:!0},s=this.$parent.product.data.gallery.images[t];console.log(this.product.orderCode,s),this.$httpc.delete("user/image/products/"+this.$parent.product.orderCode+"/"+s,a).then((function(a){a&&a.data&&a.data.success&&(console.log("image delete response",a.data),e.$parent.product.data.gallery.images.splice(t,1))}))}}}}),o=n,l=(a("bc77"),a("2877")),c=Object(l["a"])(o,s,r,!1,null,null,null);e["a"]=c.exports},"9a6b":function(t,e,a){},"9c0c":function(t,e,a){},"9e2b":function(t,e,a){"use strict";var s=a("750f"),r=a.n(s);r.a},a906:function(t,e,a){"use strict";var s=a("4b9e"),r=a.n(s);r.a},aa87:function(t,e,a){"use strict";var s=a("adc6"),r=a.n(s);r.a},adc6:function(t,e,a){},b41b:function(t,e,a){"use strict";var s=a("0a62"),r=a.n(s);r.a},bc77:function(t,e,a){"use strict";var s=a("9a6b"),r=a.n(s);r.a},df4c:function(t,e,a){"use strict";var s=a("0e19"),r=a.n(s);r.a},e15e:function(t,e,a){},e182:function(t,e,a){"use strict";var s=a("273e"),r=a.n(s);r.a},ef61:function(t,e,a){}}); -//# sourceMappingURL=app.226b04f4.js.map \ No newline at end of file +(function(t){function e(e){for(var s,r,o=e[0],l=e[1],c=e[2],d=0,u=[];d1?a("div",{staticClass:"navbar-item has-dropdown is-hoverable"},[t.$store.state.language?a("router-link",{staticClass:"navbar-link",attrs:{to:"#",tag:"a","active-class":"is-active"}},[t._v(" "+t._s(t.$store.state.language&&t.$store.state.language.code?t.$store.state.language.code:"")+" / "+t._s(t.$store.state.currency&&t.$store.state.currency.symbol?t.$store.state.currency.symbol:"")+" ")]):t._e(),t.$store.state.coredata&&t.$store.state.coredata.langs?a("div",{staticClass:"navbar-dropdown"},[t._l(t.$store.state.coredata.langs,(function(e,s){return a("a",{key:s+"langs",staticClass:"navbar-item",on:{click:function(a){return a.stopPropagation(),a.preventDefault(),t.setLang(e.code)}}},[t._v(" "+t._s(e.name)+" ")])})),a("hr",{staticClass:"navbar-divider"}),t._l(t.$store.state.coredata.currencies,(function(e,s){return a("a",{key:s+"-currecies",staticClass:"navbar-item",on:{click:function(a){return a.stopPropagation(),a.preventDefault(),t.setCurrency(e.code)}}},[t._v(" "+t._s(e.code)+" ")])}))],2):t._e()],1):t._e(),a("div",{staticClass:"navbar-item userCart",class:{"has-dropdown":t.hasCart,"is-hoverable":t.hasCart}},[null!=t.$store.state.cart?a("router-link",{staticClass:"navbar-link userCartLink",attrs:{to:{name:"cart"},tag:"a","active-class":"is-active"}},[a("span",{attrs:{translate:"yes"}},[t._v("Cart")]),t.cartItemsAmountCount?a("span",{key:t.cartItemsAmountCount,staticClass:"cartItemsCount"},[t._v(" "+t._s(t.cartItemsAmountCount)+" ")]):a("span",{staticClass:"cartItemsCount"},[t._v(" 0 ")]),null!=t.$store.state.cart?a("div",{staticClass:"navbar-dropdown",attrs:{id:"header-cart-dropdown"}},[a("div",{staticClass:"navbar-item"},[a("table",{staticClass:"table"},[a("tbody",t._l(t.$store.state.cart.items,(function(e,s){return a("tr",{key:s+"-cart"},[a("th",[t._v(t._s(e.name[t.$store.state.language.code]))]),a("td",[t._v("x"+t._s(e.amount))]),a("td",[a("span",[t._v(t._s(t.$store.state.numeral(e.price).format("0 0.00")))]),a("span",[t._v(t._s(t.$store.state.currency.symbol))])]),a("td",[a("a",{on:{click:function(a){return a.stopPropagation(),a.preventDefault(),t.clearCart(e._id)}}},[a("font-awesome-icon",{attrs:{icon:"trash"}})],1)])])})),0)])]),a("div",[a("strong",{attrs:{translate:"yes"}},[t._v("Total price")]),t._v(" "),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.pricePayment?a("span",[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceTotal).format("0.00")))]),t._v(" "+t._s(t.$store.state.currency.symbol)+" ")]):t.$store.state.cart&&null!=t.$store.state.cart.priceTotal?a("span",[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.cart.priceTotal).format("0 0.00")))]),t._v(" "+t._s(t.$store.state.currency.symbol)+" ")]):t._e()]),a("hr",{staticClass:"navbar-divider"}),null!=t.$store.state.cart?a("router-link",{staticClass:"button is-success",attrs:{to:{name:"cart"},tag:"a","active-class":"is-active",id:"header-gotocart",translate:"yes"},nativeOn:{click:function(e){return t.hideCartNavbar()}}},[t._v("Go to Cart")]):t._e()],1):t._e()]):t._e()],1),a("div",{staticClass:"navbar-item has-dropdown is-hoverable"},[t.$store.state.user.logged?a("router-link",{staticClass:"navbar-link",attrs:{to:{name:"me"},tag:"a","active-class":"is-active"}},[a("div",{staticClass:"user--avatar-wrapper",style:{"background-image":"url("+t.userProfileImage+")"}}),a("span",{attrs:{id:"header-user-profile"}},[t._v(" "+t._s(t.$store.state.user&&t.$store.state.user.profile&&null!=t.$store.state.user.profile&&t.$store.state.user.profile.username&&""!=t.$store.state.user.profile.username.toString().trim()?t.$store.state.user.profile.username:"Profile")+" ")])]):t._e(),t.$store.state.user.logged?a("div",{staticClass:"navbar-dropdown"},[a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"me"},tag:"a","active-class":"is-active"}},[a("span",{attrs:{translate:"yes",id:"header-profile"}},[t._v("Profile")])]),a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"userOrders"},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-orders",translate:"yes"}},[t._v("Orders")])]),a("hr",{staticClass:"navbar-divider"}),a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"pageNewEdit",params:{slug:"---new"}},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-newpage",translate:"yes"}},[t._v("New Page")])]),a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"productNewEdit",params:{category:"---none",slug:"---new",product:"---new"}},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-newproduct",translate:"yes"}},[t._v("New Product")])]),a("router-link",{staticClass:"navbar-item",attrs:{to:{name:"categoryNewEdit",params:{category:"---new"}},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-newcategory",translate:"yes"}},[t._v("New Category")])])],1):t._e()],1),a("div",{staticClass:"buttons"},[t.$store.state.user.logged&&1==t.$store.state.user.logged?t._e():a("router-link",{staticClass:"navbar-item button is-primary",attrs:{to:{name:"register"},tag:"a","active-class":"is-active"}},[a("strong",{attrs:{id:"header-signup",translate:"yes"}},[t._v("Sign up")])]),t.$store.state.user.logged&&1==t.$store.state.user.logged?t._e():a("router-link",{staticClass:"navbar-item button is-light",attrs:{to:{name:"login"},tag:"a","active-class":"is-active"}},[a("span",{attrs:{id:"header-login",translate:"yes"}},[t._v("Log in")])]),t.$store.state.user.logged&&1==t.$store.state.user.logged?a("a",{staticClass:"button is-light",attrs:{id:"header-logout",translate:"yes"},on:{click:t.userLogout}},[t._v("Logout")]):t._e()],1)])])])])])}),u=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a",{staticClass:"navbar-burger burger",attrs:{role:"button","aria-label":"menu","aria-expanded":"false","data-target":"navbarBasicExample"}},[a("span",{attrs:{"aria-hidden":"true"}}),a("span",{attrs:{"aria-hidden":"true"}}),a("span",{attrs:{"aria-hidden":"true"}})])}],m={name:"appHeader",data:function(){return{userLogged:!1,cartItemsCount:0}},computed:{cartItemsAmountCount:function(){return this.$store.getters.getCartItemsAmountCount},userProfileImage:function(){return this.$store.getters.getProfileImage()},hasNavigation:function(){return!!(this.$store&&this.$store.state&&this.$store.state.coredata&&this.$store.state.coredata.navigation)},navigationMain:function(){if(this.hasNavigation){var t=this.$store.getters.getNavigation("main")["main"];if(t&&t.items&&t.items.length>0)return t.items}return null}},mounted:function(){this.getCart(),this.navbarBurgerEvents()},methods:{navbarBurgerEvents:function(){var t=this,e=Array.prototype.slice.call(this.$el.querySelectorAll(".navbar-burger"),0);e.length>0&&e.forEach((function(e){e.addEventListener("click",(function(){var a=e.dataset.target,s=t.$refs[a];e.classList.toggle("is-active"),s.classList.toggle("is-active")}))}))},getNavLink:function(t){if(t&&t.typeName)return"--link"==t.typeName?t.slugParams:t.slugParams?{name:t.typeName,params:t.slugParams}:{name:t.typeName}},userLogout:function(){var t=this;this.$store.state.user.logged=!1,this.$store.state.user.profile=null,this.$httpc.defaults.headers.common["Authorization"]=null,this.$cookies.remove("token"),this.$httpc.get("users/logout").then((function(e){console.log("userLogout DONE"),t.$router.push({name:"login"})}))},getCart:function(){var t=this;this.$httpc.get("cart").then((function(e){e.data&&t.$store.dispatch("setCart",e.data)})).catch((function(t){return console.log(t),null})).then((function(){return null}))},hasCart:function(){return this.$store.state.cart&&null!=this.$store.state.cart&&this.$store.state.cart.items&&this.$store.state.cart.items.length>0},clearCart:function(t){var e=this;t="undefined"!==typeof t?t:null;var a="";null!=t&&""!=t.toString().trim()&&(a="/"+t),this.$httpc.delete("cart"+a).then((function(t){t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){return console.log(t),null})).then((function(){return null}))},setLang:function(t){var e=this,a=this;this.$store.state.coredata&&this.$store.state.coredata.lang&&this.$store.state.coredata.lang.code&&(!this.$store.state.translates||this.$store.state.translates&&"undefined"==typeof this.$store.state.translates[t]||this.$store.state.translates[t].length<1)&&t!=this.$store.state.coredata.lang.code?this.$httpc.get("/coredata/translation?lang="+t).then((function(s){s.data&&(a.$store.dispatch("setTranslates",s.data),a.$store.dispatch("setLanguage",t),localStorage.setItem("language",t),a.$parent.translateContent(e.$store.getters.getTranslates),Qe.$emit("languageChanged",t),a.setNewHistoryPath(t))})):(this.$store.dispatch("setLanguage",t),localStorage.setItem("language",t),this.$parent.translateContent(this.$store.getters.getTranslates),Qe.$emit("languageChanged",t),this.setNewHistoryPath(t))},setCurrency:function(t){this.$store.dispatch("setCurrency",t)},setNewHistoryPath:function(t){var e=window.location,a=e.pathname.split("/");a=a.filter((function(t){return""!=t})),a.length>0&&(a[0]=t),history.pushState({},null,e.origin+"/"+a.join("/"))},hideCartNavbar:function(){this.$el.querySelector("#header-cart-dropdown").style.display="none"},linkType:function(t){var e="router-link";if(t&&t.slugParams&&"string"===typeof t.slugParams){var a=t.slugParams.split("/");if(a&&a.constructor===Array&&a[0]&&""!=a[0].trim()){var s=a[0].trim();e=["https","http"].indexOf(s)?"a":"router-link"}}return e},linkDef:function(t){var e=this.linkType(t);return"a"==e?{is:"a",href:t.slugParams,target:"_blank",rel:"noopener"}:{is:"router-link",to:this.getNavLink(t)}}}},p=m,g=(a("df4c"),a("2877")),v=Object(g["a"])(p,d,u,!1,null,null,null),h=v.exports,f=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("footer",{staticClass:"footer"},[a("div",{staticClass:"container"},[t.$store&&t.$store.state&&t.$store.state.coredata&&t.$store.state.coredata.settings&&t.$store.state.coredata.settings.business?a("div",{staticClass:"columns has-text-left"},[t._m(0),t._m(1),a("div",{staticClass:"column is-3"},[a("h6",{staticClass:"title is-6",attrs:{translate:"yes"}},[t._v("Menu")]),t.hasNavigation?a("ul",t._l(t.navigationMain,(function(e,s){return a("li",{key:e.codename+s},[a("router-link",{staticClass:"navbar-item",attrs:{to:t.getNavLink(e),tag:"a","active-class":"is-active",exact:""}},[t._v(" "+t._s(e.langs[t.$store.state.language.code].name)+" ")])],1)})),0):t._e()]),a("div",{staticClass:"column is-3"},[a("h6",{staticClass:"title is-6",attrs:{translate:"yes"}},[t._v("Company")]),t.hasNavigation?a("ul",t._l(t.navigationFooter,(function(e,s){return a("li",{key:e.codename+s},[a("router-link",{staticClass:"navbar-item",attrs:{to:t.getNavLink(e),tag:"a","active-class":"is-active",exact:""}},[e.langs[t.$store.state.language.code]?a("span",[t._v(" "+t._s(e.langs[t.$store.state.language.code].name)+" ")]):t._e()])],1)})),0):t._e()]),a("div",{staticClass:"column is-3"},[a("h6",{staticClass:"title is-6",attrs:{translate:"yes"}},[t._v("Links")]),t.hasNavigation?a("ul",t._l(t.navigationFooterLinks,(function(e,s){return a("li",{key:e.codename+s},[a("router-link",{staticClass:"navbar-item",attrs:{to:t.getNavLink(e),tag:"a","active-class":"is-active",exact:""}},[e.langs[t.$store.state.language.code]?a("span",[t._v(" "+t._s(e.langs[t.$store.state.language.code].name)+" ")]):t._e()])],1)})),0):t._e()])]):t._e(),a("div",{staticClass:"columns is-size-7"},[a("div",{staticClass:"column"},[t._v(" © "+t._s(t.getYear)+" "),t.$store&&t.$store.state&&t.$store.state.coredata&&t.$store.state.coredata.settings&&t.$store.state.coredata.settings.business?a("span",[t._v(" "+t._s(t.$store.state.coredata.settings.business.name)+" ")]):t._e()])])])])},y=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-1"},[a("img",{attrs:{src:"/assets/_site/logo-words-vertical.svg",width:"80",alt:""}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-3"},[a("p",[t._v(" Created with "),a("strong",[t._v("StretchShop")]),a("br"),t._v(" Fast & Scalable e-business"),a("br"),a("a",{attrs:{href:"https://stretchshop.app/"}},[t._v("https://stretchshop.app/")])])])}],C={name:"appFooter",data:function(){return{userLogged:!1,cartItemsCount:0}},computed:{cartItemsAmountCount:function(){return this.$store.getters.getCartItemsAmountCount},userProfileImage:function(){return this.$store.getters.getProfileImage()},hasNavigation:function(){return!!(this.$store&&this.$store.state&&this.$store.state.coredata&&this.$store.state.coredata.navigation)},navigationFooter:function(){return this.getNavigation("footer")},navigationFooterLinks:function(){return this.getNavigation("footer","links")},navigationMain:function(){return this.getNavigation("main")},getYear:function(){var t=new Date;return t.getFullYear()}},mounted:function(){},methods:{getNavigation:function(t,e){var a="undefined"!=typeof e?e:"main";if(this.hasNavigation){var s=this.$store.getters.getNavigation(t)[a];if(s&&s.items&&s.items.length>0)return s.items}return null},getNavLink:function(t){if(t&&t.typeName)return"--link"==t.typeName?t.slugParams:t.slugParams?{name:t.typeName,params:t.slugParams}:{name:t.typeName}}}},_=C,$=(a("3c12"),Object(g["a"])(_,f,y,!1,null,null,null)),b=$.exports,P={name:"app",components:{"app-header":h,"app-footer":b},created:function(){var t=this;Qe.$on("translateContent",(function(e){t.translateContent(e)}))},watch:{$route:function(t,e){"undefined"!==typeof translateContent&&this.$store.state.language.code==this.$store.state.coredata.lang.code&&translateContent(this.$store.getters.getTranslates)}},events:{changeRouterLanguageEvent:function(t){return this.changeRouterLanguage(newLanguage)},translateContentEvent:function(){return this.translateContent(this.$store.getters.getTranslates)}},methods:{changeRouterLanguage:function(t){if(this.$router.options&&this.$router.options.routes&&this.$router.options.routes.length>0)for(var e=0;e1&&(a[1]=t,this.$router.options.routes[e].path=a.join("/"))}},translateContent:function(t){var e=this.$store.getters.getLanguage,a="";if(this.$store.state.coredata&&this.$store.state.coredata.langs)for(var s=0;s0||e==a)){var r=!1;null!=e&&e==a&&(e=Object.keys(t)[0],r=!0);for(var i=0;i router-link.","> a.").replace("> template > ",""),o=this.$el.querySelector(n);o&&null!=o&&(o.textContent=r?t[e][i].original:t[e][i].string)}}}}},x=P,w=(a("5c0b"),Object(g["a"])(x,l,c,!1,null,null,null)),D=w.exports,I=a("2f62"),T=a("6612"),k=a.n(T);s["a"].use(I["a"]);var A=new I["a"].Store({namespace:!0,state:{user:{logged:!1,token:null,remember:!1,profile:null,avatar:null},language:{code:"en",longCode:"en-US",name:"English"},currency:{code:"EUR",symbol:"€",ratio:1},coredata:null,cart:null,order:null,chunk:function(t,e){for(var a=[],s=0;s0){var s=!1;e.addresses.forEach((function(t){null!=t&&t.type&&"invoice"===t.type&&!s?a.addressInvoice=t:t.type&&"delivery"===t.type&&a.addressesDelivery.push(t)}))}e.bio&&(a.bio=e.bio),e.company&&(a.company=e.company),e.settings&&(a.settings=e.settings),e.dates&&(a.dates=e.dates),t.user.profile={},Object.keys(a).forEach((function(e){a[e]&&null!==a[e]&&(t.user.profile[e]=a[e])}))},setUserProfileImage:function(t,e){var a="https://stretchshop.app/static";t.coredata&&t.coredata.settings&&t.coredata.settings.assets&&t.coredata.settings.assets.url&&(a=t.coredata.settings.assets.url),e&&(t.user&&t.user.profile&&t.user.profile.image&&(t.user.profile.image=e),t.user.avatar=a+"/users/profile/"+e+"?"+(new Date).getTime())},setCoreData:function(t,e){t.language=e.language,t.coredata=e.coredata},setOrder:function(t,e){t.order=e},addNewDeliveryAddress:function(t,e){t.user.profile.addressesDelivery.unshift(e)},removeDeliveryAddress:function(t,e){t.user.profile.addressesDelivery.splice(e,1)},setLanguage:function(t,e){t.language=e},setCurrency:function(t,e){t.currency=e},setTranslates:function(t,e){t.translates=e}},actions:{setCart:function(t,e){if(console.log("setting cart"),e&&null!=e){e.priceTotal=0;var a=0,s=0,r=0,i={types:[],subtypes:[]};e.items&&e.items.length>0&&e.items.forEach((function(t){a++,s+=t.amount,r+=t.price*t.amount,i.types.indexOf(t.type)<0&&i.types.push(t.type),i.subtypes.indexOf(t.subtype)<0&&i.subtypes.push(t.subtype)})),e.itemsCount=a,e.itemsAmountCount=s,e.priceTotal=r,e.cartItemTypology=i,t.commit("setCart",e)}else if(null===e){var n={_id:null,user:null,ip:null,hash:null,order:null,dateCreated:null,dateUpdated:null,items:[],priceTotal:0,itemsCount:0,itemsAmountCount:0,cartItemTypology:{types:[],subtypes:[]}};t.commit("setCart",n)}},setCoreData:function(t,e){if(e&&null!=e){var a=JSON.parse(JSON.stringify(e));e.coredata=a,e.coredata.lang&&(e.language=e.coredata.lang);var s=[];if(e.coredata.langs)for(var r=0;r0&&(e.order.settings.deliveryMethods.forEach((function(t){s[t.type]||(s[t.type]=[]),s[t.type].push(t)})),e.order.settings.deliveryMethodsTypes=s),a("setOrder",e)}else null===e&&a("setOrder",null)},updateUser:function(t,e){var a=t.commit;t.state;e&&null!=e&&this._vm.$httpc.put("user",{user:e},{needsAuth:!0}).then((function(t){t.data.user&&a("setUserProfile",t.data.user)}))},addNewDeliveryAddress:function(t,e){e&&null!=e&&t.commit("addNewDeliveryAddress",e)},removeDeliveryAddress:function(t,e){"undefined"!==typeof e&&e>-1&&t.commit("removeDeliveryAddress",e)},checkLanguage:function(t,e){t.commit;var a=t.state;if("undefined"!==typeof e&&""!==e.toString().trim()){var s=null;if(a.coredata&&a.coredata.langs&&a.coredata.langs.length>0)for(var r=0;r0)for(var n=0;n0)for(var n=0;n-1:t.remember},on:{change:function(e){var a=t.remember,s=e.target,r=!!s.checked;if(Array.isArray(a)){var i=null,n=t._i(a,i);s.checked?n<0&&(t.remember=a.concat([i])):n>-1&&(t.remember=a.slice(0,n).concat(a.slice(n+1)))}else t.remember=r}}})]),a("button",{staticClass:"button is-medium is-primary",attrs:{type:"submit",translate:"yes"}},[t._v("Login")]),t._m(3)])]),a("div",{staticClass:"column is-4 is-offset-4"},[a("p",{attrs:{translate:"yes"}},[t._v("Forgot your password? "),a("router-link",{attrs:{to:{name:"reset"},tag:"a"}},[t._v("Reset your password")])],1)])])},q=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1"},[t._v("Login")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"wrong credentials",translate:"yes"}},[t._v("Wrong credentials")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not activated",translate:"yes"}},[t._v("Account not activated. Check your mailbox for activation email.")]),a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v(" This site is protected by reCAPTCHA and the Google"),a("br"),a("a",{attrs:{href:"https://policies.google.com/privacy"}},[t._v("Privacy Policy")]),t._v(" and "),a("a",{attrs:{href:"https://policies.google.com/terms"}},[t._v("Terms of Service")]),t._v(" apply. ")])}],R=a("5b55"),U={name:"UsersLogin",data:function(){return{email:"",password:"",remember:!1}},created:function(){},methods:{userLogin:function(){var t=this,e=this,a=this.$helpers.propertiesRequiredConfirm({email:this.email,password:this.password},["email","password"]);a.result&&""!=this.email&&""!=this.password?this.$helpers.recaptcha(this,"login").then((function(e){return t.$httpc.post("helpers/recaptcha",{token:e},{timeout:3e3}).then((function(t){return t}))})).catch((function(t){if(console.log("RECAPTCHA NOT WORKING! Make sure you have RECAPTCHA variables set in backend enviroment."),confirm("RECAPTCHA NOT WORKING\nAre you sure you want to Login?\n\nSee console for more information"))return{data:!0}})).then((function(a){a&&1==a.data&&t.$httpc.post("users/login",{user:{email:t.email,password:t.password}}).then((function(t){if(t.data.user&&t.data.user._id){R["a"].COOKIE_TIME;1==e.remember&&R["a"].COOKIE_TIME_REMEMBER;e.$store.state.user.logged=!0,e.$store.state.user.remember=e.remember;var a=t.data.user;e.$store.dispatch("setUser",a),e.$router.push({name:"me"})}})).catch((function(t){t.response&&t.response.data&&t.response.data.errors&&Object.keys(t.response.data.errors).length>0&&Object.keys(t.response.data.errors).forEach((function(a){var s=e.$el.querySelector(".field."+a);if(s){var r=s.querySelector('.form-messages .form-message[data-message="'+t.response.data.errors[a]+'"]');if(r&&null!=r){e.$helpers.undecorateFormField(s,"danger");var i=r.innerText;e.$helpers.decorateFormField(s,i,"danger")}}}))})).then((function(t){}))})):this.$helpers.formUndecorateAndDecorateFields(a.fields,a.errors)}}},j=U,V=Object(g["a"])(j,M,q,!1,null,"311a8338",null),z=V.exports,G=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container users-login"},[t._m(0),a("div",{staticClass:"columns"},[t.sent?a("div",{staticClass:"column is-half is-offset-one-quarter"},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Your registration was successfull, we are sending you email")]),a("p",{attrs:{translate:"yes"}},[t._v("Check your mailbox for verification email (if not found check, also you spam folder).")])]):a("div",{staticClass:"column is-half is-offset-one-quarter"},[a("form",{on:{submit:function(e){return e.preventDefault(),t.userRegister(e)}}},[a("div",{staticClass:"simple-wrapper"},[t._m(1),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field username"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Username")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.username,expression:"user.username"}],staticClass:"input",attrs:{type:"text",placeholder:"Username"},domProps:{value:t.user.username},on:{input:function(e){e.target.composing||t.$set(t.user,"username",e.target.value)}}})]),t._m(2)])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field email"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Email")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.email,expression:"user.email"}],staticClass:"input",attrs:{type:"email",placeholder:"Email"},domProps:{value:t.user.email},on:{input:function(e){e.target.composing||t.$set(t.user,"email",e.target.value)}}})]),t._m(3)])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field email2"},[a("label",{staticClass:"label"},[t._v("Email Confirm")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.email2,expression:"user.email2"}],staticClass:"input",attrs:{type:"email",placeholder:"Email Confirm"},domProps:{value:t.user.email2},on:{input:function(e){e.target.composing||t.$set(t.user,"email2",e.target.value)}}})]),t._m(4)])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field password"},[a("label",{staticClass:"label"},[t._v("Password")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.password,expression:"user.password"}],staticClass:"input",attrs:{type:"password",placeholder:"Password"},domProps:{value:t.user.password},on:{input:function(e){e.target.composing||t.$set(t.user,"password",e.target.value)}}})]),t._m(5)])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field password2"},[a("label",{staticClass:"label"},[t._v("Password Confirm")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.password2,expression:"user.password2"}],staticClass:"input",attrs:{type:"password",placeholder:"Password Confirm"},domProps:{value:t.user.password2},on:{input:function(e){e.target.composing||t.$set(t.user,"password2",e.target.value)}}})]),t._m(6)])])])]),t._m(7),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("First Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.nameFirst,expression:"user.nameFirst"}],staticClass:"input",attrs:{type:"text",placeholder:"First Name"},domProps:{value:t.user.nameFirst},on:{input:function(e){e.target.composing||t.$set(t.user,"nameFirst",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Last Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.nameLast,expression:"user.nameLast"}],staticClass:"input",attrs:{type:"text",placeholder:"Last Name"},domProps:{value:t.user.nameLast},on:{input:function(e){e.target.composing||t.$set(t.user,"nameLast",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Street")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.street,expression:"user.street"}],staticClass:"input",attrs:{type:"text",placeholder:"Street"},domProps:{value:t.user.street},on:{input:function(e){e.target.composing||t.$set(t.user,"street",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Street 2")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.street2,expression:"user.street2"}],staticClass:"input",attrs:{type:"text",placeholder:"Street 2"},domProps:{value:t.user.street2},on:{input:function(e){e.target.composing||t.$set(t.user,"street2",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-4"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("ZIP")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.zip,expression:"user.zip"}],staticClass:"input",attrs:{type:"text",placeholder:"ZIP"},domProps:{value:t.user.zip},on:{input:function(e){e.target.composing||t.$set(t.user,"zip",e.target.value)}}})])])]),a("div",{staticClass:"column is-8"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("City")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.city,expression:"user.city"}],staticClass:"input",attrs:{type:"text",placeholder:"City"},domProps:{value:t.user.city},on:{input:function(e){e.target.composing||t.$set(t.user,"city",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("State")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.state,expression:"user.state"}],staticClass:"input",attrs:{type:"text",placeholder:"State"},domProps:{value:t.user.state},on:{input:function(e){e.target.composing||t.$set(t.user,"state",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Country")]),a("div",{staticClass:"control select"},[t.$store.state.coredata&&t.$store.state.coredata.countries?a("select",{directives:[{name:"model",rawName:"v-model",value:t.user.country,expression:"user.country"}],on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.user,"country",e.target.multiple?a:a[0])}}},t._l(t.$store.state.coredata.countries,(function(e){return a("option",{key:e.code,domProps:{value:e.code}},[t._v(" "+t._s(e.name)+" ")])})),0):t._e()])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v("Phone")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.phone,expression:"user.phone"}],staticClass:"input",attrs:{type:"text",placeholder:"Phone"},domProps:{value:t.user.phone},on:{input:function(e){e.target.composing||t.$set(t.user,"phone",e.target.value)}}})])])])]),a("div",{staticClass:"simple-wrapper"},[t._m(8),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field companyName"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Company Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.companyName,expression:"user.companyName"}],staticClass:"input",attrs:{type:"text",placeholder:"Company Name"},domProps:{value:t.user.companyName},on:{input:function(e){e.target.composing||t.$set(t.user,"companyName",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyOrgId"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Organisation ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.companyOrgId,expression:"user.companyOrgId"}],staticClass:"input",attrs:{type:"text",placeholder:"Organisation ID"},domProps:{value:t.user.companyOrgId},on:{input:function(e){e.target.composing||t.$set(t.user,"companyOrgId",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyTaxId"},[a("label",{staticClass:"label"},[t._v("Company Tax ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.companyTaxId,expression:"user.companyTaxId"}],staticClass:"input",attrs:{type:"text",placeholder:"Company Tax ID"},domProps:{value:t.user.companyTaxId},on:{input:function(e){e.target.composing||t.$set(t.user,"companyTaxId",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyTaxVatId"},[a("label",{staticClass:"label"},[t._v("Company VAT ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.companyTaxVatId,expression:"user.companyTaxVatId"}],staticClass:"input",attrs:{type:"text",placeholder:"Company VAT ID"},domProps:{value:t.user.companyTaxVatId},on:{input:function(e){e.target.composing||t.$set(t.user,"companyTaxVatId",e.target.value)}}})])])])])]),a("hr"),a("button",{staticClass:"button is-success"},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" Register ")],1),t._m(9)])])])])},B=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns"},[a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1",attrs:{translate:"yes"}},[t._v("Register")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12",attrs:{translate:"yes"}},[t._v(" Required Fields ")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"exists",translate:"yes"}},[t._v("This email already exists")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not confirmed",translate:"yes"}},[t._v("Values do not match")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not confirmed",translate:"yes"}},[t._v("Values do not match")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[a("hr")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12",attrs:{translate:"yes"}},[t._v(" If you are company ")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v(" This site is protected by reCAPTCHA and the Google"),a("br"),a("a",{attrs:{href:"https://policies.google.com/privacy"}},[t._v("Privacy Policy")]),t._v(" and "),a("a",{attrs:{href:"https://policies.google.com/terms"}},[t._v("Terms of Service")]),t._v(" apply. ")])}],H={name:"UsersRegister",data:function(){return{sent:!1,user:{username:"",email:"",email2:"",password:"",password2:"",nameFirst:"",nameLast:"",street:"",street2:"",zip:"",city:"",state:"",country:"",phone:"",companyName:"",companyOrgId:"",companyTaxId:"",companyTaxVatId:""}}},created:function(){},methods:{userRegister:function(){var t=this,e=null,a=["username","email","password"],s=["email","password"],r=this;if(e=this.$helpers.propertiesRequiredConfirm(this.user,a,s),e.result){var i={user:{username:this.user.username,email:this.user.email,password:this.user.password}};this.$store.state.language&&this.$store.state.language.code&&this.$store.state.currency&&this.$store.state.currency.code&&(i.user["settings"]={language:this.$store.state.language.code,currency:this.$store.state.currency.code});var n=this.checkFillAddress();n&&(i.user["addresses"]=[],i.user["addresses"].push(n));var o=this.checkFillCompany();o&&(i.user["company"]=[],i.user["company"].push(o)),this.$helpers.recaptcha(this,"register").then((function(e){return t.$httpc.post("helpers/recaptcha",{token:e},{timeout:3e3}).then((function(t){return t}))})).catch((function(t){if(console.log("RECAPTCHA NOT WORKING! Make sure you have RECAPTCHA variables set in backend enviroment."),confirm("RECAPTCHA NOT WORKING\nAre you sure you want to Login?\n\nSee console for more information"))return{data:!0}})).then((function(e){e&&1==e.data&&t.$httpc.post("users/register",i,{timeout:5e3}).then((function(t){r.sent=!0;var e=r.$el.querySelector(".field.");Object.keys(e).forEach((function(t){r.$helpers.undecorateFormField(t,"danger")}))})).catch((function(t){t.response&&t.response.data&&t.response.data.errors&&Object.keys(t.response.data.errors).length>0&&Object.keys(t.response.data.errors).forEach((function(e){var a=r.$el.querySelector(".field."+e);if(a){var s=a.querySelector('.form-messages .form-message[data-message="'+t.response.data.errors[e]+'"]');if(s&&null!=s){var i=s.innerText;r.$helpers.decorateFormField(a,i,"danger")}}}))})).then((function(){}))}))}else e&&e.fields&&e.errors?(this.$scrollTo(this.$el.querySelector(".field."+e.fields[0]),500,{offset:-100}),this.$helpers.formUndecorateAndDecorateFields(e.fields,e.errors)):(this.$scrollTo(this.$el.querySelector(".field."+a.fields[0]),500,{offset:-100}),this.$helpers.formUndecorateAndDecorateFields(a,[]))},checkFillAddress:function(){var t=null,e=["nameFirst","nameLast","street","street2","zip","city","state","country","phone"],a={},s=!1,r=this;return e.forEach((function(t){""!=r.user[t].trim()&&(a[t]=r.user[t].trim(),s=!0)})),s&&(a["type"]="invoice",t=a),t},checkFillCompany:function(){var t=null,e=["companyName","companyOrgId","companyTaxId","companyTaxVatId"],a={},s=!1,r=this;return e.forEach((function(t){""!=r.user[t].trim()&&(a[t]=r.user[t].trim(),s=!0)})),s&&(t=a),t}}},W=H,K=(a("5bc8"),Object(g["a"])(W,G,B,!1,null,null,null)),Y=K.exports,J=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container users-me"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1",attrs:{translate:"yes"}},[t._v("Verify")]),a("p",{},[t._v(t._s(t.email))]),t.error?a("div",[a("p",{staticClass:"has-text-danger",attrs:{translate:"yes"}},[t._v("Activation link is not valid anymore (valid only for 2 hours)")]),a("p",[a("span",{attrs:{translate:"yes"}},[t._v("If more than 2 hours passed, try to")]),t._v(" "),a("router-link",{attrs:{to:{name:"reset"},tag:"a",translate:"yes"}},[t._v("reset your password")])],1)]):t._e()])])])},Z=[],Q=(a("3b2b"),{name:"UsersVerify",data:function(){return{error:!1}},computed:{email:function(){var t=new RegExp("--","g"),e=this.$route.params.id.toString().replace("---","@").replace(t,".");return e}},mounted:function(){console.log("verify"),this.sendVerifycation()},methods:{sendVerifycation:function(){var t=this,e=decodeURIComponent(this.$route.params.id),a=decodeURIComponent(this.$route.params.hash);this.$httpc.post("user/verify",{email:e,hash:a},{timeout:7e3}).then((function(e){if(e.data.user){t.$store.state.user.logged=!0,t.$store.state.user.remember=t.remember;var a=e.data.user;t.$store.dispatch("setUser",a);t.$router.push({name:"me"})}})).catch((function(e){console.log(e),t.error=!0})).then((function(){t.$store.state.user.logged?t.$router.push({name:"me"}):t.error=!0}))}}}),X=Q,tt=Object(g["a"])(X,J,Z,!1,null,null,null),et=tt.exports,at=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container users-me"},[t._m(0),a("div",{staticClass:"columns"},[t.sent?a("div",{staticClass:"column is-half is-offset-one-quarter"},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("We are sending you email")]),a("p",{attrs:{translate:"yes"}},[t._v("Check your mailbox for verification email (if not found check, also you spam folder).")])]):a("div",{staticClass:"column is-half is-offset-one-quarter"},[a("form",{on:{submit:function(e){return e.preventDefault(),t.resetPassword(e)}}},[a("div",{},[t._m(1),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field email"},[a("label",{staticClass:"label"},[t._v("Email")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.email,expression:"email"}],staticClass:"input",attrs:{type:"email",placeholder:"Email"},domProps:{value:t.email},on:{input:function(e){e.target.composing||(t.email=e.target.value)}}})]),t._m(2)])])]),a("button",{staticClass:"button is-success"},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" Reset ")],1),t._m(3)])])])])])},st=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns"},[a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1",attrs:{translate:"yes"}},[t._v("Reset password")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12"},[t._v(" Required Field ")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"not found",translate:"yes"}},[t._v("This email couldn't be found")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v(" This site is protected by reCAPTCHA and the Google"),a("br"),a("a",{attrs:{href:"https://policies.google.com/privacy"}},[t._v("Privacy Policy")]),t._v(" and "),a("a",{attrs:{href:"https://policies.google.com/terms"}},[t._v("Terms of Service")]),t._v(" apply. ")])}],rt={name:"UsersVerify",data:function(){return{email:null,sent:!1}},computed:{},mounted:function(){},methods:{resetPassword:function(){var t=this,e=this;this.$helpers.recaptcha(this,"reset").then((function(e){return t.$httpc.post("helpers/recaptcha",{token:e},{timeout:3e3}).then((function(t){return t}))})).catch((function(t){if(console.log("RECAPTCHA NOT WORKING! Make sure you have RECAPTCHA variables set in backend enviroment."),confirm("RECAPTCHA NOT WORKING\nAre you sure you want to Login?\n\nSee console for more information"))return{data:!0}})).then((function(a){a&&1==a.data&&t.$httpc.post("user/reset",{email:t.email},{timeout:7e3}).then((function(t){e.sent=!0})).catch((function(t){t.response&&t.response.data&&t.response.data.errors&&Object.keys(t.response.data.errors).length>0&&Object.keys(t.response.data.errors).forEach((function(a){var s=e.$el.querySelector(".field."+a);if(s){var r=s.querySelector('.form-messages .form-message[data-message="'+t.response.data.errors[a]+'"]');if(r&&null!=r){e.$helpers.undecorateFormField(s,"danger");var i=r.innerText;e.$helpers.decorateFormField(s,i,"danger")}}}))})).then((function(){}))}))}}},it=rt,nt=Object(g["a"])(it,at,st,!1,null,null,null),ot=nt.exports,lt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container category-list"},[t.userCanEdit&&(t.categoryDetail&&t.categoryDetail.pathSlug||t.page)?a("div",{staticClass:"edit-area"},[t.categoryDetail&&t.categoryDetail.pathSlug?a("router-link",{staticClass:"editor-button edit-button",attrs:{to:{name:"categoryNewEdit",params:{category:t.categoryDetail.pathSlug}}}},[a("font-awesome-icon",{attrs:{icon:"edit"}})],1):t._e(),t.page&&t.page.slug?a("router-link",{staticClass:"editor-button edit-button",attrs:{to:{name:"pageNewEdit",params:{slug:t.page.slug}}}},[a("font-awesome-icon",{attrs:{icon:"edit"}})],1):t._e()],1):t._e(),a("div",{staticClass:"columns category-header",style:{backgroundImage:"url("+t.getCategoryBackground()+")"}},[a("div",{staticClass:"column"},[t.categoryDetail?a("h1",{staticClass:"title is-1"},[t._v(t._s(t.categoryDetail.name[t.$store.state.language.code]))]):t._e(),t.categoryDetail?a("h2",{staticClass:"title is-3"},[t._v(t._s(t.categoryDetail.descriptionShort[t.$store.state.language.code]))]):t._e(),t.categoryDetail?a("p",{},[t._v(t._s(t.categoryDetail.descriptionLong[t.$store.state.language.code]))]):a("h1",{staticClass:"title is-1 title-products",attrs:{translate:"yes"}},[t._v("Products")])])]),a("div",{staticClass:"columns",attrs:{id:"category-main-content"}},[a("div",{staticClass:"column is-3"},[t.categories&&t.categories.length>0?a("nav",{staticClass:"panel"},[a("aside",{staticClass:"menu"},[a("p",{staticClass:"menu-label",attrs:{translate:"yes"}},[t._v(" Sub-Categories ")]),a("ul",{staticClass:"menu-list"},t._l(this.categories,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),0)])]):t._e(),a("category-filter",{ref:"categoryFilter",attrs:{filter:t.filter,categoryMinMaxPrice:t.categoryMinMax,categoryType:t.getCategoryType()}})],1),a("div",{staticClass:"column is-9"},[t.breadcrumbs&&null!=t.breadcrumbs&&t.breadcrumbs.length>0?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[a("ul",[t._l(t.breadcrumbs,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.$store.state.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),a("li",{staticClass:"is-active"},[a("router-link",{attrs:{title:t.categoryDetail.name[t.$store.state.language.code],to:{name:"categoryList",params:{category:t.categoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.categoryDetail.name[t.$store.state.language.code])+" ")])],1)],2)]):t._e(),t.products&&t.products.length>0?a("div",[a("category-paging",{ref:"categoryPaging",attrs:{total:t.categoryProductsTotalForPaging}}),"product"==t.itemsToListType?a("div",t._l(t.products,(function(e,s){return a("div",{key:t.groupsLastRefresh+s,staticClass:"tile is-ancestor"},t._l(e,(function(e,r){return a("router-link",{key:t.groupsLastRefresh+e._id+(s+r),staticClass:"tile is-parent is-4",attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"productDetail",params:{category:t.categoryDetail.pathSlug,product:e._id,slug:e.slug}}}},[a("product-box",{attrs:{product:e}})],1)})),1)})),0):t._e(),"page"==t.itemsToListType?a("div",t._l(t.products,(function(e,s){return a("div",{key:t.groupsLastRefresh+s,staticClass:"tile is-ancestor"},t._l(e,(function(e,r){return a("router-link",{key:t.groupsLastRefresh+e._id+(s+r),staticClass:"tile is-parent is-4",attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"pageDetail",params:{category:t.categoryDetail.pathSlug,slug:e.slug}}}},[a("product-box",{attrs:{product:e}})],1)})),1)})),0):t._e(),a("category-paging",{ref:"categoryPaging",attrs:{bottom:!0,total:t.categoryProductsTotalForPaging}})],1):t.page&&t.page.data?a("div",[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.page.data&&t.page.data.name?a("h1",{staticClass:"title is-1"},[t._v(t._s(t.page.data.name[t.$store.state.language.code]))]):t._e(),a("page-detail-content",{attrs:{content:t.categoryTypePageContent,contentData:t.categoryTypePageData,contentLang:t.language.code}})],1)])]):a("div",[a("h2",{attrs:{translate:"yes"}},[t._v("Nothing found")])])])])])},ct=[],dt=(a("55dd"),a("5ac7")),ut=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("nav",{staticClass:"panel categoryFilter"},[a("p",{staticClass:"panel-heading",attrs:{translate:"yes"}},[t._v(" Filter ")]),a("div",{staticClass:"panel-block"},[a("p",{staticClass:"control has-text-centered is-size-7"},[t.countsDoNotMatch?a("span",[a("span",{attrs:{translate:"yes"}},[t._v("Filtered")]),t._v(": "),a("span",[t._v(t._s(t.filteredCount))]),t._v(" / ")]):t._e(),a("span",{attrs:{translate:"yes"}},[t._v("Total")]),t._v(": "),a("span",[t._v(t._s(t.categoryTotalCount))])])]),a("div",{staticClass:"panel-block"},[a("p",{staticClass:"control has-icons-left"},[a("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.tempFilter.stringFilter,expression:"tempFilter.stringFilter",modifiers:{trim:!0}}],staticClass:"input is-small",attrs:{type:"text",translate:"yes",placeholder:"search"},domProps:{value:t.tempFilter.stringFilter},on:{keyup:t.stringFilterChange,input:function(e){e.target.composing||t.$set(t.tempFilter,"stringFilter",e.target.value.trim())},blur:function(e){return t.$forceUpdate()}}}),t._m(0)])]),"products"==t.categoryType?a("div",{staticClass:"panel-block"},[a("div",{staticClass:"panel-block-multiwrapper"},[t._m(1),a("div",{staticClass:"slider-range",attrs:{slider:""}},[a("div",{staticClass:"slider-range-controls"},[a("div",{staticStyle:{width:"0%"},attrs:{"inverse-left":""}}),a("div",{staticStyle:{width:"0%"},attrs:{"inverse-right":""}}),a("div",{staticStyle:{left:"0%",right:"0%"},attrs:{range:""}}),a("span",{staticStyle:{left:"0%"},attrs:{thumb:"left"}}),a("span",{staticStyle:{left:"100%"},attrs:{thumb:"right"}}),a("div",{staticStyle:{left:"0%"},attrs:{sign:"left"}},[a("span",{staticClass:"value"},[t._v(t._s(t.categoryPriceMin))])]),a("div",{staticStyle:{left:"100%"},attrs:{sign:"right"}},[a("span",{staticClass:"value"},[t._v(t._s(t.categoryPriceMax))])])]),a("input",{attrs:{type:"range",position:"left",tabindex:"0",max:t.categoryPriceMax,min:t.categoryPriceMin,step:"1"},domProps:{value:t.filterPriceMin},on:{input:t.priceSliderChange}}),a("input",{attrs:{type:"range",position:"right",tabindex:"0",max:t.categoryPriceMax,min:t.categoryPriceMin,step:"1"},domProps:{value:t.filterPriceMax},on:{input:t.priceSliderChange}})])])]):t._e(),"products"==t.categoryType?a("div",{staticClass:"panel-block"},[a("div",{staticClass:"panel-block-multiwrapper"},[t._m(2),a("div",[a("div",{staticClass:"control has-text-centered"},[a("div",{staticClass:"select is-centered"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.tempFilter.sort,expression:"tempFilter.sort"}],on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.tempFilter,"sort",e.target.multiple?a:a[0])},t.changeSorting]}},[a("option",{attrs:{value:"price"}},[t._v("Price Ascending")]),a("option",{attrs:{value:"-price"}},[t._v("Price Descending")]),a("option",{attrs:{value:"-dates.dateCreated"}},[t._v("Latest")]),a("option",{attrs:{value:"stockAmount"}},[t._v("On Stock Amount")])])])])])])]):t._e(),"pages"==t.categoryType?a("div",{staticClass:"panel-block"},[a("div",{staticClass:"panel-block-multiwrapper"},[t._m(3),a("div",[a("div",{staticClass:"control has-text-centered"},[a("div",{staticClass:"select is-centered"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.tempFilter.sort,expression:"tempFilter.sort"}],on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.tempFilter,"sort",e.target.multiple?a:a[0])},t.changeSorting]}},[a("option",{attrs:{value:"-dates.dateCreated"}},[t._v("Latest")]),a("option",{attrs:{value:"dates.dateCreated"}},[t._v("Oldest")])])])])])])]):t._e()])},mt=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",{staticClass:"icon is-small is-left"},[a("i",{staticClass:"fas fa-search",attrs:{"aria-hidden":"true"}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Price")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("label",{staticClass:"label"},[a("span",{attrs:{translate:"yes"}},[t._v("Sort by")]),t._v(":")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("label",{staticClass:"label"},[a("span",{attrs:{translate:"yes"}},[t._v("Sort by")]),t._v(":")])])}],pt={data:function(){return{eventTimeoutId:null,tempFilter:{page:1,minMaxPrice:{min:0,max:0},stringFilter:"",sort:this.getDefaultSorting()},introMinMaxPrice:{min:null,max:null}}},mounted:function(){console.log("getCategoryType:",this.getCategoryType()),Qe.$emit("translateContent",this.$store.getters.getTranslates)},props:["filter","categoryMinMaxPrice","categoryType"],computed:{filterPriceMin:function(){return 0!=this.tempFilter.minMaxPrice.min?this.tempFilter.minMaxPrice.min:this.categoryPriceMin},filterPriceMax:function(){return 0!=this.tempFilter.minMaxPrice.max?this.tempFilter.minMaxPrice.max:this.categoryPriceMax},categoryPriceMin:function(){return"undefined"!==typeof this.categoryMinMaxPrice&&this.categoryMinMaxPrice.minthis.categoryMinMaxPrice.min?this.categoryMinMaxPrice.max:0},filteredCount:function(){return"undefined"!==typeof this.$parent?this.$parent.getCategoryFilteredCount():0},categoryTotalCount:function(){return"undefined"!==typeof this.$parent&&"undefined"!==typeof this.$parent.categoryDetail&&this.$parent.categoryDetail&&this.$parent.categoryDetail.count&&this.$parent.categoryDetail.count>0?this.$parent.categoryDetail.count:0},countsDoNotMatch:function(){return this.filteredCount>0&&this.filteredCount!=this.categoryTotalCount}},methods:{stringFilterChange:function(t){var e=t.target;this.filter.stringFilter=e.value,this.requestFilteredProductList()},priceSliderChange:function(t){var e="undefined"!==typeof t.forceValue?t.forceValue:null,a=t.target,s=a.getAttribute("position"),r="",i=0,n=null;"left"===s?(r="right",i=-1,n=a.parentNode.querySelector("input[type=range][position="+r+"]"),a.value=Math.min(a.value,parseInt(n.value)+i)):(s="right",r="left",i=1,n=a.parentNode.querySelector("input[type=range][position="+r+"]"),a.value=Math.max(a.value,parseInt(n.value)+i));var o=null,l=this.$parent.getCategoryMinMax();null!==e?(0==a.min&&"undefined"!==typeof l.min&&(a.min=l.min),0==a.max&&"undefined"!==typeof l.max&&(a.max=l.max),o=100/(parseInt(a.max)-parseInt(a.min))*parseInt(e)-100/(parseInt(a.max)-parseInt(a.min))*parseInt(a.min),a.value=e):(0==a.value&&("left"===s&&l&&(a.value=l.min),"right"===s&&l&&(a.value=l.max)),o=100/(parseInt(a.max)-parseInt(a.min))*parseInt(a.value)-100/(parseInt(a.max)-parseInt(a.min))*parseInt(a.min));var c=a.parentNode.querySelector(".slider-range-controls");"left"===s?(c.querySelector("[inverse-"+s+"]").style.width=o+"%",c.querySelector("[range]").style.left=o+"%"):(c.querySelector("[inverse-"+s+"]").style.width=100-o+"%",c.querySelector("[range]").style.right=100-o+"%"),c.querySelector("[thumb="+s+"]").style.left=o+"%",c.querySelector("[sign="+s+"]").style.left=o+"%",0==a.value?("right"===s&&"undefined"!==typeof l.max&&l.max>0&&(c.querySelector("[sign="+s+"] .value").innerText=l.max),"left"===s&&"undefined"!==typeof l.min&&l.min>0&&(c.querySelector("[sign="+s+"] .value").innerText=l.min)):c.querySelector("[sign="+s+"] .value").innerText=a.value;var d={};"left"===s?(d.min=a.value,d.max=n.value):(d.min=n.value,d.max=a.value),this.tempFilter.minMaxPrice=d,null==e&&0==this.$parent.introLoading&&this.requestFilteredProductList()},requestFilteredProductList:function(){var t=this;clearTimeout(this.eventTimeoutId),this.eventTimeoutId=setTimeout((function(){t.$root.loadingShow(),t.$httpc.post(t.getCategoryType()+"/filter",t.buildFilterRequestObject(),{timeout:7e3}).then((function(e){var a=t.$parent.categoryDetail;e["data"]={categories:t.$parent.categories,categoryDetail:a,filter:e.data.filter,results:e.data.results,filteredProductsCount:e.data.filteredProductsCount},t.changeFilterUrl(),t.$parent.processCategoryResponse(e)})).catch((function(t){console.log(t)}))}),1e3)},buildFilterRequestObject:function(t){var e=this.tempFilter;"undefined"!==typeof t&&t&&(e=t);var a=null;if("undefined"!==typeof this.$parent.categoryDetail&&this.$parent.categoryDetail){e["category"]={_id:this.$parent.categoryDetail._id,pathSlug:this.$parent.categoryDetail.pathSlug,subsSlugs:this.$parent.categoryDetail.subsSlugs};var s=e.category.subsSlugs;s.unshift(e.category.pathSlug),a={$in:s}}var r={query:{categories:a},limit:R["a"].PER_PAGE,sort:e.sort};if(e.page>1){var i=Math.abs(e.page-1)*R["a"].PER_PAGE;i>0&&(r.offset=i)}e.stringFilter&&""!==e.stringFilter.trim()&&(r.query["name."+this.$store.state.language.code]={$regex:e.stringFilter});var n="undefined"!==typeof e.minMaxPrice&&"undefined"!==typeof e.minMaxPrice.min?e.minMaxPrice.min:0,o="undefined"!==typeof e.minMaxPrice&&"undefined"!==typeof e.minMaxPrice.max?e.minMaxPrice.max:0;return(n>this.categoryPriceMin||o0&&(r.query["price"]={$gte:parseFloat(n),$lte:parseFloat(o)}),r},changeFilterUrl:function(){var t=this.filterObjectToQueryString();""!==t&&history.pushState({},null,t)},filterObjectToQueryString:function(){var t=[],e="";return this.tempFilter.page>1&&t.push("page="+encodeURIComponent(parseInt(this.tempFilter.page))),this.tempFilter.minMaxPrice.min>this.categoryPriceMin&&t.push("price-min="+encodeURIComponent(this.tempFilter.minMaxPrice.min)),this.tempFilter.minMaxPrice.max0&&(e=this.$route.path+"?"+t.join("&")),e},setActivePage:function(t){this.tempFilter.page=t,this.requestFilteredProductList()},changeSorting:function(t){this.tempFilter.sort=t.target.value,this.requestFilteredProductList()},setTempFilter:function(t){var e=this,a=!1,s={target:this.$el.querySelector("input[type=range][position=left]")},r={target:this.$el.querySelector("input[type=range][position=right]")};Object.keys(t).forEach((function(i){"undefined"!==typeof e.tempFilter[i]&&(e.tempFilter[i]=t[i],"minMaxPrice"==i&&(s["forceValue"]=e.tempFilter.minMaxPrice.min,r["forceValue"]=e.tempFilter.minMaxPrice.max,a=!0))})),a&&(this.priceSliderChange(s),this.priceSliderChange(r))},getCategoryType:function(){return this.categoryType?this.categoryType:"products"},getDefaultSorting:function(){return"pages"==this.getCategoryType()?R["a"].PRODUCT_DEFAULT_SORTING:R["a"].PAGE_DEFAULT_SORTING}}},gt=pt,vt=(a("a906"),Object(g["a"])(gt,ut,mt,!1,null,null,null)),ht=vt.exports,ft=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.total>t.perPage?a("section",[a("b-pagination",{attrs:{total:t.total,current:t.current,order:t.order,size:t.size,simple:t.isSimple,rounded:t.isRounded,"per-page":t.perPage,"aria-next-label":"Next page","aria-previous-label":"Previous page","aria-page-label":"Page","aria-current-label":"Current page"},on:{"update:current":function(e){t.current=e},change:t.pagingChanged}}),1==t.bottom?a("div",[a("button",{staticClass:"button"},[t._v("Load More ...")])]):t._e()],1):t._e()},yt=[],Ct=(a("c5f6"),{data:function(){return{current:1,perPage:R["a"].PER_PAGE,order:"is-centered",size:"",isSimple:!1,isRounded:!1}},props:{bottom:!1,total:{type:Number,required:!0}},methods:{pagingChanged:function(t){this.current=t,this.$parent.$refs.categoryFilter.setActivePage(t),console.log("value:",t)}}}),_t=Ct,$t=Object(g["a"])(_t,ft,yt,!1,null,null,null),bt=$t.exports,Pt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"pagecontent",staticClass:"page-body",domProps:{innerHTML:t._s(t.content)}})},xt=[],wt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.contentData?a("div",[a("div",{staticClass:"tile is-ancestor"},t._l(t.contentData.data,(function(e,s){return a("router-link",{key:e._id+s,staticClass:"tile is-parent is-4",attrs:{title:e.descriptionShort[t.language],to:{name:"productDetail",params:{category:t.getSlugForCategory(e),product:e._id,slug:e.slug}}}},[a("product-box",{attrs:{product:e,hideBuyButton:"true"}})],1)})),1)]):t._e()},Dt=[],It={name:"ProductSlide",data:function(){return{products:[],itemsToListType:"product",introLoading:!1}},components:{"product-box":dt["a"]},props:{language:"en",contentData:null},computed:{},mounted:function(){},methods:{getSlugForCategory:function(t){return t&&t.categoriesData&&t.categoriesData[t.categories[0]]&&t.categoriesData[t.categories[0]].pathSlug?t.categoriesData[t.categories[0]].pathSlug:t.slug}}},Tt=It,kt=(a("20da"),Object(g["a"])(Tt,wt,Dt,!1,null,null,null)),At=kt.exports,St={name:"PageDetailContent",data:function(){return{page:null,parentCategoryDetail:null}},props:{contentLang:{default:"en"},content:{default:""},contentData:{default:null}},mounted:function(){var t=this;Qe.$on("pageDetailLoaded",(function(){setTimeout((function(){t.processData()}),500)}))},computed:{something:function(){}},methods:{processData:function(){if(this.contentData&&this.$refs.pagecontent)for(var t=this.$helpers.getPageFunctions(this.$refs.pagecontent.innerHTML),e=0;e0?this.page.functions:null}},components:{"product-box":dt["a"],"category-filter":ht,"category-paging":bt,"page-detail-content":Ot},mounted:function(){var t=this;this.$store&&this.$store.state&&this.$store.state.language&&this.$store.state.language.code&&this.$store.state.user?this.listCategoryItems(!0):Qe.$on("coreDataLoaded",(function(){t.listCategoryItems(!0)}))},methods:{processCategoryResponse:function(t){var e=new Date,a=this;this.groupsLastRefresh=e.getTime();var s=null;if(t.data.categoryDetail&&(this.categoryDetail=t.data.categoryDetail,t.data.categoryDetail.parentCategories&&(this.breadcrumbs=t.data.categoryDetail.parentCategories),s=this.categoryDetail.taxData?this.categoryDetail.taxData:a.$store.state.coredata.settings),t.data.categories&&(this.categories=t.data.categories),t.data.filteredProductsCount&&(this.filteredProductsCount=t.data.filteredProductsCount),t.data.results){var r=t.data.results;t.data.categoryDetail&&t.data.categoryDetail.pathSlug&&r.forEach((function(e){e=a.$helpers.getProductTaxData(e,s),e.activeParentCategoryUrl=t.data.categoryDetail.pathSlug})),r&&r[0]&&r[0].type&&(this.itemsToListType=r[0].type),this.products=this.$store.state.chunk(r,R["a"].PER_ROW)}if(t.data.filter){var i=Object.assign({},this.filter);this.filter=t.data.filter;var n=this;Object.keys(i).forEach((function(t){"undefined"!==typeof n.filter[t]&&null!=n.filter[t]||(n.filter[t]=i[t])}))}this.$root.loadingClose()},listCategoryItems:function(t){t=!("undefined"===typeof t&&!t);var e=this,a=this.$route.path.split("/").filter(Boolean),s="undefined"!==typeof a[1]?a[1]:"products";if(this.$route.params&&this.$route.params.category&&""!=this.$route.params.category.toString().trim())if(this.$root.loadingShow(),t&&Object.keys(this.$route.query).length>0){this.queryStringtoFilter();var r=this.categoryDetail&&"pages"==this.categoryDetail.type?"pageCategoryFilter":"categoryFilter";e.$httpc.post(s+"/"+this.$route.params.category,{filter:this.$refs[r].buildFilterRequestObject(this.filter)},{timeout:7e3}).then((function(t){e.processCategoryResponse(t),"undefined"!==typeof e.$refs[r]&&(e.introLoading=!0,e.$refs[r].setTempFilter(e.filter),e.introLoading=!1)})).catch((function(t){console.log(t)})).then((function(){Qe.$emit("translateContent",e.$store.getters.getTranslates)}))}else console.log("listCategoryItems no need to analyse"),this.$httpc.get(s+"/"+this.$route.params.category,{timeout:7e3}).then((function(t){e.processCategoryResponse(t)})).catch((function(t){console.log(t)})).then((function(){Qe.$emit("translateContent",e.$store.getters.getTranslates)}));else{console.log("listCategoryItems no slug");var i=this.$route.path,n=i.split("/"),o=e.$store.state.language.code;n.length>1&&(o=n[1],n.splice(0,2),i=n.join("/"));var l=i;this.$httpc.post("categories/find",{query:{parentPathSlug:"",type:l},lang:o}).then((function(t){t.data&&(e.categories=t.data.categories,t.data.page&&t.data.page.data&&(e.page=t.data.page.data))})).catch((function(t){console.log(t)})).then((function(){Qe.$emit("pageDetailLoaded")}))}},queryStringtoFilter:function(){var t={minMaxPrice:{}};if("undefined"!==typeof this.$route.query["price-min"]){var e=parseFloat(this.$route.query["price-min"]);e>0&&(t.minMaxPrice["min"]=e)}if("undefined"!==typeof this.$route.query["price-max"]){var a=parseFloat(this.$route.query["price-max"]);a>0&&(t.minMaxPrice["max"]=a)}if("undefined"!==typeof this.$route.query["string"]){var s=decodeURIComponent(this.$route.query["string"]).trim();""!==s&&(t["stringFilter"]=s)}if("undefined"!==typeof this.$route.query["sort"]){var r=decodeURIComponent(this.$route.query["sort"]).trim();""!==r&&(t["sort"]=r)}this.filter=t},getCategoryMinMax:function(){return this.categoryDetail&&this.categoryDetail.minMaxPrice?this.categoryDetail.minMaxPrice:null},getCategoryFilteredCount:function(){return this.filteredProductsCount&&this.filteredProductsCount>0?this.filteredProductsCount:0},getCategoryType:function(){return this.categoryDetail&&this.categoryDetail.type?this.categoryDetail.type:"products"},getCategoryBackground:function(){return this.categoryDetail&&this.categoryDetail.slug&&this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getImagePath("categories",this.$store.state.coredata,this.categoryDetail.slug,this.categoryDetail.slug+".jpg"):""}}}),Lt=Ft,Mt=(a("3a0c"),Object(g["a"])(Lt,lt,ct,!1,null,null,null)),qt=Mt.exports,Rt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.product?a("div",{staticClass:"container product-detail"},[t.userCanEdit&&t.parentCategoryDetail&&null!=t.parentCategoryDetail.pathSlug&&t.product.slug&&t.product._id?a("div",{staticClass:"edit-area"},[a("router-link",{staticClass:"editor-button edit-button",attrs:{to:{name:"productNewEdit",params:{category:t.parentCategoryDetail.pathSlug,slug:t.product.slug,id:t.product._id}}}},[a("font-awesome-icon",{attrs:{icon:"edit"}})],1)],1):t._e(),a("div",{staticClass:"columns reversed"},[a("div",{staticClass:"column is-7"},[a("div",{staticClass:"product-image-wrapper"},[a("img",{staticClass:"image-main",attrs:{src:t.getProductImagePath(t.product.orderCode),alt:t.product.name[t.$store.state.language.code],onerror:"this.src='/assets/_site/logo-product.svg'"}})])]),a("div",{staticClass:"column is-5 data-main"},[t.parentCategoryDetail?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[t.parentCategoryDetail.parentCategories?a("ul",[t._l(t.parentCategoryDetail.parentCategories,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.$store.state.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),a("li",[a("router-link",{attrs:{title:t.parentCategoryDetail.name[t.$store.state.language.code],to:{name:"categoryList",params:{category:t.parentCategoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.parentCategoryDetail.name[t.$store.state.language.code])+" ")])],1)],2):t._e()]):t._e(),t.product&&null!=t.product?a("div",[a("h1",{staticClass:"title is-1"},[t._v(t._s(t.product.name[t.$store.state.language.code]))]),a("div",{staticClass:"content"},[a("p",[a("span",{attrs:{translate:"yes"}},[t._v("Order Code")]),t._v(": "+t._s(t.product.orderCode))]),a("p",[a("span",{attrs:{translate:"yes"}},[t._v("In stock")]),t._v(" "+t._s(t.product&&t.product.stockAmount?t.product.stockAmount:0))]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-6"},[a("p",{staticClass:"detail-price is-size-2"},[t._v(" "+t._s(t.$store.state.numeral(t.product.price).format("0 0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]),t.product.tax&&t.product.tax>0?a("div",{staticClass:"detail-price is-size-8"},[a("span",{attrs:{translate:"yes"}},[t._v("Without Tax")]),t._v(" ("+t._s(100*t.product.tax)+"%): "+t._s(t.$store.state.numeral(t.product.price-t.product.price*t.product.tax).format("0 0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]):t._e()]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"columns"},["product"!=t.product.type&&"digital"!=t.product.subtype?a("div",{staticClass:"column is-3 product-detail-amount"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.toCartAmount,expression:"toCartAmount"}],staticClass:"input",attrs:{type:"number"},domProps:{value:t.toCartAmount},on:{input:function(e){e.target.composing||(t.toCartAmount=e.target.value)}}})]):t._e(),a("div",{staticClass:"column is-9"},[a("button",{staticClass:"button add-to-cart is-primary",attrs:{"data-id":t.product._id,disabled:t.checkIfBuyButtonEnabled(),"data-amount":t.toCartAmount},on:{click:function(e){return e.preventDefault(),t.addToCart(e)}}},[a("font-awesome-icon",{attrs:{icon:"cart-plus"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add to Cart")])],1)])])])])])]):t._e()])]),t.product&&null!=t.product?a("div",{staticClass:"columns product-descriptions reversed-desktop"},[a("div",{staticClass:"column is-5"},[a("h2",{staticClass:"subtitle"},[t._v(t._s(t.product.descriptionShort[t.$store.state.language.code]))]),t.product.data&&t.product.data.variations?a("div",[a("section",[a("b-collapse",{staticClass:"card",attrs:{"aria-id":"contentIdForA11y3",open:!1},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("div",{staticClass:"card-header",attrs:{role:"button","aria-controls":"contentIdForA11y3"}},[a("p",{staticClass:"card-header-title",attrs:{translate:"yes"}},[t._v(" Variations ")]),a("a",{staticClass:"card-header-icon"},[a("b-icon",{attrs:{icon:e.open?"angle-up":"angle-down"}})],1)])}}],null,!1,4060768951)},[a("div",{staticClass:"card-content"},t._l(t.product.data.variations,(function(e,s){return a("router-link",{key:e._id+s,staticClass:"content",attrs:{title:e.name[t.$store.state.language.code],to:{name:"productDetail",params:{category:e.categories[0],product:e._id,slug:e.slug}}}},[a("figure",{staticClass:"image is-32x32"},[a("img",{attrs:{src:t.getProductImagePath(e.orderCode),alt:e.name[t.$store.state.language.code]}})]),t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])})),1)])],1)]):t._e(),t.product&&t.product.data&&t.product.data.requirements&&t.product.data.requirements.inputs&&t.product.data.requirements.inputs.length>0?a("div",{staticClass:"product-requirements"},[t._m(0),t._l(t.product.data.requirements.inputs,(function(e,s){return a("div",{key:e.codename+s},[a("p",[t._v(t._s(e.description[t.$store.state.language.code]))]),a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[t._v(t._s(e.name[t.$store.state.language.code]))]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.data.requirements.inputs[s].value,expression:"product.data.requirements.inputs[r].value"}],class:t.productReqInputsCheckClasses(s),attrs:{type:"text",placeholder:e.name[t.$store.state.language.code]},domProps:{value:t.product.data.requirements.inputs[s].value},on:{input:function(e){e.target.composing||t.$set(t.product.data.requirements.inputs[s],"value",e.target.value)}}})])])])}))],2):t._e()]),a("div",{staticClass:"column is-7"},[a("div",{staticClass:"productContent",domProps:{innerHTML:t._s(t.product.descriptionLong[t.$store.state.language.code])}})])]):t._e(),t.product&&null!=t.product&&t.product.properties?a("div",{staticClass:"columns product-properties bg-grey"},[a("div",{staticClass:"column is-12"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Properties")]),a("ul",t._l(t.product.properties,(function(e,s){return a("li",{key:s},[a("span",[t._v(t._s(t.getPropertyStrings(e,s).name)+": ")]),a("strong",[t._v(t._s(t.getPropertyStrings(e,s).value))])])})),0)])]):t._e(),a("slider-carousel",{attrs:{product:t.product,editable:!1}}),t.product&&null!=t.product&&t.product.data&&t.product.data.related&&t.product.data.related.productResults&&t.product.data.related.productResults.length>0&&t.$store&&t.$store.state&&t.$store.state.coredata?a("div",{staticClass:"columns product-related"},[a("div",{staticClass:"column is-12"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Related")]),a("div",{staticClass:"tile is-ancestor"},t._l(t.product.data.related.productResults,(function(e,s){return a("router-link",{key:e._id+s,staticClass:"tile is-parent is-3",attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"productDetail",params:{category:e.activeParentCategoryUrl,product:e._id,slug:e.slug}}}},[a("product-box",{attrs:{product:e}})],1)})),1)])]):t._e()],1):t._e()},Ut=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h3",{staticClass:"title is-3"},[a("span",{attrs:{translate:"yes"}},[t._v("Requirements")]),t._v(":")])}],jt=a("7618"),Vt=(a("7f7f"),a("7918")),zt={name:"ProductDetail",data:function(){return{product:null,parentCategoryDetail:null,language:"en",variationModel:null,toCartAmount:1}},components:{"slider-carousel":Vt["a"],"product-box":dt["a"]},created:function(){this.getProductDetail()},computed:{userCanEdit:function(){return!!(this.$store.state&&this.$store.state.user&&this.$store.state.user.logged&&this.$store.state.user.profile&&this.$store.state.user.profile.type&&"admin"==this.$store.state.user.profile.type)}},methods:{getProductDetail:function(){var t=this;this.$route.params&&this.$route.params.category&&""!=this.$route.params.category.toString().trim()&&this.$route.params.product&&""!=this.$route.params.product.toString().trim()&&this.$httpc.get("products/"+this.$route.params.category+"/detail/"+this.$route.params.product).then((function(e){e.data&&(e.data=t.checkProductTax(e.data),t.product=e.data,t.product.name&&t.$store.state&&void 0!==Object(jt["a"])(t.product.name[t.$store.state.language.code])&&(document.title=t.product.name[t.$store.state.language.code]+" - StretchShop"),console.log(e.data)),e.data.products&&(t.products=e.data.products),e.data.parentCategoryDetail&&(t.parentCategoryDetail=e.data.parentCategoryDetail)})).catch((function(t){console.log(t)})).then((function(){}))},addToCart:function(t){var e=this;if(t.currentTarget){var a=t.currentTarget.getAttribute("data-id"),s=parseInt(t.currentTarget.getAttribute("data-amount")),r=this.$el.querySelector(".product-detail img.image-main");this.$helpers.animateAddToCart(t.currentTarget,r),s||(s=1);var i={itemId:a,amount:s};if(this.product.data&&this.product.data.requirements&&this.product.data.requirements.inputs&&this.product.data.requirements.inputs.length>0){var n=[];this.product.data.requirements.inputs.some((function(t){n.push({codename:t.codename,value:t.value})})),n.length>0&&(i["requirements"]=n)}this.$httpc.put("cart",i).then((function(t){console.log(t),t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){console.log(t)})).then((function(){}))}},getProductImagePath:function(t){return this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getProductImagePath(this.$store.state.coredata,t):null},getProductGalleryImagePath:function(t,e){return this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getProductImagePath(this.$store.state.coredata,t,e):null},getPropertyStrings:function(t,e){if(t.constructor===Array)return{name:e,value:t.join(", ")};if(t.constructor===Object){if("undefined"!==typeof t["name"]&&"undefined"!==typeof t["value"]&&this.$store&&this.$store.state&&this.$store.state.language){var a=this.getPropertyNameResult(t),s=this.getPropertyValueResult(t,e);if(""!==a&&""!==s)return{name:a,value:s}}else if("undefined"!==typeof t["value"]&&this.$store&&this.$store.state&&this.$store.state.language){var r=e,i=this.getPropertyValueResult(t);if(""!==r&&""!==i)return{name:r,value:i}}return{name:e,value:t}}return{name:e,value:t}},getPropertyNameResult:function(t,e){return"undefined"!==typeof t["name"][this.$store.state.language.code]?t["name"][this.$store.state.language.code]:e["name"]},getPropertyValueResult:function(t){return"undefined"!==typeof t["value"][this.$store.state.language.code]?t["value"][this.$store.state.language.code].constructor===Array?t["value"][this.$store.state.language.code].join(", "):t["value"][this.$store.state.language.code]:t["value"]},checkProductTax:function(t){return!t||!t.taxData||t.tax&&null!=t.tax||(taxSettings=t.taxData?t.taxData:this.$store.state.coredata.settings,t=this.$helpers.checkProductTax(t,t.taxData)),t},productReqInputsCheckClasses:function(t){var e="input is-size-5 has-text-weight-normal has-text-centered";return this.product.data.requirements.inputs[t].value&&this.product.data.requirements.inputs[t].value.length>2&&""!=this.product.data.requirements.inputs[t].value.trim()?e+=" is-success":e+=" is-danger",e},checkIfBuyButtonEnabled:function(){if(this.product&&this.product.data&&this.product.data.requirements&&this.product.data.requirements.inputs&&this.product.data.requirements.inputs.length){var t=!1;if(this.product.data.requirements.inputs.some((function(e){if(e&&e.value&&null!=e.value)return t=!0,!0})),t)return!1}return!0}}},Gt=zt,Bt=(a("6f35"),Object(g["a"])(Gt,Rt,Ut,!1,null,null,null)),Ht=Bt.exports,Wt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"order-step-1 cart-detail",attrs:{id:"orderCart"}},[a("div",{staticClass:"container"},[t.orderStateNumber<4?a("div",{staticClass:"columns"},[t._m(0)]):t._e()]),a("div",{staticClass:"container"},[t.orderStateNumber<4?a("div",{staticClass:"columns is-variable is-centered orderProgressVisual"},[a("div",{staticClass:"column is-8"},[a("div",{staticClass:"b-steps"},[a("nav",{staticClass:"steps is-rounded"},[a("ul",{staticClass:"step-items"},[a("li",{class:t.getActiveStateClasses(1)},[a("a",{class:t.getClickableStateClasses(1),on:{click:function(e){return t.setViewCoponentId(1,e)}}},[a("div",{staticClass:"step-marker"}),t._m(1)])]),a("li",{class:t.getActiveStateClasses(2)},[a("a",{class:t.getClickableStateClasses(2),on:{click:function(e){return t.setViewCoponentId(2,e)}}},[a("div",{staticClass:"step-marker"}),t._m(2)])]),a("li",{class:t.getActiveStateClasses(3)},[a("a",{class:t.getClickableStateClasses(3),on:{click:function(e){return t.setViewCoponentId(3,e)}}},[a("div",{staticClass:"step-marker"}),t._m(3)])])])])])])]):t._e()]),a("div",{staticClass:"container"},[a("div",{staticClass:"columns is-variable"},[t.orderStateNumber<4?a("div",{staticClass:"column is-6"},[null!=t.$store.state.cart&&t.$store.state.cart.items&&t.$store.state.cart.items.length>0?a("div",[a("div",{staticClass:"columns is-variable"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"b-table"},[a("div",{staticClass:"table-wrapper"},[a("table",{staticClass:"table is-hoverable is-striped is-fullwidth"},[t._m(4),a("tbody",t._l(t.$store.state.cart.items,(function(e,s){return a("tr",{key:s},[a("th",[a("router-link",{attrs:{to:{name:"productDetail",params:{category:e.categories[0],product:e._id,slug:e.slug}}}},[a("img",{attrs:{src:t.getProductImagePath(e.orderCode),alt:e.name[t.$store.state.language.code],onerror:"this.src='/assets/_site/logo-product.svg'"}}),t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1),a("td",{staticClass:"cartItemAmount has-text-right"},["product"!=e.type||"digital"!=e.subtype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.itemAmount[e._id],expression:"itemAmount[item._id]"}],staticClass:"input",attrs:{type:"number",run:!!t.itemAmount[e._id]||(t.itemAmount[e._id]=e.amount)},domProps:{value:t.itemAmount[e._id]},on:{change:function(a){return t.updateCartItemAmount(e._id)},input:function(a){a.target.composing||t.$set(t.itemAmount,e._id,a.target.value)}}}):t._e(),"product"==e.type&&"digital"==e.subtype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.itemAmount[e._id],expression:"itemAmount[item._id]"}],staticClass:"input",attrs:{type:"number",disabled:"disabled",run:!!t.itemAmount[e._id]||(t.itemAmount[e._id]=e.amount)},domProps:{value:t.itemAmount[e._id]},on:{input:function(a){a.target.composing||t.$set(t.itemAmount,e._id,a.target.value)}}}):t._e()]),a("td",{staticClass:"has-text-right"},[a("span",[t._v(t._s(t.$store.state.numeral(e.price).format("0.00")))]),a("span",[t._v(t._s(t.$store.state.currency.symbol))])]),a("td",{staticClass:"has-text-right"},[a("a",{on:{click:function(a){return t.clearCart(e._id)}}},[a("font-awesome-icon",{attrs:{icon:"trash"}})],1)])])})),0),a("tfoot",[t.$store.state.cart&&t.$store.state.cart.priceTotal?a("tr",{attrs:{id:"cart__products-total"}},[a("td"),t._m(5),a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.cart.priceTotal).format("0.00"))+" "+t._s(t.$store.state.currency.symbol))])]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceItemsNoTax?a("tr",{attrs:{id:"cart__products-notax"}},[a("td"),t._m(6),a("td",{staticClass:"has-text-right"},[t._v(" "+t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceItemsNoTax).format("0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceDelivery?a("tr",{attrs:{id:"order__delivery"}},[a("td"),t._m(7),a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceDelivery).format("0.00"))+" "+t._s(t.$store.state.currency.symbol))])]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.pricePayment?a("tr",{attrs:{id:"order__payment"}},[a("td"),t._m(8),a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.order.order.prices.pricePayment).format("0.00"))+" "+t._s(t.$store.state.currency.symbol))])]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceTaxTotal?a("tr",{attrs:{id:"cart__tax"}},[a("td"),t._m(9),a("td",{staticClass:"has-text-right"},[t._v(" "+t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceTaxTotal).format("0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]),a("td")]):t._e(),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceTotal?a("tr",[a("td"),t._m(10),t.$store.state.order&&t.$store.state.order.order&&t.$store.state.order.order.prices&&t.$store.state.order.order.prices.priceTotal?a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceTotal).format("0.00")))]),t._v(" "+t._s(t.$store.state.currency.symbol)+" ")]):t.$store.state.cart&&null!=t.$store.state.cart.priceTotal?a("td",{staticClass:"has-text-right"},[a("strong",[t._v(t._s(t.$store.state.numeral(t.$store.state.cart.priceTotal).format("0.00")))]),t._v(" "+t._s(t.$store.state.currency.symbol)+" ")]):t._e(),a("td")]):t._e()])])])])])]),a("div",{staticClass:"columns is-variable"},[a("div",{staticClass:"column is-12"},[a("button",{staticClass:"button is-danger",on:{click:function(e){return t.clearCart()}}},[a("font-awesome-icon",{attrs:{icon:"trash"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Clear Cart")])],1)])])]):a("div",[t._m(11)])]):t._e(),a("div",{staticClass:"column is-6"},[a(t.orderStateComponent,{tag:"component"})],1)])])])},Kt=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column"},[a("h1",{staticClass:"title is-1",attrs:{translate:"yes"}},[t._v("Cart")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"step-details"},[a("span",{staticClass:"step-title",attrs:{translate:"yes"}},[t._v("User")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"step-details"},[a("span",{staticClass:"step-title",attrs:{translate:"yes"}},[t._v("Delivery & Payment")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"step-details"},[a("span",{staticClass:"step-title",attrs:{translate:"yes"}},[t._v("Summary")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("thead",[a("tr",[a("th",{},[a("div",{staticClass:"th-wrap",attrs:{translate:"yes"}},[t._v("Name")])]),a("th",{},[a("div",{staticClass:"th-wrap is-pulled-right",attrs:{translate:"yes"}},[t._v("Qty")])]),a("th",{},[a("div",{staticClass:"th-wrap is-pulled-right",attrs:{translate:"yes"}},[t._v("Price/pcs")])]),a("th",{})])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("strong",{attrs:{translate:"yes"}},[t._v("Products Total")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("span",{attrs:{translate:"yes"}},[t._v("Products Without Tax")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("strong",{attrs:{translate:"yes"}},[t._v("Price delivery")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("strong",{attrs:{translate:"yes"}},[t._v("Price payment")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("span",{attrs:{translate:"yes"}},[t._v("Tax total")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("td",{staticClass:"has-text-right"},[a("strong",{attrs:{translate:"yes"}},[t._v("Total price")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h3",{staticClass:"title is-3"},[a("span",{attrs:{translate:"yes"}},[t._v("Your cart is empty")])])}],Yt=(a("6762"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"orderUser"}},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Your Address")]),a("form",{on:{submit:function(e){return e.preventDefault(),t.updateUserData(e)}}},[t.$store.state.user.logged&&!0===t.$store.state.user.logged?a("div",[a("span",{attrs:{translate:"yes"}},[t._v("Logged in as")]),t._v(" "),t.user.username?a("span",[t._v(t._s(t.user.username))]):t.user.email?a("span",[t._v(t._s(t.user.email)+" "),a("br"),a("span",{attrs:{translate:"yes"}},[t._v("Please check your email to verify your email")])]):t._e()]):a("div",[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[a("span",{attrs:{translate:"yes"}},[t._v("Already registered?")]),a("router-link",{attrs:{to:{name:"login"},tag:"a","active-class":"is-active",translate:"yes"}},[t._v("Log in")])],1)]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6",attrs:{id:"cart-user-email"}},[a("div",{staticClass:"field email"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Email")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newUserEmail,expression:"newUserEmail"}],staticClass:"input",attrs:{type:"email",translate:"yes",placeholder:"Email"},domProps:{value:t.newUserEmail},on:{input:function(e){e.target.composing||(t.newUserEmail=e.target.value)}}})]),t._m(0)])]),a("div",{staticClass:"column is-6",attrs:{id:"cart-user-email2"}},[a("div",{staticClass:"field email2"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Email Confirm")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newUserEmail2,expression:"newUserEmail2"}],staticClass:"input",attrs:{type:"email",translate:"yes",placeholder:"Email Confirm"},domProps:{value:t.newUserEmail2},on:{input:function(e){e.target.composing||(t.newUserEmail2=e.target.value)}}})]),t._m(1)])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6",attrs:{id:"cart-user-password"}},[a("div",{staticClass:"field password"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Password")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newUserPassword,expression:"newUserPassword"}],staticClass:"input",attrs:{type:"password",translate:"yes",placeholder:"Password"},domProps:{value:t.newUserPassword},on:{input:function(e){e.target.composing||(t.newUserPassword=e.target.value)}}})]),t._m(2)])]),a("div",{staticClass:"column is-6",attrs:{id:"cart-user-password2"}},[a("div",{staticClass:"field password2"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Password Confirm")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newUserPassword2,expression:"newUserPassword2"}],staticClass:"input",attrs:{type:"password",translate:"yes",placeholder:"Password Confirm"},domProps:{value:t.newUserPassword2},on:{input:function(e){e.target.composing||(t.newUserPassword2=e.target.value)}}})]),t._m(3)])])]),t._m(4)]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6",attrs:{id:"cart-user-name-first"}},[a("div",{staticClass:"field nameFirst"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("First Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.nameFirst,expression:"user.addressInvoice.nameFirst"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"First Name"},domProps:{value:t.user.addressInvoice.nameFirst},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"nameFirst",e.target.value)}}})]),t._m(5)])]),a("div",{staticClass:"column is-6",attrs:{id:"cart-user-name-last"}},[a("div",{staticClass:"field nameLast"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Last Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.nameLast,expression:"user.addressInvoice.nameLast"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Last Name"},domProps:{value:t.user.addressInvoice.nameLast},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"nameLast",e.target.value)}}})]),t._m(6)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12",attrs:{id:"cart-user-street"}},[a("div",{staticClass:"field street"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Street")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.street,expression:"user.addressInvoice.street"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Street"},domProps:{value:t.user.addressInvoice.street},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"street",e.target.value)}}})]),t._m(7)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12",attrs:{id:"cart-user-street2"}},[a("div",{staticClass:"field street2"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Street 2")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.street2,expression:"user.addressInvoice.street2"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Street 2"},domProps:{value:t.user.addressInvoice.street2},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"street2",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-4",attrs:{id:"cart-user-zip"}},[a("div",{staticClass:"field zip"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("ZIP")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.zip,expression:"user.addressInvoice.zip"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"ZIP"},domProps:{value:t.user.addressInvoice.zip},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"zip",e.target.value)}}})]),t._m(8)])]),a("div",{staticClass:"column is-8",attrs:{id:"cart-user-city"}},[a("div",{staticClass:"field city"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("City")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.city,expression:"user.addressInvoice.city"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"City"},domProps:{value:t.user.addressInvoice.city},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"city",e.target.value)}}})]),t._m(9)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6",attrs:{id:"cart-user-state"}},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("State")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.state,expression:"user.addressInvoice.state"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"State"},domProps:{value:t.user.addressInvoice.state},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"state",e.target.value)}}})])])]),a("div",{staticClass:"column is-6",attrs:{id:"cart-user-country"}},[a("div",{staticClass:"field country"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Country")]),a("div",{staticClass:"control select"},[t.$store.state.coredata&&t.$store.state.coredata.countries?a("select",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.country,expression:"user.addressInvoice.country"}],on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.user.addressInvoice,"country",e.target.multiple?a:a[0])}}},t._l(t.$store.state.coredata.countries,(function(e){return a("option",{key:e.code,domProps:{value:e.code}},[t._v(" "+t._s(e.name)+" ")])})),0):t._e()]),t._m(10)])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field phone"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Phone")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.addressInvoice.phone,expression:"user.addressInvoice.phone"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Phone"},domProps:{value:t.user.addressInvoice.phone},on:{input:function(e){e.target.composing||t.$set(t.user.addressInvoice,"phone",e.target.value)}}})]),t._m(11)])])]),a("hr"),t.user.company?a("div",{staticClass:"simple-wrapper"},[a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field companyName"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Company Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.company.name,expression:"user.company.name"}],staticClass:"input",attrs:{type:"text",placeholder:"Company Name"},domProps:{value:t.user.company.name},on:{input:function(e){e.target.composing||t.$set(t.user.company,"name",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyOrgId"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Organisation ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.company.orgId,expression:"user.company.orgId"}],staticClass:"input",attrs:{type:"text",placeholder:"Organisation ID"},domProps:{value:t.user.company.orgId},on:{input:function(e){e.target.composing||t.$set(t.user.company,"orgId",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyTaxId"},[a("label",{staticClass:"label"},[t._v("Company Tax ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.company.taxId,expression:"user.company.taxId"}],staticClass:"input",attrs:{type:"text",placeholder:"Company Tax ID"},domProps:{value:t.user.company.taxId},on:{input:function(e){e.target.composing||t.$set(t.user.company,"taxId",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field companyTaxVatId"},[a("label",{staticClass:"label"},[t._v("Company VAT ID")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.user.company.taxVatId,expression:"user.company.taxVatId"}],staticClass:"input",attrs:{type:"text",placeholder:"Company VAT ID"},domProps:{value:t.user.company.taxVatId},on:{input:function(e){e.target.composing||t.$set(t.user.company,"taxVatId",e.target.value)}}})])])])])]):t._e(),a("button",{staticClass:"button is-success",attrs:{type:"submit"}},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Set user order data")])],1)])])}),Jt=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"exists",translate:"yes"}},[t._v("This email already exists")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not confirmed",translate:"yes"}},[t._v("Values do not match")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This field cannot be empty")]),a("div",{staticClass:"form-message",attrs:{"data-message":"not confirmed",translate:"yes"}},[t._v("Values do not match")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[a("hr")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])}],Zt=(a("8e6e"),a("bd86"));function Qt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function Xt(t){for(var e=1;e0){var s={fields:[],errors:[]};console.log("responseResult",s),this.$parent.orderParams.errors.userErrors.forEach((function(t){s.fields.push(t.value),s.errors.push({name:t.value,action:t.desc})})),this.$helpers.formUndecorateAndDecorateFields(s.fields,s.errors),this.$scrollTo(this.$el.querySelector(".field."+s.fields[0]),500,{offset:-100})}}}}},ee=te,ae=(a("b41b"),Object(g["a"])(ee,Yt,Jt,!1,null,null,null)),se=ae.exports,re=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"orderDeliveryPayment",attrs:{id:"orderDeliveryPayment"}},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Delivery Payment")]),a("form",{on:{submit:function(e){return e.preventDefault(),t.updateDeliveryPaymentData(e)}}},[a("div",[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Delivery")]),t.$store.state.order.order.settings.deliveryMethodsTypes&&Object.keys(t.$store.state.order.order.settings.deliveryMethodsTypes).length>0?a("div",{staticClass:"deliveryType optionControlList"},[t._l(Object.keys(t.$store.state.order.order.settings.deliveryMethodsTypes),(function(e,s){return a("div",{key:s,staticClass:"control"},[t.$store.state.cart&&t.$store.state.cart.cartItemTypology&&t.$store.state.cart.cartItemTypology.subtypes.indexOf(e)>-1?a("div",[a("h4",{staticClass:"title is-4 has-text-left"},[a("span",[t._v(t._s(e))]),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("goods")])]),t._l(t.$store.state.order.order.settings.deliveryMethodsTypes[e],(function(s,r){return a("div",{key:r,staticClass:"field"},[a("label",{staticClass:"b-radio radio radio-button"},[a("input",{attrs:{type:"radio",name:"type-"+e},domProps:{value:s.codename,checked:t.$parent.orderParams.order.data.deliveryData&&t.$parent.orderParams.order.data.deliveryData.codename[e]&&t.$parent.orderParams.order.data.deliveryData.codename[e].value==s.codename},on:{click:function(a){return t.setDelivery(e,s.codename)}}}),a("span",{staticClass:"check"}),a("span",{staticClass:"control-label"},[t._v(" "+t._s(s.name[t.$store.state.language.code])+" ("+t._s(s.prices[0].price)+" "+t._s(t.$store.state.currency.symbol)+") ")])])])}))],2):t._e()])})),t._m(0)],2):t._e()]),t.$store.state.cart&&t.$store.state.cart.cartItemTypology&&t.$store.state.cart.cartItemTypology.subtypes.indexOf("physical")>-1?a("div",{staticClass:"deliveryAddressBlock"},[a("section",[a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field has-text-centered"},[a("label",{staticClass:"switch is-rounded"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.showDeliveryAddress,expression:"showDeliveryAddress"}],staticClass:"checkbox",attrs:{type:"checkbox","true-value":"true",value:"false"},domProps:{checked:Array.isArray(t.showDeliveryAddress)?t._i(t.showDeliveryAddress,"false")>-1:t._q(t.showDeliveryAddress,"true")},on:{change:function(e){var a=t.showDeliveryAddress,s=e.target,r=!!s.checked&&"true";if(Array.isArray(a)){var i="false",n=t._i(a,i);s.checked?n<0&&(t.showDeliveryAddress=a.concat([i])):n>-1&&(t.showDeliveryAddress=a.slice(0,n).concat(a.slice(n+1)))}else t.showDeliveryAddress=r}}}),a("span",{staticClass:"check"}),a("span",{staticClass:"control-label",attrs:{translate:"yes"}},[t._v("Use custom delivery address")])])])])])]),a("section",[t.showDeliveryAddress?a("div",{staticClass:"deliveryAddressWrapper is-clearfix"},[t.$store.state.user.profile.addressesDelivery&&t.$store.state.user.profile.addressesDelivery.length>0?a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field for-select"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Previously used addresses:")]),a("div",{staticClass:"control has-text-centered"},[a("span",{staticClass:"select is-empty"},[a("select",{staticClass:"select",on:{change:t.fillWithSelectedDeliveryAddress}},[a("option",{attrs:{value:"",translate:"yes"}},[t._v("Please select")]),t._l(t.$store.state.user.profile.addressesDelivery,(function(e,s){return a("option",{key:s,domProps:{value:s}},[t._v(" "+t._s(e.street)+", "+t._s(e.zip)+" ")])}))],2)])])])])]):t._e(),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field nameFirst"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("First Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.nameFirst,expression:"deliveryAddress.nameFirst"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"First Name"},domProps:{value:t.deliveryAddress.nameFirst},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"nameFirst",e.target.value)}}})]),t._m(1)])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field nameLast"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Last Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.nameLast,expression:"deliveryAddress.nameLast"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Last Name"},domProps:{value:t.deliveryAddress.nameLast},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"nameLast",e.target.value)}}})]),t._m(2)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field street"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Street")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.street,expression:"deliveryAddress.street"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Street"},domProps:{value:t.deliveryAddress.street},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"street",e.target.value)}}})]),t._m(3)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Street 2")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.street2,expression:"deliveryAddress.street2"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Street 2"},domProps:{value:t.deliveryAddress.street2},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"street2",e.target.value)}}})])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-4"},[a("div",{staticClass:"field zip"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("ZIP")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.zip,expression:"deliveryAddress.zip"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"ZIP"},domProps:{value:t.deliveryAddress.zip},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"zip",e.target.value)}}})]),t._m(4)])]),a("div",{staticClass:"column is-8"},[a("div",{staticClass:"field city"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("City")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.city,expression:"deliveryAddress.city"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"City"},domProps:{value:t.deliveryAddress.city},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"city",e.target.value)}}})]),t._m(5)])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("State")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.state,expression:"deliveryAddress.state"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"State"},domProps:{value:t.deliveryAddress.state},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"state",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field country"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Country")]),a("div",{staticClass:"control select"},[t.$store.state.coredata&&t.$store.state.coredata.countries?a("select",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.country,expression:"deliveryAddress.country"}],on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.deliveryAddress,"country",e.target.multiple?a:a[0])}}},t._l(t.$store.state.coredata.countries,(function(e){return a("option",{key:e.code,domProps:{value:e.code}},[t._v(" "+t._s(e.name)+" ")])})),0):t._e()]),t._m(6)])])]),a("div",{staticClass:"columns is-variable is-1 is-centered"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field phone"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Phone")]),a("div",{staticClass:"control is-clearfix"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.deliveryAddress.phone,expression:"deliveryAddress.phone"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Phone"},domProps:{value:t.deliveryAddress.phone},on:{input:function(e){e.target.composing||t.$set(t.deliveryAddress,"phone",e.target.value)}}})]),t._m(7)])])])]):t._e()])]):t._e(),a("div",[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Payment")]),t.$store.state.order.order.settings.paymentMethods&&Object.keys(t.$store.state.order.order.settings.paymentMethods).length>0?a("div",{staticClass:"paymentType optionControlList"},[t._l(t.$store.state.order.order.settings.paymentMethods,(function(e,s){return a("div",{key:s,staticClass:"field"},[a("div",{staticClass:"control"},[t.checkUsePaymentType(e)?a("div",{class:"payment-"+e.codename},[a("label",{staticClass:"b-radio radio"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.paymentData,expression:"paymentData"}],attrs:{type:"radio",name:"paymentType"},domProps:{value:e.codename,checked:t._q(t.paymentData,e.codename)},on:{change:function(a){t.paymentData=e.codename}}}),a("span",{staticClass:"check"}),a("span",{staticClass:"control-label"},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ("+t._s(t.getPaymentPrice(e))+" "+t._s(t.$store.state.currency.symbol)+") ")])])]):t._e()])])})),t._m(8)],2):t._e()]),t.$store.state.cart&&t.$store.state.cart.cartItemTypology&&t.$store.state.cart.cartItemTypology.types.indexOf("subscription")>-1?a("div",{staticClass:"subscriptionBlock"},[a("label",[a("span",{attrs:{translate:"yes"}},[t._v("Renew my subscription")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.renewSubscription,expression:"renewSubscription"}],staticClass:"checkbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.renewSubscription)?t._i(t.renewSubscription,null)>-1:t.renewSubscription},on:{change:function(e){var a=t.renewSubscription,s=e.target,r=!!s.checked;if(Array.isArray(a)){var i=null,n=t._i(a,i);s.checked?n<0&&(t.renewSubscription=a.concat([i])):n>-1&&(t.renewSubscription=a.slice(0,n).concat(a.slice(n+1)))}else t.renewSubscription=r}}})])]):t._e(),a("button",{staticClass:"button is-success"},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Set delivery and payment")])],1)])])},ie=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages"},[a("p",{staticClass:"form-message has-text-danger has-text-left is-hidden",attrs:{"data-message":"is empty"}},[a("span",{staticClass:"icon has-text-danger is-pulled-left"},[a("i",{staticClass:"fa fa-exclamation-circle"})]),a("span",{attrs:{translate:"yes"}},[t._v("Please select value")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"is empty",translate:"yes"}},[t._v("This value cannot be empty")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages"},[a("p",{staticClass:"form-message has-text-danger has-text-left is-hidden",attrs:{"data-message":"is empty"}},[a("span",{staticClass:"icon has-text-danger is-pulled-left"},[a("i",{staticClass:"fa fa-exclamation-circle"})]),a("span",{attrs:{translate:"yes"}},[t._v("Please select value")])])])}],ne=void 0,oe={name:"OrderDeliveryPayment",data:function(){return{deliveryData:{physical:null,digital:null},paymentData:null,showDeliveryAddress:!1,renewSubscription:!1,deliveryAddress:{type:"delivery",nameFirst:"",nameLast:"",street:"",street2:"",zip:"",city:"",state:"",country:"",phone:""}}},computed:{},created:function(){this.$parent&&this.$parent.orderParams&&(this.$parent.orderParams.order.data&&(this.$parent.orderParams.order.data.deliveryData&&this.$parent.orderParams.order.data.deliveryData.codename&&(this.deliveryData=this.$parent.orderParams.order.data.deliveryData.codename),this.$parent.orderParams.order.data.paymentData&&this.$parent.orderParams.order.data.paymentData.codename&&(this.paymentData=this.$parent.orderParams.order.data.paymentData.codename)),this.$parent.orderParams.order.addresses&&this.$parent.orderParams.order.addresses.deliveryAddress&&(this.deliveryAddress=this.$parent.orderParams.order.addresses.deliveryAddress,this.showDeliveryAddress=!0))},mounted:function(){Qe.$emit("translateContent",this.$store.getters.getTranslates)},methods:{updateDeliveryPaymentData:function(){var t=!1,e=this.$el.querySelector(".deliveryType .form-messages .form-message[data-message='is empty']"),a=this.$el.querySelector(".paymentType .form-messages .form-message[data-message='is empty']");if(e&&e.classList.add("is-hidden"),a&&a.classList.add("is-hidden"),this.showDeliveryAddress){this.$parent.orderParams.order.addresses||(this.$parent.orderParams.order.addresses={}),this.$parent.orderParams.order.addresses.deliveryAddress||(this.$parent.orderParams.order.addresses.deliveryAddress=[]);var s=this.$helpers.propertiesRequiredConfirm(this.deliveryAddress,["nameFirst","nameLast","street","zip","city","country","phone"],[]);s.result?this.$parent.orderParams.order.addresses.deliveryAddress=this.deliveryAddress:(this.$helpers.formUndecorateAndDecorateFields(s.fields,s.errors),t=!0)}else this.$parent.orderParams.order.addresses&&this.$parent.orderParams.order.addresses.deliveryAddress&&(this.$parent.orderParams.order.addresses.deliveryAddress=null);this.$parent.orderParams.order.data||(this.$parent.orderParams.order.data={}),!this.deliveryData||"undefined"===typeof this.deliveryData.physical||"undefined"===typeof this.deliveryData.digital||null==this.deliveryData.physical&&null==this.deliveryData.digital?(console.log(this.deliveryData,this.deliveryData.physical,this.deliveryData.digital,null!=this.deliveryData.physical||null!=this.deliveryData.digital),t=!0,console.log("missing deliveryData"),e&&e.classList.remove("is-hidden")):(this.$parent.orderParams.order.data.deliveryData||(this.$parent.orderParams.order.data.deliveryData={codename:null}),this.$parent.orderParams.order.data.deliveryData.codename=this.deliveryData),this.paymentData&&null!=this.paymentData?(this.$parent.orderParams.order.data.paymentData||(this.$parent.orderParams.order.data.paymentData={codename:null}),this.$parent.orderParams.order.data.paymentData.codename=this.paymentData):(t=!0,console.log("missing paymentData"),a&&a.classList.remove("is-hidden")),t||this.$parent.updateOrder()},checkIfDeliveryAddressExists:function(){if(!ne.$parent.orderParams.order.addresses.deliveryAddress&&ne.$parent.orderParams.order.addresses.deliveryAddress.length>0){var t=JSON.stringify(deliveryAddress);ne.$parent.orderParams.order.addresses.deliveryAddress.forEach((function(e){var a=JSON.stringify(e);if(a==t)return!0}))}return!1},fillWithSelectedDeliveryAddress:function(t){t.target.value&&""!=t.target.value&&t.target.value>-1&&(this.deliveryAddress=this.$store.state.user.profile.addressesDelivery[t.target.value])},getPaymentPrice:function(t){if(t&&t.prices&&this.$store.state&&this.$store.state.cart&&this.$store.state.cart.priceTotal)for(var e=0;e=t.prices[e].range.from&&this.$store.state.cart.priceTotal<=t.prices[e].range.to)return t.prices[e].price;return 0},setDelivery:function(t,e){this.deliveryData[t]=e},checkUsePaymentType:function(t){return!!(this.$store.state.cart&&this.$store.state.cart.cartItemTypology&&("undefined"===typeof t.type||this.$store.state.cart.cartItemTypology.subtypes.length>1&&-1==this.$store.state.cart.cartItemTypology.subtypes.indexOf(t.type)))}}},le=oe,ce=(a("4b7e"),Object(g["a"])(le,re,ie,!1,null,null,null)),de=ce.exports,ue=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"summary"}},[a("h2",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Order summary")]),a("form",{on:{submit:function(e){return e.preventDefault(),t.submitOrder(e)}}},[a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-5",attrs:{translate:"yes"}},[t._v("You are ordering to:")]),a("div",{staticClass:"summary-block with-pre-whitespace"},[t._v(t._s(t.invoiceAddress()))])]),t.checkDeliveryAddress()?a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-5",attrs:{translate:"yes"}},[t._v("With delivery to:")]),a("div",{staticClass:"summary-block with-pre-whitespace"},[t._v(t._s(t.deliveryAddress()))])]):a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-5",attrs:{translate:"yes"}},[t._v("With delivery to:")]),a("div",{staticClass:"summary-block",attrs:{translate:"yes"}},[t._v("same as invoice address")])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-5",attrs:{translate:"yes"}},[t._v("Your Delivery settings:")]),t.checkDeliveryData()?a("div",{staticClass:"content summary-block"},t._l(t.deliveryData(),(function(e,s){return a("div",{key:s},[a("p",[a("span",{staticClass:"capitalize"},[t._v(t._s(e.type))]),t._v(" - "),a("strong",[t._v(t._s(e.name))]),t._v(": "+t._s(t.$store.state.numeral(e.price).format("0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")])])})),0):t._e()]),t.checkPaymentData()?a("div",{staticClass:"column is-6"},[a("div",[a("h3",{staticClass:"title is-5"},[t._v("Your Payment settings:")]),t.paymentData()?a("div",{staticClass:"content summary-block"},[a("p",[a("strong",[t._v(t._s(t.paymentData().name))]),t._v(": "+t._s(t.$store.state.numeral(t.paymentData().price).format("0.00"))+" "+t._s(t.$store.state.currency.symbol))])]):t._e()])]):t._e()]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field has-text-centered"},[a("h3",{staticClass:"title is-5"},[a("span",{attrs:{translate:"yes"}},[t._v("Total price")]),t._v(": "),a("span",[t._v(" "+t._s(t.$store.state.numeral(t.$store.state.order.order.prices.priceTotal).format("0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")])])])])]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"field confirm has-text-centered"},[a("label",{staticClass:"b-checkbox checkbox"},[a("input",{attrs:{type:"checkbox"},on:{click:function(e){return t.setConfirmationDate(e)}}}),a("span",{staticClass:"check is-success"}),t._m(0)]),t._m(1)])])]),a("button",{staticClass:"button is-success"},[a("font-awesome-icon",{attrs:{icon:"check"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Submit order")])],1)])])},me=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",[a("span",{staticClass:"control-label",attrs:{translate:"yes"}},[t._v("I agree to the")]),t._v(" "),a("a",{attrs:{href:"#",translate:"yes"}},[t._v("terms and conditions")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"unconfirmed",translate:"yes"}},[t._v("Check this to enable sending order")])])}],pe={name:"OrderDeliveryPayment",data:function(){return{userConfirmation:null}},computed:{},mounted:function(){Qe.$emit("translateContent",this.$store.getters.getTranslates)},methods:{submitOrder:function(){var t=this.$el.querySelector("#summary .field.confirm .check");t.classList.remove("is-danger"),t&&t.parentElement.querySelector(".control-label").classList.add("has-text-danger"),this.userConfirmation?(this.$parent.orderParams.order.dates.userConfirmation=this.userConfirmation,this.$parent.updateOrder()):(this.$helpers.formUndecorateAndDecorateFields(["confirm"],[{name:"confirm",action:"unconfirmed"}]),t.classList.remove("is-success"),t.classList.remove("is-dang"),t.classList.add("is-danger"),t&&t.parentElement.querySelector(".control-label").classList.add("has-text-danger"))},setConfirmationDate:function(t){if(t.target.checked){var e=new Date;this.userConfirmation=e.getTime()}},checkDeliveryAddress:function(){return!!(this.$parent.orderParams&&this.$parent.orderParams.order&&this.$parent.orderParams.order.addresses&&this.$parent.orderParams.order.addresses.deliveryAddress&&Object.keys(this.$parent.orderParams.order.addresses.deliveryAddress).length>0)},invoiceAddress:function(){if(this.$store.state.coredata)return this.$helpers.addressToString(this.$parent.orderParams.order.addresses.invoiceAddress,this.$store.state.coredata.countries,["type"])},deliveryAddress:function(){return this.$parent.orderParams.order.addresses.deliveryAddress?this.$helpers.addressToString(this.$parent.orderParams.order.addresses.deliveryAddress,this.$store.state.coredata.countries,["type"]):null},checkDeliveryData:function(){return!!(this.$parent.orderParams.order&&this.$parent.orderParams.order.data.deliveryData&&this.$parent.orderParams.order.data.deliveryData.codename)},deliveryData:function(){var t=this,e=[];if(this.$parent.orderParams.order&&this.$parent.orderParams.order.data.deliveryData&&this.$parent.orderParams.order.data.deliveryData.codename){var a=this.$parent.orderParams.order.data.deliveryData.codename,s=this.$parent.orderParams.order.settings.deliveryMethodsTypes;return Object.keys(a).forEach((function(r){if(a&&s&&a[r]&&null!=a[r]){var i=a[r];i["type"]=r,i["name"]=i.value,s[r]&&s[r].forEach((function(e){e.type&&e.codename&&e.type==r&&e.codename==i["value"]&&(i["name"]=e.name[t.$store.getters.getLanguage])})),e.push(i)}})),e}},checkPaymentData:function(){return!!(this.$parent.orderParams&&this.$parent.orderParams.order&&this.$parent.orderParams.order.data.paymentData)},paymentData:function(){var t=this,e=null;if(this.$parent.orderParams&&this.$parent.orderParams.order&&this.$parent.orderParams.order.data.paymentData){var a="undefined"!==typeof this.$parent.orderParams.order.data.paymentData.name[t.$store.getters.getLanguage]?this.$parent.orderParams.order.data.paymentData.name[t.$store.getters.getLanguage]:this.$parent.orderParams.order.data.paymentData.codename;e={name:a,price:this.$parent.orderParams.order.data.paymentData.price}}return e}}},ge=pe,ve=(a("9e2b"),Object(g["a"])(ge,ue,me,!1,null,null,null)),he=ve.exports,fe=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("h1",{staticClass:"title is-2",attrs:{translate:"yes"}},[t._v("Order Finished")]),a("div",{staticClass:"columns is-variable is-2"},[a("div",{staticClass:"column is-12"},[a("p",[a("span",{attrs:{translate:"yes"}},[t._v("Thank you for your order. ID of your order is")]),t._v(" "),a("strong",[t._v(t._s(t.getOrderId()))]),t._v(", "),a("span",{attrs:{translate:"yes"}},[t._v("we've sent you email about it.")])]),t.isOrderPaymentCodename("online_paypal_paypal")?a("div",[a("b-loading",{attrs:{"is-full-page":!1,active:t.isLoading,"can-cancel":!1},on:{"update:active":function(e){t.isLoading=e}}}),a("p",{attrs:{translate:"yes"}},[t._v("You are being redicted to PayPal, please wait.")])],1):t._e()])])])},ye=[],Ce={name:"OrderFinished",data:function(){return{isLoading:!0,orderId:null}},mounted:function(){this.$parent.orderParams&&this.$parent.orderParams.order&&(this.orderId=this.$parent.orderParams.order._id,this.$parent.orderParams.order.data.paymentData.codename.indexOf("online_paypal")>-1&&this.paymentPayPalCall(),"cod"==this.$parent.orderParams.order.data.paymentData.codename&&this.clearFinishedOrder())},computed:{},methods:{isOrderPaymentCodename:function(t){return!!(this.$parent&&this.$parent.orderParams&&this.$parent.orderParams.order&&this.$parent.orderParams.order.data&&this.$parent.orderParams.order.data.paymentData&&this.$parent.orderParams.order.data.paymentData.codename&&this.$parent.orderParams.order.data.paymentData.codename==t)},getOrderId:function(){return this.orderId},paymentPayPalCall:function(){var t=this;t.$httpc.post("/order/paypalcheckout",{orderId:t.$parent.orderParams.order._id,checkoutData:null},{timeout:5e3}).then((function(e){e&&e.data&&e.data.url&&""!=e.data.url.trim()&&(t.clearFinishedOrder(),window.location.href=e.data.url)}))},clearFinishedOrder:function(){var t=this;setTimeout((function(){t.$parent.orderParams={},t.$store.dispatch("setOrder",null),t.$store.state.user&&null==t.$store.state.user.profile&&1==t.$store.state.user.logged&&""!=t.$store.state.user.email.toString().trim()&&(t.$store.state.user.logged=!1,t.$store.state.user.profile=null,t.$httpc.defaults.headers.common["Authorization"]=null,t.$cookies.remove("token"))}),2e3)}}},_e=Ce,$e=Object(g["a"])(_e,fe,ye,!1,null,null,null),be=$e.exports,Pe={name:"OrderCart",components:{componentOrderUser:se,componentOrderDeliveryPayment:de,componentOrderSummary:he,componentOrderFinished:be},data:function(){return{itemAmount:{},orderStateNumber:1,orderParams:{},viewComponentId:null}},computed:{orderStateComponent:function(){var t=this.$store.getters.getOrder;this.orderParams=t,t&&t.result&&t.result.id&&(this.orderStateNumber=t.result.id);var e=null!=this.viewComponentId&&this.viewComponentId<=this.orderStateNumber?this.viewComponentId:this.orderStateNumber;return 2==e?de:3==e?he:4==e?be:se}},updated:function(){document.querySelector("#header-cart-dropdown").style.display=""},created:function(){this.orderParams.order&&this.orderParams.order.addresses&&this.orderParams.order.addresses.invoiceAddress||this.updateOrder()},methods:{updateOrder:function(){var t=this,e={timeout:15e3,needsAuth:!0};this.viewComponentId=null,this.$httpc.post("order/progress",{orderParams:"undefined"!==typeof this.orderParams.order?this.orderParams.order:this.orderParams},e).then((function(e){if(e.data&&e.data.order){if(e.data.order&&e.data.order.user&&e.data.order.user.id&&null!=e.data.order.user.id&&(t.$store.state.user.logged=!0,t.$store.state.cart.user=e.data.order.user.id,t.orderStateNumber=e.data.result.id,t.$forceUpdate()),"saved"==e.data.order.status||"sent"==e.data.order.status){t.$store.dispatch("setCart",null);var a=document.querySelector(".userCartLink .cartItemsCount");a.textContent=0,console.log("cart set to NULL"),e.data.result.id=4}t.$store.dispatch("setOrder",e.data),e.data&&e.data.result&&e.data.result.id&&e.data.result.id>1&&(t.orderStateNumber=e.data.result.id)}})).catch((function(e){console.log("Cart error:",e),t.$store.dispatch("setCart",null),t.orderStateNumber=0,t.$store.dispatch("setOrder",null)})).then((function(){Qe.$emit("translateContent",t.$store.getters.getTranslates)}))},updateCartItemAmount:function(t){var e=this;this.$httpc.post("cart",{itemId:t,amount:parseInt(this.itemAmount[t])}).then((function(t){t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){return console.log(t),null})).then((function(){return null}))},clearCart:function(t){var e=this;t="undefined"!==typeof t?t:null;var a=null;a=null!=t&&""!=t.toString().trim()?this.$httpc.delete("cart?itemId="+t):this.$httpc.delete("cart"),a.then((function(t){console.log(t.data),t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){return console.log(t),null})).then((function(){return null}))},getClickableStateClasses:function(t){return t<=this.orderStateNumber?"step-link is-clickable":"step-link"},getActiveStateClasses:function(t){var e="step-item",a="";return t<=this.orderStateNumber&&(a=" is-previous"),(this.viewComponentId&&t==this.viewComponentId||t==this.orderStateNumber)&&(a=" is-active"),e+=a,e},getStateClass:function(t){return t==this.orderStateNumber?"has-text-danger":""},setViewCoponentId:function(t,e){if(t<=this.orderStateNumber){if(this.$el){var a=this.$el.querySelectorAll("#orderCart .b-steps .step-item");a.forEach((function(t){t.classList.remove("is-active")}))}e&&e.target&&!e.target.parentElement.parentElement.classList.contains("is-active")&&e.target.parentElement.parentElement.classList.add("is-active"),this.viewComponentId=t,this.$forceUpdate()}},getProductImagePath:function(t){return this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getProductImagePath(this.$store.state.coredata,t):null},countPrices:function(t){var e=["all","items","totals"];t="undefined"!==typeof t&&e.includes(t)?t:"all";var a=this,s=a.settings.defaultConstants.tax;if("all"!=t&&"items"!=t||(this.orderParams.prices.priceItems=0,this.orderParams.prices.priceItemsNoTax=0,this.orderParams.items.forEach((function(t){if(t.taxData)a.orderParams.prices.priceItems+=t.taxData.priceWithTax*t.amount,t.tax&&null!=t.tax&&(s=t.tax),a.orderParams.prices.priceItemsNoTax+=t.taxData.priceWithoutTax*t.amount,a.orderParams.prices.priceTaxTotal+=t.taxData.tax*t.amount;else{a.orderParams.prices.priceItems+=t.price*t.amount,t.tax&&null!=t.tax&&(s=t.tax);var e=t.price/(1+s);a.orderParams.prices.priceItemsNoTax+=e;var r=t.price/(1+s);a.orderParams.prices.priceTaxTotal+=r}})),this.orderParams.prices.priceItems=this.$helpers.formatPrice(this.orderParams.prices.priceItems),this.orderParams.prices.priceItemsNoTax=this.$helpers.formatPrice(this.orderParams.prices.priceItemsNoTax),this.orderParams.prices.priceTaxTotal=this.$helpers.formatPrice(this.orderParams.prices.priceTaxTotal)),"all"==t||"totals"==t){this.orderParams.prices.priceTotal=this.orderParams.prices.priceItems+this.orderParams.prices.priceDelivery+this.orderParams.prices.pricePayment,this.orderParams.prices.priceTotal=this.formatPrice.formatPrice(this.orderParams.prices.priceTotal);var r=this.orderParams.prices.priceDelivery/(1+s),i=this.orderParams.prices.pricePayment/(1+s);this.orderParams.prices.priceTotalNoTax=this.orderParams.prices.priceItemsNoTax+r+i,this.orderParams.prices.priceTotalNoTax=this.formatPrice.formatPrice(this.orderParams.prices.priceTotalNoTax)}}}},xe=Pe,we=(a("4f16"),Object(g["a"])(xe,Wt,Kt,!1,null,null,null)),De=we.exports,Ie=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.page?a("div",{staticClass:"container page-detail"},[t.userCanEdit&&t.page.data&&t.page.data.slug?a("div",{staticClass:"edit-area"},[a("router-link",{staticClass:"editor-button edit-button",attrs:{to:{name:"pageNewEdit",params:{slug:t.page.data.slug}}}},[a("font-awesome-icon",{attrs:{icon:"edit"}})],1)],1):t._e(),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3",attrs:{id:"page-detail-related"}},[t.page&&t.page.global&&t.page.global.relatedPageObjects&&t.page.global.relatedPageObjects.length>0?a("nav",{staticClass:"panel"},[a("aside",{staticClass:"menu"},[a("p",{staticClass:"menu-label",attrs:{translate:"yes"}},[t._v(" Related Pages ")]),a("ul",{staticClass:"menu-list"},t._l(t.page.global.relatedPageObjects,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.descriptionShort[t.$store.state.language.code],to:{name:"pageDetail",params:{category:e.categories[0],slug:e.slug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),0)])]):t._e()]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.parentCategoryDetail?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[t.parentCategoryDetail.parentCategories?a("ul",[t._l(t.parentCategoryDetail.parentCategories,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.$store.state.language.code],to:{name:"categoryListPage",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.$store.state.language.code])+" ")])],1)})),a("li",[a("router-link",{attrs:{title:t.parentCategoryDetail.name[t.$store.state.language.code],to:{name:"categoryListPage",params:{category:t.parentCategoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.parentCategoryDetail.name[t.$store.state.language.code])+" ")])],1)],2):t._e()]):t._e()])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.page.data&&t.page.data.name?a("h1",{staticClass:"title is-1"},[t._v(t._s(t.page.data.name[t.$store.state.language.code]))]):t._e(),a("page-detail-content",{attrs:{content:t.page.body,contentData:t.pageData,contentLang:t.$store.state.language.code}})],1)])])])]):t._e()},Te=[],ke={name:"PageDetail",data:function(){return{page:null,parentCategoryDetail:null,language:"en"}},created:function(){var t=this;this.$store&&this.$store.state&&this.$store.state.language&&this.$store.state.language.code&&this.$store.state.user?this.getPageDetail(this.$store.state.language.code):Qe.$on("coreDataLoaded",(function(){t.getPageDetail(t.$store.state.language.code)})),Qe.$on("languageChanged",(function(e){t.getPageDetail(e)}))},computed:{userCanEdit:function(){return!!(this.$store.state&&this.$store.state.user&&this.$store.state.user.logged&&this.$store.state.user.profile&&this.$store.state.user.profile.type&&"admin"==this.$store.state.user.profile.type)},pageData:function(){return this.page&&this.page.data&&this.page.data.functions&&this.page.data.functions.length?this.page.data.functions:null}},components:{"page-detail-content":Ot},methods:{getPageDetail:function(t){var e=this,a="undefined"!==typeof t?t:e.$store.state.language.code;"undefined"==typeof this.$route.params.category&&(this.$route.params.category="-"),this.$route.params&&this.$route.params.slug&&""!=this.$route.params.slug.toString().trim()&&this.$httpc.get("pages/"+this.$route.params.category+"/detail/"+this.$route.params.slug+"?lang="+a).then((function(t){t.data&&(e.page=t.data,e.page&&e.page.data&&e.page.data.name&&e.$store.state&&void 0!==Object(jt["a"])(e.page.data.name[a])&&(document.title=e.page.data.name[a]+" - StretchShop")),e.page&&e.page.data&&e.page.data.parentCategoryDetail&&(e.parentCategoryDetail=e.page.data.parentCategoryDetail)})).catch((function(t){console.log(t)})).then((function(){Qe.$emit("pageDetailLoaded")}))}}},Ae=ke,Se=(a("e182"),Object(g["a"])(Ae,Ie,Te,!1,null,null,null)),Ee=Se.exports,Ne=function(t){a.e("chunk-0924bbfc").then(function(){t(a("f1d3"))}.bind(null,a)).catch(a.oe)},Oe=function(t){a.e("chunk-950c9ebe").then(function(){t(a("8161"),"userOrders")}.bind(null,a)).catch(a.oe)},Fe=function(t){a.e("chunk-d95965c2").then(function(){t(a("836a"),"userOrders")}.bind(null,a)).catch(a.oe)},Le=function(t){Promise.all([a.e("chunk-689a3ebc"),a.e("chunk-2ec11e8f")]).then(function(){t(a("3c98"))}.bind(null,a)).catch(a.oe)},Me=function(t){Promise.all([a.e("chunk-689a3ebc"),a.e("chunk-78619b25")]).then(function(){t(a("df24"))}.bind(null,a)).catch(a.oe)},qe=function(t){a.e("chunk-1f7eff4e").then(function(){t(a("5627"))}.bind(null,a)).catch(a.oe)},Re="/"+A.state.language.code,Ue="/:lang",je="StretchShop",Ve=[{path:"/",redirect:Re},{path:Ue+"/",name:"homepage",component:L,meta:{title:"Home - "+je,metaTags:[{name:"description",content:"The about page of our example app."},{property:"og:description",content:"The about page of our example app."}]}},{path:Ue+"/login",name:"login",component:z,meta:{title:"Login - "+je,metaTags:[{name:"description",content:"The about page of our example app."},{property:"og:description",content:"The about page of our example app."}]}},{path:Ue+"/register",name:"register",component:Y,meta:{title:"Register - "+je,metaTags:[{name:"description",content:"The about page of our example app."},{property:"og:description",content:"The about page of our example app."}]}},{path:Ue+"/user",name:"me",component:Ne},{path:Ue+"/user/company",name:"meCompany",component:Ne},{path:Ue+"/user/address",name:"meAddress",component:Ne},{path:Ue+"/user/delivery",name:"meDelivery",component:Ne},{path:Ue+"/user/reset",name:"reset",component:ot},{path:Ue+"/user/verify/:id/:hash",name:"verify",component:et},{path:Ue+"/user/orders",name:"userOrders",component:Oe},{path:Ue+"/user/orders/:id",name:"userOrderDetail",component:Fe},{path:Ue+"/products",name:"productsHome",component:qt},{path:Ue+"/services",name:"servicesHome",component:qt},{path:Ue+"/products/:category",name:"categoryList",component:qt},{path:Ue+"/products/:category/product/:slug/:product",name:"productDetail",component:Ht},{path:Ue+"/products/:category/product/:slug/:product/edit",name:"productNewEdit",component:Le},{path:Ue+"/cart",name:"cart",component:De},{path:Ue+"/pages/:category",name:"categoryListPage",component:qt},{path:Ue+"/pages/:category/page/:slug",name:"pageDetail",component:Ee},{path:Ue+"/page/:slug",name:"pageDetailShort",component:Ee},{path:Ue+"/page/:slug/edit",name:"pageNewEdit",component:Me},{path:Ue+"/category/:category/edit",name:"categoryNewEdit",component:qe}],ze=a("bc3a"),Ge=a.n(ze);console.log("production");var Be=Ge.a.create({baseURL:"/api/v1/",timeout:5e3,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});Be.interceptors.request.use((function(t){if(t.needsAuth&&1==t.needsAuth&&Be.$parentVue&&Be.$parentVue.$cookies.isKey("token")){var e=Be.$parentVue.$cookies.get("token");""!=e.trim()&&(t.headers["Authorization"]="Token "+e)}return t}),(function(t){return console.log("test request interceptor error",t),Promise.reject({error:!0,code:408,message:t})})),Be.interceptors.response.use((function(t){return t}),(function(t){return console.log("test response interceptor error",t),Promise.reject(t)}));var He=a("ecee"),We=a("c074"),Ke=a("ad3d"),Ye=a("760d"),Je={checkIfObjectInArray:function(t,e){if(t&&null!=t&&e&&e instanceof Array&&e.length>0)for(var a=0;a',r.appendChild(n)}var o=document.createElement("p");o.className="help is-"+a,o.innerText=e,t.appendChild(o)}},undecorateFormField:function(t,e){var a=t.querySelector(".control");if(a&&null!=a){a.classList.remove("has-icons-right");var s=a.querySelector(".input");s&&s.classList.remove("is-"+e);var r=a.querySelector("span.icon.is-right.has-text-"+e);r&&null!=r&&a.removeChild(r)}var i=t.querySelector("p.help.is-"+e);i&&null!=i&&t.removeChild(i)},stringChunk:function(t,e){e="undefined"===typeof e?2:e;var a="";if(t&&t.length>0){for(var s=[],r="",i=0;i0&&this.formUndecorateAndDecorateFields(e,a)},verifyAddress:function(t){var e=["nameFirst","nameLast","street","zip","city","country","phone"],a=[],s=[],r=!0;return Object.keys(t).forEach((function(i){if(a.push(i),""==t[i].trim()&&e.indexOf(i)>-1){var n=i;s.push({name:n,action:"is empty"}),r=!1}})),a.length>0&&this.formUndecorateAndDecorateFields(a,s),r},propertiesRequiredConfirm:function(t,e,a){var s="undefined"!==typeof t&&t?t:null,r="undefined"!==typeof e&&e?e:null,i="undefined"!==typeof a&&a?a:[],n=0,o={result:!1,fields:[],errors:[]};return s&&null!=s?(r.forEach((function(e){o.fields.push(e),"undefined"!==typeof t[e]&&null!=t[e]&&""!=t[e].toString().trim()?i.indexOf(e)>-1?t[e]===t[e+"2"]?n++:o.errors.push({name:e+"2",action:"not confirmed"}):n++:o.errors.push({name:e,action:"is empty"})})),i.forEach((function(t){o.fields.push(t+"2")})),n==r.length&&(o.result=!0),o):o},getValueByCode:function(t,e,a){for(var s=0;s0&&r.indexOf(o)<0&&""!=t[o].trim()&&(n=n.replace("{{"+o+"}}",t[o]));return n},getProductUrl:function(t,e){var a={category:null,slug:null,id:null};if(e){a.category=e.categories[0],a.slug=e.slug,a.id=e.id;var s=t.$router.resolve({name:"productDetail",params:a});return s.href}return null},getProductImagePath:function(t,e,a){var s="undefined"!==typeof a?a:null,r=this.stringChunk(e,3),i=r;return s||(i=i+"/"+e),this.getImagePath("products",t,i,a)},getImagePath:function(t,e,a,s){var r="undefined"!==typeof s?s:null,i="https://stretchshop.app/static/",n=["products","categories"];return n.indexOf(t)<0&&(t="products"),e&&e.settings&&e.settings.assets&&e.settings.assets.url&&(i=e.settings.assets.url),null!==r?i+"/"+t+"/"+a+"/"+r:i+"/"+t+"/"+a+"-default.jpg"},animateAddToCart:function(t,e){function a(t){var e=t.timing,a=t.draw,s=t.duration,r=performance.now();requestAnimationFrame((function t(i){var n=(i-r)/s;n>1&&(n=1);var o=e(n);a(o),n<1&&requestAnimationFrame(t)}))}var s=document.querySelector(".userCartLink"),r=document.querySelector(".userCartLink .cartItemsCount"),i="undefined"!==typeof r&&r?parseInt(r.textContent,10):0,n=s.getBoundingClientRect().left+document.body.scrollLeft,o=s.getBoundingClientRect().top+document.body.scrollTop;n=Math.max(n,0),o=Math.max(o,0);var l=t,c=l.closest(".tile"),d=null;c?d=c.querySelector(".tile-image img"):"undefined"!=typeof d&&d||"undefined"===typeof e||(d=e);var u=d.getAttribute("src"),m=d,p=document.createElement("img");p.className="b-flying-img",p.setAttribute("src",u);var g=d.getBoundingClientRect();p.style.width=g.width,p.style.height=g.height;var v=m.getBoundingClientRect().left+document.body.scrollLeft;v=Math.max(v,0);var h=m.getBoundingClientRect().top+document.body.scrollTop;h=Math.max(h,0);var f=(v-n)/100/100,y=(h-o)/100/100;function C(t){return 1-Math.sin(Math.acos(t))}i+=1,a({duration:500,timing:C,draw:function(t){p.style.top=1e4*(1-t)*y-h+o+"px",p.style.left=1e4*(1-t)*f-v+n+"px",p.style.opacity=1-t,p.style.transform="scale("+(1-t)+")",1===t&&p.remove()}}),l.parentNode.appendChild(p),r.textContent=i},getObjectFromArrayByParamValue:function(t,e,a,s){return s="undefined"!==typeof s&&s,t.some((function(t){if(Object.prototype.hasOwnProperty.call(t,e)&&t[e]==a)return t})),s&&t.length>0?t[0]:null},getLangsEmptyObject:function(t){var e={};return t.forEach((function(t){e[t]=null})),e},recaptcha:function(t,e){return t.$recaptchaLoaded().then((function(){return t.$recaptcha("register")})).then((function(t){return t}))},getPageFunctions:function(t){var e,a=/\{\{\{(.*)\((.*)\)\}\}\}/g,s=[];if(t)do{if(e=a.exec(t),e){var r={method:e[1],params:e[2]};r.params.indexOf(";")>-1&&(r.params=r.params.split(";")),s.push(r)}}while(e);return s},formatPrice:function(t){return parseFloat(this.roundNumber(t).toFixed(2))},getProductTaxData:function(t,e){var a={taxDecimal:0,tax:0,taxType:"VAT",priceWithoutTax:null,priceWithTax:null};return e&&e.global&&e.global.taxDecimal&&(a.taxDecimal=e.global.taxDecimal),t&&t.tax&&null!==t.tax&&(a.taxDecimal=t.tax),a.taxDecimal>0&&t&&t.price&&(a.tax=a.taxDecimal*t.price,a.taxType=e.taxType,"IT"==e.taxType?(a.priceWithoutTax=t.price,a.priceWithTax=t.price+a.taxDecimal*t.price):(a.priceWithTax=t.price,a.priceWithoutTax=t.price-a.taxDecimal*t.price)),t.taxData=a,t.tax=a.taxDecimal,t},stringToSlug:function(t,e){return e="undefined"==typeof e?"-":e,t.toLocaleLowerCase().normalize("NFKD").replace(/[^\w\s.-_\/]/g,"").replace(/ +/g,e)}};He["d"].add(We["o"],We["e"],We["h"],We["f"],We["i"],We["j"],We["m"],We["f"],We["b"],We["c"],We["d"],We["a"],We["l"],We["n"],We["k"],We["g"]),He["b"].watch(),s["a"].component("font-awesome-icon",Ke["a"]),s["a"].config.productionTip=!1;var Ze=a("f13c"),Qe=new s["a"];s["a"].use(o.a),o.a.config("7d"),s["a"].use(r["a"]),s["a"].use(i["a"],{defaultIconPack:"fa"}),s["a"].use(Ye["VueReCaptcha"],{siteKey:"6LdAMsgUAAAAADJR3XOi_1P3RxRQ3EtLAb960GBw"});var Xe={install:function(){s["a"].helpers=Je,s["a"].prototype.$helpers=Je}};s["a"].use(Xe),s["a"].use(Ze),s["a"].config.productionTip=!1,s["a"].prototype.$httpc=Be;var ta=new r["a"]({mode:"history",routes:Ve});window.router=ta,ta.beforeEach((function(t,e,a){var s=t.matched.slice().reverse().find((function(t){return t.meta&&t.meta.title})),r=t.matched.slice().reverse().find((function(t){return t.meta&&t.meta.metaTags}));e.matched.slice().reverse().find((function(t){return t.meta&&t.meta.metaTags}));return s&&(document.title=s.meta.title),Array.from(document.querySelectorAll("[data-vue-router-controlled]")).map((function(t){return t.parentNode.removeChild(t)})),r&&r.meta.metaTags.map((function(t){var e=document.createElement("meta");return Object.keys(t).forEach((function(a){e.setAttribute(a,t[a])})),e.setAttribute("data-vue-router-controlled",""),e})).forEach((function(t){return document.head.appendChild(t)})),a()}));var ea=new s["a"]({render:function(t){return t(D)},router:ta,store:A,data:function(){return{loadingIsShowing:!1,loadingIsFullPage:!0,loadingComponent:null}},created:function(){var t=this,e=null,a=!1,s=null,r=this.$store.getters.getLanguage;e=this.$cookies.get("token"),null!=e&&(a=!0),this.$httpc.$cookies=o.a,this.$httpc.$parentVue=this,r=t.manageLanguageFirstTime(),this.$httpc.get("/coredata?transLang="+r,{needsAuth:!0}).then((function(e){if(e.data){var i=e.data.user;if(delete e.data.user,s=e.data.translation,delete e.data.translation,e.data.lang&&e.data.lang.code!=r){var n=t.$helpers.getObjectFromArrayByParamValue(e.data.langs,"code",r,!0);e.data.lang=n}t.$store.dispatch("setCoreData",e.data),i&&(t.$store.dispatch("setUser",i),i&&i._id&&""!==i._id.toString().trim()?(t.$store.state.user.logged=!0,t.$store.state.user.remember=a):(t.$store.state.user.logged=!1,t.$store.state.user.remember=!1)),s&&null!=s&&t.$store.dispatch("setTranslates",s),Qe.$emit("coreDataLoaded")}})).catch((function(t){console.log("coredata error:",t)})).then((function(){t.$nextTick((function(){this.$children[0].translateContent(t.$store.getters.getTranslates)}))}))},methods:{manageLanguageFirstTime:function(){var t=this,e=t.$store.state.language.code;if(window.navigator.languages&&window.navigator.languages.length>0||window.navigator.language||window.navigator.userLanguage){var a=window.navigator.language;if(window.navigator.languages&&window.navigator.languages.length>0){var s=window.navigator.languages[0].split("-");s.length>0&&(a=s[0])}else window.navigator.userLanguage&&(a=window.navigator.userLanguage);e=a}var r=localStorage.getItem("language");if(r&&t.$store&&t.$store.state.coredata&&null!=t.$store.state.coredata){var i=t.$helpers.checkIfObjectInArray(r,t.$store.state.coredata.langs);null!=i&&(e=r)}t.$store.state.user&&t.$store.state.user.profile&&t.$store.state.user.profile.settings&&t.$store.state.user.profile.settings.language&&(e=t.$store.state.user.profile.settings.language);var n=window.location.pathname.split("/");return n&&n.length>1&&(e=n[1]),console.log("final language",e),t.$store.dispatch("setLanguage",e),localStorage.setItem("language",e),e},loadingShow:function(){this.$buefy.loading&&(this.loadingComponent=this.$buefy.loading.open({container:this.loadingIsFullPage?null:this.$refs.element.$el}))},loadingClose:function(){this.loadingComponent&&this.loadingComponent.close()}}}).$mount("#app");ta.beforeEach((function(t,e,a){var s=t.fullPath.split("/");if(s.length>1&&s[1]!=ea.$store.state.language.code&&s.length>0){var r=e.fullPath.split("/"),i=ea.$store.state.language.code;if(r.length>1&&(i=r[1]),i!==ea.$store.state.language.code){s[1]=ea.$store.state.language.code;var n=s.join("/");return a({path:n})}var o=t.fullPath;return s.length>1&&(s[1]=ea.$store.state.language.code,o=s.join("/")),console.log("newUrl:",o),a({path:o})}return a()}))},"578f":function(t,e,a){},"5ac7":function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("article",{staticClass:"tile is-child box"},[a("p",{staticClass:"title"},[t._v(t._s(t.product.name[t.getLang]))]),a("p",{staticClass:"subtitle"},[t._v(t._s(t.product.descriptionShort[t.getLang]))]),a("div",{staticClass:"tile-image"},[a("img",{attrs:{src:t.getProductImagePath(t.product.orderCode),alt:t.product.name[t.getLang],onerror:"this.src='/assets/_site/logo-product.svg'"}})]),"product"==t.product.type?a("div",{staticClass:"bottom-part"},[a("p",{staticClass:"stock"},[a("span",{attrs:{translate:"yes"}},[t._v("In stock")]),t._v(" "+t._s(t.product.stockAmount))]),a("p",{staticClass:"price"},[a("span",{attrs:{translate:"yes"}},[t._v("Price")]),t._v(" "+t._s(t.$store.state.numeral(t.product.price).format("0 0.00"))+" "+t._s(t.$store.state.currency.symbol))]),t.product.tax&&t.product.tax>0?a("div",{staticClass:"product-price-tax"},[a("span",{attrs:{translate:"yes"}},[t._v("Without Tax")]),t._v(" ("+t._s(t.$store.state.numeral(100*t.product.tax).format("0 0.00"))+"%): "+t._s(t.$store.state.numeral(t.product.price-t.product.price*t.product.tax).format("0 0.00"))+" "+t._s(t.$store.state.currency.symbol)+" ")]):a("div",{staticClass:"product-price-tax"}),!this.hideBuyButton||"false"==this.hideBuyButton||this.requirementsCheckShow(t.product)?a("div",{staticClass:"buy-button"},[a("button",{staticClass:"button is-primary",attrs:{"data-id":t.product._id},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.addToCart(e)}}},[a("font-awesome-icon",{attrs:{icon:"cart-plus"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add to Cart")])],1)]):a("div",{staticClass:"buy-button"},[a("button",{staticClass:"button is-primary"},[a("font-awesome-icon",{attrs:{icon:"plus"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("See detail")])],1)])]):t._e()])},r=[],i={props:["product","propLang","hideBuyButton"],computed:{getLang:function(){return this.$store&&this.$store.state&&this.$store.state.language.code?this.$store.state.language.code:this.propLang?propLang:"en"}},methods:{addToCart:function(t){var e=this,a=t.currentTarget.getAttribute("data-id"),s=t.currentTarget.getAttribute("data-amount");this.$helpers.animateAddToCart(t.currentTarget),s||(s=1),console.log(a),this.$httpc.put("cart",{itemId:a,amount:s}).then((function(t){console.log(t),t.data&&e.$store.dispatch("setCart",t.data)})).catch((function(t){console.log(t)})).then((function(){}))},getProductImagePath:function(t){return this.$store&&this.$store.state&&this.$store.state.coredata&&this.$store.state.coredata.settings&&this.$store.state.coredata.settings.assets&&this.$store.state.coredata.settings.assets.url?this.$helpers.getProductImagePath(this.$store.state.coredata,t):null},requirementsCheckShow:function(t){return!(t&&t.data&&t.data.requirements&&t.data.requirements.inputs&&t.data.requirements.inputs.length>0)}}},n=i,o=(a("10a8"),a("2877")),l=Object(o["a"])(n,s,r,!1,null,null,null);e["a"]=l.exports},"5b55":function(t,e,a){"use strict";var s=100,r=3,i="price",n=["price","-price","-dates.dateCreated","-stockAmount"],o="-dates.dateCreated",l=["-dates.dateCreated","-stockAmount"],c="{{nameFirst}} {{nameLast}}\n{{addressFull}}\n{{city}}\n{{zip}}\n{{country}}",d="{{nameFirst}} {{nameLast}}\n{{companyName}}\n{{addressFull}}\n{{city}}\n{{zip}}\n{{country}}\n{{companyOrgId}}\n{{companyTaxId}}, {{companyTaxVatId}}",u="1d",m="30d";e["a"]={PER_PAGE:s,PER_ROW:r,PRODUCT_DEFAULT_SORTING:i,PRODUCT_SORTING_VALUES:n,PAGE_DEFAULT_SORTING:o,PAGE_SORTING_VALUES:l,ADDRESS_FORMAT:c,ADDRESS_FORMAT_COMPANY:d,COOKIE_TIME:u,COOKIE_TIME_REMEMBER:m}},"5bc8":function(t,e,a){"use strict";var s=a("578f"),r=a.n(s);r.a},"5c0b":function(t,e,a){"use strict";var s=a("9c0c"),r=a.n(s);r.a},"5e51":function(t,e,a){},6400:function(t,e,a){},"6f35":function(t,e,a){"use strict";var s=a("2a7d"),r=a.n(s);r.a},"750f":function(t,e,a){},7918:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.product&&null!=t.product&&t.product.data&&t.product.data.gallery&&t.product.data.gallery.images&&t.$store&&t.$store.state&&t.$store.state.coredata?a("div",{staticClass:"columns product-gallery"},[a("div",{staticClass:"column is-12"},[a("div",{staticClass:"columns"},[t._m(0),t.editable?a("div",{staticClass:"column is-6 has-text-right"},[a("b-field",{staticClass:"file action edit"},[a("b-upload",{on:{input:function(e){t.editGalleryImage(t.countProductGalleryPictures())}},model:{value:t.galleryImages["galleryImage_"+t.countProductGalleryPictures()],callback:function(e){t.$set(t.galleryImages,"galleryImage_"+t.countProductGalleryPictures(),e)},expression:"galleryImages['galleryImage_'+countProductGalleryPictures()]"}},[a("a",{staticClass:"button is-primary is-info"},[a("i",{staticClass:"fa fa-plus"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add Image to Gallery")])])])],1)],1):t._e()]),a("div",[t.$store.state.language?a("hooper",{staticClass:"hooper200",attrs:{settings:t.hooperSettings}},[t._l(t.product.data.gallery.images,(function(e,s){return a("slide",{key:s,attrs:{index:s}},[a("a",{staticClass:"image-overlay",attrs:{href:"#"+s,"data-id":"product/"+t.product.orderCode+"/"+e},on:{click:function(e){return e.preventDefault(),t.getImageModal(e)}}},[a("img",{attrs:{src:t.$parent.getProductGalleryImagePath(t.product.orderCode,e),"data-index":s,alt:""}})]),t.editable?a("div",{staticClass:"slider__actions-wrapper"},[a("b-field",{staticClass:"file action edit"},[a("b-upload",{on:{input:function(e){return t.editGalleryImage(s)}},model:{value:t.galleryImages["galleryImage_"+s],callback:function(e){t.$set(t.galleryImages,"galleryImage_"+s,e)},expression:"galleryImages['galleryImage_'+i]"}},[a("a",{staticClass:"button is-primary is-info"},[a("i",{staticClass:"fa fa-file-upload"})])])],1),a("a",{staticClass:"action remove",on:{click:function(e){return e.preventDefault(),t.deleteGalleryImage(s)}}},[a("i",{staticClass:"fa fa-trash"})])],1):t._e()])})),a("hooper-navigation",{attrs:{slot:"hooper-addons"},slot:"hooper-addons"})],2):t._e(),t.modal.image?a("b-modal",{attrs:{active:t.modal.isImageModalActive},on:{"update:active":function(e){return t.$set(t.modal,"isImageModalActive",e)}}},[a("div",{staticClass:"my-modal-image",style:{"background-image":"url("+t.modal.image+")","background-size":t.modal.cssSize}})]):t._e()],1)])]):t._e()},r=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Gallery")])])}],i=(a("7f7f"),a("7e04")),n=(a("955f"),{props:["product","editable"],name:"SliderCarousel",data:function(){return{hooperSettings:{infiniteScroll:!0,itemsToShow:this.getItemsToShow()},modal:{isImageModalActive:!1,image:null,cssSize:"contain"},galleryImages:{}}},components:{Hooper:i["a"],Slide:i["c"],HooperNavigation:i["b"]},methods:{getItemsToShow:function(){return document.body.clientWidth<=768?3:5},getImageModal:function(t){if(t.currentTarget){var e=this,a=t.currentTarget,s=a.querySelector("img");a.parentElement.parentElement;if(s){var r=s.getAttribute("src");if(r&&""!==r.trim()){var i=new Image;return i.src=r,i.onload=function(){i.width0&&a.data.files[0].path&&""!=a.data.files[0].path.trim()){var r=e.$el.querySelectorAll('.product-gallery .hooper .hooper-list .hooper-slide img[data-index="'+t+'"]');if(r&&r.length)for(var i=0;i=e.countProductGalleryPictures()&&""!=a.data.files[0].name.trim()&&e.product.data.gallery.images.push(a.data.files[0].name)}}}))},deleteGalleryImage:function(t){console.log("deleteGalleryImage index:",t,this.$parent.product.orderCode);var e=this;if(confirm("Are you sure?")){var a={timeout:15e3,needsAuth:!0},s=this.$parent.product.data.gallery.images[t];console.log(this.product.orderCode,s),this.$httpc.delete("user/image/products/"+this.$parent.product.orderCode+"/"+s,a).then((function(a){a&&a.data&&a.data.success&&(console.log("image delete response",a.data),e.$parent.product.data.gallery.images.splice(t,1))}))}}}}),o=n,l=(a("bc77"),a("2877")),c=Object(l["a"])(o,s,r,!1,null,null,null);e["a"]=c.exports},"9a6b":function(t,e,a){},"9c0c":function(t,e,a){},"9e2b":function(t,e,a){"use strict";var s=a("750f"),r=a.n(s);r.a},a906:function(t,e,a){"use strict";var s=a("4b9e"),r=a.n(s);r.a},aa87:function(t,e,a){"use strict";var s=a("adc6"),r=a.n(s);r.a},adc6:function(t,e,a){},b41b:function(t,e,a){"use strict";var s=a("0a62"),r=a.n(s);r.a},bc77:function(t,e,a){"use strict";var s=a("9a6b"),r=a.n(s);r.a},df4c:function(t,e,a){"use strict";var s=a("0e19"),r=a.n(s);r.a},e15e:function(t,e,a){},e182:function(t,e,a){"use strict";var s=a("273e"),r=a.n(s);r.a},ef61:function(t,e,a){}}); +//# sourceMappingURL=app.8dd7c6cf.js.map \ No newline at end of file diff --git a/public/js/chunk-029e64c6.d7f76ec2.js b/public/js/chunk-029e64c6.d7f76ec2.js deleted file mode 100644 index de80be0..0000000 --- a/public/js/chunk-029e64c6.d7f76ec2.js +++ /dev/null @@ -1,2 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-029e64c6"],{"2fdb":function(t,e,a){"use strict";var s=a("5ca1"),r=a("d2c8"),o="includes";s(s.P+s.F*a("5147")(o),"String",{includes:function(t){return!!~r(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},"3c98":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.product&&t.userEditAllowed?a("div",{staticClass:"container product-detail",attrs:{id:"product-new-edit"}},[a("div",{staticClass:"field product-edit-language hidden"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Edit Language")]),a("div",{staticClass:"control select"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.newLanguage,expression:"newLanguage"}],on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.newLanguage=e.target.multiple?a:a[0]},function(e){return t.changeEditedLang()}]}},t._l(t.$store.state.coredata.langs,(function(e,s){return a("option",{key:s+"langs",domProps:{value:e}},[t._v(" "+t._s(e.name)+" ")])})),0)])]),t.editing?a("div",{staticClass:"product-hidden-properties"},[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenProperties"},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{translate:"yes"}},[t._v("Product's hidden properties")]),t._v(" "),a("font-awesome-icon",{attrs:{icon:(e.open,"angle-up")}})],1)}}],null,!1,3080087121)},[a("div",{staticClass:"editableByAuthor-hidden collapse-content",attrs:{id:"contentHiddenProperties","aria-expanded":"true"}},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Type")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.type,expression:"product.type"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Type"},domProps:{value:t.product.type},on:{input:function(e){e.target.composing||t.$set(t.product,"type",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Subtype")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.subtype,expression:"product.subtype"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Subtype"},domProps:{value:t.product.subtype},on:{input:function(e){e.target.composing||t.$set(t.product,"subtype",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("External Id")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.externalId,expression:"product.externalId"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"External Id"},domProps:{value:t.product.externalId},on:{input:function(e){e.target.composing||t.$set(t.product,"externalId",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Variation Group Id")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.variationGroupId,expression:"product.variationGroupId"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Variation Group Id"},domProps:{value:t.product.variationGroupId},on:{input:function(e){e.target.composing||t.$set(t.product,"variationGroupId",e.target.value)}}})])])])]):t._e()])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Slug")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.slug,expression:"product.slug"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Slug"},domProps:{value:t.product.slug},on:{input:function(e){e.target.composing||t.$set(t.product,"slug",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Note")]),a("div",{staticClass:"control"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.product.note,expression:"product.note"}],staticClass:"textarea",attrs:{translate:"yes",placeholder:"Note"},domProps:{value:t.product.note},on:{input:function(e){e.target.composing||t.$set(t.product,"note",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Activity")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.activity,expression:"product.activity"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Activity"},domProps:{value:t.product.activity},on:{input:function(e){e.target.composing||t.$set(t.product,"activity",e.target.value)}}})])])])]):t._e()])])])]),t.user&&null!=t.user&&t.user.type&&"admin"==t.user.type?a("div",[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenPropertiesAdmin"},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{translate:"yes"}},[t._v("Editable by admin user")]),t._v(" "),a("font-awesome-icon",{attrs:{icon:e.open?"angle-down":"angle-up"}})],1)}}],null,!1,4162815105)},[a("div",{staticClass:"editableByAdmin-hidden"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-4 is-offset-4"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Publisher")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.publisher,expression:"product.publisher"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Publisher"},domProps:{value:t.product.publisher},on:{input:function(e){e.target.composing||t.$set(t.product,"publisher",e.target.value)}}})])])])])])])],1):t._e()],1):t._e(),a("div",{staticClass:"columns reversed"},[a("div",{staticClass:"column is-7"},[a("div",{staticClass:"product-image-wrapper"},[a("img",{staticClass:"image-main",attrs:{src:t.getProductImagePath(t.product.orderCode),alt:t.product.name[t.language.code],onerror:"this.src='/assets/_site/logo-product.svg'"}}),a("b-field",{staticClass:"file action edit"},[a("b-upload",{on:{input:function(e){return t.productMainImageUpload()}},model:{value:t.productMainImageFile,callback:function(e){t.productMainImageFile=e},expression:"productMainImageFile"}},[a("a",{staticClass:"button is-primary is-info"},[a("i",{staticClass:"fa fa-file-upload"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Click to upload")])])])],1),a("a",{staticClass:"action remove button is-danger is-outlined",on:{click:function(e){return e.preventDefault(),t.productMainImageDelete()}}},[a("i",{staticClass:"fa fa-trash"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Click to remove")])])],1)]),a("div",{staticClass:"column is-5 data-main"},[a("section",[a("b-field",{attrs:{label:"Enter categories' url slugs"}},[a("b-taginput",{attrs:{data:t.filteredCategoriesSlugs,autocomplete:"","allow-new":!1,field:"user.first_name",icon:"tags",placeholder:"Categories",type:"is-info"},on:{typing:t.getFilteredCategories},model:{value:t.product.categories,callback:function(e){t.$set(t.product,"categories",e)},expression:"product.categories"}})],1)],1),t.parentCategoryDetail?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[t.parentCategoryDetail.parentCategories?a("ul",[t._l(t.parentCategoryDetail.parentCategories,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.language.code])+" ")])],1)})),a("li",{staticClass:"is-active"},[a("router-link",{attrs:{title:t.parentCategoryDetail.name[t.language.code],to:{name:"categoryList",params:{category:t.parentCategoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.parentCategoryDetail.name[t.language.code])+" ")])],1)],2):t._e()]):t._e(),t.product&&null!=t.product?a("div",[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.name[t.language.code],expression:"product.name[language.code]"}],staticClass:"input is-size-1 has-text-weight-semibold has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Name"},domProps:{value:t.product.name[t.language.code]},on:{input:function(e){e.target.composing||t.$set(t.product.name,t.language.code,e.target.value)}}})])]),a("div",{staticClass:"content"},[a("div",{staticClass:"columns"},[t._m(0),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Order code")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.orderCode,expression:"product.orderCode"}],staticClass:"input has-text-weight-normal has-text-left",attrs:{type:"text",translate:"yes",placeholder:"Order code"},domProps:{value:t.product.orderCode},on:{input:function(e){e.target.composing||t.$set(t.product,"orderCode",e.target.value)}}})]),a("p",{staticClass:"help is-danger",attrs:{translate:"yes"}},[t._v("Changing OrderCode may disable images and other external dependecies")])])])]),a("div",{staticClass:"columns"},[t._m(1),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("In stock")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.stockAmount,expression:"product.stockAmount"}],staticClass:"input has-text-weight-normal has-text-left",attrs:{type:"text",translate:"yes",placeholder:"In stock"},domProps:{value:t.product.stockAmount},on:{input:function(e){e.target.composing||t.$set(t.product,"stockAmount",e.target.value)}}})])])])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[a("span",{attrs:{translate:"yes"}},[t._v("Price")]),t._v(" "+t._s(t.$store.state.currency.symbol))]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.price,expression:"product.price"}],staticClass:"input is-size-2 has-text-weight-normal has-text-right",attrs:{type:"text",translate:"yes",placeholder:"Price"},domProps:{value:t.product.price},on:{input:function(e){e.target.composing||t.$set(t.product,"price",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("button",{staticClass:"button add-to-cart is-primary",attrs:{"data-id":t.product._id,disabled:""},on:{click:function(e){return e.preventDefault(),t.addToCart(e)}}},[a("font-awesome-icon",{attrs:{icon:"cart-plus"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add to Cart")])],1)])])])]):t._e()])]),t.product&&null!=t.product?a("div",{staticClass:"columns product-descriptions reversed-desktop"},[a("div",{staticClass:"column is-5"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Description Short")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.descriptionShort[t.language.code],expression:"product.descriptionShort[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Short"},domProps:{value:t.product.descriptionShort[t.language.code]},on:{input:function(e){e.target.composing||t.$set(t.product.descriptionShort,t.language.code,e.target.value)}}})])]),t.product.data&&t.product.data.variations?a("div",[a("section",[a("b-collapse",{staticClass:"card",attrs:{"aria-id":"contentIdForA11y3",open:!1},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("div",{staticClass:"card-header",attrs:{role:"button","aria-controls":"contentIdForA11y3"}},[a("p",{staticClass:"card-header-title",attrs:{translate:"yes"}},[t._v(" Variations ")]),a("a",{staticClass:"card-header-icon"},[a("b-icon",{attrs:{icon:e.open?"angle-up":"angle-down"}})],1)])}}],null,!1,4060768951)},[a("div",{staticClass:"card-content"},t._l(t.product.data.variations,(function(e,s){return a("router-link",{key:e._id+s,staticClass:"content",attrs:{title:e.name[t.language.code],to:{name:"productDetail",params:{category:e.categories[0],product:e._id,slug:e.slug}}}},[a("figure",{staticClass:"image is-32x32"},[a("img",{attrs:{src:t.getProductImagePath(e.orderCode),alt:e.name[t.language.code]}})]),t._v(" "+t._s(e.name[t.language.code])+" ")])})),1)])],1)]):t._e()]),a("div",{staticClass:"column is-7"},[a("div",{staticClass:"productContent",attrs:{"data-editable":"","data-name":"description"},domProps:{innerHTML:t._s(t.product.descriptionLong[t.language.code])}})])]):t._e(),t.product&&null!=t.product&&t.product.properties?a("div",{staticClass:"product-properties bg-grey"},[a("div",{staticClass:"columns"},[t._m(2),a("div",{staticClass:"column is-6 has-text-right"},[a("a",{staticClass:"button is-primary is-info",on:{click:function(e){return e.preventDefault(),t.newPropertyCardModal()}}},[a("i",{staticClass:"fa fa-plus"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add New Property")])])])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[a("div",[a("table",{staticClass:"table"},t._l(t.product.properties,(function(e,s){return a("tr",{key:s,attrs:{"data-key":s}},[a("th",[a("div",{staticClass:"field property-key"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Property Key")]),a("div",{staticClass:"control"},[a("input",{staticClass:"input has-text-weight-normal has-text-left",attrs:{disabled:t.getPropertyStrings(e,s).name===s,type:"text",translate:"yes",placeholder:"Property Key","data-orig":s},domProps:{value:s},on:{keyup:function(e){return t.changePropertyValue(s,"key")}}})]),t._m(3,!0)])]),a("td",[a("div",{staticClass:"field property-name"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Property Name")]),a("div",{staticClass:"control"},[a("input",{staticClass:"input has-text-weight-normal has-text-left",attrs:{type:"text",translate:"yes",placeholder:"Property Name","data-orig":t.getPropertyStrings(e,s).name},domProps:{value:t.getPropertyStrings(e,s).name},on:{keyup:function(e){return t.changePropertyValue(s,"name")}}}),a("b-switch",{attrs:{type:"is-info",value:t.checkIfPropertyHasLang(e,"name"),translate:"yes"},on:{input:function(a){return t.changePropertyLangOption(e,s,"name")}}},[t._v("Lang")])],1),t._m(4,!0)])]),a("td",[a("div",{staticClass:"field property-value"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Property Value")]),a("div",{staticClass:"control"},[a("input",{staticClass:"input has-text-weight-normal has-text-left",attrs:{type:"text",translate:"yes",placeholder:"Property Value","data-orig":t.getPropertyStrings(e,s).value},domProps:{value:t.getPropertyStrings(e,s).value},on:{keyup:function(e){return t.changePropertyValue(s,"value")}}}),a("b-switch",{attrs:{type:"is-info",value:t.checkIfPropertyHasLang(e,"value")},on:{input:function(a){return t.changePropertyLangOption(e,s,"value")}}},[t._v("Lang")])],1)])]),a("td",{staticClass:"has-text-centered",attrs:{width:"50"}},[a("a",{staticClass:"is-size-4 has-text-danger",attrs:{href:"#revemoProperty"},on:{click:function(e){return e.preventDefault(),t.removeProperty(s)}}},[a("font-awesome-icon",{attrs:{icon:"minus"}})],1)])])})),0)])])])]):t._e(),a("slider-carousel",{attrs:{product:t.product,editable:!0}}),t.product&&t.product.data&&t.product.data.related&&t.product.data.related.products?a("section",[a("b-field",{attrs:{label:"Enter order codes of related products"}},[a("b-taginput",{attrs:{data:t.filteredProductCodes,autocomplete:"","allow-new":!1,field:"user.first_name",icon:"tags",placeholder:"Related",type:"is-info"},on:{typing:t.getFilteredRelatedProducts},model:{value:t.product.data.related.products,callback:function(e){t.$set(t.product.data.related,"products",e)},expression:"product.data.related.products"}})],1)],1):t._e(),t.product&&null!=t.product&&t.product.data&&t.product.data.related&&t.product.data.related.productResults&&t.product.data.related.productResults.length>0&&t.$store&&t.$store.state&&t.$store.state.coredata?a("div",{staticClass:"columns product-related"},[a("div",{staticClass:"column is-12"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Related")]),a("div",{staticClass:"tile is-ancestor"},t._l(t.product.data.related.productResults,(function(e,s){return a("router-link",{key:e._id+s,staticClass:"tile is-parent is-3",attrs:{title:e.descriptionShort[t.language.code],to:{name:"productDetail",params:{category:e.activeParentCategoryUrl,product:e._id,slug:e.slug}}}},[a("product-box",{attrs:{product:e}})],1)})),1)])]):t._e(),t.product&&null!=t.product?a("div",{staticClass:"columns product-delete"},[a("div",{staticClass:"column is-12"},[a("section",[a("button",{staticClass:"button is-danger",attrs:{translate:"yes"},on:{click:function(e){return t.deleteProduct()}}},[t._v("DELETE This Product")]),a("p",{attrs:{translate:"yes"}},[t._v("Warning: This action cannot be undone!")])])])]):t._e(),a("product-property",{attrs:{modal:t.modal}})],1):t._e()},r=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-6 has-text-right"},[a("span",{attrs:{translate:"yes"}},[t._v("Order code")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-6 has-text-right"},[a("span",{attrs:{translate:"yes"}},[t._v("In stock")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Properties")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"exists",translate:"yes"}},[t._v("This key already exists")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"exists",translate:"yes"}},[t._v("This key already exists")])])}],o=(a("28a5"),a("6762"),a("2fdb"),a("ac6a"),a("456d"),a("7618")),i=(a("7f7f"),a("6b54"),a("77b6")),n=a.n(i),l=(a("2b31"),a("7918")),c=a("5ac7"),d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.modal?a("div",{staticClass:"modal is-active"},[a("div",{staticClass:"modal-background"}),a("div",{staticClass:"animation-content"},[a("form",{attrs:{action:""}},[a("div",{staticClass:"modal-card",staticStyle:{width:"auto"}},[t._m(0),a("section",{staticClass:"modal-card-body"},[t.$store.state.coredata&&t.$store.state.coredata.langs?a("b-field",{attrs:{label:"Language"}},[a("div",{staticClass:"control select"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.propertyLang,expression:"propertyLang"}],on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.propertyLang=e.target.multiple?a:a[0]}}},[a("option",{attrs:{disabled:"disabled",value:"",translate:"yes"}},[t._v("Select language")]),a("option",{attrs:{value:""}},[t._v("-- "),a("span",{attrs:{translate:"yes"}},[t._v("None")]),t._v(" --")]),t._l(t.$store.state.coredata.langs,(function(e){return a("option",{key:e.code,domProps:{value:e.code}},[t._v(" "+t._s(e.name)+" ")])}))],2)])]):t._e(),a("b-field",{attrs:{label:"Property key"}},[a("b-input",{attrs:{type:"text",placeholder:"Property key",required:""},model:{value:t.propertyKey,callback:function(e){t.propertyKey=e},expression:"propertyKey"}})],1),t.propertyLang?a("b-field",{attrs:{label:"Property Name"}},[a("b-input",{attrs:{type:"text",placeholder:"Property Name"},model:{value:t.propertyName,callback:function(e){t.propertyName=e},expression:"propertyName"}})],1):t._e(),a("b-field",{attrs:{label:"Property value"}},[a("b-input",{attrs:{type:"text",placeholder:"Property value",required:""},model:{value:t.propertyValue,callback:function(e){t.propertyValue=e},expression:"propertyValue"}})],1)],1),a("footer",{staticClass:"modal-card-foot"},[a("button",{staticClass:"button",attrs:{type:"button",translate:"yes"},on:{click:function(e){t.$parent.modal=!1}}},[t._v("Close")]),a("button",{staticClass:"button is-primary",attrs:{translate:"yes"},on:{click:function(e){return e.preventDefault(),t.setProperty()}}},[t._v("Add Property")])])])])])]):t._e()},u=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("header",{staticClass:"modal-card-head"},[a("p",{staticClass:"modal-card-title",attrs:{translate:"yes"}},[t._v("New Product Property")])])}],p={props:["modal"],name:"ProductNewEditProperty",data:function(){return{propertyKey:null,propertyName:null,propertyValue:null,propertyLang:null}},mounted:function(){},methods:{setProperty:function(){console.log(this.$parent.setProperty(this.propertyKey,this.propertyValue,this.propertyLang,this.propertyName))}}},g=p,h=a("2877"),m=Object(h["a"])(g,d,u,!1,null,null,null),v=m.exports,y={name:"ProductNewEdit",data:function(){return{product:null,productMainImageFile:null,productPropertyLangSwitches:{},parentCategoryDetail:null,language:{code:"en",longCode:"en-US",name:"English"},newLanguage:null,variationModel:null,editor:null,editing:!1,userEditAllowed:!1,filteredCategoriesSlugs:[],filteredProductCodes:[],renderComponent:!0,modal:null,fireCounter:0}},components:{"slider-carousel":l["a"],"product-box":c["a"],"product-property":v},created:function(){this.language=this.$store.state.language},computed:{user:function(){return this.$store.getters.getUserProfile}},beforeRouteLeave:function(t,e,a){this.editor&&this.editor.destroy(),a()},watch:{user:function(t,e){console.log("new & old",t,e),t&&null!=t&&(this.getUserEditAllowed(),this.userEditAllowed&&this.getProductDetail())}},mounted:function(){this.getUserEditAllowed(),console.log("mounted this.userEditAllowed",this.userEditAllowed),this.userEditAllowed&&this.getProductDetail()},methods:{getUserEditAllowed:function(){if(this.language=this.$store.state.language,this.user&&null!=this.user&&this.user.type&&"admin"==this.user.type)return this.userEditAllowed=!0,void(this.user.settings.language&&(this.language=this.$store.state.language));this.userEditAllowed=!1},getProductDetail:function(){var t=this;this.$route.params&&this.$route.params.category&&""!=this.$route.params.category.toString().trim()&&this.$route.params.product&&""!=this.$route.params.product.toString().trim()&&("---new"==this.$route.params.product.toString().trim()&&"---new"==this.$route.params.slug.toString().trim()?setTimeout((function(){t.product=t.getEmptyProduct(),t.runEditor()}),1e3):this.$httpc.get("products/"+this.$route.params.category+"/detail/"+this.$route.params.product).then((function(e){if(e.data){if(t.product=e.data,t.product.name&&t.$store.state&&void 0!==Object(o["a"])(t.product.name[t.language.code])&&(document.title=t.product.name[t.language.code]+" - StretchShop"),t.product&&t.product.categories&&(t.filteredCategoriesSlugs=t.product.categories),t.product&&t.product.properties){var a=Object.keys(t.product.properties);if(a&&a.length>0)for(var s=0;s0)return!0}return!1},changePropertyLangOption:function(t,e,a){console.log("value query:",".product-properties .table data-key["+e+"] .field.property-"+a+" input[text]");var s=this.$el.querySelector('.product-properties .table [data-key="'+e+'"] .field.property-'+a+" input[type=text]").value,r=this.productPropertyLangSwitches[e],o="remove";0==r[a]&&(o="add");var i=this.product.properties[e];if(console.log("changePropertyLangOption params and value:",t,e,a,s,o),a&&"name"==a){if("remove"==o)1==r.name&&1==r.value?(delete i.name,delete this.product.properties[e],this.product.properties[s]=i):1==r.name&&0==r.value&&(delete this.product.properties[e],this.product.properties[s]=i.value);else if("add"==o){this.product.properties[e].constructor!=Object&&(this.product.properties[e]={value:this.product.properties[e]}),this.product.properties[e][a]={};for(var n=0;n0&&(s=r[r.length-1])}console.log(this.product.orderCode,a),this.$httpc.delete("user/image/products/"+this.product.orderCode+"/"+s,e).then((function(e){e&&e.data&&e.data.success&&(console.log("image delete response",e.data),t.$el.querySelector(".product-image-wrapper img.image-main").setAttribute("src",t.getProductImagePath(t.product.orderCode)))}))}},productMainImageUpload:function(){if(console.log("productMainImageFile:",this.productMainImageFile),this.productMainImageFile){var t=this,e=new FormData;if(this.productMainImageFile.length&&this.productMainImageFile.length>0)for(var a=0;a0&&e.data.files[0].path&&""!=e.data.files[0].path.trim()){var s=t.$el.querySelector(".product-image-wrapper img.image-main");s&&s.setAttribute("src",t.$store.state.coredata.settings.assets.url+"/products/"+e.data.files[0].path)}}}))}},changeEditedLang:function(){this.fireCounter++,this.editing&&this.newLanguage&&this.newLanguage.code&&1==this.fireCounter&&(window.location=window.location.origin+this.$route.path+"?lang="+this.newLanguage.code)},saveProduct:function(){var t=this;this.product&&this.product._id&&!this.product.id&&(this.product.id=this.product._id),this.product.price&&this.product.stockAmount&&(this.product.price=parseFloat(this.product.price),this.product.stockAmount=parseFloat(this.product.stockAmount));var e={products:[]};e.products.push(this.product),this.$httpc.put("products",e,{needsAuth:!0}).then((function(e){if(e.data&&e.data.length>0){var a=e.data[0],s=t.$router.resolve({name:"productNewEdit",params:{category:a.categories[0],slug:a.slug,product:a._id}});window.location=s.href}})).catch((function(t){console.log("saveProduct error:",t)}))},deleteProduct:function(){var t=this,e={products:[{id:t.product._id}]};this.product&&this.product._id&&confirm("Are you sure you want to delete this product?")&&this.$httpc.delete("products",{data:e}).then((function(t){t&&t.data&&alert("Product has been successfully removed. You will be redirected now")}))},getEmptyProduct:function(){var t=this;return{externalId:null,orderCode:null,variationGroupId:null,publisher:t.user.email,type:"product",subtype:null,name:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),descriptionShort:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),descriptionLong:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),price:0,tax:null,stockAmount:0,slug:null,properties:{},categories:[],dates:{dateCreated:null,dateUpdated:null,dateSynced:null},data:{related:{products:[],productResults:[]},gallery:{name:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),images:[]}},note:null,parentCategoryDetail:{}}}}},f=y,C=(a("f7b0"),Object(h["a"])(f,s,r,!1,null,"366eb4a8",null));e["default"]=C.exports},5147:function(t,e,a){var s=a("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(a){try{return e[s]=!1,!"/./"[t](e)}catch(r){}}return!0}},"5a35":function(t,e,a){},d2c8:function(t,e,a){var s=a("aae3"),r=a("be13");t.exports=function(t,e,a){if(s(e))throw TypeError("String#"+a+" doesn't accept regex!");return String(r(t))}},f7b0:function(t,e,a){"use strict";var s=a("5a35"),r=a.n(s);r.a}}]); -//# sourceMappingURL=chunk-029e64c6.d7f76ec2.js.map \ No newline at end of file diff --git a/public/js/chunk-02b9cd01.63c0f110.js b/public/js/chunk-02b9cd01.63c0f110.js deleted file mode 100644 index f1522e5..0000000 --- a/public/js/chunk-02b9cd01.63c0f110.js +++ /dev/null @@ -1,2 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-02b9cd01"],{"4c05":function(e,t,a){"use strict";var s=a("741d"),i=a.n(s);i.a},"741d":function(e,t,a){},df24:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.page?a("div",{staticClass:"container page-detail"},[a("div",{staticClass:"field product-edit-language hidden"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Edit Language")]),a("div",{staticClass:"control select"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.newLanguage,expression:"newLanguage"}],on:{change:[function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.newLanguage=t.target.multiple?a:a[0]},function(t){return e.changeEditedLang()}]}},e._l(e.$store.state.coredata.langs,(function(t,s){return a("option",{key:s+"langs",domProps:{value:t}},[e._v(" "+e._s(t.name)+" ")])})),0)])]),e.editing?a("div",{staticClass:"page-hidden-properties"},[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenProperties"},scopedSlots:e._u([{key:"trigger",fn:function(t){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties"}},[a("span",{attrs:{translate:"yes"}},[e._v("Page's hidden properties")]),e._v(" "),a("font-awesome-icon",{attrs:{icon:t.open?"angle-down":"angle-up"}})],1)}}],null,!1,4003255297)},[a("div",{staticClass:"editableByAuthor-hidden collapse-content",attrs:{id:"contentHiddenProperties","aria-expanded":"true"}},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[e.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Type")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.type,expression:"page.data.type"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Type"},domProps:{value:e.page.data.type},on:{input:function(t){t.target.composing||e.$set(e.page.data,"type",t.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Subtype")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.subtype,expression:"page.data.subtype"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Subtype"},domProps:{value:e.page.data.subtype},on:{input:function(t){t.target.composing||e.$set(e.page.data,"subtype",t.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("External Id")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.externalId,expression:"page.data.externalId"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"External Id"},domProps:{value:e.page.data.externalId},on:{input:function(t){t.target.composing||e.$set(e.page.data,"externalId",t.target.value)}}})])])])]):e._e()])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[e.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Slug")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.slug,expression:"page.data.slug"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Slug"},domProps:{value:e.page.data.slug},on:{input:function(t){t.target.composing||e.$set(e.page.data,"slug",t.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Note")]),a("div",{staticClass:"control"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.page.data.note,expression:"page.data.note"}],staticClass:"textarea",attrs:{translate:"yes",placeholder:"Note"},domProps:{value:e.page.data.note},on:{input:function(t){t.target.composing||e.$set(e.page.data,"note",t.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Activity")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.activity,expression:"page.data.activity"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Activity"},domProps:{value:e.page.data.activity},on:{input:function(t){t.target.composing||e.$set(e.page.data,"activity",t.target.value)}}})])])])]):e._e()])])])]),e.user&&null!=e.user&&e.user.type&&"admin"==e.user.type?a("div",[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenPropertiesAdmin"},scopedSlots:e._u([{key:"trigger",fn:function(t){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{traslate:"yes"}},[e._v("Editable by admin user")]),e._v(" "),a("font-awesome-icon",{attrs:{icon:t.open?"angle-down":"angle-up"}})],1)}}],null,!1,476455311)},[a("div",{staticClass:"editableByAdmin-hidden"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-4 is-offset-4"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Publisher")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.publisher,expression:"page.data.publisher"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Publisher"},domProps:{value:e.page.data.publisher},on:{input:function(t){t.target.composing||e.$set(e.page.data,"publisher",t.target.value)}}})])])])])])])],1):e._e()],1):e._e(),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"}),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-6"},[a("section",[a("b-field",{attrs:{label:"Enter categories' url slugs"}},[a("b-taginput",{attrs:{data:e.filteredCategoriesSlugs,autocomplete:"","allow-new":!1,field:"user.first_name",icon:"tags",placeholder:"Categories",type:"is-info"},on:{typing:e.getFilteredCategories},model:{value:e.page.data.categories,callback:function(t){e.$set(e.page.data,"categories",t)},expression:"page.data.categories"}})],1)],1),e.parentCategoryDetail?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[e.parentCategoryDetail.parentCategories?a("ul",[e._l(e.parentCategoryDetail.parentCategories,(function(t,s){return a("li",{key:s},[a("router-link",{attrs:{title:t.name[e.$store.state.language.code],to:{name:"categoryList",params:{category:t.pathSlug}}}},[e._v(" "+e._s(t.name[e.$store.state.language.code])+" ")])],1)})),a("li",{staticClass:"is-active"},[a("router-link",{attrs:{title:e.parentCategoryDetail.name[e.$store.state.language.code],to:{name:"categoryList",params:{category:e.parentCategoryDetail.pathSlug}},"aria-current":"page"}},[e._v(" "+e._s(e.parentCategoryDetail.name[e.$store.state.language.code])+" ")])],1)],2):e._e()]):e._e()]),a("div",{staticClass:"column is-6"},[a("section",[a("b-field",{attrs:{label:"Enter related pages' url slugs"}},[a("b-taginput",{attrs:{data:e.filteredPagesSlugs,autocomplete:"","allow-new":!1,icon:"tags",placeholder:"Pages",type:"is-info"},on:{typing:e.getFilteredPages},model:{value:e.page.data.pages,callback:function(t){e.$set(e.page.data,"pages",t)},expression:"page.data.pages"}})],1)],1)])]),e.page&&e.page.data&&null!=e.page.data?a("div",{staticClass:"data-main"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.name[e.language.code],expression:"page.data.name[language.code]"}],staticClass:"input is-size-1 has-text-weight-semibold has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Name"},domProps:{value:e.page.data.name[e.language.code]},on:{input:function(t){t.target.composing||e.$set(e.page.data.name,e.language.code,t.target.value)}}})])]),a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Description Short")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.descriptionShort[e.language.code],expression:"page.data.descriptionShort[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Short"},domProps:{value:e.page.data.descriptionShort[e.language.code]},on:{input:function(t){t.target.composing||e.$set(e.page.data.descriptionShort,e.language.code,t.target.value)}}})])]),a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Description Long")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.descriptionLong[e.language.code],expression:"page.data.descriptionLong[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Long"},domProps:{value:e.page.data.descriptionLong[e.language.code]},on:{input:function(t){t.target.composing||e.$set(e.page.data.descriptionLong,e.language.code,t.target.value)}}})])])]):e._e(),a("div",{staticClass:"page-body",domProps:{innerHTML:e._s(e.page.body)}})])]),e.page&&null!=e.page?a("div",{staticClass:"columns page-delete"},[a("div",{staticClass:"column is-12"},[a("section",[a("button",{staticClass:"button is-danger",attrs:{translate:"yes"},on:{click:function(t){return e.deletePage()}}},[e._v("DELETE This Page")]),a("p",{attrs:{translate:"yes"}},[e._v("Warning: This action cannot be undone!")])])])]):e._e()]):e._e()},i=[],n=(a("a481"),a("456d"),a("ac6a"),a("3b2b"),a("7618")),l=(a("7f7f"),a("6b54"),a("77b6")),o=a.n(l),r=(a("2b31"),{name:"PageNewEdit",data:function(){return{page:null,parentCategoryDetail:null,language:{code:"en",longCode:"en-US",name:"English"},newLanguage:null,editor:null,editing:!1,userEditAllowed:!1,filteredCategoriesSlugs:[],filteredPagesSlugs:[],modal:null,fireCounter:0}},created:function(){this.language=this.$store.state.language},computed:{user:function(){return this.$store.getters.getUserProfile}},beforeRouteLeave:function(e,t,a){this.editor&&this.editor.destroy(),a()},watch:{user:function(e,t){console.log("new & old",e,t),e&&null!=e&&(this.getUserEditAllowed(),this.userEditAllowed&&this.getPageDetail())}},mounted:function(){this.getUserEditAllowed(),this.userEditAllowed&&this.getPageDetail()},methods:{getUserEditAllowed:function(){if(this.language=this.$store.state.language,this.user&&null!=this.user&&this.user.type&&"admin"==this.user.type)return this.userEditAllowed=!0,void this.user.settings.language;this.userEditAllowed=!1},getPageDetail:function(){var e=this;"undefined"==typeof this.$route.params.category&&(this.$route.params.category="-"),this.$route.params&&this.$route.params.slug&&""!=this.$route.params.slug.toString().trim()&&("---new"==this.$route.params.slug.toString().trim()?setTimeout((function(){e.page=e.getEmptyPage(),e.runEditor()}),1e3):this.$httpc.get("pages/"+this.$route.params.category+"/detail/"+this.$route.params.slug+"?lang="+e.$store.state.language.code).then((function(t){t.data&&(e.page=t.data,e.page&&e.page.data&&e.page.data.name&&e.$store.state&&void 0!==Object(n["a"])(e.page.data.name[e.$store.state.language.code])&&(document.title=e.page.data.name[e.$store.state.language.code]+" - StretchShop"),console.log("page detail",t.data)),e.page&&e.page.data&&e.page.data.parentCategoryDetail&&(e.parentCategoryDetail=e.page.data.parentCategoryDetail,delete e.page.data.parentCategoryDetail)})).catch((function(e){console.log(e)})).then((function(){e.runEditor()})))},runEditor:function(){var e=this;if(this.$route.query.lang){var t=this.$store.dispatch("checkLanguage",this.$route.query.lang);t.then((function(t){console.log("language check result:",t),e.language&&e.language.code&&t&&t.code&&e.language.code!=t.code&&(e.language=t)}))}setTimeout((function(){o.a.IMAGE_UPLOADER=e.editorCTimageUploader,e.editor=o.a.EditorApp.get(),console.log("get editor"),e.editor.init("*[data-editable]","data-name"),console.log("init editor"),e.editor.start(),console.log("start editor"),e.editor.ignition().state("editing"),console.log("editor ignition state editing"),e.editing=!0,e.newLanguage=e.language,e.editor.addEventListener("saved",(function(t){console.log("editor saved",t);var a=t.detail().regions;console.log("regions",a),e.editor.busy(!0),a&&"undefined"!==typeof a["content"]&&(console.log("self.page: ",e.page),console.log("self.page.data: ",e.page.data),console.log("self.page.data.data: ",e.page.data.data),e.page.data.data.blocks||(e.page.data.data.blocks=[]),0==e.page.data.data.blocks.length&&e.page.data.data.blocks.push({}),console.log("self.page.data.data.blocks: ",e.page.data.data.blocks),console.log("self.page.data.data.blocks[0]: ",e.page.data.data.blocks[0]),e.page.data.data.blocks[0]&&!e.page.data.data.blocks[0][e.language.code]&&(e.page.data.data.blocks[0][e.language.code]={}),e.page.data.data.blocks[0][e.language.code]=a["content"],console.log("page data.blocks[0]["+e.language.code+"]:",e.page.data.data.blocks[0][e.language.code])),e.savePage()}))}),1e3)},editorCTimageUploader:function(e){var t,a,s,i,n=this;console.log("xxx",e),e.addEventListener("imageuploader.cancelupload",(function(){a&&(a.upload.removeEventListener("progress",i),a.removeEventListener("readystatechange",s),a.abort()),e.state("empty")})),e.addEventListener("imageuploader.clear",(function(){e.clear(),t=null})),e.addEventListener("imageuploader.fileready",(function(l){var r,d=l.detail().file;i=function(t){e.progress(t.loaded/t.total*100)},s=function(l){var r;if(4==l.target.readyState)if(a=null,i=null,s=null,200==parseInt(l.target.status)){var d=l.target.responseText.length-2,g=l.target.responseText.substr(1,d);r=JSON.parse(g),console.log("upload response:",r);var c=new Image,u=n.$store.state.coredata.settings.assets.url+"/pages/editor/"+r.files[0].path;c.onload=function(){t={size:[c.width,c.height],url:u},e.populate(t.url,t.size)},c.src=u}else new o.a.FlashUI("no")},e.state("uploading"),e.progress(0),r=new FormData,r.append("image",d),a=new XMLHttpRequest,a.upload.addEventListener("progress",i),a.addEventListener("readystatechange",s),console.log("POST URL:",n.$httpc.defaults,n.$httpc.defaults.baseURL,n.$httpc.defaults.baseURL+"/pages/upload/"+n.page.data.slug),a.open("POST",n.$httpc.defaults.baseURL+"pages/upload/"+n.page.data.slug,!0),a.setRequestHeader("Authorization","Token "+n.$cookies.get("token")),a.setRequestHeader("Accept","application/json"),a.send(r)})),e.addEventListener("imageuploader.save",(function(){e.save(t.url,t.size,{alt:"test","data-ce-max-width":t.size[0]})}))},changeEditedLang:function(){this.fireCounter++,this.editing&&this.newLanguage&&this.newLanguage.code&&1==this.fireCounter&&(window.location=window.location.origin+this.$route.path+"?lang="+this.newLanguage.code)},savePage:function(){var e=this;if(this.page&&this.page.data&&this.page.data._id&&!this.page.data.id&&(this.page.data.id=this.page.data._id,delete this.page.data._id),this.page.data.blocks){var t=new RegExp(" data-editable ","g");Object.keys(this.page.data.blocks).forEach((function(e){if(this.page.data.blocks[e].indexOf(" data-editable ")){this.$route.params.id.toString().replace("---","@").replace(t,".");this.page.data.blocks[e]=this.page.data.blocks[e].replace(t)}}))}var a={pages:[]};a.pages.push(this.page.data),console.log("pagesToPut: ",a),this.$httpc.put("pages",a,{needsAuth:!0}).then((function(t){if(t.data&&t.data.length>0){var a=t.data[0],s=e.$router.resolve({name:"pageNewEdit",params:{slug:a.slug}});window.location=s.href}})).catch((function(t){console.log("savePage error:",t),e.editor.busy(!1)}))},deletePage:function(){var e=this,t={pages:[{id:e.page._id}]};this.page&&this.page._id&&confirm("Are you sure you want to delete this page?")&&this.$httpc.delete("pages",{data:t}).then((function(e){e&&e.data&&alert("Page has been successfully removed. You will be redirected now")}))},getFilteredCategories:function(e){var t=this;return e&&""!=e.toString().trim()?this.$httpc.post("categories/find",{query:{pathSlug:{$regex:e},type:"pages"}}).then((function(e){if(e.data)return e.data})).catch((function(e){console.log(e)})).then((function(e){var a=[];if(t.page.data.categories&&e&&e.categories&&e.categories.length>0)for(var s=0;s0)for(var s=0;s

Your content here

',data:{externalId:null,variationGroupId:null,slug:null,publisher:e.user.email,authors:null,type:"page",subtype:"default",name:e.$helpers.getLangsEmptyObject(e.$store.state.coredata.langCodes),descriptionShort:e.$helpers.getLangsEmptyObject(e.$store.state.coredata.langCodes),descriptionLong:e.$helpers.getLangsEmptyObject(e.$store.state.coredata.langCodes),properties:null,data:{blocks:[]},categories:[],pages:[],dates:{dateCreated:null,dateUpdated:null,dateSynced:null},note:null,activity:null}}}}}),d=r,g=(a("4c05"),a("2877")),c=Object(g["a"])(d,s,i,!1,null,"06e97b26",null);t["default"]=c.exports}}]); -//# sourceMappingURL=chunk-02b9cd01.63c0f110.js.map \ No newline at end of file diff --git a/public/js/chunk-1f7eff4e.03f7672f.js b/public/js/chunk-1f7eff4e.03f7672f.js new file mode 100644 index 0000000..0bfd556 --- /dev/null +++ b/public/js/chunk-1f7eff4e.03f7672f.js @@ -0,0 +1,2 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1f7eff4e"],{5627:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.categoryDetail?a("div",{staticClass:"container category-list"},[a("div",{staticClass:"edit-area"},[a("a",{staticClass:"editor-button confirm-button",attrs:{href:"#confirm"},on:{click:function(e){return e.preventDefault(),t.saveCategory()}}},[a("font-awesome-icon",{attrs:{icon:"check"}})],1),a("div",{staticClass:"field product-edit-language hidden"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Edit Language")]),a("div",{staticClass:"control select"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.newLanguage,expression:"newLanguage"}],on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.newLanguage=e.target.multiple?a:a[0]},function(e){return t.changeEditedLang()}]}},t._l(t.$store.state.coredata.langs,(function(e,s){return a("option",{key:s+"langs",domProps:{value:e}},[t._v(" "+t._s(e.name)+" ")])})),0)])])]),t.editing?a("div",{staticClass:"category-hidden-properties"},[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenProperties"},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{translate:"yes"}},[t._v("Category's hidden properties")]),t._v(" "),a("font-awesome-icon",{attrs:{icon:e.open?"angle-down":"angle-up"}})],1)}}],null,!1,2747750493)},[a("div",{staticClass:"editableByAuthor-hidden collapse-content",attrs:{id:"contentHiddenProperties","aria-expanded":"true"}},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Type")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.type,expression:"categoryDetail.type"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Type"},domProps:{value:t.categoryDetail.type},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"type",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Subtype")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.subtype,expression:"categoryDetail.subtype"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Subtype"},domProps:{value:t.categoryDetail.subtype},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"subtype",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("External Id")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.externalId,expression:"categoryDetail.externalId"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"External Id"},domProps:{value:t.categoryDetail.externalId},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"externalId",e.target.value)}}})])])])]):t._e()])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Slug")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.slug,expression:"categoryDetail.slug"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Slug"},domProps:{value:t.categoryDetail.slug},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"slug",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Note")]),a("div",{staticClass:"control"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.note,expression:"categoryDetail.note"}],staticClass:"textarea",attrs:{translate:"yes",placeholder:"Note"},domProps:{value:t.categoryDetail.note},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"note",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Activity")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.activity,expression:"categoryDetail.activity"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Activity"},domProps:{value:t.categoryDetail.activity},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"activity",e.target.value)}}})])])])]):t._e()])])])]),t.user&&null!=t.user&&t.user.type&&"admin"==t.user.type?a("div",[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenPropertiesAdmin"},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{translate:"yes"}},[t._v("Editable by admin user")]),t._v(" "),a("font-awesome-icon",{attrs:{icon:e.open?"angle-down":"angle-up"}})],1)}}],null,!1,4162815105)},[a("div",{staticClass:"editableByAdmin-hidden"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-4 is-offset-4"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Publisher")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.publisher,expression:"categoryDetail.publisher"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Publisher"},domProps:{value:t.categoryDetail.publisher},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"publisher",e.target.value)}}})])])])])])])],1):t._e()],1):t._e(),a("div",{staticClass:"columns category-header",style:{backgroundImage:"url("+t.getCategoryBackground()+")"}},[a("div",{staticClass:"column"},[a("div",{staticClass:"category-image-wrapper"},[a("b-field",{staticClass:"file action edit"},[a("b-upload",{on:{input:function(e){return t.categoryMainImageUpload()}},model:{value:t.categoryMainImageFile,callback:function(e){t.categoryMainImageFile=e},expression:"categoryMainImageFile"}},[a("a",{staticClass:"button is-primary is-info"},[a("i",{staticClass:"fa fa-file-upload"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Click to upload")])])])],1),a("a",{staticClass:"action remove button is-danger is-outlined",on:{click:function(e){return e.preventDefault(),t.categoryMainImageDelete()}}},[a("i",{staticClass:"fa fa-trash"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Click to remove")])])],1),t.categoryDetail?a("h1",{staticClass:"title is-1"},[t._v(t._s(t.categoryDetail.name[t.language.code]))]):t._e(),t.categoryDetail?a("h2",{staticClass:"title is-3"},[t._v(t._s(t.categoryDetail.descriptionShort[t.language.code]))]):t._e(),t.categoryDetail?a("p",{},[t._v(t._s(t.categoryDetail.descriptionLong[t.language.code]))]):a("h1",{staticClass:"title is-1 title-products",attrs:{translate:"yes"}},[t._v("Products")])])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column data-main"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.name[t.language.code],expression:"categoryDetail.name[language.code]"}],staticClass:"input is-size-1 has-text-weight-semibold has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Name"},domProps:{value:t.categoryDetail.name[t.language.code]},on:{keyup:function(e){return t.checkNameDependents()},input:function(e){e.target.composing||t.$set(t.categoryDetail.name,t.language.code,e.target.value)}}})])]),a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Description Short")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.descriptionShort[t.language.code],expression:"categoryDetail.descriptionShort[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Short"},domProps:{value:t.categoryDetail.descriptionShort[t.language.code]},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail.descriptionShort,t.language.code,e.target.value)}}})])]),a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Description Long")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.descriptionLong[t.language.code],expression:"categoryDetail.descriptionLong[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Long"},domProps:{value:t.categoryDetail.descriptionLong[t.language.code]},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail.descriptionLong,t.language.code,e.target.value)}}})])])])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3",attrs:{id:"category-edit-navigation"}},[t.categoryDetail&&t.categoryDetail.subs?a("nav",{staticClass:"panel"},[a("p",{staticClass:"panel-heading",attrs:{translate:"yes"}},[t._v(" Sub-Categories ")]),t._l(this.categoryDetail.subs,(function(e,s){return a("router-link",{key:s,staticClass:"panel-block",attrs:{title:e.descriptionShort[t.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.language.code])+" ")])}))],2):t._e()]),a("div",{staticClass:"column is-9"},[a("section",[a("b-field",{attrs:{label:"Enter parent categories' url slugs"}},[a("b-taginput",{attrs:{data:t.filteredCategoriesSlugs,autocomplete:"","allow-new":!1,field:"user.first_name",icon:"tags",placeholder:"Parent Categories",type:"is-info"},on:{typing:t.getFilteredCategories},model:{value:t.categoryDetail.parentPath,callback:function(e){t.$set(t.categoryDetail,"parentPath",e)},expression:"categoryDetail.parentPath"}})],1)],1),t.breadcrumbs&&null!=t.breadcrumbs&&t.breadcrumbs.length>0?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[a("ul",[t._l(t.breadcrumbs,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.language.code])+" ")])],1)})),a("li",{staticClass:"is-active"},[a("router-link",{attrs:{title:t.categoryDetail.name[t.language.code],to:{name:"categoryList",params:{category:t.categoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.categoryDetail.name[t.language.code])+" ")])],1)],2)]):t._e()])]),this.categoryDetail&&null!=this.categoryDetail?a("div",{staticClass:"columns category-delete"},[a("div",{staticClass:"column is-12"},[a("section",[a("button",{staticClass:"button is-danger",attrs:{translate:"yes"},on:{click:function(e){return t.deleteCategory()}}},[t._v("DELETE This Category")]),a("p",{attrs:{translate:"yes"}},[t._v("Warning: This action cannot be undone! This action does not remove category's content!")])])])]):t._e()]):t._e()},i=[],l=(a("7f7f"),a("28a5"),a("6b54"),a("df7c"),a("5b55"),{name:"CategoryNewEdit",data:function(){return{categories:[],filteredProductsCount:null,products:[],categoryMainImageFile:null,breadcrumbs:[],categoryDetail:null,language:{code:"en",longCode:"en-US",name:"English"},newLanguage:null,editing:!1,userEditAllowed:!1,groupsLastRefresh:0,filteredCategoriesSlugs:[],fireCounter:0,dataToGenerateFromName:{slug:!0,externalId:!0}}},created:function(){this.language=this.$store.state.language},computed:{user:function(){return this.$store.getters.getUserProfile}},components:{},watch:{user:function(t,e){console.log("new & old",t,e),t&&null!=t&&(this.getUserEditAllowed(),this.userEditAllowed&&this.getCategoryDetail())}},mounted:function(){this.getUserEditAllowed(),console.log("mounted this.userEditAllowed",this.userEditAllowed),this.userEditAllowed&&this.getCategoryDetail()},methods:{getUserEditAllowed:function(){if(this.language=this.$store.state.language,this.user&&null!=this.user&&this.user.type&&"admin"==this.user.type)return this.userEditAllowed=!0,void(this.user.settings.language&&(this.language=this.$store.state.language));this.userEditAllowed=!1},changeEditedLang:function(){this.fireCounter++,this.editing&&this.newLanguage&&this.newLanguage.code&&1==this.fireCounter&&(window.location=window.location.origin+this.$route.path+"?lang="+this.newLanguage.code)},processCategoryResponse:function(t){var e=new Date;this.groupsLastRefresh=e.getTime(),t.data&&(this.categoryDetail=t.data,t.data.parentCategories&&(this.breadcrumbs=t.data.parentCategories),this.editing=!0,this.newLanguage=this.language),t.data.categories&&(this.categories=t.data.categories)},getCategoryDetail:function(){var t=this;this.$route.params&&this.$route.params.category&&""!=this.$route.params.category.toString().trim()&&("---new"==this.$route.params.category.toString().trim()?setTimeout((function(){t.categoryDetail=t.getEmptyCategory(),t.editing=!0}),1e3):this.$httpc.get("category/"+this.$route.params.category,{timeout:7e3}).then((function(e){t.processCategoryResponse(e)})).catch((function(t){console.log(t)})))},getFilteredCategories:function(t){var e=this;return t&&""!=t.toString().trim()?this.$httpc.post("categories/find",{query:{pathSlug:{$regex:t},type:e.categoryDetail&&e.categoryDetail.type?e.categoryDetail.type:"products"}}).then((function(t){if(t.data)return t.data})).catch((function(t){console.log(t)})).then((function(t){for(var a=[],s=0;s0)for(var a=0;a0&&e.data.files[0].path&&""!=e.data.files[0].path.trim()){var s=t.$el.querySelector(".category-list .category-header");s&&s.setAttribute("style","background-image: url('"+t.$store.state.coredata.settings.assets.url+"/categories/"+e.data.files[0].path+"')")}}}))}},categoryMainImageDelete:function(){var t=this;if(confirm("Are you sure?")){var e={timeout:15e3,needsAuth:!0},a=this.getCategoryBackground(this.categoryDetail.slug),s="";if(""!=a.trim()){var i=a.split("/");i.length>0&&(s=i[i.length-1])}console.log(this.categoryDetail.slug,a),this.$httpc.delete("user/image/categories/"+this.categoryDetail.slug+"/"+s,e).then((function(e){e&&e.data&&e.data.success&&(console.log("image delete response",e.data),t.$el.querySelector(".category-list .category-header").setAttribute("style",""))}))}},saveCategory:function(){var t=this,e=this.categoryDetail;e&&e._id&&!e.id&&(e.id=e._id),e.parentCategories&&delete e.parentCategories,e.subs&&delete e.subs,e.subsSlugs&&delete e.subsSlugs,e.count&&delete e.count,e.minMaxPrice&&delete e.minMaxPrice;var a={categories:[]};a.categories.push(e),this.$httpc.put("categories",a,{needsAuth:!0}).then((function(e){if(e.data&&e.data.length>0){var a=e.data[0],s=t.$router.resolve({name:"categoryNewEdit",params:{category:a.pathSlug}});window.location=s.href}})).catch((function(t){console.log("saveCategory error:",t)}))},deleteCategory:function(){var t=this,e={categories:[{id:t.categoryDetail._id}]};this.categoryDetail&&this.categoryDetail._id&&confirm("Are you sure you want to delete this product?")&&this.$httpc.delete("categories",{data:e}).then((function(t){t&&t.data&&alert("Category has been successfully removed. You will be redirected now")}))},getEmptyCategory:function(){var t=this;return{externalId:null,publisher:t.$store.state.user.profile.email,slug:null,pathSlug:null,parentPath:[],parentPathSlug:null,type:"products",subtype:"physical",name:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),descriptionShort:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),descriptionLong:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),categories:[],dates:{dateCreated:null,dateUpdated:null,dateSynced:null},data:{},note:null}},checkNameDependents:function(){if(this.categoryDetail&&!this.categoryDetail._id){var t=this.language&&this.language.code?this.language.code:null;this.newLanguage&&this.newLanguage.code&&(t=this.newLanguage.code),this.categoryDetail.name&&this.categoryDetail.name[t]&&""!=this.categoryDetail.name[t].trim()&&((this.categoryDetail.slug&&""==this.categoryDetail.slug.trim()||this.dataToGenerateFromName.slug)&&(this.categoryDetail.slug=this.$helpers.stringToSlug(this.categoryDetail.name[t]),this.dataToGenerateFromName.slug=!0),(this.categoryDetail.externalId&&""==this.categoryDetail.externalId.trim()||this.dataToGenerateFromName.externalId)&&(this.categoryDetail.externalId=this.$helpers.stringToSlug(this.categoryDetail.name[t]),this.dataToGenerateFromName.externalId=!0))}}}}),r=l,o=(a("8e42"),a("2877")),n=Object(o["a"])(r,s,i,!1,null,"ec750884",null);e["default"]=n.exports},"8e42":function(t,e,a){"use strict";var s=a("d5c3"),i=a.n(s);i.a},d5c3:function(t,e,a){}}]); +//# sourceMappingURL=chunk-1f7eff4e.03f7672f.js.map \ No newline at end of file diff --git a/public/js/chunk-2ec11e8f.850313d5.js b/public/js/chunk-2ec11e8f.850313d5.js new file mode 100644 index 0000000..32caa24 --- /dev/null +++ b/public/js/chunk-2ec11e8f.850313d5.js @@ -0,0 +1,2 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2ec11e8f"],{"2fdb":function(t,e,a){"use strict";var r=a("5ca1"),s=a("d2c8"),o="includes";r(r.P+r.F*a("5147")(o),"String",{includes:function(t){return!!~s(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},"3c98":function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.product&&t.userEditAllowed?a("div",{staticClass:"container product-detail",attrs:{id:"product-new-edit"}},[a("div",{staticClass:"field product-edit-language hidden"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Edit Language")]),a("div",{staticClass:"control select"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.newLanguage,expression:"newLanguage"}],on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.newLanguage=e.target.multiple?a:a[0]},function(e){return t.changeEditedLang()}]}},t._l(t.$store.state.coredata.langs,(function(e,r){return a("option",{key:r+"langs",domProps:{value:e}},[t._v(" "+t._s(e.name)+" ")])})),0)])]),t.editing?a("div",{staticClass:"product-hidden-properties"},[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenProperties"},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{translate:"yes"}},[t._v("Product's hidden properties")]),t._v(" "),a("font-awesome-icon",{attrs:{icon:(e.open,"angle-up")}})],1)}}],null,!1,3080087121)},[a("div",{staticClass:"editableByAuthor-hidden collapse-content",attrs:{id:"contentHiddenProperties","aria-expanded":"true"}},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Type")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.type,expression:"product.type"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Type"},domProps:{value:t.product.type},on:{input:function(e){e.target.composing||t.$set(t.product,"type",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Subtype")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.subtype,expression:"product.subtype"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Subtype"},domProps:{value:t.product.subtype},on:{input:function(e){e.target.composing||t.$set(t.product,"subtype",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("External Id")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.externalId,expression:"product.externalId"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"External Id"},domProps:{value:t.product.externalId},on:{input:function(e){e.target.composing||t.$set(t.product,"externalId",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Variation Group Id")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.variationGroupId,expression:"product.variationGroupId"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Variation Group Id"},domProps:{value:t.product.variationGroupId},on:{input:function(e){e.target.composing||t.$set(t.product,"variationGroupId",e.target.value)}}})])])])]):t._e()])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Slug")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.slug,expression:"product.slug"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Slug"},domProps:{value:t.product.slug},on:{input:function(e){e.target.composing||t.$set(t.product,"slug",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Note")]),a("div",{staticClass:"control"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.product.note,expression:"product.note"}],staticClass:"textarea",attrs:{translate:"yes",placeholder:"Note"},domProps:{value:t.product.note},on:{input:function(e){e.target.composing||t.$set(t.product,"note",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Activity")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.activity,expression:"product.activity"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Activity"},domProps:{value:t.product.activity},on:{input:function(e){e.target.composing||t.$set(t.product,"activity",e.target.value)}}})])])])]):t._e()])])])]),t.user&&null!=t.user&&t.user.type&&"admin"==t.user.type?a("div",[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenPropertiesAdmin"},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{translate:"yes"}},[t._v("Editable by admin user")]),t._v(" "),a("font-awesome-icon",{attrs:{icon:e.open?"angle-down":"angle-up"}})],1)}}],null,!1,4162815105)},[a("div",{staticClass:"editableByAdmin-hidden"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-4 is-offset-4"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Publisher")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.publisher,expression:"product.publisher"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Publisher"},domProps:{value:t.product.publisher},on:{input:function(e){e.target.composing||t.$set(t.product,"publisher",e.target.value)}}})])])])])])])],1):t._e()],1):t._e(),a("div",{staticClass:"columns reversed"},[a("div",{staticClass:"column is-7"},[a("div",{staticClass:"product-image-wrapper"},[a("img",{staticClass:"image-main",attrs:{src:t.getProductImagePath(t.product.orderCode),alt:t.product.name[t.language.code],onerror:"this.src='/assets/_site/logo-product.svg'"}}),a("b-field",{staticClass:"file action edit"},[a("b-upload",{on:{input:function(e){return t.productMainImageUpload()}},model:{value:t.productMainImageFile,callback:function(e){t.productMainImageFile=e},expression:"productMainImageFile"}},[a("a",{staticClass:"button is-primary is-info"},[a("i",{staticClass:"fa fa-file-upload"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Click to upload")])])])],1),a("a",{staticClass:"action remove button is-danger is-outlined",on:{click:function(e){return e.preventDefault(),t.productMainImageDelete()}}},[a("i",{staticClass:"fa fa-trash"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Click to remove")])])],1)]),a("div",{staticClass:"column is-5 data-main"},[a("section",[a("b-field",{attrs:{label:"Enter categories' url slugs"}},[a("b-taginput",{attrs:{data:t.filteredCategoriesSlugs,autocomplete:"","allow-new":!1,field:"user.first_name",icon:"tags",placeholder:"Categories",type:"is-info"},on:{typing:t.getFilteredCategories},model:{value:t.product.categories,callback:function(e){t.$set(t.product,"categories",e)},expression:"product.categories"}})],1)],1),t.parentCategoryDetail?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[t.parentCategoryDetail.parentCategories?a("ul",[t._l(t.parentCategoryDetail.parentCategories,(function(e,r){return a("li",{key:r},[a("router-link",{attrs:{title:e.name[t.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.language.code])+" ")])],1)})),a("li",{staticClass:"is-active"},[a("router-link",{attrs:{title:t.parentCategoryDetail.name[t.language.code],to:{name:"categoryList",params:{category:t.parentCategoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.parentCategoryDetail.name[t.language.code])+" ")])],1)],2):t._e()]):t._e(),t.product&&null!=t.product?a("div",[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.name[t.language.code],expression:"product.name[language.code]"}],staticClass:"input is-size-1 has-text-weight-semibold has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Name"},domProps:{value:t.product.name[t.language.code]},on:{keyup:function(e){return t.checkNameDependents()},input:function(e){e.target.composing||t.$set(t.product.name,t.language.code,e.target.value)}}})])]),a("div",{staticClass:"content"},[a("div",{staticClass:"columns"},[t._m(0),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Order code")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.orderCode,expression:"product.orderCode"}],staticClass:"input has-text-weight-normal has-text-left",attrs:{type:"text",translate:"yes",placeholder:"Order code"},domProps:{value:t.product.orderCode},on:{input:function(e){e.target.composing||t.$set(t.product,"orderCode",e.target.value)}}})]),a("p",{staticClass:"help is-danger",attrs:{translate:"yes"}},[t._v("Changing OrderCode may disable images and other external dependecies")])])])]),a("div",{staticClass:"columns"},[t._m(1),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("In stock")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.stockAmount,expression:"product.stockAmount"}],staticClass:"input has-text-weight-normal has-text-left",attrs:{type:"text",translate:"yes",placeholder:"In stock"},domProps:{value:t.product.stockAmount},on:{input:function(e){e.target.composing||t.$set(t.product,"stockAmount",e.target.value)}}})])])])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label"},[a("span",{attrs:{translate:"yes"}},[t._v("Price")]),t._v(" "+t._s(t.$store.state.currency.symbol))]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.price,expression:"product.price"}],staticClass:"input is-size-2 has-text-weight-normal has-text-right",attrs:{type:"text",translate:"yes",placeholder:"Price"},domProps:{value:t.product.price},on:{input:function(e){e.target.composing||t.$set(t.product,"price",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("button",{staticClass:"button add-to-cart is-primary",attrs:{"data-id":t.product._id,disabled:""},on:{click:function(e){return e.preventDefault(),t.addToCart(e)}}},[a("font-awesome-icon",{attrs:{icon:"cart-plus"}}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add to Cart")])],1)])])])]):t._e()])]),t.product&&null!=t.product?a("div",{staticClass:"columns product-descriptions reversed-desktop"},[a("div",{staticClass:"column is-5"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Description Short")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.product.descriptionShort[t.language.code],expression:"product.descriptionShort[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Short"},domProps:{value:t.product.descriptionShort[t.language.code]},on:{input:function(e){e.target.composing||t.$set(t.product.descriptionShort,t.language.code,e.target.value)}}})])]),t.product.data&&t.product.data.variations?a("div",[a("section",[a("b-collapse",{staticClass:"card",attrs:{"aria-id":"contentIdForA11y3",open:!1},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("div",{staticClass:"card-header",attrs:{role:"button","aria-controls":"contentIdForA11y3"}},[a("p",{staticClass:"card-header-title",attrs:{translate:"yes"}},[t._v(" Variations ")]),a("a",{staticClass:"card-header-icon"},[a("b-icon",{attrs:{icon:e.open?"angle-up":"angle-down"}})],1)])}}],null,!1,4060768951)},[a("div",{staticClass:"card-content"},t._l(t.product.data.variations,(function(e,r){return a("router-link",{key:e._id+r,staticClass:"content",attrs:{title:e.name[t.language.code],to:{name:"productDetail",params:{category:e.categories[0],product:e._id,slug:e.slug}}}},[a("figure",{staticClass:"image is-32x32"},[a("img",{attrs:{src:t.getProductImagePath(e.orderCode),alt:e.name[t.language.code]}})]),t._v(" "+t._s(e.name[t.language.code])+" ")])})),1)])],1)]):t._e()]),a("div",{staticClass:"column is-7"},[a("div",{staticClass:"productContent",attrs:{"data-editable":"","data-name":"description"},domProps:{innerHTML:t._s(t.product.descriptionLong[t.language.code])}})])]):t._e(),t.product&&null!=t.product&&t.product.properties?a("div",{staticClass:"product-properties bg-grey"},[a("div",{staticClass:"columns"},[t._m(2),a("div",{staticClass:"column is-6 has-text-right"},[a("a",{staticClass:"button is-primary is-info",on:{click:function(e){return e.preventDefault(),t.newPropertyCardModal()}}},[a("i",{staticClass:"fa fa-plus"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Add New Property")])])])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[a("div",[a("table",{staticClass:"table"},t._l(t.product.properties,(function(e,r){return a("tr",{key:r,attrs:{"data-key":r}},[a("th",[a("div",{staticClass:"field property-key"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Property Key")]),a("div",{staticClass:"control"},[a("input",{staticClass:"input has-text-weight-normal has-text-left",attrs:{disabled:t.getPropertyStrings(e,r).name===r,type:"text",translate:"yes",placeholder:"Property Key","data-orig":r},domProps:{value:r},on:{keyup:function(e){return t.changePropertyValue(r,"key")}}})]),t._m(3,!0)])]),a("td",[a("div",{staticClass:"field property-name"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Property Name")]),a("div",{staticClass:"control"},[a("input",{staticClass:"input has-text-weight-normal has-text-left",attrs:{type:"text",translate:"yes",placeholder:"Property Name","data-orig":t.getPropertyStrings(e,r).name},domProps:{value:t.getPropertyStrings(e,r).name},on:{keyup:function(e){return t.changePropertyValue(r,"name")}}}),a("b-switch",{attrs:{type:"is-info",value:t.checkIfPropertyHasLang(e,"name"),translate:"yes"},on:{input:function(a){return t.changePropertyLangOption(e,r,"name")}}},[t._v("Lang")])],1),t._m(4,!0)])]),a("td",[a("div",{staticClass:"field property-value"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Property Value")]),a("div",{staticClass:"control"},[a("input",{staticClass:"input has-text-weight-normal has-text-left",attrs:{type:"text",translate:"yes",placeholder:"Property Value","data-orig":t.getPropertyStrings(e,r).value},domProps:{value:t.getPropertyStrings(e,r).value},on:{keyup:function(e){return t.changePropertyValue(r,"value")}}}),a("b-switch",{attrs:{type:"is-info",value:t.checkIfPropertyHasLang(e,"value")},on:{input:function(a){return t.changePropertyLangOption(e,r,"value")}}},[t._v("Lang")])],1)])]),a("td",{staticClass:"has-text-centered",attrs:{width:"50"}},[a("a",{staticClass:"is-size-4 has-text-danger",attrs:{href:"#revemoProperty"},on:{click:function(e){return e.preventDefault(),t.removeProperty(r)}}},[a("font-awesome-icon",{attrs:{icon:"minus"}})],1)])])})),0)])])])]):t._e(),a("slider-carousel",{attrs:{product:t.product,editable:!0}}),t.product&&t.product.data&&t.product.data.related&&t.product.data.related.products?a("section",[a("b-field",{attrs:{label:"Enter order codes of related products"}},[a("b-taginput",{attrs:{data:t.filteredProductCodes,autocomplete:"","allow-new":!1,field:"user.first_name",icon:"tags",placeholder:"Related",type:"is-info"},on:{typing:t.getFilteredRelatedProducts},model:{value:t.product.data.related.products,callback:function(e){t.$set(t.product.data.related,"products",e)},expression:"product.data.related.products"}})],1)],1):t._e(),t.product&&null!=t.product&&t.product.data&&t.product.data.related&&t.product.data.related.productResults&&t.product.data.related.productResults.length>0&&t.$store&&t.$store.state&&t.$store.state.coredata?a("div",{staticClass:"columns product-related"},[a("div",{staticClass:"column is-12"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Related")]),a("div",{staticClass:"tile is-ancestor"},t._l(t.product.data.related.productResults,(function(e,r){return a("router-link",{key:e._id+r,staticClass:"tile is-parent is-3",attrs:{title:e.descriptionShort[t.language.code],to:{name:"productDetail",params:{category:e.activeParentCategoryUrl,product:e._id,slug:e.slug}}}},[a("product-box",{attrs:{product:e}})],1)})),1)])]):t._e(),t.product&&null!=t.product?a("div",{staticClass:"columns product-delete"},[a("div",{staticClass:"column is-12"},[a("section",[a("button",{staticClass:"button is-danger",attrs:{translate:"yes"},on:{click:function(e){return t.deleteProduct()}}},[t._v("DELETE This Product")]),a("p",{attrs:{translate:"yes"}},[t._v("Warning: This action cannot be undone!")])])])]):t._e(),a("product-property",{attrs:{modal:t.modal}})],1):t._e()},s=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-6 has-text-right"},[a("span",{attrs:{translate:"yes"}},[t._v("Order code")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-6 has-text-right"},[a("span",{attrs:{translate:"yes"}},[t._v("In stock")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"column is-6"},[a("h3",{staticClass:"title is-3 has-text-left",attrs:{translate:"yes"}},[t._v("Properties")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"exists",translate:"yes"}},[t._v("This key already exists")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-messages is-hidden"},[a("div",{staticClass:"form-message",attrs:{"data-message":"exists",translate:"yes"}},[t._v("This key already exists")])])}],o=(a("28a5"),a("6762"),a("2fdb"),a("ac6a"),a("456d"),a("7618")),i=(a("7f7f"),a("6b54"),a("77b6")),n=a.n(i),l=(a("2b31"),a("7918")),d=a("5ac7"),c=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.modal?a("div",{staticClass:"modal is-active"},[a("div",{staticClass:"modal-background"}),a("div",{staticClass:"animation-content"},[a("form",{attrs:{action:""}},[a("div",{staticClass:"modal-card",staticStyle:{width:"auto"}},[t._m(0),a("section",{staticClass:"modal-card-body"},[t.$store.state.coredata&&t.$store.state.coredata.langs?a("b-field",{attrs:{label:"Language"}},[a("div",{staticClass:"control select"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.propertyLang,expression:"propertyLang"}],on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.propertyLang=e.target.multiple?a:a[0]}}},[a("option",{attrs:{disabled:"disabled",value:"",translate:"yes"}},[t._v("Select language")]),a("option",{attrs:{value:""}},[t._v("-- "),a("span",{attrs:{translate:"yes"}},[t._v("None")]),t._v(" --")]),t._l(t.$store.state.coredata.langs,(function(e){return a("option",{key:e.code,domProps:{value:e.code}},[t._v(" "+t._s(e.name)+" ")])}))],2)])]):t._e(),a("b-field",{attrs:{label:"Property key"}},[a("b-input",{attrs:{type:"text",placeholder:"Property key",required:""},model:{value:t.propertyKey,callback:function(e){t.propertyKey=e},expression:"propertyKey"}})],1),t.propertyLang?a("b-field",{attrs:{label:"Property Name"}},[a("b-input",{attrs:{type:"text",placeholder:"Property Name"},model:{value:t.propertyName,callback:function(e){t.propertyName=e},expression:"propertyName"}})],1):t._e(),a("b-field",{attrs:{label:"Property value"}},[a("b-input",{attrs:{type:"text",placeholder:"Property value",required:""},model:{value:t.propertyValue,callback:function(e){t.propertyValue=e},expression:"propertyValue"}})],1)],1),a("footer",{staticClass:"modal-card-foot"},[a("button",{staticClass:"button",attrs:{type:"button",translate:"yes"},on:{click:function(e){t.$parent.modal=!1}}},[t._v("Close")]),a("button",{staticClass:"button is-primary",attrs:{translate:"yes"},on:{click:function(e){return e.preventDefault(),t.setProperty()}}},[t._v("Add Property")])])])])])]):t._e()},u=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("header",{staticClass:"modal-card-head"},[a("p",{staticClass:"modal-card-title",attrs:{translate:"yes"}},[t._v("New Product Property")])])}],p={props:["modal"],name:"ProductNewEditProperty",data:function(){return{propertyKey:null,propertyName:null,propertyValue:null,propertyLang:null}},mounted:function(){},methods:{setProperty:function(){console.log(this.$parent.setProperty(this.propertyKey,this.propertyValue,this.propertyLang,this.propertyName))}}},g=p,h=a("2877"),m=Object(h["a"])(g,c,u,!1,null,null,null),v=m.exports,y={name:"ProductNewEdit",data:function(){return{product:null,productMainImageFile:null,productPropertyLangSwitches:{},parentCategoryDetail:null,language:{code:"en",longCode:"en-US",name:"English"},newLanguage:null,variationModel:null,editor:null,editing:!1,userEditAllowed:!1,filteredCategoriesSlugs:[],filteredProductCodes:[],renderComponent:!0,modal:null,fireCounter:0,dataToGenerateFromName:{slug:!0,externalId:!0}}},components:{"slider-carousel":l["a"],"product-box":d["a"],"product-property":v},created:function(){this.language=this.$store.state.language},computed:{user:function(){return this.$store.getters.getUserProfile}},beforeRouteLeave:function(t,e,a){this.editor&&this.editor.destroy(),a()},watch:{user:function(t,e){console.log("new & old",t,e),t&&null!=t&&(this.getUserEditAllowed(),this.userEditAllowed&&this.getProductDetail())}},mounted:function(){this.getUserEditAllowed(),console.log("mounted this.userEditAllowed",this.userEditAllowed),this.userEditAllowed&&this.getProductDetail()},methods:{getUserEditAllowed:function(){if(this.language=this.$store.state.language,this.user&&null!=this.user&&this.user.type&&"admin"==this.user.type)return this.userEditAllowed=!0,void(this.user.settings.language&&(this.language=this.$store.state.language));this.userEditAllowed=!1},getProductDetail:function(){var t=this;this.$route.params&&this.$route.params.category&&""!=this.$route.params.category.toString().trim()&&this.$route.params.product&&""!=this.$route.params.product.toString().trim()&&("---new"==this.$route.params.product.toString().trim()&&"---new"==this.$route.params.slug.toString().trim()?setTimeout((function(){t.product=t.getEmptyProduct(),t.runEditor()}),1e3):this.$httpc.get("products/"+this.$route.params.category+"/detail/"+this.$route.params.product).then((function(e){if(e.data){if(t.product=e.data,t.product.name&&t.$store.state&&void 0!==Object(o["a"])(t.product.name[t.language.code])&&(document.title=t.product.name[t.language.code]+" - StretchShop"),t.product&&t.product.categories&&(t.filteredCategoriesSlugs=t.product.categories),t.product&&t.product.properties){var a=Object.keys(t.product.properties);if(a&&a.length>0)for(var r=0;r0)return!0}return!1},changePropertyLangOption:function(t,e,a){console.log("value query:",".product-properties .table data-key["+e+"] .field.property-"+a+" input[text]");var r=this.$el.querySelector('.product-properties .table [data-key="'+e+'"] .field.property-'+a+" input[type=text]").value,s=this.productPropertyLangSwitches[e],o="remove";0==s[a]&&(o="add");var i=this.product.properties[e];if(console.log("changePropertyLangOption params and value:",t,e,a,r,o),a&&"name"==a){if("remove"==o)1==s.name&&1==s.value?(delete i.name,delete this.product.properties[e],this.product.properties[r]=i):1==s.name&&0==s.value&&(delete this.product.properties[e],this.product.properties[r]=i.value);else if("add"==o){this.product.properties[e].constructor!=Object&&(this.product.properties[e]={value:this.product.properties[e]}),this.product.properties[e][a]={};for(var n=0;n0&&(r=s[s.length-1])}console.log(this.product.orderCode,a),this.$httpc.delete("user/image/products/"+this.product.orderCode+"/"+r,e).then((function(e){e&&e.data&&e.data.success&&(console.log("image delete response",e.data),t.$el.querySelector(".product-image-wrapper img.image-main").setAttribute("src",t.getProductImagePath(t.product.orderCode)))}))}},productMainImageUpload:function(){if(console.log("productMainImageFile:",this.productMainImageFile),this.productMainImageFile){var t=this,e=new FormData;if(this.productMainImageFile.length&&this.productMainImageFile.length>0)for(var a=0;a0&&e.data.files[0].path&&""!=e.data.files[0].path.trim()){var r=t.$el.querySelector(".product-image-wrapper img.image-main");r&&r.setAttribute("src",t.$store.state.coredata.settings.assets.url+"/products/"+e.data.files[0].path)}}}))}},changeEditedLang:function(){this.fireCounter++,this.editing&&this.newLanguage&&this.newLanguage.code&&1==this.fireCounter&&(window.location=window.location.origin+this.$route.path+"?lang="+this.newLanguage.code)},saveProduct:function(){var t=this;this.product&&this.product._id&&!this.product.id&&(this.product.id=this.product._id),this.product.price&&this.product.stockAmount&&(this.product.price=parseFloat(this.product.price),this.product.stockAmount=parseFloat(this.product.stockAmount));var e={products:[]};e.products.push(this.product),this.$httpc.put("products",e,{needsAuth:!0}).then((function(e){if(e.data&&e.data.length>0){var a=e.data[0],r=t.$router.resolve({name:"productNewEdit",params:{category:a.categories[0],slug:a.slug,product:a._id}});window.location=r.href}})).catch((function(t){console.log("saveProduct error:",t)}))},deleteProduct:function(){var t=this,e={products:[{id:t.product._id}]};this.product&&this.product._id&&confirm("Are you sure you want to delete this product?")&&this.$httpc.delete("products",{data:e}).then((function(t){t&&t.data&&alert("Product has been successfully removed. You will be redirected now")}))},getEmptyProduct:function(){var t=this;return{externalId:null,orderCode:null,variationGroupId:null,publisher:t.user.email,type:"product",subtype:null,name:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),descriptionShort:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),descriptionLong:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),price:0,tax:null,stockAmount:0,slug:null,properties:{},categories:[],dates:{dateCreated:null,dateUpdated:null,dateSynced:null},data:{related:{products:[],productResults:[]},gallery:{name:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),images:[]}},note:null,parentCategoryDetail:{}}},checkNameDependents:function(){if(this.product&&!this.product._id){var t=this.language&&this.language.code?this.language.code:null;this.newLanguage&&this.newLanguage.code&&(t=this.newLanguage.code),this.product.name&&this.product.name[t]&&""!=this.product.name[t].trim()&&((this.product.slug&&""==this.product.slug.trim()||this.dataToGenerateFromName.slug)&&(this.product.slug=this.$helpers.stringToSlug(this.product.name[t]),this.dataToGenerateFromName.slug=!0),(this.product.externalId&&""==this.product.externalId.trim()||this.dataToGenerateFromName.externalId)&&(this.product.externalId=this.$helpers.stringToSlug(this.product.name[t]),this.dataToGenerateFromName.externalId=!0))}}}},f=y,C=(a("d167"),Object(h["a"])(f,r,s,!1,null,"441455fe",null));e["default"]=C.exports},5147:function(t,e,a){var r=a("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(a){try{return e[r]=!1,!"/./"[t](e)}catch(s){}}return!0}},"815b":function(t,e,a){},d167:function(t,e,a){"use strict";var r=a("815b"),s=a.n(r);s.a},d2c8:function(t,e,a){var r=a("aae3"),s=a("be13");t.exports=function(t,e,a){if(r(e))throw TypeError("String#"+a+" doesn't accept regex!");return String(s(t))}}}]); +//# sourceMappingURL=chunk-2ec11e8f.850313d5.js.map \ No newline at end of file diff --git a/public/js/chunk-54e6d611.9551f3e2.js b/public/js/chunk-54e6d611.9551f3e2.js deleted file mode 100644 index 92540f4..0000000 --- a/public/js/chunk-54e6d611.9551f3e2.js +++ /dev/null @@ -1,2 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-54e6d611"],{4206:function(t,e,a){},5627:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.categoryDetail?a("div",{staticClass:"container category-list"},[a("div",{staticClass:"edit-area"},[a("a",{staticClass:"editor-button confirm-button",attrs:{href:"#confirm"},on:{click:function(e){return e.preventDefault(),t.saveCategory()}}},[a("font-awesome-icon",{attrs:{icon:"check"}})],1),a("div",{staticClass:"field product-edit-language hidden"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Edit Language")]),a("div",{staticClass:"control select"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.newLanguage,expression:"newLanguage"}],on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.newLanguage=e.target.multiple?a:a[0]},function(e){return t.changeEditedLang()}]}},t._l(t.$store.state.coredata.langs,(function(e,s){return a("option",{key:s+"langs",domProps:{value:e}},[t._v(" "+t._s(e.name)+" ")])})),0)])])]),t.editing?a("div",{staticClass:"category-hidden-properties"},[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenProperties"},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{translate:"yes"}},[t._v("Category's hidden properties")]),t._v(" "),a("font-awesome-icon",{attrs:{icon:e.open?"angle-down":"angle-up"}})],1)}}],null,!1,2747750493)},[a("div",{staticClass:"editableByAuthor-hidden collapse-content",attrs:{id:"contentHiddenProperties","aria-expanded":"true"}},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Type")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.type,expression:"categoryDetail.type"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Type"},domProps:{value:t.categoryDetail.type},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"type",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Subtype")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.subtype,expression:"categoryDetail.subtype"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Subtype"},domProps:{value:t.categoryDetail.subtype},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"subtype",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("External Id")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.externalId,expression:"categoryDetail.externalId"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"External Id"},domProps:{value:t.categoryDetail.externalId},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"externalId",e.target.value)}}})])])])]):t._e()])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[t.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Slug")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.slug,expression:"categoryDetail.slug"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Slug"},domProps:{value:t.categoryDetail.slug},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"slug",e.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Note")]),a("div",{staticClass:"control"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.note,expression:"categoryDetail.note"}],staticClass:"textarea",attrs:{translate:"yes",placeholder:"Note"},domProps:{value:t.categoryDetail.note},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"note",e.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Activity")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.activity,expression:"categoryDetail.activity"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Activity"},domProps:{value:t.categoryDetail.activity},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"activity",e.target.value)}}})])])])]):t._e()])])])]),t.user&&null!=t.user&&t.user.type&&"admin"==t.user.type?a("div",[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenPropertiesAdmin"},scopedSlots:t._u([{key:"trigger",fn:function(e){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{translate:"yes"}},[t._v("Editable by admin user")]),t._v(" "),a("font-awesome-icon",{attrs:{icon:e.open?"angle-down":"angle-up"}})],1)}}],null,!1,4162815105)},[a("div",{staticClass:"editableByAdmin-hidden"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-4 is-offset-4"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Publisher")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.publisher,expression:"categoryDetail.publisher"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Publisher"},domProps:{value:t.categoryDetail.publisher},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail,"publisher",e.target.value)}}})])])])])])])],1):t._e()],1):t._e(),a("div",{staticClass:"columns category-header",style:{backgroundImage:"url("+t.getCategoryBackground()+")"}},[a("div",{staticClass:"column"},[a("div",{staticClass:"category-image-wrapper"},[a("b-field",{staticClass:"file action edit"},[a("b-upload",{on:{input:function(e){return t.categoryMainImageUpload()}},model:{value:t.categoryMainImageFile,callback:function(e){t.categoryMainImageFile=e},expression:"categoryMainImageFile"}},[a("a",{staticClass:"button is-primary is-info"},[a("i",{staticClass:"fa fa-file-upload"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Click to upload")])])])],1),a("a",{staticClass:"action remove button is-danger is-outlined",on:{click:function(e){return e.preventDefault(),t.categoryMainImageDelete()}}},[a("i",{staticClass:"fa fa-trash"}),t._v(" "),a("span",{attrs:{translate:"yes"}},[t._v("Click to remove")])])],1),t.categoryDetail?a("h1",{staticClass:"title is-1"},[t._v(t._s(t.categoryDetail.name[t.language.code]))]):t._e(),t.categoryDetail?a("h2",{staticClass:"title is-3"},[t._v(t._s(t.categoryDetail.descriptionShort[t.language.code]))]):t._e(),t.categoryDetail?a("p",{},[t._v(t._s(t.categoryDetail.descriptionLong[t.language.code]))]):a("h1",{staticClass:"title is-1 title-products",attrs:{translate:"yes"}},[t._v("Products")])])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column data-main"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.name[t.language.code],expression:"categoryDetail.name[language.code]"}],staticClass:"input is-size-1 has-text-weight-semibold has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Name"},domProps:{value:t.categoryDetail.name[t.language.code]},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail.name,t.language.code,e.target.value)}}})])]),a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Description Short")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.descriptionShort[t.language.code],expression:"categoryDetail.descriptionShort[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Short"},domProps:{value:t.categoryDetail.descriptionShort[t.language.code]},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail.descriptionShort,t.language.code,e.target.value)}}})])]),a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[t._v("Description Long")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.categoryDetail.descriptionLong[t.language.code],expression:"categoryDetail.descriptionLong[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Long"},domProps:{value:t.categoryDetail.descriptionLong[t.language.code]},on:{input:function(e){e.target.composing||t.$set(t.categoryDetail.descriptionLong,t.language.code,e.target.value)}}})])])])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3",attrs:{id:"category-edit-navigation"}},[t.categoryDetail&&t.categoryDetail.subs?a("nav",{staticClass:"panel"},[a("p",{staticClass:"panel-heading",attrs:{translate:"yes"}},[t._v(" Sub-Categories ")]),t._l(this.categoryDetail.subs,(function(e,s){return a("router-link",{key:s,staticClass:"panel-block",attrs:{title:e.descriptionShort[t.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.language.code])+" ")])}))],2):t._e()]),a("div",{staticClass:"column is-9"},[a("section",[a("b-field",{attrs:{label:"Enter parent categories' url slugs"}},[a("b-taginput",{attrs:{data:t.filteredCategoriesSlugs,autocomplete:"","allow-new":!1,field:"user.first_name",icon:"tags",placeholder:"Parent Categories",type:"is-info"},on:{typing:t.getFilteredCategories},model:{value:t.categoryDetail.parentPath,callback:function(e){t.$set(t.categoryDetail,"parentPath",e)},expression:"categoryDetail.parentPath"}})],1)],1),t.breadcrumbs&&null!=t.breadcrumbs&&t.breadcrumbs.length>0?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[a("ul",[t._l(t.breadcrumbs,(function(e,s){return a("li",{key:s},[a("router-link",{attrs:{title:e.name[t.language.code],to:{name:"categoryList",params:{category:e.pathSlug}}}},[t._v(" "+t._s(e.name[t.language.code])+" ")])],1)})),a("li",{staticClass:"is-active"},[a("router-link",{attrs:{title:t.categoryDetail.name[t.language.code],to:{name:"categoryList",params:{category:t.categoryDetail.pathSlug}},"aria-current":"page"}},[t._v(" "+t._s(t.categoryDetail.name[t.language.code])+" ")])],1)],2)]):t._e()])]),this.categoryDetail&&null!=this.categoryDetail?a("div",{staticClass:"columns category-delete"},[a("div",{staticClass:"column is-12"},[a("section",[a("button",{staticClass:"button is-danger",attrs:{translate:"yes"},on:{click:function(e){return t.deleteCategory()}}},[t._v("DELETE This Category")]),a("p",{attrs:{translate:"yes"}},[t._v("Warning: This action cannot be undone! This action does not remove category's content!")])])])]):t._e()]):t._e()},i=[],l=(a("28a5"),a("6b54"),a("df7c"),a("5b55"),{name:"CategoryNewEdit",data:function(){return{categories:[],filteredProductsCount:null,products:[],categoryMainImageFile:null,breadcrumbs:[],categoryDetail:null,language:{code:"en",longCode:"en-US",name:"English"},newLanguage:null,editing:!1,userEditAllowed:!1,groupsLastRefresh:0,filteredCategoriesSlugs:[],fireCounter:0}},created:function(){this.language=this.$store.state.language},computed:{user:function(){return this.$store.getters.getUserProfile}},components:{},watch:{user:function(t,e){console.log("new & old",t,e),t&&null!=t&&(this.getUserEditAllowed(),this.userEditAllowed&&this.getCategoryDetail())}},mounted:function(){this.getUserEditAllowed(),console.log("mounted this.userEditAllowed",this.userEditAllowed),this.userEditAllowed&&this.getCategoryDetail()},methods:{getUserEditAllowed:function(){if(this.language=this.$store.state.language,this.user&&null!=this.user&&this.user.type&&"admin"==this.user.type)return this.userEditAllowed=!0,void(this.user.settings.language&&(this.language=this.$store.state.language));this.userEditAllowed=!1},changeEditedLang:function(){this.fireCounter++,this.editing&&this.newLanguage&&this.newLanguage.code&&1==this.fireCounter&&(window.location=window.location.origin+this.$route.path+"?lang="+this.newLanguage.code)},processCategoryResponse:function(t){var e=new Date;this.groupsLastRefresh=e.getTime(),t.data&&(this.categoryDetail=t.data,t.data.parentCategories&&(this.breadcrumbs=t.data.parentCategories),this.editing=!0,this.newLanguage=this.language),t.data.categories&&(this.categories=t.data.categories)},getCategoryDetail:function(){var t=this;this.$route.params&&this.$route.params.category&&""!=this.$route.params.category.toString().trim()&&("---new"==this.$route.params.category.toString().trim()?setTimeout((function(){t.categoryDetail=t.getEmptyCategory(),t.editing=!0}),1e3):this.$httpc.get("category/"+this.$route.params.category,{timeout:7e3}).then((function(e){t.processCategoryResponse(e)})).catch((function(t){console.log(t)})))},getFilteredCategories:function(t){var e=this;return t&&""!=t.toString().trim()?this.$httpc.post("categories/find",{query:{pathSlug:{$regex:t},type:e.categoryDetail&&e.categoryDetail.type?e.categoryDetail.type:"products"}}).then((function(t){if(t.data)return t.data})).catch((function(t){console.log(t)})).then((function(t){for(var a=[],s=0;s0)for(var a=0;a0&&e.data.files[0].path&&""!=e.data.files[0].path.trim()){var s=t.$el.querySelector(".category-list .category-header");s&&s.setAttribute("style","background-image: url('"+t.$store.state.coredata.settings.assets.url+"/categories/"+e.data.files[0].path+"')")}}}))}},categoryMainImageDelete:function(){var t=this;if(confirm("Are you sure?")){var e={timeout:15e3,needsAuth:!0},a=this.getCategoryBackground(this.categoryDetail.slug),s="";if(""!=a.trim()){var i=a.split("/");i.length>0&&(s=i[i.length-1])}console.log(this.categoryDetail.slug,a),this.$httpc.delete("user/image/categories/"+this.categoryDetail.slug+"/"+s,e).then((function(e){e&&e.data&&e.data.success&&(console.log("image delete response",e.data),t.$el.querySelector(".category-list .category-header").setAttribute("style",""))}))}},saveCategory:function(){var t=this,e=this.categoryDetail;e&&e._id&&!e.id&&(e.id=e._id),e.parentCategories&&delete e.parentCategories,e.subs&&delete e.subs,e.subsSlugs&&delete e.subsSlugs,e.count&&delete e.count,e.minMaxPrice&&delete e.minMaxPrice;var a={categories:[]};a.categories.push(e),this.$httpc.put("categories",a,{needsAuth:!0}).then((function(e){if(e.data&&e.data.length>0){var a=e.data[0],s=t.$router.resolve({name:"categoryNewEdit",params:{category:a.pathSlug}});window.location=s.href}})).catch((function(t){console.log("saveCategory error:",t)}))},deleteCategory:function(){var t=this,e={categories:[{id:t.categoryDetail._id}]};this.categoryDetail&&this.categoryDetail._id&&confirm("Are you sure you want to delete this product?")&&this.$httpc.delete("categories",{data:e}).then((function(t){t&&t.data&&alert("Category has been successfully removed. You will be redirected now")}))},getEmptyCategory:function(){var t=this;return{externalId:null,publisher:t.$store.state.user.profile.email,slug:null,pathSlug:null,parentPath:[],parentPathSlug:null,type:"products",subtype:"physical",name:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),descriptionShort:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),descriptionLong:t.$helpers.getLangsEmptyObject(t.$store.state.coredata.langCodes),categories:[],dates:{dateCreated:null,dateUpdated:null,dateSynced:null},data:{},note:null}}}}),r=l,o=(a("e06a"),a("2877")),n=Object(o["a"])(r,s,i,!1,null,"41d914f6",null);e["default"]=n.exports},e06a:function(t,e,a){"use strict";var s=a("4206"),i=a.n(s);i.a}}]); -//# sourceMappingURL=chunk-54e6d611.9551f3e2.js.map \ No newline at end of file diff --git a/public/js/chunk-78619b25.cec71534.js b/public/js/chunk-78619b25.cec71534.js new file mode 100644 index 0000000..cb39546 --- /dev/null +++ b/public/js/chunk-78619b25.cec71534.js @@ -0,0 +1,2 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-78619b25"],{5940:function(e,t,a){},6028:function(e,t,a){"use strict";var s=a("5940"),i=a.n(s);i.a},df24:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.page?a("div",{staticClass:"container page-detail"},[a("div",{staticClass:"field product-edit-language hidden"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Edit Language")]),a("div",{staticClass:"control select"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.newLanguage,expression:"newLanguage"}],on:{change:[function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.newLanguage=t.target.multiple?a:a[0]},function(t){return e.changeEditedLang()}]}},e._l(e.$store.state.coredata.langs,(function(t,s){return a("option",{key:s+"langs",domProps:{value:t}},[e._v(" "+e._s(t.name)+" ")])})),0)])]),e.editing?a("div",{staticClass:"page-hidden-properties"},[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenProperties"},scopedSlots:e._u([{key:"trigger",fn:function(t){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties"}},[a("span",{attrs:{translate:"yes"}},[e._v("Page's hidden properties")]),e._v(" "),a("font-awesome-icon",{attrs:{icon:t.open?"angle-down":"angle-up"}})],1)}}],null,!1,4003255297)},[a("div",{staticClass:"editableByAuthor-hidden collapse-content",attrs:{id:"contentHiddenProperties","aria-expanded":"true"}},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[e.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Type")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.type,expression:"page.data.type"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Type"},domProps:{value:e.page.data.type},on:{input:function(t){t.target.composing||e.$set(e.page.data,"type",t.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Subtype")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.subtype,expression:"page.data.subtype"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Subtype"},domProps:{value:e.page.data.subtype},on:{input:function(t){t.target.composing||e.$set(e.page.data,"subtype",t.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("External Id")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.externalId,expression:"page.data.externalId"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"External Id"},domProps:{value:e.page.data.externalId},on:{input:function(t){t.target.composing||e.$set(e.page.data,"externalId",t.target.value)}}})])])])]):e._e()])]),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-12"},[e.editing?a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Slug")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.slug,expression:"page.data.slug"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Slug"},domProps:{value:e.page.data.slug},on:{input:function(t){t.target.composing||e.$set(e.page.data,"slug",t.target.value)}}})])])]),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Note")]),a("div",{staticClass:"control"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.page.data.note,expression:"page.data.note"}],staticClass:"textarea",attrs:{translate:"yes",placeholder:"Note"},domProps:{value:e.page.data.note},on:{input:function(t){t.target.composing||e.$set(e.page.data,"note",t.target.value)}}})])])]),a("div",{staticClass:"column is-3"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Activity")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.activity,expression:"page.data.activity"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Activity"},domProps:{value:e.page.data.activity},on:{input:function(t){t.target.composing||e.$set(e.page.data,"activity",t.target.value)}}})])])])]):e._e()])])])]),e.user&&null!=e.user&&e.user.type&&"admin"==e.user.type?a("div",[a("b-collapse",{attrs:{open:!1,"aria-id":"contentHiddenPropertiesAdmin"},scopedSlots:e._u([{key:"trigger",fn:function(t){return a("h3",{staticClass:"title is-3",attrs:{"aria-controls":"contentHiddenProperties",translate:"yes"}},[a("span",{attrs:{traslate:"yes"}},[e._v("Editable by admin user")]),e._v(" "),a("font-awesome-icon",{attrs:{icon:t.open?"angle-down":"angle-up"}})],1)}}],null,!1,476455311)},[a("div",{staticClass:"editableByAdmin-hidden"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-4 is-offset-4"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Publisher")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.publisher,expression:"page.data.publisher"}],staticClass:"input",attrs:{type:"text",translate:"yes",placeholder:"Publisher"},domProps:{value:e.page.data.publisher},on:{input:function(t){t.target.composing||e.$set(e.page.data,"publisher",t.target.value)}}})])])])])])])],1):e._e()],1):e._e(),a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-3"}),a("div",{staticClass:"column is-6"},[a("div",{staticClass:"columns"},[a("div",{staticClass:"column is-6"},[a("section",[a("b-field",{attrs:{label:"Enter categories' url slugs"}},[a("b-taginput",{attrs:{data:e.filteredCategoriesSlugs,autocomplete:"","allow-new":!1,field:"user.first_name",icon:"tags",placeholder:"Categories",type:"is-info"},on:{typing:e.getFilteredCategories},model:{value:e.page.data.categories,callback:function(t){e.$set(e.page.data,"categories",t)},expression:"page.data.categories"}})],1)],1),e.parentCategoryDetail?a("nav",{staticClass:"breadcrumb",attrs:{"aria-label":"breadcrumbs"}},[e.parentCategoryDetail.parentCategories?a("ul",[e._l(e.parentCategoryDetail.parentCategories,(function(t,s){return a("li",{key:s},[a("router-link",{attrs:{title:t.name[e.$store.state.language.code],to:{name:"categoryList",params:{category:t.pathSlug}}}},[e._v(" "+e._s(t.name[e.$store.state.language.code])+" ")])],1)})),a("li",{staticClass:"is-active"},[a("router-link",{attrs:{title:e.parentCategoryDetail.name[e.$store.state.language.code],to:{name:"categoryList",params:{category:e.parentCategoryDetail.pathSlug}},"aria-current":"page"}},[e._v(" "+e._s(e.parentCategoryDetail.name[e.$store.state.language.code])+" ")])],1)],2):e._e()]):e._e()]),a("div",{staticClass:"column is-6"},[a("section",[a("b-field",{attrs:{label:"Enter related pages' url slugs"}},[a("b-taginput",{attrs:{data:e.filteredPagesSlugs,autocomplete:"","allow-new":!1,icon:"tags",placeholder:"Pages",type:"is-info"},on:{typing:e.getFilteredPages},model:{value:e.page.data.pages,callback:function(t){e.$set(e.page.data,"pages",t)},expression:"page.data.pages"}})],1)],1)])]),e.page&&e.page.data&&null!=e.page.data?a("div",{staticClass:"data-main"},[a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Name")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.name[e.language.code],expression:"page.data.name[language.code]"}],staticClass:"input is-size-1 has-text-weight-semibold has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Name"},domProps:{value:e.page.data.name[e.language.code]},on:{keyup:function(t){return e.checkNameDependents()},input:function(t){t.target.composing||e.$set(e.page.data.name,e.language.code,t.target.value)}}})])]),a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Description Short")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.descriptionShort[e.language.code],expression:"page.data.descriptionShort[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Short"},domProps:{value:e.page.data.descriptionShort[e.language.code]},on:{input:function(t){t.target.composing||e.$set(e.page.data.descriptionShort,e.language.code,t.target.value)}}})])]),a("div",{staticClass:"field"},[a("label",{staticClass:"label",attrs:{translate:"yes"}},[e._v("Description Long")]),a("div",{staticClass:"control"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.page.data.descriptionLong[e.language.code],expression:"page.data.descriptionLong[language.code]"}],staticClass:"input is-size-5 has-text-weight-normal has-text-centered",attrs:{type:"text",translate:"yes",placeholder:"Description Long"},domProps:{value:e.page.data.descriptionLong[e.language.code]},on:{input:function(t){t.target.composing||e.$set(e.page.data.descriptionLong,e.language.code,t.target.value)}}})])])]):e._e(),a("div",{staticClass:"page-body",domProps:{innerHTML:e._s(e.page.body)}})])]),e.page&&null!=e.page?a("div",{staticClass:"columns page-delete"},[a("div",{staticClass:"column is-12"},[a("section",[a("button",{staticClass:"button is-danger",attrs:{translate:"yes"},on:{click:function(t){return e.deletePage()}}},[e._v("DELETE This Page")]),a("p",{attrs:{translate:"yes"}},[e._v("Warning: This action cannot be undone!")])])])]):e._e()]):e._e()},i=[],n=(a("a481"),a("456d"),a("ac6a"),a("3b2b"),a("7618")),l=(a("7f7f"),a("6b54"),a("77b6")),o=a.n(l),r=(a("2b31"),{name:"PageNewEdit",data:function(){return{page:null,parentCategoryDetail:null,language:{code:"en",longCode:"en-US",name:"English"},newLanguage:null,editor:null,editing:!1,userEditAllowed:!1,filteredCategoriesSlugs:[],filteredPagesSlugs:[],modal:null,fireCounter:0,dataToGenerateFromName:{slug:!0,externalId:!0}}},created:function(){this.language=this.$store.state.language},computed:{user:function(){return this.$store.getters.getUserProfile}},beforeRouteLeave:function(e,t,a){this.editor&&this.editor.destroy(),a()},watch:{user:function(e,t){console.log("new & old",e,t),e&&null!=e&&(this.getUserEditAllowed(),this.userEditAllowed&&this.getPageDetail())}},mounted:function(){this.getUserEditAllowed(),this.userEditAllowed&&this.getPageDetail()},methods:{getUserEditAllowed:function(){if(this.language=this.$store.state.language,this.user&&null!=this.user&&this.user.type&&"admin"==this.user.type)return this.userEditAllowed=!0,void this.user.settings.language;this.userEditAllowed=!1},getPageDetail:function(){var e=this;"undefined"==typeof this.$route.params.category&&(this.$route.params.category="-"),this.$route.params&&this.$route.params.slug&&""!=this.$route.params.slug.toString().trim()&&("---new"==this.$route.params.slug.toString().trim()?setTimeout((function(){e.page=e.getEmptyPage(),e.runEditor()}),1e3):this.$httpc.get("pages/"+this.$route.params.category+"/detail/"+this.$route.params.slug+"?lang="+e.$store.state.language.code).then((function(t){t.data&&(e.page=t.data,e.page&&e.page.data&&e.page.data.name&&e.$store.state&&void 0!==Object(n["a"])(e.page.data.name[e.$store.state.language.code])&&(document.title=e.page.data.name[e.$store.state.language.code]+" - StretchShop"),console.log("page detail",t.data)),e.page&&e.page.data&&e.page.data.parentCategoryDetail&&(e.parentCategoryDetail=e.page.data.parentCategoryDetail,delete e.page.data.parentCategoryDetail)})).catch((function(e){console.log(e)})).then((function(){e.runEditor()})))},runEditor:function(){var e=this;if(this.$route.query.lang){var t=this.$store.dispatch("checkLanguage",this.$route.query.lang);t.then((function(t){console.log("language check result:",t),e.language&&e.language.code&&t&&t.code&&e.language.code!=t.code&&(e.language=t)}))}setTimeout((function(){o.a.IMAGE_UPLOADER=e.editorCTimageUploader,e.editor=o.a.EditorApp.get(),console.log("get editor"),e.editor.init("*[data-editable]","data-name"),console.log("init editor"),e.editor.start(),console.log("start editor"),e.editor.ignition().state("editing"),console.log("editor ignition state editing"),e.editing=!0,e.newLanguage=e.language,e.editor.addEventListener("saved",(function(t){console.log("editor saved",t);var a=t.detail().regions;console.log("regions",a),e.editor.busy(!0),a&&"undefined"!==typeof a["content"]&&(console.log("self.page: ",e.page),console.log("self.page.data: ",e.page.data),console.log("self.page.data.data: ",e.page.data.data),e.page.data.data.blocks||(e.page.data.data.blocks=[]),0==e.page.data.data.blocks.length&&e.page.data.data.blocks.push({}),console.log("self.page.data.data.blocks: ",e.page.data.data.blocks),console.log("self.page.data.data.blocks[0]: ",e.page.data.data.blocks[0]),e.page.data.data.blocks[0]&&!e.page.data.data.blocks[0][e.language.code]&&(e.page.data.data.blocks[0][e.language.code]={}),e.page.data.data.blocks[0][e.language.code]=a["content"],console.log("page data.blocks[0]["+e.language.code+"]:",e.page.data.data.blocks[0][e.language.code])),e.savePage()}))}),1e3)},editorCTimageUploader:function(e){var t,a,s,i,n=this;console.log("xxx",e),e.addEventListener("imageuploader.cancelupload",(function(){a&&(a.upload.removeEventListener("progress",i),a.removeEventListener("readystatechange",s),a.abort()),e.state("empty")})),e.addEventListener("imageuploader.clear",(function(){e.clear(),t=null})),e.addEventListener("imageuploader.fileready",(function(l){var r,d=l.detail().file;i=function(t){e.progress(t.loaded/t.total*100)},s=function(l){var r;if(4==l.target.readyState)if(a=null,i=null,s=null,200==parseInt(l.target.status)){var d=l.target.responseText.length-2,g=l.target.responseText.substr(1,d);r=JSON.parse(g),console.log("upload response:",r);var c=new Image,u=n.$store.state.coredata.settings.assets.url+"/pages/editor/"+r.files[0].path;c.onload=function(){t={size:[c.width,c.height],url:u},e.populate(t.url,t.size)},c.src=u}else new o.a.FlashUI("no")},e.state("uploading"),e.progress(0),r=new FormData,r.append("image",d),a=new XMLHttpRequest,a.upload.addEventListener("progress",i),a.addEventListener("readystatechange",s),console.log("POST URL:",n.$httpc.defaults,n.$httpc.defaults.baseURL,n.$httpc.defaults.baseURL+"/pages/upload/"+n.page.data.slug),a.open("POST",n.$httpc.defaults.baseURL+"pages/upload/"+n.page.data.slug,!0),a.setRequestHeader("Authorization","Token "+n.$cookies.get("token")),a.setRequestHeader("Accept","application/json"),a.send(r)})),e.addEventListener("imageuploader.save",(function(){e.save(t.url,t.size,{alt:"test","data-ce-max-width":t.size[0]})}))},changeEditedLang:function(){this.fireCounter++,this.editing&&this.newLanguage&&this.newLanguage.code&&1==this.fireCounter&&(window.location=window.location.origin+this.$route.path+"?lang="+this.newLanguage.code)},savePage:function(){var e=this;if(this.page&&this.page.data&&this.page.data._id&&!this.page.data.id&&(this.page.data.id=this.page.data._id,delete this.page.data._id),this.page.data.blocks){var t=new RegExp(" data-editable ","g");Object.keys(this.page.data.blocks).forEach((function(e){if(this.page.data.blocks[e].indexOf(" data-editable ")){this.$route.params.id.toString().replace("---","@").replace(t,".");this.page.data.blocks[e]=this.page.data.blocks[e].replace(t)}}))}var a={pages:[]};a.pages.push(this.page.data),console.log("pagesToPut: ",a),this.$httpc.put("pages",a,{needsAuth:!0}).then((function(t){if(t.data&&t.data.length>0){var a=t.data[0],s=e.$router.resolve({name:"pageNewEdit",params:{slug:a.slug}});window.location=s.href}})).catch((function(t){console.log("savePage error:",t),e.editor.busy(!1)}))},deletePage:function(){var e=this,t={pages:[{id:e.page._id}]};this.page&&this.page._id&&confirm("Are you sure you want to delete this page?")&&this.$httpc.delete("pages",{data:t}).then((function(e){e&&e.data&&alert("Page has been successfully removed. You will be redirected now")}))},getFilteredCategories:function(e){var t=this;return e&&""!=e.toString().trim()?this.$httpc.post("categories/find",{query:{pathSlug:{$regex:e},type:"pages"}}).then((function(e){if(e.data)return e.data})).catch((function(e){console.log(e)})).then((function(e){var a=[];if(t.page.data.categories&&e&&e.categories&&e.categories.length>0)for(var s=0;s0)for(var s=0;s

Your content here

',data:{externalId:null,variationGroupId:null,slug:null,publisher:e.user.email,authors:null,type:"page",subtype:"default",name:e.$helpers.getLangsEmptyObject(e.$store.state.coredata.langCodes),descriptionShort:e.$helpers.getLangsEmptyObject(e.$store.state.coredata.langCodes),descriptionLong:e.$helpers.getLangsEmptyObject(e.$store.state.coredata.langCodes),properties:null,data:{blocks:[]},categories:[],pages:[],dates:{dateCreated:null,dateUpdated:null,dateSynced:null},note:null,activity:null}}},checkNameDependents:function(){if(this.page&&this.page.data&&!this.page.data._id){var e=this.language&&this.language.code?this.language.code:null;this.newLanguage&&this.newLanguage.code&&(e=this.newLanguage.code),this.page.data.name&&this.page.data.name[e]&&""!=this.page.data.name[e].trim()&&((this.page.data.slug&&""==this.page.data.slug.trim()||this.dataToGenerateFromName.slug)&&(this.page.data.slug=this.$helpers.stringToSlug(this.page.data.name[e]),this.dataToGenerateFromName.slug=!0),(this.page.data.externalId&&""==this.page.data.externalId.trim()||this.dataToGenerateFromName.externalId)&&(this.page.data.externalId=this.$helpers.stringToSlug(this.page.data.name[e]),this.dataToGenerateFromName.externalId=!0))}}}}),d=r,g=(a("6028"),a("2877")),c=Object(g["a"])(d,s,i,!1,null,"f57b8758",null);t["default"]=c.exports}}]); +//# sourceMappingURL=chunk-78619b25.cec71534.js.map \ No newline at end of file