@ozdao/prometheus-framework 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-579e2c7a.mjs +1945 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cab2bcd2.js +1 -0
  3. package/dist/ButtonFollow-23c4d9fc.mjs +132 -0
  4. package/dist/ButtonFollow-bf5e6d42.js +1 -0
  5. package/dist/CardOrganization-63dcc83b.js +1 -0
  6. package/dist/CardOrganization-e530c9d5.mjs +230 -0
  7. package/dist/Chips-3dac276c.js +1 -0
  8. package/dist/Feed-4d9001aa.mjs +368 -0
  9. package/dist/Feed-51eef23f.js +1 -0
  10. package/dist/Feed-d78d4b91.mjs +439 -0
  11. package/dist/Feed-f4e9769e.js +1 -0
  12. package/dist/Gallery-1f82841a.mjs +357 -0
  13. package/dist/Gallery-dd29c7f6.js +1 -0
  14. package/dist/Image-a2c2ab9c.js +9 -0
  15. package/dist/Image-ad6d4f0f.mjs +477 -0
  16. package/dist/Popup-383abb2e.js +1 -0
  17. package/dist/Popup-f7a5e86b.mjs +76 -0
  18. package/dist/Product-b32fb0e1.js +7 -0
  19. package/dist/Product-d01e3a0d.mjs +839 -0
  20. package/dist/ProductEdit-2b4d1d88.js +1 -0
  21. package/dist/ProductEdit-5e479343.mjs +300 -0
  22. package/dist/ProfileBlogposts-070cb7e9.mjs +65 -0
  23. package/dist/ProfileBlogposts-b6bf0c42.js +1 -0
  24. package/dist/ProfileComments-8a0c489c.mjs +44 -0
  25. package/dist/ProfileComments-f0000ea6.js +1 -0
  26. package/dist/ProfileEvents-8b88287a.js +1 -0
  27. package/dist/ProfileEvents-d978617d.mjs +57 -0
  28. package/dist/ProfileLikes-d5f9f058.js +1 -0
  29. package/dist/ProfileLikes-f5ad4497.mjs +44 -0
  30. package/dist/ProfileOrganizations-422d1fa5.js +1 -0
  31. package/dist/ProfileOrganizations-6b1bc5b2.mjs +213 -0
  32. package/dist/Publics-640d32fc.mjs +123 -0
  33. package/dist/Publics-8595ab7e.js +1 -0
  34. package/dist/Socials-43293869.js +1 -0
  35. package/dist/Tab-dcd62005.js +1 -0
  36. package/dist/UploadImage-dfb36cdb.js +1 -0
  37. package/dist/UploadImage-e4418b43.mjs +83 -0
  38. package/dist/UploadImageMultiple-c9a7b54f.js +1 -0
  39. package/dist/UploadImageMultiple-d2d48f39.mjs +58 -0
  40. package/dist/auth-45a454f2.js +7 -0
  41. package/dist/auth-5cd34aae.mjs +905 -0
  42. package/dist/auth.client.cjs +8 -8
  43. package/dist/auth.client.js +16 -15
  44. package/dist/auth.validation-4b016fa5.js +1 -0
  45. package/dist/auth.validation-a52304cf.mjs +20 -0
  46. package/dist/backoffice.client.cjs +1 -0
  47. package/dist/backoffice.client.js +69 -0
  48. package/dist/carousel.es-cdfb392c.js +5 -0
  49. package/dist/community.client.cjs +1 -1
  50. package/dist/community.client.js +23 -22
  51. package/dist/components/EditImages/EditImages.vue.d.ts +7 -0
  52. package/dist/components/FieldPhone/FieldPhone(script-setup).vue.d.ts +3 -3
  53. package/dist/components/FieldPhone/FieldPhone.vue.d.ts +1 -1
  54. package/dist/events.client.cjs +2 -2
  55. package/dist/events.client.js +17 -16
  56. package/dist/files.server.js +149 -112
  57. package/dist/files.server.mjs +149 -112
  58. package/dist/gallery.server.js +127 -0
  59. package/dist/gallery.server.mjs +128 -0
  60. package/dist/index-2059e444.js +2 -0
  61. package/dist/index-4e469a71.mjs +941 -0
  62. package/dist/landing.client.cjs +1 -1
  63. package/dist/modules/gallery/components/sections/Gallery.vue.d.ts +2 -0
  64. package/dist/modules/icons/navigation/IconChevronRight.vue.d.ts +13 -1
  65. package/dist/modules/mobile/components/Menu/MenuItem.vue.d.ts +14 -2
  66. package/dist/organizations-81e762e7.mjs +122 -0
  67. package/dist/organizations-cf1ab766.js +1 -0
  68. package/dist/organizations.client-b692a78a.mjs +3018 -0
  69. package/dist/organizations.client-bdc9b044.js +3 -0
  70. package/dist/organizations.client.cjs +1 -1
  71. package/dist/organizations.client.js +44 -43
  72. package/dist/style.css +1 -1
  73. package/dist/users.client.cjs +1 -1
  74. package/dist/users.client.js +224 -184
  75. package/dist/vue-draggable-next.esm-bundler-21a209c6.js +10 -0
  76. package/dist/vuex.esm-bundler-685cf29f.js +5 -0
  77. package/package.json +10 -1
  78. package/src/components/EditImages/EditImages.vue +55 -0
  79. package/src/configurator/components/layouts/layoutConfigurator.vue +0 -40
  80. package/src/modules/backoffice/backoffice.client.js +15 -0
  81. package/src/modules/backoffice/components/layouts/Account.vue +48 -58
  82. package/src/modules/backoffice/router/backoffice.js +20 -0
  83. package/src/modules/files/controllers/files.controller.js +27 -131
  84. package/src/modules/files/middlewares/server/index.js +10 -0
  85. package/src/modules/files/middlewares/server/md.js +151 -0
  86. package/src/modules/files/middlewares/server/middlewareMulter.js +121 -0
  87. package/src/modules/files/routes/files.routes.js +20 -6
  88. package/src/modules/gallery/components/sections/Gallery.vue +414 -0
  89. package/src/modules/gallery/controllers/gallery.controller.js +87 -73
  90. package/src/modules/gallery/gallery.client.js +17 -0
  91. package/src/modules/gallery/gallery.server.js +13 -0
  92. package/src/modules/gallery/models/photo.model.js +20 -14
  93. package/src/modules/gallery/routes/gallery.routes.js +18 -9
  94. package/src/modules/gallery/store/gallery.js +25 -19
  95. package/src/modules/icons/navigation/IconChevronRight.vue +14 -2
  96. package/src/modules/mobile/components/Menu/Menu.vue +1 -1
  97. package/src/modules/mobile/components/Menu/MenuItem.vue +8 -2
  98. package/src/modules/users/components/pages/Profile.vue +22 -1
  99. package/src/modules/backoffice/components/pages/Profile.vue +0 -109
  100. package/src/modules/backoffice/components/pages/profile/ProfileEdit.vue +0 -132
@@ -0,0 +1,10 @@
1
+ "use strict";const Oe=require("vue");/*!
2
+ * vue-draggable-next v2.1.0
3
+ * (c) 2021 Anish George
4
+ * @license MIT
5
+ *//**!
6
+ * Sortable 1.14.0
7
+ * @author RubaXa <trash@rubaxa.org>
8
+ * @author owenm <owen23355@gmail.com>
9
+ * @license MIT
10
+ */function ft(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ft(Object(n),!0).forEach(function(o){Rt(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Fe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fe=function(e){return typeof e}:Fe=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fe(t)}function Rt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U(){return U=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},U.apply(this,arguments)}function Yt(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,r;for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Bt(t,e){if(t==null)return{};var n=Yt(t,e),o,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var $t="1.14.0";function z(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var q=z(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ce=z(/Edge/i),ht=z(/firefox/i),Ee=z(/safari/i)&&!z(/chrome/i)&&!z(/android/i),Dt=z(/iP(ad|od|hone)/i),jt=z(/chrome/i)&&z(/android/i),St={capture:!1,passive:!1};function y(t,e,n){t.addEventListener(e,n,!q&&St)}function b(t,e,n){t.removeEventListener(e,n,!q&&St)}function Ye(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Ht(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function j(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Ye(t,e):Ye(t,e))||o&&t===n)return t;if(t===n)break}while(t=Ht(t))}return null}var pt=/\s+/g;function M(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(pt," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(pt," ")}}function h(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function ce(t,e){var n="";if(typeof t=="string")n=t;else do{var o=h(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Tt(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function H(){var t=document.scrollingElement;return t||document.documentElement}function C(t,e,n,o,i){if(!(!t.getBoundingClientRect&&t!==window)){var r,a,l,s,u,f,c;if(t!==window&&t.parentNode&&t!==H()?(r=t.getBoundingClientRect(),a=r.top,l=r.left,s=r.bottom,u=r.right,f=r.height,c=r.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,f=window.innerHeight,c=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!q))do if(i&&i.getBoundingClientRect&&(h(i,"transform")!=="none"||n&&h(i,"position")!=="static")){var m=i.getBoundingClientRect();a-=m.top+parseInt(h(i,"border-top-width")),l-=m.left+parseInt(h(i,"border-left-width")),s=a+r.height,u=l+r.width;break}while(i=i.parentNode);if(o&&t!==window){var E=ce(i||t),v=E&&E.a,w=E&&E.d;E&&(a/=w,l/=v,c/=v,f/=w,s=a+f,u=l+c)}return{top:a,left:l,bottom:s,right:u,width:c,height:f}}}function gt(t,e,n){for(var o=ee(t,!0),i=C(t)[e];o;){var r=C(o)[n],a=void 0;if(n==="top"||n==="left"?a=i>=r:a=i<=r,!a)return o;if(o===H())break;o=ee(o,!1)}return!1}function fe(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==p.ghost&&(o||a[r]!==p.dragged)&&j(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function st(t,e){for(var n=t.lastElementChild;n&&(n===p.ghost||h(n,"display")==="none"||e&&!Ye(n,e));)n=n.previousElementSibling;return n||null}function X(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==p.clone&&(!e||Ye(t,e))&&n++;return n}function mt(t){var e=0,n=0,o=H();if(t)do{var i=ce(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function Gt(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function ee(t,e){if(!t||!t.getBoundingClientRect)return H();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=h(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return H();if(o||e)return n;o=!0}}while(n=n.parentNode);return H()}function Wt(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function We(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var _e;function Ct(t,e){return function(){if(!_e){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),_e=setTimeout(function(){_e=void 0},e)}}}function Vt(){clearTimeout(_e),_e=void 0}function xt(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function It(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}var L="Sortable"+new Date().getTime();function zt(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(i){if(!(h(i,"display")==="none"||i===p.ghost)){t.push({target:i,rect:C(i)});var r=G({},t[t.length-1].rect);if(i.thisAnimationDuration){var a=ce(i,!0);a&&(r.top-=a.f,r.left-=a.e)}i.fromRect=r}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(Gt(t,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var r=!1,a=0;t.forEach(function(l){var s=0,u=l.target,f=u.fromRect,c=C(u),m=u.prevFromRect,E=u.prevToRect,v=l.rect,w=ce(u,!0);w&&(c.top-=w.f,c.left-=w.e),u.toRect=c,u.thisAnimationDuration&&We(m,c)&&!We(f,c)&&(v.top-c.top)/(v.left-c.left)===(f.top-c.top)/(f.left-c.left)&&(s=qt(v,m,E,i.options)),We(c,f)||(u.prevFromRect=f,u.prevToRect=c,s||(s=i.options.animation),i.animate(u,v,c,s)),s&&(r=!0,a=Math.max(a,s),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},s),u.thisAnimationDuration=s)}),clearTimeout(e),r?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,i,r,a){if(a){h(o,"transition",""),h(o,"transform","");var l=ce(this.el),s=l&&l.a,u=l&&l.d,f=(i.left-r.left)/(s||1),c=(i.top-r.top)/(u||1);o.animatingX=!!f,o.animatingY=!!c,h(o,"transform","translate3d("+f+"px,"+c+"px,0)"),this.forRepaintDummy=Ut(o),h(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),h(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){h(o,"transition",""),h(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function Ut(t){return t.offsetWidth}function qt(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var le=[],Ve={initializeByDefault:!0},xe={mount:function(e){for(var n in Ve)Ve.hasOwnProperty(n)&&!(n in e)&&(e[n]=Ve[n]);le.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),le.push(e)},pluginEvent:function(e,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=e+"Global";le.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][r]&&n[a.pluginName][r](G({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](G({sortable:n},o)))})},initializePlugins:function(e,n,o,i){le.forEach(function(l){var s=l.pluginName;if(!(!e.options[s]&&!l.initializeByDefault)){var u=new l(e,n,e.options);u.sortable=e,u.options=e.options,e[s]=u,U(o,u.defaults)}});for(var r in e.options)if(e.options.hasOwnProperty(r)){var a=this.modifyOption(e,r,e.options[r]);typeof a<"u"&&(e.options[r]=a)}},getEventProperties:function(e,n){var o={};return le.forEach(function(i){typeof i.eventProperties=="function"&&U(o,i.eventProperties.call(n[i.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return le.forEach(function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(i=r.optionListeners[n].call(e[r.pluginName],o))}),i}};function Kt(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,u=t.newIndex,f=t.oldDraggableIndex,c=t.newDraggableIndex,m=t.originalEvent,E=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[L],!!e){var w,k=e.options,W="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!q&&!Ce?w=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(o,!0,!0)),w.to=a||n,w.from=l||n,w.item=i||n,w.clone=r,w.oldIndex=s,w.newIndex=u,w.oldDraggableIndex=f,w.newDraggableIndex=c,w.originalEvent=m,w.pullMode=E?E.lastPutMode:void 0;var O=G(G({},v),xe.getEventProperties(o,e));for(var R in O)w[R]=O[R];n&&n.dispatchEvent(w),k[W]&&k[W].call(e,w)}}var Zt=["evt"],P=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=Bt(o,Zt);xe.pluginEvent.bind(p)(e,n,G({dragEl:d,parentEl:D,ghostEl:g,rootEl:_,nextEl:ae,lastDownEl:Le,cloneEl:S,cloneHidden:J,dragStarted:be,putSortable:x,activeSortable:p.active,originalEvent:i,oldIndex:de,oldDraggableIndex:De,newIndex:F,newDraggableIndex:Q,hideGhostForTarget:Nt,unhideGhostForTarget:Mt,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(l){A({sortable:n,name:l,originalEvent:i})}},r))};function A(t){Kt(G({putSortable:x,cloneEl:S,targetEl:d,rootEl:_,oldIndex:de,oldDraggableIndex:De,newIndex:F,newDraggableIndex:Q},t))}var d,D,g,_,ae,Le,S,J,de,F,De,Q,Ae,x,ue=!1,Be=!1,$e=[],ie,Y,ze,Ue,vt,bt,be,se,Se,Te=!1,Pe=!1,Xe,I,qe=[],nt=!1,je=[],Ge=typeof document<"u",Ne=Dt,yt=Ce||q?"cssFloat":"float",Qt=Ge&&!jt&&!Dt&&"draggable"in document.createElement("div"),Ot=function(){if(Ge){if(q)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),At=function(e,n){var o=h(e),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=fe(e,0,n),a=fe(e,1,n),l=r&&h(r),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(r).width,f=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+C(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var c=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===c)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=i&&o[yt]==="none"||a&&o[yt]==="none"&&u+f>i)?"vertical":"horizontal"},Jt=function(e,n,o){var i=o?e.left:e.top,r=o?e.right:e.bottom,a=o?e.width:e.height,l=o?n.left:n.top,s=o?n.right:n.bottom,u=o?n.width:n.height;return i===l||r===s||i+a/2===l+u/2},en=function(e,n){var o;return $e.some(function(i){var r=i[L].options.emptyInsertThreshold;if(!(!r||st(i))){var a=C(i),l=e>=a.left-r&&e<=a.right+r,s=n>=a.top-r&&n<=a.bottom+r;if(l&&s)return o=i}}),o},Pt=function(e){function n(r,a){return function(l,s,u,f){var c=l.options.group.name&&s.options.group.name&&l.options.group.name===s.options.group.name;if(r==null&&(a||c))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(l,s,u,f),a)(l,s,u,f);var m=(a?l:s).options.group.name;return r===!0||typeof r=="string"&&r===m||r.join&&r.indexOf(m)>-1}}var o={},i=e.group;(!i||Fe(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,e.group=o},Nt=function(){!Ot&&g&&h(g,"display","none")},Mt=function(){!Ot&&g&&h(g,"display","")};Ge&&document.addEventListener("click",function(t){if(Be)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Be=!1,!1},!0);var re=function(e){if(d){e=e.touches?e.touches[0]:e;var n=en(e.clientX,e.clientY);if(n){var o={};for(var i in e)e.hasOwnProperty(i)&&(o[i]=e[i]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[L]._onDragOver(o)}}},tn=function(e){d&&d.parentNode[L]._isOutsideThisEl(e.target)};function p(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=U({},e),t[L]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return At(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!Ee,emptyInsertThreshold:5};xe.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);Pt(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:Qt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?y(t,"pointerdown",this._onTapStart):(y(t,"mousedown",this._onTapStart),y(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(t,"dragover",this),y(t,"dragenter",this)),$e.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),U(this,zt())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(se=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,i=this.options,r=i.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(l||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,f=i.filter;if(dn(o),!d&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Ee&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=j(s,i.draggable,o,!1),!(s&&s.animated)&&Le!==s)){if(de=X(s),De=X(s,i.draggable),typeof f=="function"){if(f.call(this,e,s,this)){A({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:o,fromEl:o}),P("filter",n,{evt:e}),r&&e.cancelable&&e.preventDefault();return}}else if(f&&(f=f.split(",").some(function(c){if(c=j(u,c.trim(),o,!1),c)return A({sortable:n,rootEl:c,name:"filter",targetEl:s,fromEl:o,toEl:o}),P("filter",n,{evt:e}),!0}),f)){r&&e.cancelable&&e.preventDefault();return}i.handle&&!j(u,i.handle,o,!1)||this._prepareDragStart(e,l,s)}}},_prepareDragStart:function(e,n,o){var i=this,r=i.el,a=i.options,l=r.ownerDocument,s;if(o&&!d&&o.parentNode===r){var u=C(o);if(_=r,d=o,D=d.parentNode,ae=d.nextSibling,Le=o,Ae=a.group,p.dragged=d,ie={target:d,clientX:(n||e).clientX,clientY:(n||e).clientY},vt=ie.clientX-u.left,bt=ie.clientY-u.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,d.style["will-change"]="all",s=function(){if(P("delayEnded",i,{evt:e}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!ht&&i.nativeDraggable&&(d.draggable=!0),i._triggerDragStart(e,n),A({sortable:i,name:"choose",originalEvent:e}),M(d,a.chosenClass,!0)},a.ignore.split(",").forEach(function(f){Tt(d,f.trim(),Ke)}),y(l,"dragover",re),y(l,"mousemove",re),y(l,"touchmove",re),y(l,"mouseup",i._onDrop),y(l,"touchend",i._onDrop),y(l,"touchcancel",i._onDrop),ht&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),P("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Ce||q))){if(p.eventCanceled){this._onDrop();return}y(l,"mouseup",i._disableDelayedDrag),y(l,"touchend",i._disableDelayedDrag),y(l,"touchcancel",i._disableDelayedDrag),y(l,"mousemove",i._delayedDragTouchMoveHandler),y(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&y(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&Ke(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):n?y(document,"touchmove",this._onTouchMove):y(document,"mousemove",this._onTouchMove):(y(d,"dragend",this),y(_,"dragstart",this._onDragStart));try{document.selection?ke(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(ue=!1,_&&d){P("dragStarted",this,{evt:n}),this.nativeDraggable&&y(document,"dragover",tn);var o=this.options;!e&&M(d,o.dragClass,!1),M(d,o.ghostClass,!0),p.active=this,e&&this._appendGhost(),A({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Y){this._lastX=Y.clientX,this._lastY=Y.clientY,Nt();for(var e=document.elementFromPoint(Y.clientX,Y.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Y.clientX,Y.clientY),e!==n);)n=e;if(d.parentNode[L]._isOutsideThisEl(e),n)do{if(n[L]){var o=void 0;if(o=n[L]._onDragOver({clientX:Y.clientX,clientY:Y.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=n.parentNode);Mt()}},_onTouchMove:function(e){if(ie){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=g&&ce(g,!0),l=g&&a&&a.a,s=g&&a&&a.d,u=Ne&&I&&mt(I),f=(r.clientX-ie.clientX+i.x)/(l||1)+(u?u[0]-qe[0]:0)/(l||1),c=(r.clientY-ie.clientY+i.y)/(s||1)+(u?u[1]-qe[1]:0)/(s||1);if(!p.active&&!ue){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(g){a?(a.e+=f-(ze||0),a.f+=c-(Ue||0)):a={a:1,b:0,c:0,d:1,e:f,f:c};var m="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(g,"webkitTransform",m),h(g,"mozTransform",m),h(g,"msTransform",m),h(g,"transform",m),ze=f,Ue=c,Y=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!g){var e=this.options.fallbackOnBody?document.body:_,n=C(d,!0,Ne,!0,e),o=this.options;if(Ne){for(I=e;h(I,"position")==="static"&&h(I,"transform")==="none"&&I!==document;)I=I.parentNode;I!==document.body&&I!==document.documentElement?(I===document&&(I=H()),n.top+=I.scrollTop,n.left+=I.scrollLeft):I=H(),qe=mt(I)}g=d.cloneNode(!0),M(g,o.ghostClass,!1),M(g,o.fallbackClass,!0),M(g,o.dragClass,!0),h(g,"transition",""),h(g,"transform",""),h(g,"box-sizing","border-box"),h(g,"margin",0),h(g,"top",n.top),h(g,"left",n.left),h(g,"width",n.width),h(g,"height",n.height),h(g,"opacity","0.8"),h(g,"position",Ne?"absolute":"fixed"),h(g,"zIndex","100000"),h(g,"pointerEvents","none"),p.ghost=g,e.appendChild(g),h(g,"transform-origin",vt/parseInt(g.style.width)*100+"% "+bt/parseInt(g.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,i=e.dataTransfer,r=o.options;if(P("dragStart",this,{evt:e}),p.eventCanceled){this._onDrop();return}P("setupClone",this),p.eventCanceled||(S=It(d),S.draggable=!1,S.style["will-change"]="",this._hideClone(),M(S,this.options.chosenClass,!1),p.clone=S),o.cloneId=ke(function(){P("clone",o),!p.eventCanceled&&(o.options.removeCloneOnHide||_.insertBefore(S,d),o._hideClone(),A({sortable:o,name:"clone"}))}),!n&&M(d,r.dragClass,!0),n?(Be=!0,o._loopId=setInterval(o._emulateDragOver,50)):(b(document,"mouseup",o._onDrop),b(document,"touchend",o._onDrop),b(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(o,i,d)),y(document,"drop",o),h(d,"transform","translateZ(0)")),ue=!0,o._dragStartId=ke(o._dragStarted.bind(o,n,e)),y(document,"selectstart",o),be=!0,Ee&&h(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,i,r,a,l=this.options,s=l.group,u=p.active,f=Ae===s,c=l.sort,m=x||u,E,v=this,w=!1;if(nt)return;function k(ve,Xt){P(ve,v,G({evt:e,isOwner:f,axis:E?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:c,fromSortable:m,target:o,completed:O,onMove:function(ct,kt){return Me(_,n,d,i,ct,C(ct),e,kt)},changed:R},Xt))}function W(){k("dragOverAnimationCapture"),v.captureAnimationState(),v!==m&&m.captureAnimationState()}function O(ve){return k("dragOverCompleted",{insertion:ve}),ve&&(f?u._hideClone():u._showClone(v),v!==m&&(M(d,x?x.options.ghostClass:u.options.ghostClass,!1),M(d,l.ghostClass,!0)),x!==v&&v!==p.active?x=v:v===p.active&&x&&(x=null),m===v&&(v._ignoreWhileAnimating=o),v.animateAll(function(){k("dragOverAnimationComplete"),v._ignoreWhileAnimating=null}),v!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(o===d&&!d.animated||o===n&&!o.animated)&&(se=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(d.parentNode[L]._isOutsideThisEl(e.target),!ve&&re(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),w=!0}function R(){F=X(d),Q=X(d,l.draggable),A({sortable:v,name:"change",toEl:n,newIndex:F,newDraggableIndex:Q,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=j(o,l.draggable,n,!0),k("dragOver"),p.eventCanceled)return w;if(d.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||v._ignoreWhileAnimating===o)return O(!1);if(Be=!1,u&&!l.disabled&&(f?c||(a=D!==_):x===this||(this.lastPutMode=Ae.checkPull(this,u,d,e))&&s.checkPut(this,u,d,e))){if(E=this._getDirection(e,o)==="vertical",i=C(d),k("dragOverValid"),p.eventCanceled)return w;if(a)return D=_,W(),this._hideClone(),k("revert"),p.eventCanceled||(ae?_.insertBefore(d,ae):_.appendChild(d)),O(!0);var B=st(n,l.draggable);if(!B||an(e,E,this)&&!B.animated){if(B===d)return O(!1);if(B&&n===e.target&&(o=B),o&&(r=C(o)),Me(_,n,d,i,o,r,e,!!o)!==!1)return W(),n.appendChild(d),D=n,R(),O(!0)}else if(B&&rn(e,E,this)){var te=fe(n,0,l,!0);if(te===d)return O(!1);if(o=te,r=C(o),Me(_,n,d,i,o,r,e,!1)!==!1)return W(),n.insertBefore(d,te),D=n,R(),O(!0)}else if(o.parentNode===n){r=C(o);var $=0,ne,he=d.parentNode!==n,N=!Jt(d.animated&&d.toRect||i,o.animated&&o.toRect||r,E),pe=E?"top":"left",K=gt(o,"top","top")||gt(d,"top","top"),ge=K?K.scrollTop:void 0;se!==o&&(ne=r[pe],Te=!1,Pe=!N&&l.invertSwap||he),$=ln(e,o,r,E,N?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Pe,se===o);var V;if($!==0){var oe=X(d);do oe-=$,V=D.children[oe];while(V&&(h(V,"display")==="none"||V===g))}if($===0||V===o)return O(!1);se=o,Se=$;var me=o.nextElementSibling,Z=!1;Z=$===1;var Ie=Me(_,n,d,i,o,r,e,Z);if(Ie!==!1)return(Ie===1||Ie===-1)&&(Z=Ie===1),nt=!0,setTimeout(on,30),W(),Z&&!me?n.appendChild(d):o.parentNode.insertBefore(d,Z?me:o),K&&xt(K,0,ge-K.scrollTop),D=d.parentNode,ne!==void 0&&!Pe&&(Xe=Math.abs(ne-C(o)[pe])),R(),O(!0)}if(n.contains(d))return O(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){b(document,"mousemove",this._onTouchMove),b(document,"touchmove",this._onTouchMove),b(document,"pointermove",this._onTouchMove),b(document,"dragover",re),b(document,"mousemove",re),b(document,"touchmove",re)},_offUpEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._onDrop),b(e,"touchend",this._onDrop),b(e,"pointerup",this._onDrop),b(e,"touchcancel",this._onDrop),b(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(F=X(d),Q=X(d,o.draggable),P("drop",this,{evt:e}),D=d&&d.parentNode,F=X(d),Q=X(d,o.draggable),p.eventCanceled){this._nulling();return}ue=!1,Pe=!1,Te=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ot(this.cloneId),ot(this._dragStartId),this.nativeDraggable&&(b(document,"drop",this),b(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ee&&h(document.body,"user-select",""),h(d,"transform",""),e&&(be&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),g&&g.parentNode&&g.parentNode.removeChild(g),(_===D||x&&x.lastPutMode!=="clone")&&S&&S.parentNode&&S.parentNode.removeChild(S),d&&(this.nativeDraggable&&b(d,"dragend",this),Ke(d),d.style["will-change"]="",be&&!ue&&M(d,x?x.options.ghostClass:this.options.ghostClass,!1),M(d,this.options.chosenClass,!1),A({sortable:this,name:"unchoose",toEl:D,newIndex:null,newDraggableIndex:null,originalEvent:e}),_!==D?(F>=0&&(A({rootEl:D,name:"add",toEl:D,fromEl:_,originalEvent:e}),A({sortable:this,name:"remove",toEl:D,originalEvent:e}),A({rootEl:D,name:"sort",toEl:D,fromEl:_,originalEvent:e}),A({sortable:this,name:"sort",toEl:D,originalEvent:e})),x&&x.save()):F!==de&&F>=0&&(A({sortable:this,name:"update",toEl:D,originalEvent:e}),A({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((F==null||F===-1)&&(F=de,Q=De),A({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){P("nulling",this),_=d=D=g=ae=S=Le=J=ie=Y=be=F=Q=de=De=se=Se=x=Ae=p.dragged=p.ghost=p.clone=p.active=null,je.forEach(function(e){e.checked=!0}),je.length=ze=Ue=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),nn(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n=o[i],j(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||un(n));return e},sort:function(e,n){var o={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];j(l,this.options.draggable,i,!1)&&(o[r]=l)},this),n&&this.captureAnimationState(),e.forEach(function(r){o[r]&&(i.removeChild(o[r]),i.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return j(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var i=xe.modifyOption(this,e,n);typeof i<"u"?o[e]=i:o[e]=n,e==="group"&&Pt(o)},destroy:function(){P("destroy",this);var e=this.el;e[L]=null,b(e,"mousedown",this._onTapStart),b(e,"touchstart",this._onTapStart),b(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(b(e,"dragover",this),b(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),$e.splice($e.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!J){if(P("hideClone",this),p.eventCanceled)return;h(S,"display","none"),this.options.removeCloneOnHide&&S.parentNode&&S.parentNode.removeChild(S),J=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(J){if(P("showClone",this),p.eventCanceled)return;d.parentNode==_&&!this.options.group.revertClone?_.insertBefore(S,d):ae?_.insertBefore(S,ae):_.appendChild(S),this.options.group.revertClone&&this.animate(d,S),h(S,"display",""),J=!1}}};function nn(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Me(t,e,n,o,i,r,a,l){var s,u=t[L],f=u.options.onMove,c;return window.CustomEvent&&!q&&!Ce?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||C(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),f&&(c=f.call(u,s,a)),c}function Ke(t){t.draggable=!1}function on(){nt=!1}function rn(t,e,n){var o=C(fe(n.el,0,n.options,!0)),i=10;return e?t.clientX<o.left-i||t.clientY<o.top&&t.clientX<o.right:t.clientY<o.top-i||t.clientY<o.bottom&&t.clientX<o.left}function an(t,e,n){var o=C(st(n.el,n.options.draggable)),i=10;return e?t.clientX>o.right+i||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+i}function ln(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,u=o?n.height:n.width,f=o?n.top:n.left,c=o?n.bottom:n.right,m=!1;if(!a){if(l&&Xe<u*i){if(!Te&&(Se===1?s>f+u*r/2:s<c-u*r/2)&&(Te=!0),Te)m=!0;else if(Se===1?s<f+Xe:s>c-Xe)return-Se}else if(s>f+u*(1-i)/2&&s<c-u*(1-i)/2)return sn(e)}return m=m||a,m&&(s<f+u*r/2||s>c-u*r/2)?s>f+u/2?1:-1:0}function sn(t){return X(d)<X(t)?1:-1}function un(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function dn(t){je.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&je.push(o)}}function ke(t){return setTimeout(t,0)}function ot(t){return clearTimeout(t)}Ge&&y(document,"touchmove",function(t){(p.active||ue)&&t.cancelable&&t.preventDefault()});p.utils={on:y,off:b,css:h,find:Tt,is:function(e,n){return!!j(e,n,e,!1)},extend:Wt,throttle:Ct,closest:j,toggleClass:M,clone:It,index:X,nextTick:ke,cancelNextTick:ot,detectDirection:At,getChild:fe};p.get=function(t){return t[L]};p.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(p.utils=G(G({},p.utils),o.utils)),xe.mount(o)})};p.create=function(t,e){return new p(t,e)};p.version=$t;var T=[],ye,it,rt=!1,Ze,Qe,He,we;function cn(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?y(document,"pointermove",this._handleFallbackAutoScroll):o.touches?y(document,"touchmove",this._handleFallbackAutoScroll):y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?b(document,"dragover",this._handleAutoScroll):(b(document,"pointermove",this._handleFallbackAutoScroll),b(document,"touchmove",this._handleFallbackAutoScroll),b(document,"mousemove",this._handleFallbackAutoScroll)),wt(),Re(),Vt()},nulling:function(){He=it=ye=rt=we=Ze=Qe=null,T.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var i=this,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(r,a);if(He=n,o||this.options.forceAutoScrollFallback||Ce||q||Ee){Je(n,this.options,l,o);var s=ee(l,!0);rt&&(!we||r!==Ze||a!==Qe)&&(we&&wt(),we=setInterval(function(){var u=ee(document.elementFromPoint(r,a),!0);u!==s&&(s=u,Re()),Je(n,i.options,u,o)},10),Ze=r,Qe=a)}else{if(!this.options.bubbleScroll||ee(l,!0)===H()){Re();return}Je(n,this.options,ee(l,!1),!1)}}},U(t,{pluginName:"scroll",initializeByDefault:!0})}function Re(){T.forEach(function(t){clearInterval(t.pid)}),T=[]}function wt(){clearInterval(we)}var Je=Ct(function(t,e,n,o){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,s=H(),u=!1,f;it!==n&&(it=n,Re(),ye=e.scroll,f=e.scrollFn,ye===!0&&(ye=ee(n,!0)));var c=0,m=ye;do{var E=m,v=C(E),w=v.top,k=v.bottom,W=v.left,O=v.right,R=v.width,B=v.height,te=void 0,$=void 0,ne=E.scrollWidth,he=E.scrollHeight,N=h(E),pe=E.scrollLeft,K=E.scrollTop;E===s?(te=R<ne&&(N.overflowX==="auto"||N.overflowX==="scroll"||N.overflowX==="visible"),$=B<he&&(N.overflowY==="auto"||N.overflowY==="scroll"||N.overflowY==="visible")):(te=R<ne&&(N.overflowX==="auto"||N.overflowX==="scroll"),$=B<he&&(N.overflowY==="auto"||N.overflowY==="scroll"));var ge=te&&(Math.abs(O-i)<=a&&pe+R<ne)-(Math.abs(W-i)<=a&&!!pe),V=$&&(Math.abs(k-r)<=a&&K+B<he)-(Math.abs(w-r)<=a&&!!K);if(!T[c])for(var oe=0;oe<=c;oe++)T[oe]||(T[oe]={});(T[c].vx!=ge||T[c].vy!=V||T[c].el!==E)&&(T[c].el=E,T[c].vx=ge,T[c].vy=V,clearInterval(T[c].pid),(ge!=0||V!=0)&&(u=!0,T[c].pid=setInterval((function(){o&&this.layer===0&&p.active._onTouchMove(He);var me=T[this.layer].vy?T[this.layer].vy*l:0,Z=T[this.layer].vx?T[this.layer].vx*l:0;typeof f=="function"&&f.call(p.dragged.parentNode[L],Z,me,t,He,T[this.layer].el)!=="continue"||xt(T[this.layer].el,Z,me)}).bind({layer:c}),24))),c++}while(e.bubbleScroll&&m!==s&&(m=ee(m,!1)));rt=u}},30),Ft=function(e){var n=e.originalEvent,o=e.putSortable,i=e.dragEl,r=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(n){var u=o||r;l();var f=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,c=document.elementFromPoint(f.clientX,f.clientY);s(),u&&!u.el.contains(c)&&(a("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function ut(){}ut.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=fe(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:Ft};U(ut,{pluginName:"revertOnSpill"});function dt(){}dt.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable,i=o||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop:Ft};U(dt,{pluginName:"removeOnSpill"});p.mount(new cn);p.mount(dt,ut);function fn(){return typeof window<"u"?window.console:global.console}const hn=fn();function pn(t){const e=Object.create(null);return function(o){return e[o]||(e[o]=t(o))}}const gn=/-(\w)/g,Et=pn(t=>t.replace(gn,(e,n)=>n?n.toUpperCase():""));function et(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function _t(t,e,n){const o=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}function mn(t,e){return Object.values(t).indexOf(e)}function vn(t,e,n,o){if(!t)return[];const i=Object.values(t),r=e.length-o;return[...e].map((l,s)=>s>=r?i.length:i.indexOf(l))}function Lt(t,e){this.$nextTick(()=>this.$emit(t.toLowerCase(),e))}function bn(t){return e=>{this.realList!==null&&this["onDrag"+t](e),Lt.call(this,t,e)}}function yn(t){return["transition-group","TransitionGroup"].includes(t)}function wn(t){if(!t||t.length!==1)return!1;const[{type:e}]=t;return e?yn(e.name):!1}function En(t,e){return e?{...e.props,...e.attrs}:t}const at=["Start","Add","Remove","Update","End"],lt=["Choose","Unchoose","Sort","Filter","Clone"],_n=["Move",...at,...lt].map(t=>"on"+t);let tt=null;const Dn={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},Sn=Oe.defineComponent({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...at.map(t=>t.toLowerCase()),...lt.map(t=>t.toLowerCase())],props:Dn,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const t=this.$slots.default?this.$slots.default():null,e=En(this.$attrs,this.componentData);return t?(this.transitionMode=wn(t),Oe.h(this.getTag(),e,t)):Oe.h(this.getTag(),e,[])},created(){this.list!==null&&this.modelValue!==null&&hn.error("list props are mutually exclusive! Please set one.")},mounted(){const t={};at.forEach(i=>{t["on"+i]=bn.call(this,i)}),lt.forEach(i=>{t["on"+i]=Lt.bind(this,i)});const e=Object.keys(this.$attrs).reduce((i,r)=>(i[Et(r)]=this.$attrs[r],i),{}),n=Object.assign({},e,t,{onMove:(i,r)=>this.onDragMove(i,r)});!("draggable"in n)&&(n.draggable=">*");const o=this.$el.nodeType===1?this.$el:this.$el.parentElement;this._sortable=new p(o,n),o.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{this._sortable!==void 0&&this._sortable.destroy()}catch{}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?Oe.resolveComponent(this.component):this.tag},updateOptions(t){for(var e in t){const n=Et(e);_n.indexOf(n)===-1&&this._sortable.option(n,t[e])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=vn(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(t){const e=mn(this.getChildrenNodes()||[],t);if(e===-1)return null;const n=this.realList[e];return{index:e,element:n}},emitChanges(t){this.$nextTick(()=>{this.$emit("change",t)})},alterList(t){if(this.list){t(this.list);return}const e=[...this.modelValue];t(e),this.$emit("update:modelValue",e)},spliceList(){const t=e=>e.splice(...arguments);this.alterList(t)},updatePosition(t,e){const n=o=>o.splice(e,0,o.splice(t,1)[0]);this.alterList(n)},getVmIndex(t){const e=this.visibleIndexes,n=e.length;return t>n-1?n:e[t]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[t].data=null;const n=this.getComponent();n.children=[],n.kept=void 0},onDragStart(t){this.context=this.getUnderlyingVm(t.item),this.context&&(t.item._underlying_vm_=this.clone(this.context.element),tt=t.item)},onDragAdd(t){const e=t.item._underlying_vm_;if(e===void 0)return;et(t.item);const n=this.getVmIndex(t.newIndex);this.spliceList(n,0,e),this.computeIndexes();const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(_t(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){et(t.clone);return}if(!this.context)return;const e=this.context.index;this.spliceList(e,1);const n={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:n})},onDragUpdate(t){et(t.item),_t(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},onDragMove(t,e){const n=this.move;if(!n||!this.realList)return!0;const o=this.getRelatedContextFromMoveEvent(t),i=this.context,r=this.computeFutureIndex(o,t);Object.assign(i,{futureIndex:r});const a=Object.assign({},t,{relatedContext:o,draggedContext:i});return n(a,e)},onDragEnd(){this.computeIndexes(),tt=null},getTrargetedComponent(t){return t.__draggable_component__},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getTrargetedComponent(t);if(!n)return{component:n};const o=n.realList,i={list:o,component:n};if(t!==e&&o&&n.getUnderlyingVm){const r=n.getUnderlyingVm(e);if(r)return Object.assign(r,i)}return i},computeFutureIndex(t,e){const n=[...e.to.children].filter(a=>a.style.display!=="none");if(n.length===0)return 0;const o=n.indexOf(e.related),i=t.component.getVmIndex(o);return n.indexOf(tt)!==-1||!e.willInsertAfter?i:i+1}}});exports.VueDraggableNext=Sn;
@@ -0,0 +1,5 @@
1
+ "use strict";const E=require("vue");function q(){return L().__VUE_DEVTOOLS_GLOBAL_HOOK__}function L(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const J=typeof Proxy=="function",W="devtools-plugin:setup",Y="plugin:settings:set";let b,S;function X(){var e;return b!==void 0||(typeof window<"u"&&window.performance?(b=!0,S=window.performance):typeof global<"u"&&(!((e=global.perf_hooks)===null||e===void 0)&&e.performance)?(b=!0,S=global.perf_hooks.performance):b=!1),b}function z(){return X()?S.now():Date.now()}class Z{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const r={};if(t.settings)for(const i in t.settings){const c=t.settings[i];r[i]=c.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let s=Object.assign({},r);try{const i=localStorage.getItem(o),c=JSON.parse(i);Object.assign(s,c)}catch{}this.fallbacks={getSettings(){return s},setSettings(i){try{localStorage.setItem(o,JSON.stringify(i))}catch{}s=i},now(){return z()}},n&&n.on(Y,(i,c)=>{i===this.plugin.id&&this.fallbacks.setSettings(c)}),this.proxiedOn=new Proxy({},{get:(i,c)=>this.target?this.target.on[c]:(...a)=>{this.onQueue.push({method:c,args:a})}}),this.proxiedTarget=new Proxy({},{get:(i,c)=>this.target?this.target[c]:c==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(c)?(...a)=>(this.targetQueue.push({method:c,args:a,resolve:()=>{}}),this.fallbacks[c](...a)):(...a)=>new Promise(l=>{this.targetQueue.push({method:c,args:a,resolve:l})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function tt(e,t){const n=e,r=L(),o=q(),s=J&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(W,e,t);else{const i=s?new Z(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}/*!
2
+ * vuex v4.1.0
3
+ * (c) 2022 Evan You
4
+ * @license MIT
5
+ */var G="store";function et(e){return e===void 0&&(e=null),E.inject(e!==null?e:G)}function g(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}function rt(e){return e!==null&&typeof e=="object"}function nt(e){return e&&typeof e.then=="function"}function v(e,t){if(!e)throw new Error("[vuex] "+t)}function ot(e,t){return function(){return e(t)}}function P(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function M(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;w(e,n,[],e._modules.root,!0),C(e,n,t)}function C(e,t,n){var r=e._state,o=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var s=e._wrappedGetters,i={},c={},a=E.effectScope(!0);a.run(function(){g(s,function(l,u){i[u]=ot(l,e),c[u]=E.computed(function(){return i[u]()}),Object.defineProperty(e.getters,u,{get:function(){return c[u].value},enumerable:!0})})}),e._state=E.reactive({data:t}),e._scope=a,e.strict&&ut(e),r&&n&&e._withCommit(function(){r.data=null}),o&&o.stop()}function w(e,t,n,r,o){var s=!n.length,i=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[i]&&process.env.NODE_ENV!=="production"&&console.error("[vuex] duplicate namespace "+i+" for the namespaced module "+n.join("/")),e._modulesNamespaceMap[i]=r),!s&&!o){var c=D(t,n.slice(0,-1)),a=n[n.length-1];e._withCommit(function(){process.env.NODE_ENV!=="production"&&a in c&&console.warn('[vuex] state field "'+a+'" was overridden by a module with the same name at "'+n.join(".")+'"'),c[a]=r.state})}var l=r.context=it(e,i,n);r.forEachMutation(function(u,f){var p=i+f;st(e,p,u,l)}),r.forEachAction(function(u,f){var p=u.root?f:i+f,d=u.handler||u;ct(e,p,d,l)}),r.forEachGetter(function(u,f){var p=i+f;at(e,p,u,l)}),r.forEachChild(function(u,f){w(e,t,n.concat(f),u,o)})}function it(e,t,n){var r=t==="",o={dispatch:r?e.dispatch:function(s,i,c){var a=O(s,i,c),l=a.payload,u=a.options,f=a.type;if((!u||!u.root)&&(f=t+f,process.env.NODE_ENV!=="production"&&!e._actions[f])){console.error("[vuex] unknown local action type: "+a.type+", global type: "+f);return}return e.dispatch(f,l)},commit:r?e.commit:function(s,i,c){var a=O(s,i,c),l=a.payload,u=a.options,f=a.type;if((!u||!u.root)&&(f=t+f,process.env.NODE_ENV!=="production"&&!e._mutations[f])){console.error("[vuex] unknown local mutation type: "+a.type+", global type: "+f);return}e.commit(f,l,u)}};return Object.defineProperties(o,{getters:{get:r?function(){return e.getters}:function(){return $(e,t)}},state:{get:function(){return D(e.state,n)}}}),o}function $(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach(function(o){if(o.slice(0,r)===t){var s=o.slice(r);Object.defineProperty(n,s,{get:function(){return e.getters[o]},enumerable:!0})}}),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function st(e,t,n,r){var o=e._mutations[t]||(e._mutations[t]=[]);o.push(function(i){n.call(e,r.state,i)})}function ct(e,t,n,r){var o=e._actions[t]||(e._actions[t]=[]);o.push(function(i){var c=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},i);return nt(c)||(c=Promise.resolve(c)),e._devtoolHook?c.catch(function(a){throw e._devtoolHook.emit("vuex:error",a),a}):c})}function at(e,t,n,r){if(e._wrappedGetters[t]){process.env.NODE_ENV!=="production"&&console.error("[vuex] duplicate getter key: "+t);return}e._wrappedGetters[t]=function(s){return n(r.state,r.getters,s.state,s.getters)}}function ut(e){E.watch(function(){return e._state.data},function(){process.env.NODE_ENV!=="production"&&v(e._committing,"do not mutate vuex store state outside mutation handlers.")},{deep:!0,flush:"sync"})}function D(e,t){return t.reduce(function(n,r){return n[r]},e)}function O(e,t,n){return rt(e)&&e.type&&(n=t,t=e,e=e.type),process.env.NODE_ENV!=="production"&&v(typeof e=="string","expects string as the type, but found "+typeof e+"."),{type:e,payload:t,options:n}}var ft="vuex bindings",I="vuex:mutations",N="vuex:actions",y="vuex",lt=0;function dt(e,t){tt({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[ft]},function(n){n.addTimelineLayer({id:I,label:"Vuex Mutations",color:A}),n.addTimelineLayer({id:N,label:"Vuex Actions",color:A}),n.addInspector({id:y,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(r){if(r.app===e&&r.inspectorId===y)if(r.filter){var o=[];H(o,t._modules.root,r.filter,""),r.rootNodes=o}else r.rootNodes=[k(t._modules.root,"")]}),n.on.getInspectorState(function(r){if(r.app===e&&r.inspectorId===y){var o=r.nodeId;$(t,o),r.state=vt(gt(t._modules,o),o==="root"?t.getters:t._makeLocalGettersCache,o)}}),n.on.editInspectorState(function(r){if(r.app===e&&r.inspectorId===y){var o=r.nodeId,s=r.path;o!=="root"&&(s=o.split("/").filter(Boolean).concat(s)),t._withCommit(function(){r.set(t._state.data,s,r.state.value)})}}),t.subscribe(function(r,o){var s={};r.payload&&(s.payload=r.payload),s.state=o,n.notifyComponentUpdate(),n.sendInspectorTree(y),n.sendInspectorState(y),n.addTimelineEvent({layerId:I,event:{time:Date.now(),title:r.type,data:s}})}),t.subscribeAction({before:function(r,o){var s={};r.payload&&(s.payload=r.payload),r._id=lt++,r._time=Date.now(),s.state=o,n.addTimelineEvent({layerId:N,event:{time:r._time,title:r.type,groupId:r._id,subtitle:"start",data:s}})},after:function(r,o){var s={},i=Date.now()-r._time;s.duration={_custom:{type:"duration",display:i+"ms",tooltip:"Action duration",value:i}},r.payload&&(s.payload=r.payload),s.state=o,n.addTimelineEvent({layerId:N,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:s}})}})})}var A=8702998,pt=6710886,ht=16777215,R={label:"namespaced",textColor:ht,backgroundColor:pt};function U(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function k(e,t){return{id:t||"root",label:U(t),tags:e.namespaced?[R]:[],children:Object.keys(e._children).map(function(n){return k(e._children[n],t+n+"/")})}}function H(e,t,n,r){r.includes(n)&&e.push({id:r||"root",label:r.endsWith("/")?r.slice(0,r.length-1):r||"Root",tags:t.namespaced?[R]:[]}),Object.keys(t._children).forEach(function(o){H(e,t._children[o],n,r+o+"/")})}function vt(e,t,n){t=n==="root"?t:t[n];var r=Object.keys(t),o={state:Object.keys(e.state).map(function(i){return{key:i,editable:!0,value:e.state[i]}})};if(r.length){var s=_t(t);o.getters=Object.keys(s).map(function(i){return{key:i.endsWith("/")?U(i):i,editable:!1,value:x(function(){return s[i]})}})}return o}function _t(e){var t={};return Object.keys(e).forEach(function(n){var r=n.split("/");if(r.length>1){var o=t,s=r.pop();r.forEach(function(i){o[i]||(o[i]={_custom:{value:{},display:i,tooltip:"Module",abstract:!0}}),o=o[i]._custom.value}),o[s]=x(function(){return e[n]})}else t[n]=x(function(){return e[n]})}),t}function gt(e,t){var n=t.split("/").filter(function(r){return r});return n.reduce(function(r,o,s){var i=r[o];if(!i)throw new Error('Missing module "'+o+'" for path "'+t+'".');return s===n.length-1?i:i._children},t==="root"?e:e.root._children)}function x(e){try{return e()}catch(t){return t}}var _=function(t,n){this.runtime=n,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=(typeof r=="function"?r():r)||{}},Q={namespaced:{configurable:!0}};Q.namespaced.get=function(){return!!this._rawModule.namespaced};_.prototype.addChild=function(t,n){this._children[t]=n};_.prototype.removeChild=function(t){delete this._children[t]};_.prototype.getChild=function(t){return this._children[t]};_.prototype.hasChild=function(t){return t in this._children};_.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)};_.prototype.forEachChild=function(t){g(this._children,t)};_.prototype.forEachGetter=function(t){this._rawModule.getters&&g(this._rawModule.getters,t)};_.prototype.forEachAction=function(t){this._rawModule.actions&&g(this._rawModule.actions,t)};_.prototype.forEachMutation=function(t){this._rawModule.mutations&&g(this._rawModule.mutations,t)};Object.defineProperties(_.prototype,Q);var m=function(t){this.register([],t,!1)};m.prototype.get=function(t){return t.reduce(function(n,r){return n.getChild(r)},this.root)};m.prototype.getNamespace=function(t){var n=this.root;return t.reduce(function(r,o){return n=n.getChild(o),r+(n.namespaced?o+"/":"")},"")};m.prototype.update=function(t){K([],this.root,t)};m.prototype.register=function(t,n,r){var o=this;r===void 0&&(r=!0),process.env.NODE_ENV!=="production"&&B(t,n);var s=new _(n,r);if(t.length===0)this.root=s;else{var i=this.get(t.slice(0,-1));i.addChild(t[t.length-1],s)}n.modules&&g(n.modules,function(c,a){o.register(t.concat(a),c,r)})};m.prototype.unregister=function(t){var n=this.get(t.slice(0,-1)),r=t[t.length-1],o=n.getChild(r);if(!o){process.env.NODE_ENV!=="production"&&console.warn("[vuex] trying to unregister module '"+r+"', which is not registered");return}o.runtime&&n.removeChild(r)};m.prototype.isRegistered=function(t){var n=this.get(t.slice(0,-1)),r=t[t.length-1];return n?n.hasChild(r):!1};function K(e,t,n){if(process.env.NODE_ENV!=="production"&&B(e,n),t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r)){process.env.NODE_ENV!=="production"&&console.warn("[vuex] trying to add a new module '"+r+"' on hot reloading, manual reload is needed");return}K(e.concat(r),t.getChild(r),n.modules[r])}}var V={assert:function(e){return typeof e=="function"},expected:"function"},mt={assert:function(e){return typeof e=="function"||typeof e=="object"&&typeof e.handler=="function"},expected:'function or object with "handler" function'},T={getters:V,mutations:V,actions:mt};function B(e,t){Object.keys(T).forEach(function(n){if(t[n]){var r=T[n];g(t[n],function(o,s){v(r.assert(o),bt(e,n,s,o,r.expected))})}})}function bt(e,t,n,r,o){var s=t+" should be "+o+' but "'+t+"."+n+'"';return e.length>0&&(s+=' in module "'+e.join(".")+'"'),s+=" is "+JSON.stringify(r)+".",s}var h=function e(t){var n=this;t===void 0&&(t={}),process.env.NODE_ENV!=="production"&&(v(typeof Promise<"u","vuex requires a Promise polyfill in this browser."),v(this instanceof e,"store must be called with the new operator."));var r=t.plugins;r===void 0&&(r=[]);var o=t.strict;o===void 0&&(o=!1);var s=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new m(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=s;var i=this,c=this,a=c.dispatch,l=c.commit;this.dispatch=function(p,d){return a.call(i,p,d)},this.commit=function(p,d,F){return l.call(i,p,d,F)},this.strict=o;var u=this._modules.root.state;w(this,u,[],this._modules.root),C(this,u),r.forEach(function(f){return f(n)})},j={state:{configurable:!0}};h.prototype.install=function(t,n){t.provide(n||G,this),t.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:process.env.NODE_ENV!=="production"||!1;r&&dt(t,this)};j.state.get=function(){return this._state.data};j.state.set=function(e){process.env.NODE_ENV!=="production"&&v(!1,"use store.replaceState() to explicit replace store state.")};h.prototype.commit=function(t,n,r){var o=this,s=O(t,n,r),i=s.type,c=s.payload,a=s.options,l={type:i,payload:c},u=this._mutations[i];if(!u){process.env.NODE_ENV!=="production"&&console.error("[vuex] unknown mutation type: "+i);return}this._withCommit(function(){u.forEach(function(p){p(c)})}),this._subscribers.slice().forEach(function(f){return f(l,o.state)}),process.env.NODE_ENV!=="production"&&a&&a.silent&&console.warn("[vuex] mutation type: "+i+". Silent option has been removed. Use the filter functionality in the vue-devtools")};h.prototype.dispatch=function(t,n){var r=this,o=O(t,n),s=o.type,i=o.payload,c={type:s,payload:i},a=this._actions[s];if(!a){process.env.NODE_ENV!=="production"&&console.error("[vuex] unknown action type: "+s);return}try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(c,r.state)})}catch(u){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in before action subscribers: "),console.error(u))}var l=a.length>1?Promise.all(a.map(function(u){return u(i)})):a[0](i);return new Promise(function(u,f){l.then(function(p){try{r._actionSubscribers.filter(function(d){return d.after}).forEach(function(d){return d.after(c,r.state)})}catch(d){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in after action subscribers: "),console.error(d))}u(p)},function(p){try{r._actionSubscribers.filter(function(d){return d.error}).forEach(function(d){return d.error(c,r.state,p)})}catch(d){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in error action subscribers: "),console.error(d))}f(p)})})};h.prototype.subscribe=function(t,n){return P(t,this._subscribers,n)};h.prototype.subscribeAction=function(t,n){var r=typeof t=="function"?{before:t}:t;return P(r,this._actionSubscribers,n)};h.prototype.watch=function(t,n,r){var o=this;return process.env.NODE_ENV!=="production"&&v(typeof t=="function","store.watch only accepts a function."),E.watch(function(){return t(o.state,o.getters)},n,Object.assign({},r))};h.prototype.replaceState=function(t){var n=this;this._withCommit(function(){n._state.data=t})};h.prototype.registerModule=function(t,n,r){r===void 0&&(r={}),typeof t=="string"&&(t=[t]),process.env.NODE_ENV!=="production"&&(v(Array.isArray(t),"module path must be a string or an Array."),v(t.length>0,"cannot register the root module by using registerModule.")),this._modules.register(t,n),w(this,this.state,t,this._modules.get(t),r.preserveState),C(this,this.state)};h.prototype.unregisterModule=function(t){var n=this;typeof t=="string"&&(t=[t]),process.env.NODE_ENV!=="production"&&v(Array.isArray(t),"module path must be a string or an Array."),this._modules.unregister(t),this._withCommit(function(){var r=D(n.state,t.slice(0,-1));delete r[t[t.length-1]]}),M(this)};h.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),process.env.NODE_ENV!=="production"&&v(Array.isArray(t),"module path must be a string or an Array."),this._modules.isRegistered(t)};h.prototype.hotUpdate=function(t){this._modules.update(t),M(this,!0)};h.prototype._withCommit=function(t){var n=this._committing;this._committing=!0,t(),this._committing=n};Object.defineProperties(h.prototype,j);exports.useStore=et;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Web3 Framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -120,6 +120,14 @@
120
120
  "./modules/landing/client": {
121
121
  "import": "./dist/landing.client.js",
122
122
  "require": "./dist/landing.client.cjs"
123
+ },
124
+ "./modules/gallery/server": {
125
+ "import": "./dist/gallery.server.mjs",
126
+ "require": "./dist/gallery.server.js"
127
+ },
128
+ "./modules/backoffice/client": {
129
+ "import": "./dist/backoffice.client.js",
130
+ "require": "./dist/backoffice.client.cjs"
123
131
  }
124
132
  },
125
133
  "browser": {
@@ -168,6 +176,7 @@
168
176
  "rollup": "^3.29.0",
169
177
  "rollup-plugin-typescript2": "^0.35.0",
170
178
  "sass": "^1.59.3",
179
+ "sharp": "^0.32.6",
171
180
  "tslib": "^2.6.2",
172
181
  "typescript": "^4.5.4",
173
182
  "vite": "^4.4.9",
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <div>
3
+ <!-- <p v-if="localImages.length < 1" class="mn-big">
4
+ The images doesn't have any images yet.
5
+ </p> -->
6
+
7
+ <UploadImageMultiple
8
+ @update:images="onImagesUpdate"
9
+ :uploadPath="'photos'"
10
+ class="mn-semi pd-small w-100 button bg-black t-white"
11
+ />
12
+ <VueDraggableNext class="gap-small flex dragArea list-group w-full" v-model="localImages" @change="emitChanges">
13
+ <div v-for="(image, index) in localImages" class="pos-relative">
14
+ <img class="i-extra radius-small o-hidden mn-thin" :src="(FILE_SERVER_URL || '') + image" />
15
+ <a @click="deleteImage(index)" class="pos-absolute t-center radius-extra i-medium bg-red pos-t-0 pos-r-0">X</a>
16
+ </div>
17
+ </VueDraggableNext>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup>
22
+ import { ref, defineProps, watchEffect } from 'vue';
23
+ import { VueDraggableNext } from 'vue-draggable-next'
24
+ import UploadImageMultiple from "@pf/src/components/UploadImageMultiple/UploadImageMultiple.vue";
25
+
26
+ const props = defineProps({
27
+ images: Array,
28
+ });
29
+
30
+ const emit = defineEmits(['update'])
31
+
32
+ const localImages = ref([...props.images])
33
+
34
+ watchEffect(() => {
35
+ localImages.value = [...props.images]
36
+ })
37
+
38
+ const emitChanges = () => {
39
+ emit('update:images', localImages.value)
40
+ }
41
+
42
+ const onImagesUpdate = (newImages) => {
43
+ localImages.value = [...localImages.value, ...newImages]
44
+ emitChanges()
45
+ }
46
+
47
+ const deleteImage = (index) => {
48
+ localImages.value.splice(index, 1)
49
+ emitChanges()
50
+ }
51
+ </script>
52
+
53
+ <style lang="scss">
54
+ // Your styles here
55
+ </style>
@@ -53,45 +53,5 @@ function logout () {
53
53
  </script>
54
54
 
55
55
  <style lang="scss">
56
- #account {
57
- padding-top: 8rem;
58
- }
59
- .menu-tabs {
60
-
61
- min-width: 16rem;
62
- height: min-content;
63
-
64
- border-radius: 1rem;
65
- background: #f7f7f7;
66
-
67
- .product-tab {
68
- display: flex;
69
- align-items: center;
70
- justify-content: flex-start;
71
-
72
-
73
-
74
- background: transparent;
75
-
76
- text-align: left;
77
56
 
78
- padding: 0.5rem;
79
- border-radius: 0.5rem;
80
- width: 100%;
81
-
82
- svg { opacity: 0.33; margin-right: 1rem; }
83
-
84
- &:hover {
85
- cursor: pointer;
86
- }
87
-
88
- &-active {
89
- color: rgb(var(--main));
90
- background: white;
91
-
92
- svg { opacity: 1; path { fill: rgb(var(--main));} }
93
- }
94
-
95
- }
96
- }
97
57
  </style>
@@ -0,0 +1,15 @@
1
+
2
+ // Importing Vue components from the components directory
3
+ // import Profile from './components/pages/Profile.vue';
4
+ // import ProfileEdit from './components/pages/ProfileEdit.vue';
5
+
6
+ // Importing Vuex store modules from the store directory
7
+ // import * as filesStore from './store/files.store.js';
8
+
9
+ // Importing Vue Router routes from the router directory
10
+ import backofficeRoutes from './router/backoffice.js';
11
+
12
+ // Exporting components, store modules, and routes
13
+ export {
14
+ backofficeRoutes
15
+ };
@@ -1,62 +1,54 @@
1
1
  <template>
2
- <div class="for-transition w-100">
3
-
4
- <section id="account" class="cols-2-1_3 gap-thin pd-thin">
5
- <div class="menu-tabs t-white bg-black pd-medium radius-big">
6
- <div
7
- v-for="(item, index) in tabs"
8
- :key="index"
9
- :class="{ 'product-tab-active': $route.name === item.routeName }"
10
- class="product-tab"
11
- @click="navigate(item.routeName)"
12
- >
13
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
14
- <path fill-rule="evenodd" clip-rule="evenodd" d="M8.75 7C8.75 5.20507 10.2051 3.75 12 3.75C13.7949 3.75 15.25 5.20507 15.25 7C15.25 8.79493 13.7949 10.25 12 10.25C10.2051 10.25 8.75 8.79493 8.75 7ZM12 2.25C9.37665 2.25 7.25 4.37665 7.25 7C7.25 9.62335 9.37665 11.75 12 11.75C14.6234 11.75 16.75 9.62335 16.75 7C16.75 4.37665 14.6234 2.25 12 2.25ZM5.75 19C5.75 17.2051 7.20507 15.75 9 15.75H15C16.7949 15.75 18.25 17.2051 18.25 19C18.25 19.6904 17.6904 20.25 17 20.25H7C6.30964 20.25 5.75 19.6904 5.75 19ZM9 14.25C6.37665 14.25 4.25 16.3766 4.25 19C4.25 20.5188 5.48122 21.75 7 21.75H17C18.5188 21.75 19.75 20.5188 19.75 19C19.75 16.3766 17.6234 14.25 15 14.25H9Z" fill="#242424"/>
15
- </svg>
16
- {{ item.name }}
17
- </div>
18
- <button @click="logout()" class="w-100 mn-t-semi bg-main button">Выйти</button>
19
- </div>
20
-
21
- <div class="account-view">
22
- <router-view v-slot="{ Component, route }">
23
- <transition name="scaleIn" mode="out-in">
24
- <component ref="page" :key="route.path" :is="Component" />
25
- </transition>
26
- </router-view>
27
- </div>
28
- </section>
29
-
30
- </div>
2
+ <section id="account" class="cols-2-1_3 gap-medium pd-medium">
3
+ <!-- ---------------------------------------------------------------- -->
4
+ <!-- 02. Page Tabs -->
5
+ <!-- ---------------------------------------------------------------- -->
6
+ <div class="pd-medium menu-tabs">
7
+ <button
8
+ v-if="store.auth.state.access.roles.includes('ROLE_ADMIN')"
9
+ @click="$router.push('/account/community')"
10
+ :class="{'product-tab-active': $route.path === '/account/community'}"
11
+ class="mn-small product-tab"
12
+ >
13
+ Blog
14
+ </button>
15
+
16
+ <button
17
+ v-if="store.auth.state.access.roles.includes('ROLE_ADMIN')"
18
+ @click="$router.push('/account/gallery')"
19
+ :class="{'product-tab-active': $route.path === '/account/gallery'}" class="product-tab"
20
+ >
21
+ Gallery
22
+ </button>
23
+ </div>
24
+
25
+ <div class="w-100">
26
+ <router-view v-slot="{ Component, route }">
27
+ <transition name="scaleIn" mode="out-in">
28
+ <component ref="page" :key="route.path" :is="Component" />
29
+ </transition>
30
+ </router-view>
31
+ </div>
32
+
33
+ </section>
31
34
  </template>
32
35
 
36
+
33
37
  <script setup>
34
- import { ref } from 'vue';
35
- import { useRoute, useRouter } from 'vue-router';
38
+ import { computed, onMounted,reactive,toRefs } from 'vue'
36
39
 
37
- import Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'
40
+ import { useRoute,useRouter } from 'vue-router'
38
41
 
39
- import * as auth from '@pf/src/modules/auth/store/auth'
42
+ const route = useRoute()
43
+ const router = useRouter()
44
+
45
+ let data = reactive({currentTab: 'user'})
46
+ let reactiveData = toRefs(data)
47
+ function changeTab (tab) {data.currentTab = tab; console.log(data.currentTab) }
40
48
 
41
- const route = useRoute();
42
- const router = useRouter();
43
49
 
44
- const tabs = ref([
45
- { name: 'Profile', routeName: 'Profile' },
46
- { name: 'Wallet', routeName: 'Wallet' },
47
- { name: 'Organizations', routeName: 'Organizations' },
48
- { name: 'Journal', routeName: 'Community Account' },
49
- { name: 'Settings', routeName: 'Settings' },
50
- ]);
51
50
 
52
- function logout () {
53
- auth.actions.logout()
54
- router.push({name: 'Sign In'})
55
- }
56
51
 
57
- const navigate = (routeName) => {
58
- router.push({ name: routeName });
59
- };
60
52
  </script>
61
53
 
62
54
  <style lang="scss">
@@ -64,6 +56,10 @@ const navigate = (routeName) => {
64
56
 
65
57
  min-width: 16rem;
66
58
  height: min-content;
59
+
60
+ border-radius: 1rem;
61
+ background: #f7f7f7;
62
+
67
63
  .product-tab {
68
64
  display: flex;
69
65
  align-items: center;
@@ -86,18 +82,12 @@ const navigate = (routeName) => {
86
82
  }
87
83
 
88
84
  &-active {
89
- color: #00ff88;
85
+ color: rgb(var(--main));
90
86
  background: white;
91
87
 
92
- svg { opacity: 1; path { fill: #00ff88;} }
88
+ svg { opacity: 1; path { fill: rgb(var(--main));} }
93
89
  }
94
90
 
95
91
  }
96
- }
97
-
98
- #account {
99
- .account-view {
100
- width: 100%;
101
- }
102
92
  }
103
- </style>
93
+ </style>
@@ -0,0 +1,20 @@
1
+ import layoutAccount from '../components/layouts/Account.vue'
2
+
3
+ const account = [{
4
+ path: 'backoffice',
5
+ component: layoutAccount,
6
+ children: [{
7
+ path: ':_id',
8
+ name: 'Backoffice',
9
+ meta: {
10
+ title: {
11
+ en: 'Backoffice',
12
+ ru: 'Управление'
13
+ },
14
+ authorize: []
15
+ },
16
+ component: () => import(/* webpackChunkName: 'Account' */ '@pf/src/modules/gallery/components/sections/Gallery.vue'),
17
+ }]
18
+ }];
19
+
20
+ export default account;
@@ -1,151 +1,47 @@
1
- const multer = require('multer');
2
- const path = require('path');
3
- const fs = require('fs');
4
-
5
- const createMulterStorage = (folderName, publicPath) => {
6
-
7
- return multer.diskStorage({
8
- destination: function (req, file, cb) {
9
- let user = {};
10
- try {
11
- user = JSON.parse(req.cookies.user);
12
- } catch (err) {
13
- return cb(new Error('Unable to parse user from cookies'));
14
- }
15
-
16
- if (!user._id) {
17
- return cb(new Error('No user _id found in cookies'));
18
- }
19
-
20
- const userUploadPath = path.join(publicPath, 'users', String(user._id), folderName);
21
-
22
- fs.mkdirSync(userUploadPath, { recursive: true });
23
-
24
- cb(null, userUploadPath);
25
- },
26
- filename: function (req, file, cb) {
27
- cb(null, Date.now() + path.extname(file.originalname));
28
- }
29
- });
30
- }
31
-
32
- const createStorage = (folderName, publicPath) => {
33
-
34
- return multer.diskStorage({
35
- destination: function (req, file, cb) {
36
- let user = {};
37
- try {
38
- user = JSON.parse(req.cookies.user);
39
- } catch (err) {
40
- return cb(new Error('Unable to parse user from cookies'));
41
- }
42
-
43
- if (!user._id) {
44
- return cb(new Error('No user _id found in cookies'));
45
- }
46
-
47
- const userUploadPath = path.join(publicPath, folderName);
48
-
49
- fs.mkdirSync(userUploadPath, { recursive: true });
50
-
51
- cb(null, userUploadPath);
52
- },
53
- filename: function (req, file, cb) {
54
- cb(null, Date.now() + path.extname(file.originalname));
55
- }
56
- });
57
- }
58
-
59
1
  const controllerFactory = (db, publicPath) => {
60
- const uploadImageController = async (req, res, next) => {
61
- const upload = multer({ storage: createMulterStorage('blog', publicPath) }).single('file');
62
-
63
- console.log(req.file)
64
-
65
- upload(req, res, function(err) {
66
- if (err instanceof multer.MulterError) {
67
- console.log(err)
68
- return res.status(500).json(err);
69
- } else if (err) {
70
- console.log(err)
71
- return res.status(500).json(err);
72
- }
73
- if (!req.file) {
74
- return res.status(400).send({ message: 'No file uploaded.' });
75
- }
76
-
77
- const user = JSON.parse(req.cookies.user);
78
-
79
- res.status(200).send({
80
- message: 'File uploaded successfully.',
81
- filename: req.file.filename,
82
- filepath: `/users/${user._id}/blog/${req.file.filename}`
83
- });
84
- });
85
- };
86
2
 
87
3
  const uploadFileController = async (req, res, next) => {
4
+ if (!req.file) {
5
+ return res.status(400).send({ message: 'No file uploaded.' });
6
+ }
88
7
 
89
- const folderName = req.query.folderName ? req.query.folderName : 'unsorted'; // получаем folderName из параметров запроса
90
- const upload = multer({ storage: createStorage(folderName, publicPath) }).single('file');
91
-
92
- console.log(folderName)
93
- console.log(req.files)
94
-
95
- upload(req, res, function(err) {
96
- if (err instanceof multer.MulterError) {
97
- console.log(err)
98
- return res.status(500).json(err);
99
- } else if (err) {
100
- console.log(err)
101
- return res.status(500).json(err);
102
- }
103
- if (!req.file) {
104
- return res.status(400).send({ message: 'No file uploaded.' });
105
- }
106
-
107
- const user = JSON.parse(req.cookies.user);
108
-
8
+ try {
109
9
  res.status(200).send({
110
10
  message: 'File uploaded successfully.',
111
11
  filename: req.file.filename,
112
- filepath: `/${folderName}/${req.file.filename}`
12
+ filepath: `/${req.query.folderName || 'unsorted'}/${req.file.filename}`
113
13
  });
114
- });
14
+ } catch (error) {
15
+ console.error('Error in uploadFileController:', error);
16
+ return res.status(500).send({ message: 'Error during file processing.' });
17
+ }
115
18
  };
116
19
 
117
- const uploadMultipleFile = async (req, res, next) => {
118
- const folderName = req.query.folderName; // получаем folderName из параметров запроса
119
- const upload = multer({ storage: createStorage(folderName) }).array('file');
120
-
121
- upload(req, res, function(err) {
122
- if (err instanceof multer.MulterError) {
123
- console.log(err)
124
- return res.status(500).json(err);
125
- } else if (err) {
126
- console.log(err)
127
- return res.status(500).json(err);
128
- }
129
- if (!req.files || req.files.length === 0) {
130
- return res.status(400).send({ message: 'No file uploaded.' });
131
- }
132
-
133
- const user = JSON.parse(req.cookies.user);
20
+ const uploadMultipleFileController = async (req, res, next) => {
21
+ if (!req.files || req.files.length === 0) {
22
+ return res.status(400).send({ message: 'No files uploaded.' });
23
+ }
134
24
 
135
- // send back all filenames and paths
136
- res.status(200).send(req.files.map(file => ({
25
+ try {
26
+ const fileResponses = req.files.map(file => ({
137
27
  message: 'File uploaded successfully.',
138
28
  filename: file.filename,
139
- filepath: `/${folderName}/${file.filename}`,
140
- })));
141
- });
29
+ filepath: `/${req.query.folderName || 'unsorted'}/${file.filename}`
30
+ }));
31
+
32
+ // Your logic related to the DB or further processing can be here.
33
+
34
+ res.status(200).send(fileResponses);
35
+ } catch (error) {
36
+ console.error('Error in uploadMultipleFileController:', error);
37
+ return res.status(500).send({ message: 'Error during files processing.' });
38
+ }
142
39
  };
143
40
 
144
41
  return {
145
- uploadImageController,
146
42
  uploadFileController,
147
- uploadMultipleFile
43
+ uploadMultipleFileController
148
44
  };
149
45
  };
150
46
 
151
- module.exports = controllerFactory;
47
+ module.exports = controllerFactory;