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AAKgR,KAAK60E,G,ICpFvF,IAAIE,EAAsB3E,EAAoBQ,OAAEz0D,EAAW,CAAC,MAAM,WAAa,OAAOi0D,EAAoB,MAAQ,IAClH2E,EAAsB3E,EAAoBQ,EAAEmE,E","sources":["webpack://bml2/./src/App.vue","webpack://bml2/./src/components/messages.vue","webpack://bml2/./src/components/message.vue","webpack://bml2/src/components/message.vue","webpack://bml2/./src/components/message.vue?e3be","webpack://bml2/./src/components/message.vue?b633","webpack://bml2/src/components/messages.vue","webpack://bml2/./src/components/messages.vue?2738","webpack://bml2/./src/components/messages.vue?7ea4","webpack://bml2/./src/components/General/TokenExpired.vue","webpack://bml2/src/components/General/TokenExpired.vue","webpack://bml2/./src/components/General/TokenExpired.vue?cd86","webpack://bml2/./src/components/General/TokenExpired.vue?9795","webpack://bml2/./src/components/General/SettingsPanel.vue","webpack://bml2/src/components/General/SettingsPanel.vue","webpack://bml2/./src/components/General/SettingsPanel.vue?6701","webpack://bml2/./src/components/General/SettingsPanel.vue?bb89","webpack://bml2/./src/components/General/AccountSelect.vue","webpack://bml2/src/components/General/AccountSelect.vue","webpack://bml2/./src/components/General/AccountSelect.vue?3f0c","webpack://bml2/./src/components/General/AccountSelect.vue?2e40","webpack://bml2/./src/components/maintenance.vue","webpack://bml2/src/components/maintenance.vue","webpack://bml2/./src/components/maintenance.vue?314e","webpack://bml2/./src/components/maintenance.vue?8ea3","webpack://bml2/src/App.vue","webpack://bml2/./src/App.vue?c036","webpack://bml2/./src/App.vue?0e40","webpack://bml2/./src/store/hooks.js","webpack://bml2/./src/plugins/icons.js","webpack://bml2/./src/plugins/directives.js","webpack://bml2/./src/components/Product/SaveDialog.vue","webpack://bml2/src/components/Product/SaveDialog.vue","webpack://bml2/./src/components/Product/SaveDialog.vue?0c3f","webpack://bml2/./src/components/Product/SaveDialog.vue?b381","webpack://bml2/./src/util/initialization.js","webpack://bml2/./src/assets/config/translations/index.js","webpack://bml2/./src/main.js","webpack://bml2/./src/plugins/filters.js","webpack://bml2/./src/repository/auth.js","webpack://bml2/./src/repository/company.js","webpack://bml2/./src/repository/document-repository.js","webpack://bml2/./src/repository/field-repository.js","webpack://bml2/./src/repository/invoice.js","webpack://bml2/./src/repository/pdf.js","webpack://bml2/./src/repository/product.js","webpack://bml2/./src/repository/system.js","webpack://bml2/./src/views/auth/acceptinvite.vue","webpack://bml2/src/views/auth/acceptinvite.vue","webpack://bml2/./src/views/auth/acceptinvite.vue?870d","webpack://bml2/./src/views/auth/acceptinvite.vue?1d6f","webpack://bml2/./src/router.js","webpack://bml2/./src/service/messaging.js","webpack://bml2/./src/repository/category-repository.js","webpack://bml2/./src/store/modules/category.js","webpack://bml2/./src/store/modules/categorytext.js","webpack://bml2/./src/store/modules/restrictiontext.js","webpack://bml2/./src/repository/biostandard-repository.js","webpack://bml2/./src/store/modules/biostandard.js","webpack://bml2/./src/repository/checklist.js","webpack://bml2/./src/store/modules/checklist.js","webpack://bml2/./src/repository/selectoptions.js","webpack://bml2/./src/store/modules/selectoptions.js","webpack://bml2/./src/repository/country.js","webpack://bml2/./src/store/modules/country.js","webpack://bml2/./src/repository/lists.js","webpack://bml2/./src/store/modules/list.js","webpack://bml2/./src/repository/permit.js","webpack://bml2/./src/store/modules/permit.js","webpack://bml2/./src/store/modules/field.js","webpack://bml2/./src/store/modules/invoice.js","webpack://bml2/./src/repository/component.js","webpack://bml2/./src/store/modules/component.js","webpack://bml2/./src/repository/hobbygarden.js","webpack://bml2/./src/store/modules/hobbygarden.js","webpack://bml2/./src/store/modules/productlist.js","webpack://bml2/./src/store/modules/company/documents.js","webpack://bml2/./src/store/modules/company/checklist.js","webpack://bml2/./src/util/company/sort.js","webpack://bml2/./src/store/modules/companylist.js","webpack://bml2/./src/repository/labels.js","webpack://bml2/./src/store/modules/label.js","webpack://bml2/./src/repository/search/search.js","webpack://bml2/./src/store/modules/search/main.js","webpack://bml2/./src/repository/search/columnset.js","webpack://bml2/./src/store/modules/columnset/base.js","webpack://bml2/./src/store/modules/columnset/main.js","webpack://bml2/./src/store/modules/exportset/main.js","webpack://bml2/./src/store/modules/auth/login.js","webpack://bml2/./src/store/modules/auth/user/notes.js","webpack://bml2/./src/store/modules/auth/user/roles.js","webpack://bml2/./src/store/modules/auth/user/routes.js","webpack://bml2/./src/store/modules/auth/user.js","webpack://bml2/./src/store/modules/auth/admin.js","webpack://bml2/./src/repository/org.js","webpack://bml2/./src/store/modules/auth/org.js","webpack://bml2/./src/store/modules/auth/main.js","webpack://bml2/./src/repository/messages.js","webpack://bml2/./src/store/modules/messages.js","webpack://bml2/./src/store/modules/paiduser.js","webpack://bml2/./src/store/modules/base.js","webpack://bml2/./src/repository/messagecenter.js","webpack://bml2/./src/store/modules/messagecenter.js","webpack://bml2/./src/util/flow-helper.js","webpack://bml2/./src/store/modules/related.js","webpack://bml2/./src/store/main.js","webpack://bml2/./src/repository/batchjob.js","webpack://bml2/./src/store/modules/batchtemplate.js","webpack://bml2/./src/store/modules/product/documents.js","webpack://bml2/./src/store/modules/product/display.js","webpack://bml2/./src/store/modules/product/approvals.js","webpack://bml2/./src/repository/listingconfirmation.js","webpack://bml2/./src/store/modules/product/listingconfirmation.js","webpack://bml2/./src/store/modules/product/notes.js","webpack://bml2/./src/store/modules/product/options.js","webpack://bml2/./src/store/modules/product/presence.js","webpack://bml2/./src/util/change-emitter.js","webpack://bml2/./src/store/modules/product.js","webpack://bml2/./src/store/modules/product/checklist.js","webpack://bml2/./src/store/modules/product/exports.js","webpack://bml2/./src/store/modules/product/history.js","webpack://bml2/./src/util/approval-workflow-service.js","webpack://bml2/./src/util/component-helper.js","webpack://bml2/./src/util/document-helper.js","webpack://bml2/./src/util/env.js","webpack://bml2/./src/util/error.js","webpack://bml2/./src/util/eventbus.js","webpack://bml2/./src/util/field-helper.js","webpack://bml2/./src/util/jwt-cache.js","webpack://bml2/./src/util/message-center.js","webpack://bml2/./src/util/portal-store-helper.js","webpack://bml2/./src/util/load-indicator.js","webpack://bml2/./src/util/request.js","webpack://bml2/./src/util/role.js","webpack://bml2/./src/util/search/columnset.js","webpack://bml2/./src/util/search/query-generator.js","webpack://bml2/./src/util/search/sort-util.js","webpack://bml2/./src/util/search/structures.js","webpack://bml2/./src/util/select-helper.js","webpack://bml2/./src/util/uuid.js","webpack://bml2/./node_modules/moment/locale/ sync ^\\.\\/.*$","webpack://bml2/webpack/bootstrap","webpack://bml2/webpack/runtime/chunk loaded","webpack://bml2/webpack/runtime/compat get default export","webpack://bml2/webpack/runtime/define property getters","webpack://bml2/webpack/runtime/ensure chunk","webpack://bml2/webpack/runtime/get javascript chunk filename","webpack://bml2/webpack/runtime/get mini-css chunk filename","webpack://bml2/webpack/runtime/global","webpack://bml2/webpack/runtime/hasOwnProperty shorthand","webpack://bml2/webpack/runtime/load script","webpack://bml2/webpack/runtime/make namespace object","webpack://bml2/webpack/runtime/node module decorator","webpack://bml2/webpack/runtime/publicPath","webpack://bml2/webpack/runtime/css loading","webpack://bml2/webpack/runtime/jsonp chunk loading","webpack://bml2/webpack/startup"],"sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.isMaintenance)?_c('layout-maintenance'):_c('div',{staticClass:\"grid-container\",class:_vm.showSidebar\n\t\t\t? 'grid-container-columns-full'\n\t\t\t: 'grid-container-columns-hidden-sidebar',attrs:{\"id\":\"appbody\"}},[_c('vue-progress-bar'),_c('messages'),_c('main',{class:_vm.mainClass()},[_c('div',{staticClass:\"container-fluid px-0\"},[_c('div',{staticClass:\"row no-gutters\"},[_c('div',{staticClass:\"col\"},[(_vm.loading)?_c('div',{staticClass:\"w-100 h-100 d-flex justify-content-center align-content-center loading-indicator\"},[_c('img',{attrs:{\"src\":require(\"@/assets/images/Wedges-3s-200px.svg\")}})]):_vm._e(),_c('router-view')],1)])])]),_c('div',{staticClass:\"sidenav bg-secondary text-white\",style:({ display: _vm.showSidebar ? 'inherit' : 'none' })},_vm._l((_vm.navGroups),function(group){return _c('b-nav',{key:group,staticClass:\"nav-header\",attrs:{\"vertical\":\"\"}},[(group)?_c('header',{staticClass:\"bg-dark text-white\"},[_vm._v(\" \"+_vm._s(group)+\" \")]):_vm._e(),_vm._l((_vm.navItems(group)),function(item,index){return _c('b-nav-item',{key:index,attrs:{\"to\":item.path}},[(item.name === 'MessageCenter')?_c('div',[_vm._v(\" \"+_vm._s(_vm.$t(`default.router.sidebar.${item.name}`))+\": Unread (\"+_vm._s(_vm.unreadCount)+\") \")]):_c('div',[_vm._v(\" \"+_vm._s(_vm.$t(`default.router.sidebar.${item.name}`))+\" \")])])})],2)}),1),_c('div',{class:_vm.isDemo\n\t\t\t\t? 'navbar bg-danger text-white'\n\t\t\t\t: 'navbar bg-dark text-white'},[_c('div',{staticClass:\"col m-0 app-title\",attrs:{\"id\":\"globalWarnings\"}},[_vm._v(\" \"+_vm._s(_vm.productTitle)+_vm._s(_vm.$t(`default.router.title.${_vm.$route.name}`))+\" \"),(_vm.subTitle)?[_c('br'),_c('span',{staticClass:\"subtitle\"},[_vm._v(\" \"+_vm._s(_vm.subTitle)+\" \")])]:_vm._e()],2),_c('settings-panel',{ref:\"settingsPanel\"}),_c('account-select',{staticClass:\"ml-2\"}),_c('b-button',{staticClass:\"ml-2\",attrs:{\"title\":_vm.$t('default.toggleSidebar')},on:{\"click\":function($event){return _vm.toggleSidebar()}}},[_c('v-icon',{staticClass:\"m-0\",attrs:{\"icon\":\"bars\"}})],1),(_vm.canGoBack)?_c('b-button',{staticClass:\"ml-3\",attrs:{\"variant\":\"warning\"},on:{\"click\":_vm.goBack}},[_vm._v(\" « \"+_vm._s(_vm.$t(\"default.common.back\"))+\" \")]):_vm._e()],1),_c('footer',{staticClass:\"footer bg-dark text-white\"},[_vm._v(\" © \"+_vm._s(new Date().getFullYear())+\" FiBL \")]),_c('div',{staticClass:\"logo\",style:({ display: _vm.showSidebar ? 'inherit' : 'none' })},[_c('b-link',{attrs:{\"to\":\"/\"}},[_c('img',{staticClass:\"p-3\",attrs:{\"height\":\"60\",\"alt\":\"Logo\",\"src\":require(\"@/assets/images/logo.png\")}})])],1),_c('b-modal',{ref:\"errorModal\",attrs:{\"scrollable\":\"\",\"size\":\"lg\",\"title\":_vm.$t('default.common.error.title'),\"ok-only\":\"\"}},[_c('div',[_c('p',[_c('strong',[_vm._v(\" \"+_vm._s(_vm.$t(\"default.common.error.occured\"))+\" \")])]),_c('ul',_vm._l((_vm.lastError),function(line){return _c('li',{key:line},[_vm._v(\" \"+_vm._s(line)+\" \")])}),0)]),_c('p',[_vm._v(_vm._s(_vm.$t(\"default.common.error.details\")))]),_c('template',{slot:\"modal-ok\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"default.common.error.submit\"))+\" \")])],2),_c('b-modal',{ref:\"warningModal\",attrs:{\"scrollable\":\"\",\"size\":\"lg\",\"title\":_vm.$t('default.common.warnings.title'),\"ok-only\":\"\"}},[_c('div',[_c('ul',_vm._l((_vm.warnings),function(line){return _c('li',{key:line},[_vm._v(\" \"+_vm._s(line)+\" \")])}),0)]),_c('template',{slot:\"modal-ok\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"default.common.warnings.submit\"))+\" \")])],2),_c('token-expired',{ref:\"tokenExpiredModal\"})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{attrs:{\"id\":\"messages\"}},[_c('transition-group',{attrs:{\"tag\":\"div\",\"name\":\"message\"}},_vm._l((_vm.items),function(item){return _c('message',_vm._b({key:item.n,on:{\"close\":function($event){return _vm.remove(item)}}},'message',item,false))}),1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"message\",class:_vm.cls,on:{\"click\":_vm.close}},[_c('header',[_vm._v(_vm._s(_vm.title))]),_c('article',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.message),expression:\"message\"}]},[_vm._v(\" \"+_vm._s(_vm.message)+\" \")]),_c('button',{staticClass:\"faded\",on:{\"click\":_vm.pin}},[_c('span',{domProps:{\"innerHTML\":_vm._s(_vm.pinSign)}})])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./message.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./message.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./message.vue?vue&type=template&id=48bdf35d\"\nimport script from \"./message.vue?vue&type=script&lang=js\"\nexport * from \"./message.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./messages.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./messages.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./messages.vue?vue&type=template&id=03157e9e\"\nimport script from \"./messages.vue?vue&type=script&lang=js\"\nexport * from \"./messages.vue?vue&type=script&lang=js\"\nimport style0 from \"./messages.vue?vue&type=style&index=0&id=03157e9e&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('b-modal',{ref:\"expirationModal\",attrs:{\"scrollable\":\"\",\"size\":\"lg\",\"title\":_vm.$t('auth.views.tokenExpired.title'),\"no-close-on-backdrop\":\"\",\"no-close-on-esc\":\"\",\"hide-header-close\":\"\"},model:{value:(_vm.show),callback:function ($$v) {_vm.show=$$v},expression:\"show\"}},[_c('div',[_c('p',[_c('strong',[_vm._v(\" \"+_vm._s(_vm.$t('auth.views.tokenExpired.message'))+\" \")])]),_c('p',[_vm._v(\" \"+_vm._s(_vm.$t('auth.views.tokenExpired.backToSSOMessage'))+\" \")])]),_c('template',{slot:\"modal-footer\"},[_c('b-button',{attrs:{\"variant\":\"primary\"},on:{\"click\":function($event){return _vm.goToSso()}}},[_vm._v(\" \"+_vm._s(_vm.$t('auth.views.tokenExpired.backToSSOButton'))+\" \")])],1)],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n","import mod from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./TokenExpired.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./TokenExpired.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./TokenExpired.vue?vue&type=template&id=4423fcbc\"\nimport script from \"./TokenExpired.vue?vue&type=script&lang=js\"\nexport * from \"./TokenExpired.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{directives:[{name:\"click-outside\",rawName:\"v-click-outside\",value:(_vm.hide),expression:\"hide\"}],attrs:{\"id\":\"SettingsPanel\"}},[_c('b-button',{on:{\"click\":_vm.toggle}},[_c('v-icon',{staticClass:\"m-0\",attrs:{\"icon\":\"cog\"}})],1),_c('b-card',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.open && _vm.loaded),expression:\"open && loaded\"}],staticClass:\"popout\"},[_c('b-form-group',{attrs:{\"label\":_vm.$t('default.settingsPanel.interface')}},[_c('b-form-select',{attrs:{\"options\":_vm.languages},model:{value:(_vm.mainUiLang),callback:function ($$v) {_vm.mainUiLang=$$v},expression:\"mainUiLang\"}})],1),_c('b-form-group',{attrs:{\"label\":_vm.$t('default.settingsPanel.fieldLangs')}},[_c('multi-select',{attrs:{\"max\":3,\"options\":_vm.languageCodes,\"multiple\":true,\"allow-empty\":false,\"custom-label\":_vm.languageTitle,\"close-on-select\":false,\"disabled\":!_vm.overrideMultitextLanguages,\"placeholder\":_vm.$t('default.multiselect.placeholder')},model:{value:(_vm.fieldLangs),callback:function ($$v) {_vm.fieldLangs=$$v},expression:\"fieldLangs\"}})],1),_c('b-form-group',{attrs:{\"label\":_vm.$t('default.settingsPanel.useListDataForMultitextLanguages')}},[_c('b-form-checkbox',{model:{value:(_vm.overrideMultitextLanguages),callback:function ($$v) {_vm.overrideMultitextLanguages=$$v},expression:\"overrideMultitextLanguages\"}})],1),_c('b-form-group',{attrs:{\"label\":_vm.$t('default.settingsPanel.receiveMailsNotes')}},[_c('b-form-checkbox',{model:{value:(_vm.receiveMailsNotes),callback:function ($$v) {_vm.receiveMailsNotes=$$v},expression:\"receiveMailsNotes\"}})],1),_c('b-form-group',{attrs:{\"label\":_vm.$t('default.settingsPanel.receiveMailsMessages')}},[_c('b-form-checkbox',{model:{value:(_vm.receiveMailsMessages),callback:function ($$v) {_vm.receiveMailsMessages=$$v},expression:\"receiveMailsMessages\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Default Search\"}},[_c('b-form-select',{attrs:{\"options\":_vm.searchOptions},model:{value:(_vm.defaultProductFilter),callback:function ($$v) {_vm.defaultProductFilter=$$v},expression:\"defaultProductFilter\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Default Columns\"}},[_c('b-form-select',{attrs:{\"options\":_vm.columnsetOptions},model:{value:(_vm.defaultProductColumns),callback:function ($$v) {_vm.defaultProductColumns=$$v},expression:\"defaultProductColumns\"}})],1),_c('b-button',{attrs:{\"variant\":\"primary\",\"disabled\":!_vm.canSave},on:{\"click\":_vm.save}},[_vm._v(\" \"+_vm._s(_vm.$t('default.dialog.save'))+\" \")])],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./SettingsPanel.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./SettingsPanel.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./SettingsPanel.vue?vue&type=template&id=17a40c72\"\nimport script from \"./SettingsPanel.vue?vue&type=script&lang=js\"\nexport * from \"./SettingsPanel.vue?vue&type=script&lang=js\"\nimport style0 from \"./SettingsPanel.vue?vue&type=style&index=0&id=17a40c72&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{directives:[{name:\"click-outside\",rawName:\"v-click-outside\",value:(_vm.hideAccountSelect),expression:\"hideAccountSelect\"}],attrs:{\"id\":\"AccountSelect\"}},[_c('b-button',{on:{\"click\":_vm.toggle}},[_c('v-icon',{staticClass:\"m-0\",attrs:{\"icon\":\"user-circle\"}}),_vm._v(\" \"+_vm._s(_vm.accountName)+\" \")],1),_c('b-card',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.open),expression:\"open\"}],staticClass:\"popout\"},[(_vm.hasMultipleAccounts)?[_c('b-form-group',{attrs:{\"label\":_vm.$t('default.accountSelect.account')}},[_c('b-form-select',{attrs:{\"options\":_vm.accounts},model:{value:(_vm.account),callback:function ($$v) {_vm.account=$$v},expression:\"account\"}})],1),(_vm.isDev)?_c('b-button',{staticClass:\"btn-block\",attrs:{\"variant\":\"danger\"},on:{\"click\":_vm.unregister}},[_vm._v(\" \"+_vm._s(_vm.$t('default.accountSelect.unregister'))+\" \")]):_vm._e()]:_vm._e(),(_vm.isLoggedIn)?_c('b-button',{staticClass:\"btn-block\",attrs:{\"variant\":\"primary\"},on:{\"click\":_vm.goToKeycloak}},[_vm._v(\" \"+_vm._s(_vm.$t('default.accountSelect.editKeycloakData'))+\" \")]):_vm._e(),(_vm.isLoggedIn)?_c('b-button',{staticClass:\"mt-2 btn-block\",attrs:{\"variant\":\"danger\"},on:{\"click\":_vm.logout}},[_vm._v(\" \"+_vm._s(_vm.$t('default.accountSelect.logout'))+\" \")]):_vm._e()],2)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./AccountSelect.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./AccountSelect.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./AccountSelect.vue?vue&type=template&id=713ad968\"\nimport script from \"./AccountSelect.vue?vue&type=script&lang=js\"\nexport * from \"./AccountSelect.vue?vue&type=script&lang=js\"\nimport style0 from \"./AccountSelect.vue?vue&type=style&index=0&id=713ad968&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('b-jumbotron',{staticClass:\"m-5\",attrs:{\"header\":_vm.$t('maintenance.header')}},[_c('p',[_vm._v(_vm._s(_vm.$t('maintenance.text')))])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./maintenance.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./maintenance.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./maintenance.vue?vue&type=template&id=7b2204ff\"\nimport script from \"./maintenance.vue?vue&type=script&lang=js\"\nexport * from \"./maintenance.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=355b7bee&scoped=true\"\nimport script from \"./App.vue?vue&type=script&lang=js\"\nexport * from \"./App.vue?vue&type=script&lang=js\"\nimport style0 from \"./App.vue?vue&type=style&index=0&id=355b7bee&prod&scoped=true&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"355b7bee\",\n null\n \n)\n\nexport default component.exports","import store from './main.js';\nimport EventBus from '@/util/eventbus.js';\nimport { stripUnusedData, rebuildComponents } from '@/util/component-helper.js';\n\nEventBus.on('beforeProductSave', async(workingCopy) => {\n\tstripUnusedData(workingCopy);\n\tawait store.dispatch('product/uploadDocuments', workingCopy);\n});\nEventBus.on('beforeProductSaveCleanup', (workingCopy) => {\n\trebuildComponents(workingCopy);\n});\nEventBus.on('afterSwitchList', async() => {\n\tstore.dispatch('product/clearMoveDocuments');\n\tawait store.dispatch('product/display/updateCompanyData');\n});\nEventBus.on('beforeProductSaveAllLists', async({ id, data, savedList }) => {\n\tif (store.getters['product/isBaseList'] && store.state.product.workingCopyHasChanges) {\n\t\tawait store.dispatch('productlist/unlinkNewComponents', { id, data, savedList });\n\t\tstore.dispatch('productlist/cleanDeletedComponents', { data, savedList });\n\t}\n\t// store.dispatch('productlist/syncComponents', { data });\n\tif (store.getters['product/getDocumentsToMove'].length) {\n\t\tstore.dispatch('productlist/moveDocumentsToTargetList', {\n\t\t\tdocumentsToMove: store.getters['product/getDocumentsToMove'],\n\t\t\tdata,\n\t\t\tsavedList\n\t\t});\n\t\tstore.dispatch('product/clearMoveDocuments');\n\t}\n});\n\n// re-set available lists in product store after account switch or login\nEventBus.on('auth.updateLists', () => {\n\tconst allLists = store.getters['auth/user/roles/getAvailableLists'];\n\tstore.commit('product/setAllLists', { lists: allLists });\n});\n\n// check and refresh user token and login\nEventBus.on('checkToken', async() => {\n\tawait store.dispatch('auth/login/refreshTokenAndLogin');\n});\n","import Vue from 'vue';\nimport { library } from '@fortawesome/fontawesome-svg-core';\nimport { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';\nimport {\n\tfaSave,\n\tfaWindowRestore,\n\tfaSearch,\n\tfaTimes,\n\tfaPencilAlt,\n\tfaPlus,\n\tfaPlusCircle,\n\tfaCircle,\n\tfaCheckCircle,\n\tfaTimesCircle,\n\tfaTrashAlt,\n\tfaCheckSquare,\n\tfaSquareFull,\n\tfaGlobe,\n\tfaGlobeEurope,\n\tfaUserCircle,\n\tfaStar,\n\tfaLock,\n\tfaArrowCircleUp,\n\tfaArrowCircleDown,\n\tfaClock,\n\tfaCalendar,\n\tfaTrash,\n\tfaCog,\n\tfaFilter,\n\tfaBars,\n\tfaEye\n} from '@fortawesome/free-solid-svg-icons';\n\nlibrary.add(\n\tfaSave,\n\tfaWindowRestore,\n\tfaSearch,\n\tfaTimes,\n\tfaPencilAlt,\n\tfaPlus,\n\tfaPlusCircle,\n\tfaCircle,\n\tfaCheckCircle,\n\tfaTimesCircle,\n\tfaTrashAlt,\n\tfaCheckSquare,\n\tfaSquareFull,\n\tfaGlobe,\n\tfaGlobeEurope,\n\tfaUserCircle,\n\tfaStar,\n\tfaLock,\n\tfaArrowCircleUp,\n\tfaArrowCircleDown,\n\tfaClock,\n\tfaCalendar,\n\tfaTrash,\n\tfaCog,\n\tfaFilter,\n\tfaBars,\n\tfaEye\n);\n\nVue.component('VIcon', FontAwesomeIcon);\n","import Vue from 'vue';\n\nVue.directive('visible', function(el, binding) {\n\tel.style.visibility = binding.value ? 'visible' : 'hidden';\n});\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"custom-view-wrapper\"},[_c('h2',{staticClass:\"dg-title\"},[_vm._v(\" \"+_vm._s(_vm.t('default.dialog.save'))+\" \")]),(_vm.options.html)?_c('div',{staticClass:\"dg-content\",domProps:{\"innerHTML\":_vm._s(_vm.messageBody)}}):_c('div',{staticClass:\"dg-content\"},[_vm._v(\" \"+_vm._s(_vm.messageBody)+\" \")]),_c('br'),_c('b-button',{attrs:{\"variant\":\"success\"},on:{\"click\":function($event){return _vm.handleSave()}}},[_vm._v(\" \"+_vm._s(_vm.t('default.dialog.save'))+\" \")]),_c('b-button',{staticClass:\"ml-3\",attrs:{\"variant\":\"danger\"},on:{\"click\":function($event){return _vm.handleDismiss()}}},[_vm._v(\" \"+_vm._s(_vm.t('default.dialog.discard'))+\" \")]),_c('b-button',{staticClass:\"ml-3\",on:{\"click\":function($event){return _vm.handleCancel()}}},[_vm._v(\" \"+_vm._s(_vm.t('default.dialog.cancel'))+\" \")])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./SaveDialog.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./SaveDialog.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./SaveDialog.vue?vue&type=template&id=f7a627ae&scoped=true\"\nimport script from \"./SaveDialog.vue?vue&type=script&lang=js\"\nexport * from \"./SaveDialog.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"f7a627ae\",\n null\n \n)\n\nexport default component.exports","import store from '../store/main.js';\nimport { setToken } from './jwt-cache.js';\nimport Vue from 'vue';\nimport jwtDecode from 'jwt-decode';\nimport EventBus from '@/util/eventbus.js';\nimport { CommitSha } from './env.js';\nimport { log } from './request';\n\nfunction checkForMaintenance(e) {\n\tif (!e || !e.message) return false;\n\tif (e.message.includes('service is currently not available. check back later')) {\n\t\tstore.commit('base/setIsMaintenance');\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction getExtraLogData() {\n\treturn {\n\t\tua: navigator.userAgent,\n\t\tlang: navigator.language,\n\t\tplat: navigator.platform,\n\t\tloc: window.location.href,\n\t\tsx: screen.width,\n\t\tsy: screen.height,\n\t\tapp: 'bmle',\n\t\tbuild: CommitSha\n\t};\n}\n\nasync function logError(data) {\n\ttry {\n\t\tawait log({ ...data, ...getExtraLogData() });\n\t} catch (e) {\n\t\tconsole.log('error during error logging', e);\n\t}\n}\n\nexport default async function init() {\n\n\t// error handling\n\tVue.config.errorHandler = function(error) {\n\t\tcheckForMaintenance(error);\n\t\tconsole.error('vue.errorHandler', error);\n\t\tif (process.env.NODE_ENV !== 'production') EventBus.$emit('error', error);\n\t};\n\tVue.config.warnHandler = function(error) {\n\t\tcheckForMaintenance(error);\n\t\tconsole.warn('vue.warnHandler', error);\n\t\tif (process.env.NODE_ENV !== 'production') EventBus.$emit('warning', error);\n\t};\n\twindow.addEventListener('unhandledrejection', event => {\n\t\tcheckForMaintenance(event.reason);\n\t\tconsole.log('unhandledRejection', event);\n\t});\n\twindow.onerror = function(message, source, lineno, colno, error) {\n\t\tconsole.log('window.onerror', error);\n\t\tEventBus.$emit('error', error);\n\t\tlet maintenance = checkForMaintenance(error);\n\t\tif (!maintenance) {\n\t\t\tlogError({ message, source, lineno, colno, error });\n\t\t}\n\t};\n\n\tif (store.getters['auth/login/isLoggedIn']) {\n\t\tlet token = store.getters['auth/login/getCurrentToken'];\n\t\tlet { exp } = jwtDecode(token);\n\t\tif (exp > ~~(Date.now()/1000)) {\n\t\t\tsetToken(token);\n\t\t\tif (store.getters['auth/login/hasAccountSelected']) {\n\t\t\t\tstore.dispatch('auth/user/loadAccounts');\n\t\t\t\tstore.dispatch('auth/user/loadAccountData');\n\t\t\t}\n\t\t}\n\t}\n\n\twindow.addEventListener('keyup', function(event) {\n\t\tif (event.keyCode === 13) {\n\t\t\tEventBus.emit('globalKeyUp', 'ENTER');\n\t\t}\n\t});\n\n\tawait store.dispatch('auth/login/initApp');\n}\n","import de_DE from './de_DE.json';\nimport en_GB from './en_GB.json';\nimport fr_FR from './fr_FR.json';\nimport sv_SE from './sv_SE.json';\n\nexport const languages = {\n\tde_DE,\n\ten_GB,\n\tfr_FR,\n\tsv_SE\n};\n","// import '@babel/polyfill';\n// import 'mutationobserver-shim';\nimport Vue from 'vue';\nimport { BootstrapVue,IconsPlugin } from 'bootstrap-vue';\nimport VueProgressBar from 'vue-progressbar';\nimport '@/assets/scss/custom.scss';\nimport App from './App.vue';\nimport router from './router';\nimport store from './store/main.js';\nimport './store/hooks.js';\nimport './plugins/icons.js';\nimport './plugins/filters.js';\nimport './plugins/directives.js';\nimport VueI18n from 'vue-i18n';\nimport Vuelidate from 'vuelidate';\nimport VuejsDialog from 'vuejs-dialog';\nimport 'vuejs-dialog/dist/vuejs-dialog.min.css';\nimport SaveDialog from '@/components/Product/SaveDialog.vue';\nimport init from '@/util/initialization.js';\nimport EventBus from '@/util/eventbus.js';\nimport Autocomplete from 'v-autocomplete';\n\nError.stackTraceLimit = Infinity;\nimport { languages } from '@/assets/config/translations/index.js';\n\nconst languageStrings = Object.assign(languages);\n\nVue.use(BootstrapVue);\nVue.use(IconsPlugin);\nVue.use(VueProgressBar, {\n\tthickness: '10px',\n\tcolor: '#2ab561'\n});\n\nVue.use(VueI18n);\nVue.use(Vuelidate);\n\nVue.component('VAutocomplete', Autocomplete);\n\nVue.config.productionTip = false;\n\nexport const i18n = new VueI18n({\n\tlocale: store.state.base.selectedUiLanguage,\n\tfallbackLocale: 'de_DE',\n\tmessages: languageStrings\n});\n\nVue.directive('click-outside', {\n\tbind: (el, binding, vnode) => {\n\t\tel.clickOutsideEvent = function(event) {\n\t\t\tif (!(el == event.target || el.contains(event.target))) {\n\t\t\t\tvnode.context[binding.expression](event);\n\t\t\t}\n\t\t};\n\t\tdocument.body.addEventListener('click', el.clickOutsideEvent);\n\t},\n\tunbind: (el) => {\n\t\tdocument.body.removeEventListener('click', el.clickOutsideEvent);\n\t},\n});\n\nconst VIEW_NAME = 'save-dialog';\n\nVue.use(VuejsDialog, {\n\tview: VIEW_NAME,\n\thtml: true,\n\tloader: true,\n\tokText: 'Ok',\n\tcancelText: 'Abbrechen'\n});\n\nVue.dialog.registerComponent(VIEW_NAME, SaveDialog);\n\ninit();\n\nnew Vue({\n\trouter,\n\tstore,\n\ti18n,\n\trender: h => h(App)\n}).$mount('#app');\n\nconst tokenCheckHandler = () => {\n\tEventBus.emit('checkToken');\n};\n\nwindow.addEventListener('load', tokenCheckHandler);\nwindow.addEventListener('focus', tokenCheckHandler);\n","import Vue from 'vue';\nimport moment from 'moment';\nimport Store from '@/store/main.js';\nimport { i18n } from '@/main';\n\nexport function alphanumericSort(a, b) {\n\tif (a.text < b.text) {\n\t\treturn -1;\n\t}\n\n\tif (a.text > b.text) {\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n\nexport function toDate(dateString) {\n\treturn moment(dateString);\n}\n\nexport function toTimeFormat(date) {\n\tconst format = Store.state.base.userTimeFormat;\n\treturn moment(date).format(format);\n}\n\nexport function toDateFormat(date) {\n\tif (!date) {\n\t\treturn '';\n\t}\n\n\tconst locale = window.navigator.language;\n\treturn moment(date).locale(locale).format('L');\n}\n\nexport function toDateTimeFormat(obj) {\n\tconst format = `L ${Store.state.base.userTimeFormat}`;\n\tconst locale = window.navigator.language;\n\treturn moment(obj).locale(locale).format(format);\n}\n\nVue.filter('dateFormat', toDateFormat);\nVue.filter('timeFormat', toTimeFormat);\nVue.filter('dateTimeFormat', toDateTimeFormat);\n\nexport function toLocale(obj, language, fallbackLanguage) {\n\tconst t = typeof obj;\n\tif (t === 'string' || t === 'number') return obj;\n\tif (t === 'boolean') return booleanDisplay(obj);\n\tif (t === 'object' && obj) {\n\t\tlet best = language || Store.state.product.exports.exportLanguage || Store.state.base.selectedUiLanguage;\n\t\tif (obj[best]) return obj[best];\n\t\tlet fallback = fallbackLanguage || Store.state.base.fallbackLocale;\n\t\tif (obj[fallback]) return obj[fallback];\n\t\tfor (let [ key, value ] of Object.entries(obj)) {\n\t\t\tif (typeof value === 'string' && value.trim().length > 0) {\n\t\t\t\treturn obj[key];\n\t\t\t}\n\t\t}\n\t}\n\treturn '---';\t//undefined / null\n}\nexport function toSortable(str) {\n\tif (typeof str !== 'string') return '';\n\treturn str.toLowerCase()\n\t\t.replace('ö', 'o')\n\t\t.replace('ä', 'a')\n\t\t.replace('ü', 'u');\n}\n\nVue.filter('toLocale', toLocale);\n\nexport function booleanDisplay(obj) {\n\tlet booleanValue = false;\n\tif (typeof obj !== 'undefined') {\n\t\tbooleanValue = obj;\n\t}\n\n\tif (booleanValue) {\n\t\treturn i18n.t('admin.crud.yes');\n\t}\n\n\treturn i18n.t('admin.crud.no');\n}\n\nVue.filter('toBooleanDisplay', booleanDisplay);\n\nexport function invoiceFlagDisplay(product, timeline, flag, returnDate) {\n\tif (!product || !product.data.invoiceFlags || !product.data.invoiceFlags[flag]) {\n\t\treturn '';\n\t}\n\n\tif (!returnDate) {\n\t\tconst flagDisplay = Store.getters['selectoptions/byId'](flag);\n\t\tif (flagDisplay) {\n\t\t\treturn toLocale(flagDisplay.data.title);\n\t\t}\n\n\t\treturn '';\n\t}\n\n\tif (timeline) {\n\t\tconst rev = product.data.invoiceFlags[flag];\n\t\tconst entry = timeline.find(f => f.rev === rev);\n\t\tif (entry) {\n\t\t\treturn toDateTimeFormat(entry.updated);\n\t\t}\n\t}\n\n\treturn '';\n}\n\nVue.filter('toTabDisplay', function(tab) {\n\treturn i18n.t(`product.tabTitles.${tab}`);\n});\n\nfunction genericDisplay(baseData, entry) {\n\tif (!baseData || baseData.length === 0) return '';\n\tconst actualEntry = baseData.find(x => x.id === entry);\n\tif (!actualEntry) return '';\n\treturn toLocale(actualEntry.data.title);\n}\n\nexport function categoryDisplay(category) {\n\treturn genericDisplay(Store.state.category.categories, category);\n}\n\nexport function componentDisplay(component) {\n\treturn genericDisplay(Store.state.component.components, component);\n}\n\nexport function hobbygardenDisplay(entry) {\n\treturn genericDisplay(Store.state.hobbygarden.entries, entry);\n}\n\nexport function treeDisplay(type, value) {\n\tif (type === 'category') {\n\t\treturn categoryDisplay(value);\n\t} else if (type === 'component') {\n\t\treturn componentDisplay(value);\n\t} else if (type === 'hobbygarden') {\n\t\treturn hobbygardenDisplay(value);\n\t}\n\n\treturn value;\n}\n\nexport function selectOptionDisplay(id) {\n\treturn genericDisplay(Store.state.selectoptions.options, id);\n}\n\nexport function countryDisplay(country) {\n\treturn genericDisplay(Store.state.country.countries, country);\n}\n\nexport function regionDisplay(region) {\n\treturn genericDisplay(Store.state.region.regions, region);\n}\n\nexport function labelDisplay(label) {\n\treturn genericDisplay(Store.state.label.labels, label);\n}\n\nexport function roleDisplay(role) {\n\tconst roleEntry = Store.state.companylist.roles.find(f => f === role);\n\tif (roleEntry) {\n\t\treturn i18n.t(`default.companyRoles.${role}`);\n\t}\n\n\treturn '';\n}\n\nexport function biostandardDisplay(value) {\n\tif (value) {\n\t\tlet biostandard = Store.getters['biostandard/byId'](value);\n\t\tif (biostandard) {\n\t\t\treturn toLocale(biostandard.data.name);\n\t\t}\n\t}\n\n\treturn '-';\n}\n\nexport function listDisplay(list) {\n\tconst allLists = Store.state.list.lists;\n\tif (!allLists || allLists.length === 0) return '';\n\tconst currentList = allLists.find(x => x.id === list);\n\tif (!currentList) return '';\n\treturn toLocale(currentList.data.title);\n}\n\nVue.filter('toCategoryDisplay', categoryDisplay);\nVue.filter('toComponentDisplay', componentDisplay);\nVue.filter('toSelectOptionDisplay', selectOptionDisplay);\nVue.filter('toCountryDisplay', countryDisplay);\nVue.filter('toRegionDisplay', regionDisplay);\nVue.filter('toLabelDisplay', labelDisplay);\nVue.filter('toListDisplay', listDisplay);\nVue.filter('toRoleDisplay', roleDisplay);\nVue.filter('toBiostandardDisplay', biostandardDisplay);\n\nVue.filter('toNumberFormat', function(val) {\n\tif (typeof val !== 'number') return val;\n\tlet formatter = new Intl.NumberFormat(Store.state.base.selectedUiLanguage.replace('_', '-'), {\n\t\tstyle: 'percent',\n\t\tminimumFractionDigits: 3\n\t});\n\treturn formatter.format(val / 100.0);\n});\n\nexport function accountDisplay(accountId) {\n\tconst account = Store.getters['auth/admin/getAccountById'](accountId);\n\n\tif (account) {\n\t\treturn account.data.staticData.fullname;\n\t}\n\n\treturn '';\n}\n\nVue.filter('toAccountDisplay', accountDisplay);\n","import { get, post } from '@/util/request.js';\nimport { getToken } from '@/util/jwt-cache.js';\n\nexport async function listAccountsForUser() {\n\tif (!getToken()) return [];\n\tlet list = await get('auth/domain/listaccounts');\n\treturn list;\n}\n\nexport async function switchAccount(accountId) {\n\tconst payload = { account: accountId };\n\tconst data = await post('auth/account/switchaccount', payload);\n\treturn data;\n}\n\nexport async function registerWithDomainByInvite(inviteId, registrationName, token) {\n\tconst payload = {\n\t\tinviteId,\n\t\tregistrationName,\n\t\tuserData: {},\n\t\ttoken\n\t};\n\tlet { account } = await post('auth/domain/register', payload);\n\treturn account;\n}\n\nexport function refreshToken() {\n\treturn post('auth/account/refreshtoken');\n}\n\nexport function getAccountDetails() {\n\treturn get('auth/account/getaccount');\n}\n\nexport function unregisterAccount(account) {\n\treturn post('auth/account/unregisterwithaccount', { account });\n}\n\nexport function unregisterOtherAccount(account, ssoUser) {\n\treturn post('auth/accountmanage/unlinkaccount', { account, ssoUser });\n}\n\nexport function getUserInfos(ids) {\n\treturn post('auth/keycloak/getuserinfos', { userIds: ids });\n}\n\nexport function updateAccount(data) {\n\treturn post('auth/account/updateaccount', data);\n}\n\nexport function loginToDomain(token, useAccount) {\n\tlet p = { token };\n\tif (useAccount) p.useAccount = useAccount;\n\treturn post('auth/domain/login', p);\n}\n\nexport function createNewAccount({ registrationName, requiresConfirmation, userData, staticData }) {\n\treturn post('auth/accountmanage/createaccount', {\n\t\tregistrationName, requiresConfirmation, userData, staticData\n\t});\n}\n\nexport function updateExistingAccount({ active, account, userData, staticData, maxUsers }) {\n\treturn post('auth/accountmanage/updateaccount', {\n\t\tactive, account, userData, staticData, maxUsers\n\t});\n}\n\nexport function removeAccount({ account }) {\n\treturn post('auth/accountmanage/removeaccount', {\n\t\taccount\n\t});\n}\n\nexport async function createAccountInvite({ account }) {\n\tlet { inviteId } = await post('auth/accountmanage/createaccountinvite', {\n\t\taccount\n\t}, getToken());\n\treturn inviteId;\n}\n\nexport function sendInvite({ link, email }) {\n\treturn post('bml/paiduser/sendinvite', { link, email, template: 'generic' }, getToken());\n}\n","import { post as sendPostRequest } from '@/util/request.js';\nimport { search, getEntitiesById } from './system.js';\nimport Store from '@/store/main';\nimport { chunk } from 'lodash';\nimport {toLocale} from '@/plugins/filters';\nimport { createPatch } from 'rfc6902';\n\nexport function getCompanyById(id) {\n\treturn sendPostRequest('bml/company/load', { id });\n}\n\n// add additional index fields\nfunction _updateIndex(entityData, oldData) {\n\tif (oldData && oldData.indexData) {\n\t\tentityData.indexData = JSON.parse(JSON.stringify(oldData.indexData));\n\t}\n\tif (!entityData.indexData) {\n\t\tentityData.indexData = {};\n\t}\n\t// country for main address\n\tconst mainAddress = entityData.addresses.find(f => f.type === 'main');\n\tif (mainAddress && mainAddress.country) {\n\t\tconst country = Store.getters['country/byId'](mainAddress.country);\n\t\tif (country) {\n\t\t\tentityData.indexData.country = toLocale(country.data.title);\n\t\t}\n\t}\n\t// owner\n\tconst owner = entityData.baseData.owner;\n\tif (owner) {\n\t\tconst institution = Store.getters['auth/org/byId'](owner);\n\t\tif (institution) {\n\t\t\tentityData.indexData.owner = institution.data.title;\n\t\t}\n\t}\n}\n\nexport async function createCompany(entityclass, attributeset, data) {\n\t_updateIndex(data);\n\tlet createdEntity = await sendPostRequest('bml/company/create', data);\n\treturn createdEntity;\n}\n\nexport function updateProductsAfterMerge(companyIds) {\n\treturn sendPostRequest('bml/company/updateProductsAfterMerge', companyIds);\n}\n\nexport function updateCompany(oldEntity, newData, changeset) {\n\t_updateIndex(newData, oldEntity.data);\n\tif (!oldEntity) {\n\t\treturn null;\n\t}\n\tconst patch = createPatch(oldEntity.data, newData);\n\tif (patch.length === 0) {\n\t\treturn null;\n\t}\n\tlet payload = {\n\t\tid: oldEntity.id,\n\t\trev: oldEntity.rev,\n\t\tpatch\n\t};\n\tif (changeset && changeset !== oldEntity.attributeset) {\n\t\tpayload.changeset = changeset;\n\t}\n\treturn sendPostRequest('bml/company/save', payload);\n}\n\nexport async function deleteCompany(id) {\n\tlet deletedEntity = await sendPostRequest('eav/entity/disable', id);\n\treturn deletedEntity.id;\n}\n\nexport function searchCompanies(entityclassId, filter, pagination, sort) {\n\treturn search(entityclassId, filter, pagination, sort);\n}\n\nexport async function getCompaniesByIds(entityclassId, companyIds) {\n\tlet result = [];\n\tconst CHUNK_SIZE = 500;\n\tconst chunks = chunk(companyIds, CHUNK_SIZE);\n\tfor (const chunk of chunks) {\n\t\tconst tempResult = await getEntitiesById(chunk);\n\t\tresult = result.concat(tempResult);\n\t}\n\treturn result;\n}\n\nexport async function aggregateSearch({ attributeFilter }) {\n\tconst endpoint = 'bml/company/aggregate';\n\tlet result = await sendPostRequest(endpoint, { attributeFilter });\n\treturn result;\n}\n","import { get as sendGetRequest, post as sendPostRequest } from '@/util/request.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId, getEntityById } from './system.js';\nimport { base64EncodeFile, base64DecodeFile } from '@/util/document-helper.js';\n\nlet entityClassId, attributeSetId;\n\nasync function init() {\n\tif (!entityClassId) {\n\t\tlet entityClass = await getEntityclassByExternalId('uploaded');\n\t\tentityClassId = entityClass.id;\n\t}\n\tif (!attributeSetId) {\n\t\tlet attributeSet = await getAttributesetByExternalId('uploaded');\n\t\tattributeSetId = attributeSet.id;\n\t}\n}\n\nasync function encodeFile(fileContent) {\n\tlet encodedFile = await base64EncodeFile(fileContent);\n\tif (encodedFile.length > 32 * 1024 * 1024) {\n\t\tthrow new Error('File size cannot be above 32 MB.');\n\t}\n\treturn encodedFile;\n}\n\nasync function createHash(data) {\n\tlet hash = await crypto.subtle.digest('sha-1', data);\n\treturn buf2hex(hash);\n}\nfunction buf2hex(buffer) {\n\treturn [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, '0')).join('');\n}\n\nexport async function createDocument(fileContent, fileName, flags) {\n\tawait init();\n\n\tlet encoder = new TextEncoder();\n\tlet encodedFile = encoder.encode(fileContent);\n\tif (encodedFile.length > 32 * 1024 * 1024) {\n\t\tthrow new Error('File size cannot be above 24MB.');\n\t}\n\tlet hashedFile = await createHash(encodedFile);\n\n\tlet documentConfig = {\n\t\tentityclass: entityClassId,\n\t\tattributeset: attributeSetId,\n\t\tdata: {\n\t\t\tfileName,\n\t\t\thash: hashedFile,\n\t\t\tflags\n\t\t}\n\t};\n\n\tlet documentEntity = await sendPostRequest('eav/entity/create', documentConfig);\n\tlet attachmentResponse;\n\ttry {\n\t\tattachmentResponse = await sendPostRequest('eav/entity/setattachment', {\n\t\t\trev: documentEntity.rev,\n\t\t\tid: documentEntity.id,\n\t\t\tattachment: await base64EncodeFile(fileContent),\n\t\t});\n\t} catch (e) {\n\t\tawait sendPostRequest('eav/entity/delete', { id: documentEntity.id });\n\t\tthrow new Error(`Upload of attachment failed: ${fileName}.`);\n\t}\n\treturn attachmentResponse;\n}\n\nexport async function getDocument(id, fileName) {\n\tlet document = await getEntityById(id);\n\tlet attachment = await sendGetRequest('eav/entity/getattachment', { id });\n\tif (!attachment) {\n\t\tthrow new Error(`File with name ${fileName} not found`);\n\t}\n\tObject.defineProperty(document, 'file', {\n\t\tget() {\n\t\t\treturn base64DecodeFile(attachment, fileName);\n\t\t}\n\t});\n\treturn document;\n}\n\nexport async function findIdentical(file) {\n\treturn null;\n}\n\nexport async function getDecodedAttachment(id, rev, fileName) {\n\tlet params = { id };\n\tif (rev) params.rev = rev;\n\tlet attachment = await sendGetRequest('eav/entity/getattachment', params);\n\tif (!attachment) return null;\n\treturn base64DecodeFile(attachment, fileName);\n}\n\nexport async function setAttachment(entity, fileContent) {\n\tawait init();\n\tlet encodedFile = await encodeFile(fileContent);\n\tconsole.log('file content?', encodedFile);\n\tlet attachmentResponse;\n\ttry {\n\t\tlet params = {\n\t\t\trev: entity.rev,\n\t\t\tid: entity.id,\n\t\t\tattachment: encodedFile\n\t\t};\n\t\tattachmentResponse = await sendPostRequest('eav/entity/setattachment', params);\n\t} catch (e) {\n\t\tthrow new Error('File upload failed.');\n\t}\n\treturn attachmentResponse;\n}\n\nexport async function createDocumentFromFile(file, companyId) {\n\tconst fileContent = await readFile(file);\n\treturn createDocument(fileContent, file.name, companyId);\n}\n\nfunction readFile(file){\n\treturn new Promise((res, rej) => {\n\t\tlet r = new FileReader();\n\t\tr.readAsDataURL(file);\n\t\tr.onload = () => res(r.result);\n\t\tr.onerror = rej;\n\t});\n}\n\nexport function getAttachment(id, rev) {\n\treturn sendGetRequest('eav/entity/getattachment', { id, rev });\n}","import { get, post } from '@/util/request.js';\nimport { search, genericEntityUpdate, genericEntityCreate } from './system.js';\n\nexport function createField(data, entityclassId, attributesetId) {\n\treturn genericEntityCreate(entityclassId, attributesetId, data);\n}\n\nexport function getAllFields(entityclassId) {\n\treturn search(entityclassId);\n}\n\nexport function updateField(oldEntry, newData, set) {\n\treturn genericEntityUpdate(oldEntry, newData, set);\n}\n\nexport async function deleteField(id) {\n\tlet field = await post('eav/entity/disable', id);\n\n\treturn field.id;\n}\n\nexport async function hasDuplicatePaths(entityclass, path, id) {\n\tlet pathFilter = {\n\t\t'field': '/data/path',\n\t\t'comparison': 'eq',\n\t\t'value': path\n\t};\n\tlet idFilter = id ? { $not: {\n\t\t'field': '/id',\n\t\t'comparison': 'eq',\n\t\t'value': id\n\t} } : null;\n\n\tlet filter = idFilter ? {\n\t\t$and: [ pathFilter, idFilter ]\n\t} : pathFilter;\n\tlet searchRequest = {\n\t\tentityClass: entityclass,\n\t\tattributeFilter: filter\n\t};\n\n\tconst count = await get('search/search/count', searchRequest);\n\treturn count > 0;\n}\n","import { post } from '@/util/request.js';\nimport { genericEntityUpdate } from './system.js';\n\nexport async function createFromProducts(invoiceData) {\n\tlet invoice = await post('bml/invoice/createFromProducts', invoiceData);\n\treturn invoice;\n}\n\nexport function updateInvoice(oldEntry, newData, set) {\n\treturn genericEntityUpdate(oldEntry, newData, set);\n}\n\nexport function deleteSelection(attributeFilter) {\n\treturn post('bml/invoice/deleteInvoices', { attributeFilter });\n}\n\nexport function sendSelection(attributeFilter) {\n\treturn post('bml/invoice/sendInvoices', { attributeFilter });\n}\n\nexport async function findInvoicedSpecialItems({ ids, institutionId }) {\n\tconst endpoint = 'bml/invoice/findinvoicedspecialitems';\n\tlet result = await post(endpoint, { ids, institutionId });\n\treturn result;\n}\n\nexport async function markForUnindex({ productId, listId, institutionId }) {\n\tconst endpoint = 'bml/invoice/markforunindex';\n\tlet result = await post(endpoint, { productId, listId, institutionId });\n\treturn result;\n}\n\nexport async function markAsPseudoSent(attributeFilter) {\n\tconst endpoint = 'bml/invoice/markinvoicesaspseudosent';\n\tlet result = await post(endpoint, { attributeFilter });\n\treturn result;\n}\n","import { get, post } from '@/util/request.js';\n\nfunction sleep(ms) {\n\treturn new Promise(function(resolve) {\n\t\tsetTimeout(resolve, ms);\n\t});\n}\n\nexport async function waitForTicket(ticketNumber, waitingInterval) {\n\tlet start = Date.now();\n\tdo {\n\t\tlet { done, result, error } = await get('bml/product/getpdfandstatus', { ticketNumber }, null, null, null, true);\n\t\tif (error) throw new Error(error.message ? error.message : error);\n\t\tif (done) return result;\n\t\tawait sleep(waitingInterval || 1000);\n\t} while (Date.now() - start < 1000 * 60 * 45);\n\tthrow new Error('timeout on retrieving pdf');\n}\n\nexport function createInvoicePdf(params) {\n\treturn post('bml/invoice/createinvoicepdf', params);\n}\n\nexport async function createPrintReportPdf({ attributeFilter, listId, language, standard, reportType, productId, contactPerson, dateTime } ) {\n\tlet { ticket } = await post('bml/product/pdfprintreport', { attributeFilter, listId, language, standard, reportType, productId, contactPerson, dateTime });\n\treturn ticket;\n}\n\nexport async function createReregistrationPdf({ attributeFilter, listId, biologicalGardeningListId, language, standard, reportType, company, institution } ) {\n\tlet { ticket } = await post('bml/product/pdfreregistration', { attributeFilter, listId, biologicalGardeningListId, language, standard, reportType, company, institution });\n\treturn ticket;\n}\n\nexport async function getReregistrationSummary({ attributeFilter, listId, biologicalGardeningListId, language, standard, reportType, institution } ) {\n\tlet summary = await post('bml/product/pdfreregistrationsummary', { attributeFilter, listId, biologicalGardeningListId, language, standard, reportType, institution });\n\treturn summary;\n}\n\nexport async function* waitForMultiple(tickets) {\n\tfor (let entry of tickets) {\n\t\ttry {\n\t\t\tlet pdf = await waitForTicket(entry.ticket);\n\t\t\tyield { pdf, id: entry.id, name: entry.name };\n\t\t} catch (e) {\n\t\t\tyield { error: e, id: entry.id, name: entry.name };\n\t\t}\n\t}\n}\n","import { get, post } from '@/util/request.js';\nimport { createPatch } from 'rfc6902';\nimport EventHub from '@/util/eventbus.js';\nimport { disablePresence } from '@/util/env.js';\nimport { doNotMergePaths, listOfPathsForDeepLinking } from '@/store/modules/product';\nimport { doNotUnlinkNewLists } from '@/util/component-helper';\n// import { createNotesOnProduct } from '@/util/notes-watcher';\nimport BmlCommon from '@fibl/bml-common';\n\nconst cache = new Map();\n\nexport function clearProductCache() {\n\tconsole.debug('clearing items from product cache', cache.size);\n\tcache.clear();\n}\n\nexport function addToProductCache(p) {\n\tcache.set(p.id, p);\n}\n\nexport async function loadProductWithCache(productId) {\n\tlet entity;\n\tif (cache.has(productId)) {\n\t\tentity = cache.get(productId);\n\t} else {\n\t\tentity = await loadProduct(productId);\n\t}\n\treturn JSON.parse(JSON.stringify(entity));\n}\n\nexport async function loadProduct(productId, rev) {\n\tlet payload = { 'id': productId };\n\tif (rev) {\n\t\tpayload.rev = rev;\n\t}\n\n\tconst entity = await get('bml/product/load', payload);\n\tcache.set(entity.id, entity);\n\treturn entity;\n}\n\nasync function saveProduct(id, rev, patch, attempt, oldSet, changeset) {\n\t// console.log('patch', patch);\n\t// return cache.get(id);\n\ttry {\n\t\tlet payload = { id, rev, patch };\n\t\tif (changeset && changeset !== oldSet) {\n\t\t\tpayload.changeset = changeset;\n\t\t}\n\t\tlet entity = await post('bml/product/save', payload, null, true);\n\t\tif (entity) {\n\t\t\tcache.set(entity.id, entity);\n\t\t}\n\t\treturn entity;\n\t} catch (e) {\n\t\tif (e.message.match(/1560950549/) === null) {\t//check for error code targeting rev\n\t\t\tthrow e;\n\t\t}\n\t\tlet newEnt = await loadProduct(id);\n\t\tif (attempt >= 2) {\n\t\t\tthrow new Error('unable to save after 3 attempts, giving up.');\n\t\t}\n\t\treturn saveProduct(id, newEnt.rev, patch, attempt+1, oldSet, changeset);\n\t}\n}\n\nexport async function saveProductWrap(productId, data, changeset, withPatch) {\n\tlet oldEntity = cache.get(productId);\n\tif (!oldEntity) oldEntity = await loadProductWithCache(productId);\n\t// console.log('create patch for ', JSON.stringify(data, null, 2));\n\tlet patch = createPatch(oldEntity.data, data);\n\tif (patch.length === 0) {\n\t\treturn withPatch ? { entity: oldEntity, patch: [] } : null;\n\t}\n\tlet entity = await saveProduct(oldEntity.id, oldEntity.rev, patch, 0, oldEntity.attributeset, changeset);\n\t// console.log('nach dem Speichern im repo: ', entity);\n\tif(withPatch) {\n\t\treturn { entity, patch };\n\t}\n\treturn entity;\n}\n\nexport async function syncListData(productId, listId, newData, changeset) {\n\tlet entity = cache.get(productId);\n\tif (!entity) {\n\t\tconsole.warn('expected product in cache but got nothing', { productId, listId, newData });\n\t\tentity = await loadProduct(productId);\n\t}\n\tlet data = JSON.parse(JSON.stringify( entity.data ));\n\tdata.listData[listId] = newData;\n\tawait EventHub.emit('beforeProductSaveAllLists', { id: productId, data, savedList: listId });\n\tlet newEntity = await saveProductWrap(productId, data, changeset, true);\n\tif (!newEntity.entity) {\n\t\tnewEntity.entity = await loadProduct(productId);\n\t\tif (newEntity.entity.rev === entity.rev) return null;\n\t}\n\tconst savedData = newEntity.entity.data.listData[listId];\n\tconst patch = newEntity.patch;\n\treturn { savedData, patch };\n}\n\nfunction setNewDerivedProductData(data, derivedProduct, fieldByPath, getDefaultValue) {\n\tfor (let [ listId, listData ] of Object.entries(data.listData)) {\n\t\tif (!listData._linked || !Object.keys(listData._linked).length) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (let [ fieldName, fieldValue ] of Object.entries(listData._linked)) {\n\t\t\tif (fieldValue !== 'related-product' || doNotMergePaths.includes(fieldName) || listOfPathsForDeepLinking.includes(fieldName)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (derivedProduct.data.listData[listId] && fieldName in derivedProduct.data.listData[listId]) {\n\t\t\t\tlistData[fieldName] = derivedProduct.data.listData[listId][fieldName];\n\t\t\t} else {\n\t\t\t\tlet field = fieldByPath(fieldName);\n\t\t\t\tlistData[fieldName] = getDefaultValue(field.id);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport async function setDerivedProductId(id, derivedProductId, changeset, fieldByPath, getDefaultValue) {\n\tlet oldEntity = await loadProductWithCache(id);\n\tif (!oldEntity || !oldEntity.data) {\n\t\treturn false;\n\t}\n\tlet data = JSON.parse(JSON.stringify(oldEntity.data));\n\n\tif (derivedProductId) {\n\t\tdata.derivedProductId = derivedProductId;\n\t} else {\n\t\tfor (let listData of Object.values(data.listData)) {\n\t\t\tif (listData._linked) {\n\t\t\t\tfor (let [ entryName, linkedEntry] of Object.entries(listData._linked)) {\n\t\t\t\t\tif (linkedEntry === 'related-product') {\n\t\t\t\t\t\tlistData._linked[entryName] = 'direct';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdelete data.derivedProductId;\n\t}\n\tif (oldEntity.data.derivedProductId && oldEntity.data.derivedProductId !== derivedProductId && derivedProductId) {\n\t\tlet derivedProduct = await loadProductWithCache(derivedProductId);\n\t\tif (derivedProduct) {\n\t\t\tsetNewDerivedProductData(data, derivedProduct, fieldByPath, getDefaultValue);\n\t\t}\n\t}\n\n\tlet entity = await saveProductWrap(id, data, changeset);\n\treturn entity;\n}\n\nexport async function resetNationalPartnerStatus(id, changeset) {\n\tconst oldEntity = await loadProductWithCache(id);\n\tif (!oldEntity || !oldEntity.data) {\n\t\treturn false;\n\t}\n\tlet data = JSON.parse(JSON.stringify(oldEntity.data));\n\tdelete data.isNationalPartner;\n\n\tlet entity = await saveProductWrap(id, data, changeset);\n\treturn entity;\n}\n\nexport async function setListArchived(id, listId, archived, changeset) {\n\tlet oldEntity = cache.get(id);\n\tlet data = JSON.parse(JSON.stringify(oldEntity.data));\n\tdata.listData[listId]._archived = archived;\n\n\tlet entity = await saveProductWrap(id, data, changeset);\n\treturn entity;\n}\n\nexport async function searchProducts(filter, pagination, sorting) {\n\tconst endpoint = 'bml/product/search';\n\tlet searchRequest = {};\n\n\tif (pagination) {\n\t\tsearchRequest.pagination = pagination;\n\t}\n\n\tif (sorting) {\n\t\tsearchRequest.sorting = sorting;\n\t}\n\n\tif (filter) searchRequest.attributeFilter = filter;\n\tlet result = await post(endpoint, searchRequest);\n\treturn result.list;\n}\n\nexport async function listProductsForOwner(\n\tfilter,\n\tids,\n\tsorting,\n\tpagination,\n){\n\tlet params = {};\n\tif (filter) params.attributeFilter = filter;\n\telse if (ids) {\n\t\tparams.attributeFilter = {\n\t\t\t$or: ids.map((id) => ({ field: '/id', comparison: 'eq', value: id })),\n\t\t};\n\t}\n\tif (pagination) params.pagination = pagination;\n\telse params.pagination = { start: 0, limit: 15 };\n\tif (sorting) params.sorting = sorting;\n\tlet res = await post(\n\t\t`${SERVICE}/portal/listownedproducts`,\n\t\tparams,\n\t);\n\tlet products = res.list.map((entity) => {\n\t\tlet model = new BmlCommon.ProductClass();\n\t\tmodel.fromStorage(entity);\n\t\treturn model;\n\t});\n\treturn { list: products, count: res.count };\n}\n\nexport async function countProducts(filter) {\n\tconst endpoint = 'bml/product/count';\n\tlet searchRequest = {};\n\tif (filter) searchRequest.attributeFilter = filter;\n\tlet result = await post(endpoint, searchRequest);\n\treturn result;\n}\n\nexport async function createProduct(data) {\n\tlet entity = await post('bml/product/create', {}, null, true);\n\tcache.set(entity.id, entity);\n\ttry {\n\t\tentity = await saveProductWrap(entity.id, data);\n\t} catch (e) {\n\t\tawait deleteProduct(entity.id);\n\t\tthrow e;\n\t}\n\treturn entity;\n}\n\nexport async function deleteProduct(id) {\n\tlet deletedEntity = await post('bml/product/deleteproduct', id);\n\treturn deletedEntity.id;\n}\n\nexport async function getProductTimeline(id) {\n\tlet timeline = await get('bml/product/gettimeline', id);\n\n\treturn timeline;\n}\n\nexport async function updatePresenceStatus(section, name, id) {\n\tif (disablePresence) return [];\n\tconst presentUsers = await post('bml/presence/update', { section, id, name }, null, false, true, true);\n\treturn presentUsers;\n}\n\nconst doNotCopyForNewList = [\n\t'_companies',\n\t'_components',\n\t'_documents',\n\t'_notes',\n\t'deactivatedBy',\n\t'deactivatedOn',\n\t'_active',\n\t'_checklist',\n\t'_nameHistory',\n\t'_responsible',\n\t'_approval',\n\t'_invoiceSpecialItems'\n];\nconst doNotLinkInNewList = [\n\t'_categoryTree',\n\t'_display',\n\t'_risklabels',\n\t'_hobbygardenTree',\n\t'_preventPublicDisplay'\n];\n// Adds and persists an list to an given product without changing an working copy.\n// This must be done in sync with updating the product state.\nexport async function addList(productId, listId, baseListId, attributesetId, accountId, fieldsEmptyInList) {\n\t// fetch the product from the server\n\tconst product = await loadProductWithCache(productId);\n\tif (!product || !product.data || !product.data.listData) {\n\t\tthrow new Error('listdata not found');\n\t}\n\n\t// list may already exist. prevent execution.\n\tif (product.data.listData[listId]) {\n\t\tthrow new Error('listdata already exists');\n\t}\n\n\t// add the new list.\n\tconst newData = JSON.parse(JSON.stringify(product.data));\n\tconst newList = newData.listData[listId] = {\n\t\tactivatedOn: {\n\t\t\tdateValue: new Date().toJSON().substr(0, 10)\n\t\t},\n\t\tactivatedBy: accountId\n\t};\n\n\t// unlink declared fields\n\tif (fieldsEmptyInList && fieldsEmptyInList.length) {\n\t\tnewList._linked = {};\n\t\tfor (const field of fieldsEmptyInList) {\n\t\t\tif (!field.emptyInLists || !field.emptyInLists.includes(listId)) continue;\n\t\t\tnewList[field.path] = field.defaultValue;\n\t\t\tnewList._linked[field.path] = 'direct';\n\t\t}\n\t}\n\n\t// unlink component fields\n\tif (newData.listData[baseListId]._components && (newData.listData[baseListId]._components.base || newData.listData[baseListId]._components.additional)\n\t\t&& !doNotUnlinkNewLists.includes(listId)) {\n\t\tnewList._components = { base: [], additional: [] };\n\t\tconst unlinkNewComponents = function(newData, baseListId, listId, type) {\n\t\t\tif (newData.listData[baseListId]._components[type] && newData.listData[baseListId]._components[type].length) {\n\t\t\t\tfor (const baseListComponent of newData.listData[baseListId]._components[type]) {\n\t\t\t\t\tlet baseListSecrecy = baseListComponent.secrecy ? baseListComponent.secrecy.selectValue : null;\n\t\t\t\t\tconst unlinkedComponent = {\n\t\t\t\t\t\tsecrecy: {\n\t\t\t\t\t\t\tselectValue: baseListSecrecy === 'base-data-responsible' ? 'base-data-responsible' : 'core-partners'\n\t\t\t\t\t\t},\n\t\t\t\t\t\t_id: baseListComponent._id\n\t\t\t\t\t};\n\t\t\t\t\tnewList._components[type].push(unlinkedComponent);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tunlinkNewComponents(newData, baseListId, listId, 'base');\n\t\tunlinkNewComponents(newData, baseListId, listId, 'additional');\n\t}\n\n\tlet baseList = product.data.listData[baseListId];\n\tif (baseList) {\n\t\tObject.entries(baseList).forEach(([k, v]) => {\n\t\t\tif (doNotCopyForNewList.includes(k) || k in newList) return;\n\t\t\tnewList[k] = v;\n\t\t\tif (!doNotLinkInNewList.includes(k)) {\n\t\t\t\tnewList._linked[k] = 'basis';\n\t\t\t}\n\t\t});\n\t}\n\n\t// patch the product (e. g. add the new list object).\n\tlet patch = createPatch(product.data, newData);\n\tif (patch.length === 0) {\n\t\tthrow new Error('no patch created');\n\t}\n\n\t// send the patch to the server and return an success value.\n\tconst entity = await saveProduct(product.id, product.rev, patch, 0, product.attributeset, attributesetId);\n\treturn entity.data.listData[listId];\n}\n\nexport function moveList(params) {\n\treturn post('bml/product/movelist', params);\n}\n\nexport async function aggregateSearch({ attributeFilter, targetField, groupBy, ecName, limit }) {\n\tconst endpoint = 'bml/product/aggregatesearch';\n\tlet result = await post(endpoint, { attributeFilter, targetField, groupBy, ecName, limit });\n\treturn result;\n}\n\nEventHub.on('product.cache.clear', clearProductCache);\n","import { get, post } from '@/util/request.js';\nimport { createPatch } from 'rfc6902';\nimport * as ProductRepo from './product.js';\n\nexport const searchWindow = 250;\nexport const MAX_SEARCH_RESULTS = 9000;\nlet ecListPromise;\n\nfunction getEntityclassList() {\n\treturn get('eav/entityclass/list');\n}\n\nexport async function getEntityclassByExternalId(extId) {\n\tif (!ecListPromise) {\n\t\tecListPromise = getEntityclassList();\n\t}\n\tlet list = await ecListPromise;\n\tlet ec = list.find(e => e.externalId === extId);\n\tif (!ec) throw new Error(`ec not found: ${extId}`);\n\treturn ec;\n}\n\nexport function getAttributesetByExternalId(extId) {\n\treturn get('eav/attribute/getbyexternalid', extId);\n}\n\nexport function getDomain() {\n\treturn get('eav/domain/getbyurl');\n}\n\nexport async function getEntityById(id) {\n\tlet list = await getEntitiesById([id]);\n\treturn list[0];\n}\n\nexport function getEntityFromEav(params) {\n\treturn get('eav/entity/get', params);\n}\n\nexport function getEntitiesById(ids) {\n\tif (!ids || !ids.length || !ids.filter(id => !!id).length) return [];\n\tids = ids.filter(id => !!id);\n\treturn post('search/search/ids', { ids });\n}\n\nexport function genericEntityUpdate(oldEntity, newData, changeset, supe) {\n\tif (!oldEntity) {\n\t\treturn null;\n\t}\n\n\tconst patch = createPatch(oldEntity.data, newData);\n\tif (patch.length === 0) {\n\t\treturn null;\n\t}\n\tlet payload = {\n\t\tid: oldEntity.id,\n\t\trev: oldEntity.rev,\n\t\tpatch\n\t};\n\tif (changeset && changeset !== oldEntity.attributeset) {\n\t\tpayload.changeset = changeset;\n\t}\n\treturn post('eav/entity/updatefrompatch', payload, null, supe);\n}\n\nexport function genericEntityCreate(entityclass, attributeset, data) {\n\treturn post('eav/entity/create', {\n\t\tentityclass,\n\t\tattributeset,\n\t\tdata\n\t});\n}\n\nexport function genericEntityDelete({ id }) {\n\treturn post('eav/entity/delete', { id });\n}\n\nexport function getTimeline(entityId, start, limit) {\n\treturn get('eav/entity/history', {\n\t\tid: entityId,\n\t\tstart,\n\t\tlimit\n\t});\n}\n\nexport function search(entityclass, filter, pagination, sorting) {\n\treturn _search(entityclass, filter, 'post', 'search/search/execute', pagination, sorting);\n}\n\nexport async function _search(entityclass, filter, requestType, endpoint, pagination, sorting, onlyIds) {\n\tlet result = [];\n\tlet searchRequest = {\n\t\tpagination: {\n\t\t\tstart: 0,\n\t\t\tlimit: searchWindow\n\t\t}\n\t};\n\tif (entityclass) searchRequest.entityClass = entityclass;\n\tif (filter) searchRequest.attributeFilter = filter;\n\tif (pagination) searchRequest.pagination = pagination;\n\tif (sorting) searchRequest.sorting = sorting;\n\tif (onlyIds) searchRequest.onlyIds = true;\n\n\tlet temp;\n\tdo {\n\t\tif (!requestType || requestType === 'get') {\n\t\t\ttemp = await get(endpoint, searchRequest);\n\t\t} else {\n\t\t\ttemp = await post(endpoint, searchRequest);\n\t\t}\n\t\tresult = result.concat(temp.list ? temp.list : temp);\n\n\t\tif (!pagination) {\n\t\t\tsearchRequest.pagination.start += searchWindow;\n\t\t}\n\t} while (!pagination && temp && temp.length >= searchWindow && temp.length <= MAX_SEARCH_RESULTS);\n\n\treturn result;\n}\n\nexport async function _searchCursor(entityclass, filter, requestType, endpoint, sorting, onlyIds) {\n\tlet result = [];\n\tlet searchRequest = {};\n\tif (endpoint.substr(0, 4) === 'bml/') {\n\t\tsearchRequest.pagination = { limit: searchWindow };\n\t\tsearchRequest.useCursor = true;\n\t} else {\n\t\tsearchRequest.limit = searchWindow;\n\t}\n\tif (entityclass) {\n\t\tsearchRequest.entityClass = entityclass;\n\t}\n\tif (filter) {\n\t\tsearchRequest.attributeFilter = filter;\n\t}\n\tif (sorting) {\n\t\tsearchRequest.sorting = sorting;\n\t}\n\tif (onlyIds) {\n\t\tsearchRequest.onlyIds = true;\n\t}\n\n\tlet temp;\n\tlet lastCursor;\n\tdo {\n\t\tif (lastCursor) {\n\t\t\tsearchRequest.cursor = [ lastCursor ];\n\t\t}\n\n\t\tif (!requestType || requestType === 'get') {\n\t\t\ttemp = await get(endpoint, searchRequest);\n\t\t} else {\n\t\t\ttemp = await post(endpoint, searchRequest);\n\t\t}\n\n\t\tif (temp.cursor && temp.cursor.length > 0) {\n\t\t\tlastCursor = temp.cursor[0];\n\t\t}\n\n\t\tresult = result.concat(temp.list);\n\t} while (lastCursor && temp && temp.list.length >= searchWindow);\n\n\treturn result;\n}\n\nexport async function* searchCursorWithGenerator(entityclass, filter, requestType, endpoint, sorting, idsOnly) {\n\tlet searchRequest = {};\n\tif (endpoint.substr(0, 4) === 'bml/') {\n\t\tsearchRequest.pagination = { limit: searchWindow };\n\t\tsearchRequest.useCursor = true;\n\t} else {\n\t\tsearchRequest.limit = searchWindow;\n\t}\n\tif (entityclass) {\n\t\tsearchRequest.entityClass = entityclass;\n\t}\n\tif (filter) {\n\t\tsearchRequest.attributeFilter = filter;\n\t}\n\tif (sorting) {\n\t\tsearchRequest.sorting = sorting;\n\t}\n\tif (idsOnly) {\n\t\tsearchRequest.idsOnly = true;\n\t}\n\tlet temp;\n\tlet lastCursor;\n\tdo {\n\t\tif (lastCursor) {\n\t\t\tsearchRequest.cursor = [ lastCursor ];\n\t\t}\n\t\tif (!requestType || requestType === 'get') {\n\t\t\ttemp = await get(endpoint, searchRequest);\n\t\t} else {\n\t\t\ttemp = await post(endpoint, searchRequest);\n\t\t}\n\t\tif (temp.cursor && temp.cursor.length > 0) {\n\t\t\tlastCursor = temp.cursor[0];\n\t\t}\n\t\tif (endpoint.includes('product')) ProductRepo.clearProductCache();\n\t\tfor (const item of temp.list) {\n\t\t\tif (endpoint.includes('product')) ProductRepo.addToProductCache(item);\t//in case it is then saved\n\t\t\tyield item;\n\t\t}\n\t} while (lastCursor && temp && temp.list.length >= searchWindow);\n}\n\n\nexport async function countEntries(entityClass, filter) {\n\tconst endpoint = 'search/search/count';\n\tlet searchRequest = {\n\t\tentityClass\n\t};\n\tif (filter) searchRequest.attributeFilter = filter;\n\tlet result = await post(endpoint, searchRequest, null, null, null, true);\n\treturn result;\n}\n\nexport async function updateEntity(\n\tent,\n\tmode,\n\tdryrun = false,\n){\n\tlet params = {\n\t\tpatch: ent.getPatch(),\n\t\tid: ent.getId(),\n\t\trev: ent.getRev(),\n\t\tmode,\n\t\tdryrun,\n\t};\n\tif (params.patch.length === 0) return;\n\tconst data = await post('eav/entity/updatefrompatch', params);\n\tent.fromStorage(data);\n}\n\nexport async function submitNewRequest(req) {\n\tconst externalId = 'changerequest';\n\tlet data = req.toStorage();\n\tlet ec = await getEntityclassByExternalId(externalId);\n\tlet as = await getAttributesetByExternalId(externalId);\n\tlet entity = await genericEntityCreate(ec.id, as.id, data);\n\treq.fromStorage(entity);\n\treturn req;\n}\n\nexport async function aggregateRun(\n\tec,\n\taggregate,\n\tattributeFilter,\n) {\n\tif (!ec) throw new Error('missing entityclass for search');\n\tlet payload = {\n\t\tentityClass: await coalesceEc(ec),\n\t};\n\tif (attributeFilter) {\n\t\tpayload.attributeFilter = attributeFilter;\n\t}\n\tif (Array.isArray(aggregate)) {\n\t\tpayload = {\n\t\t\t...payload,\n\t\t\taggregates: aggregate,\n\t\t};\n\t} else {\n\t\tpayload = {\n\t\t\t...payload,\n\t\t\taggregate: aggregate,\n\t\t};\n\t}\n\tconst result = await post('search/aggregate/run', payload);\n\treturn result;\n}\n\nasync function coalesceEc(ec) {\n\tif (ec.length < 35) {\n\t\tlet ecr = await getEntityclassByExternalId(ec);\n\t\treturn ecr.id;\n\t}\n\treturn ec;\n}\n\nexport async function createEntity(ent) {\n\tlet params = {\n\t\tentityclass: ent.getEntityclass(),\n\t\tattributeset: ent.getAttributeSet(),\n\t\tdata: ent.toStorage(),\n\t};\n\tlet res = await post('eav/entity/create', params);\n\tent.fromStorage(res);\n}","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('b-card',[(!_vm.isLoggedIn)?_c('b-card-body',[_c('p',[_vm._v(\" \"+_vm._s(_vm.$t('auth.views.acceptInvite.requiresLogin'))+\" \")]),_c('b-button',{attrs:{\"variant\":\"primary\"},on:{\"click\":_vm.gotoLogin}},[_vm._v(\" \"+_vm._s(_vm.$t('auth.views.acceptInvite.loginBtn'))+\" \")])],1):_c('b-card-body',[_c('p',[_vm._v(\" \"+_vm._s(_vm.$t('auth.views.acceptInvite.introText'))+\" \")]),_c('b-button',{attrs:{\"variant\":\"success\"},on:{\"click\":function($event){return _vm.registerWithDomain()}}},[_vm._v(\" \"+_vm._s(_vm.$t('default.dialog.submit'))+\" \")])],1)],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n","import mod from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./acceptinvite.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./acceptinvite.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./acceptinvite.vue?vue&type=template&id=0346565b\"\nimport script from \"./acceptinvite.vue?vue&type=script&lang=js\"\nexport * from \"./acceptinvite.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue';\nimport Router from 'vue-router';\nimport AcceptInvite from './views/auth/acceptinvite.vue';\nimport store from './store/main.js';\nimport { ROLE } from '@/util/role.js';\nimport { basePath } from './util/env.js';\nimport EventBus from './util/eventbus.js';\n\nVue.use(Router);\n\nlet router = new Router({\n\tmode: 'history',\n\tbase: basePath,\n\troutes: [\n\t\t{\n\t\t\tpath: '/',\n\t\t\tname: 'productList',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductList.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Redaktion',\n\t\t\t\tpermission: 'Editor'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/company/list',\n\t\t\tname: 'companyList',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/company/CompanyList.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Redaktion',\n\t\t\t\tpermission: 'Editor'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/invoice/list',\n\t\t\tname: 'invoiceList',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/invoice/InvoiceList.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Redaktion',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/company/view/:company_id',\n\t\t\tname: 'company',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/company/CompanyViewDetail.vue'),\n\t\t\tmeta: {\n\t\t\t\tpermission: 'Editor'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/company/merge',\n\t\t\tname: 'CompanyMerge',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/company/CompanyMerge.vue'),\n\t\t\tmeta: {\n\t\t\t\tpermission: 'Editor'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/product/:product_id/:list_id/:rev?',\n\t\t\tname: 'product',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/Product.vue'),\n\t\t\tmeta: {\n\t\t\t\tpermission: 'Editor'\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\tpath: 'main',\n\t\t\t\tname: 'product-tab-main',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabBase.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t},\n\t\t\t}, {\n\t\t\t\tpath: 'permits',\n\t\t\t\tname: 'product-tab-permits',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabPermits.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t},\n\t\t\t}, {\n\t\t\t\tpath: 'specific',\n\t\t\t\tname: 'product-tab-specific',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabSpecific.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t},\n\t\t\t}, {\n\t\t\t\tpath: 'hobbygarden',\n\t\t\t\tname: 'product-tab-hobbygarden',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabHobbyGarden.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t},\n\t\t\t}, {\n\t\t\t\tpath: 'misc',\n\t\t\t\tname: 'product-tab-misc',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabMisc.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t},\n\t\t\t}, {\n\t\t\t\tpath: 'documents',\n\t\t\t\tname: 'product-tab-documents',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabDocuments.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tpath: 'display',\n\t\t\t\tname: 'product-tab-display',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabDisplay.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tpath: 'checklist',\n\t\t\t\tname: 'product-tab-checklist',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabChecklist.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tpath: 'approvals',\n\t\t\t\tname: 'product-tab-approvals',\n\t\t\t\tcomponent: () => import(/* webpackChunkName: \"editorial\" */ './views/editorial/product/ProductTabApprovals.vue'),\n\t\t\t\tmeta: {\n\t\t\t\t\tpermission: 'Editor'\n\t\t\t\t}\n\t\t\t}, ]\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/category',\n\t\t\tname: 'CategoryManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/CategoryManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/categorytext',\n\t\t\tname: 'CategoryTextManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/CategoryTextManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Redaktion',\n\t\t\t\tpermission: 'Editor'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/component',\n\t\t\tname: 'ComponentManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/ComponentManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/hobbygarden',\n\t\t\tname: 'HobbyGardenManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/HobbyGardenManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/biostandard',\n\t\t\tname: 'biostandard',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/Biostandard.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/checklist',\n\t\t\tname: 'ChecklistManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/ChecklistManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/selectoptions',\n\t\t\tname: 'SelectOptionManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/SelectOptionManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/restrictiontext',\n\t\t\tname: 'RestrictionTextManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/RestrictionTextManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/countrymanagement',\n\t\t\tname: 'CountryManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/CountryManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/listmanagement',\n\t\t\tname: 'ListManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/ListManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/labelmanagement',\n\t\t\tname: 'LabelManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/LabelManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/permitmanagement',\n\t\t\tname: 'PermitManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/PermitManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/fieldmanagement',\n\t\t\tname: 'FieldManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/FieldManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/user/accountmanagement',\n\t\t\tname: 'AccountManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/user/AccountManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/user/institutionmanagement',\n\t\t\tname: 'InstitutionManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/user/InstitutionManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/user/paidaccounts',\n\t\t\tname: 'PaidAccountManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/user/PaidAccountManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/pubsearch',\n\t\t\tname: 'PubSearchManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/PubSearchManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/admin/linkeddocumentmanagement',\n\t\t\tname: 'LinkedDocumentManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"admin\" */ './views/admin/LinkedDocumentManagement.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'Administration',\n\t\t\t\tpermission: 'Admin'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/auth/acceptinvite',\n\t\t\tname: 'AcceptInvite',\n\t\t\tcomponent: AcceptInvite,\n\t\t\tmeta: {\n\t\t\t\tgroup: '',\n\t\t\t\thideInNav: true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/user/notes',\n\t\t\tname: 'NotesManagement',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"user\" */ './views/user/Notes.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'User-Center',\n\t\t\t\tpermission: 'Registered'\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpath: '/user/messagecenter',\n\t\t\tname: 'MessageCenter',\n\t\t\tcomponent: () => import(/* webpackChunkName: \"user\" */ './views/user/messagecenter/MessageCenter.vue'),\n\t\t\tmeta: {\n\t\t\t\tgroup: 'User-Center',\n\t\t\t\tpermission: 'Registered'\n\t\t\t},\n\t\t\tchildren: [\n\t\t\t\t{\n\t\t\t\t\tpath: 'detail/:id',\n\t\t\t\t\tname: 'MessagingDetail',\n\t\t\t\t\tcomponent: () => import(/* webpackChunkName: \"user\" */ './views/user/messagecenter/MessagingDetail.vue'),\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tpermission: 'Registered'\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t]\n});\n\nlet waitForRole = new Promise(res => {\n\tstore.watch(() => store.getters['auth/user/getCurrentAccountId'], a => {\n\t\tif (a) res();\n\t});\n});\n\nrouter.beforeEach((to, from, next) => {\n\tconst isAdmin = store.getters['auth/user/roles/isAdmin'];\n\tconst isAuthRoute = to.matched.some(f => f.meta.permission);\n\tstore.commit('base/setRoute', to);\n\tif (!isAuthRoute || isAdmin) {\n\t\treturn next();\n\t} else {\n\t\treturn waitForRole.then(() => {\n\t\t\tconst isAdmin = store.getters['auth/user/roles/isAdmin'];\n\t\t\tconst isEditor = isAdmin || store.getters['auth/user/roles/isEditor'];\n\t\t\tif (to.matched.some(f => f.meta.permission === ROLE.Admin)) {\n\t\t\t\tif (!isAdmin) {\n\t\t\t\t\treturn next({name: 'home'});\n\t\t\t\t} else {\n\t\t\t\t\treturn next();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (to.matched.some(f => f.meta.permission === ROLE.Editor)) {\n\t\t\t\tif (!isEditor) {\n\t\t\t\t\treturn next({name: 'home'});\n\t\t\t\t} else {\n\t\t\t\t\treturn next();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn next();\n\t\t});\n\t}\n\n});\nrouter.beforeEach((t, f, next) => {\n\tEventBus.removeAllListeners('globalKeyUp');\n\treturn next();\n});\nrouter.afterEach((to, from) => {\n\tif ((from.name || '').startsWith('product-tab-') && !(to.name || '').startsWith('product-tab-')) {\n\t\t//leaving product\n\t\tstore.commit('product/closeProduct');\n\t}\n});\n\nexport default router;\n","import { traverse } from \"@/util/field-helper\";\nimport BmlCommon from \"@fibl/bml-common\";\nimport Store from \"@/store/main.js\";\n\nexport function getParty(conversation, uid) {\n\ttry {\n\t\treturn BmlCommon.MessageClass.getParty(\n\t\t\tconversation,\n\t\t\tuid,\n\t\t\tStore.getters[\"auth/login/currentAccountInstitution\"],\n\t\t\tStore.getters[\"auth/login/currentAccountCompany\"]\n\t\t);\n\t} catch (error) {\n\t\tthrow new Error(`Error fetching current party: ` + error);\n\t}\n}\n\nexport function getMeFilterBothSides(extra) {\n\treturn {\n\t\t$or: [\n\t\t\tgetFilterForMe(\"sender\", extra),\n\t\t\tgetFilterForMe(\"recipient\", extra),\n\t\t],\n\t};\n}\n\nexport function getFilterForMe(party, extra) {\n\tconst storeOrgs = Store.getters[\"auth/login/currentAccountInstitution\"];\n\tconst storeCompany = Store.getters[\"auth/login/currentAccountCompany\"];\n\tconst amFibl = storeOrgs.length > 0;\n\tlet res;\n\tif (amFibl) {\n\t\tres = {\n\t\t\t$or: storeOrgs.map((org) => ({\n\t\t\t\tfield: `/data/${party}/fiblorg`,\n\t\t\t\tcomparison: \"eq\",\n\t\t\t\tvalue: org,\n\t\t\t})),\n\t\t};\n\t} else {\n\t\tlet company = storeCompany || \"none\";\n\t\tres = {\n\t\t\tfield: `/data/${party}/company`,\n\t\t\tcomparison: \"eq\",\n\t\t\tvalue: company,\n\t\t};\n\t}\n\tlet wrap = res;\n\tif (extra) {\n\t\textra = JSON.parse(JSON.stringify(extra));\n\t\ttraverse(extra, function (layer) {\n\t\t\tif (layer?.field) {\n\t\t\t\tlayer.field = layer.field.replace(\"%P\", party);\n\t\t\t}\n\t\t});\n\t\twrap = { $and: [res, extra] };\n\t}\n\treturn wrap;\n}\n","import { post as sendPostRequest } from '@/util/request.js';\nimport { search, genericEntityUpdate, getEntityById } from './system.js';\n\nexport async function createCategory(title, parentId, disabled, mainCategoryKey, number, entityclass, attributeset, order) {\n\n\tlet categoryData = {};\n\tcategoryData.title = title;\n\tif (typeof parentId === 'string' && parentId !== '') categoryData.parent = parentId;\n\tif (typeof disabled !== 'undefined') categoryData.disabled = disabled;\n\tif (typeof mainCategoryKey !== 'undefined') categoryData.mainCategoryKey = mainCategoryKey;\n\tif (order) {\n\t\tcategoryData.order = order;\n\t}\n\n\tif (number) {\n\t\tcategoryData.number = parseFloat(number);\n\t}\n\n\tlet categoryConfig = {\n\t\tentityclass,\n\t\tattributeset,\n\t\tdata: categoryData\n\t};\n\n\tlet createdCategoryEntity = await sendPostRequest('eav/entity/create', categoryConfig);\n\n\treturn createdCategoryEntity;\n}\n\nexport function getCategoryById(id) {\n\treturn getEntityById(id);\n}\n\nexport function updateCategory(oldCategory, newData, set) {\n\tlet categoryData = JSON.parse(JSON.stringify(newData));\n\tif (categoryData.number) {\n\t\tcategoryData.number = parseFloat(categoryData.number);\n\t}\n\n\treturn genericEntityUpdate(oldCategory, categoryData, set);\n}\n\nexport async function deleteCategory(id) {\n\tlet deletedCategoryEntity = await sendPostRequest('eav/entity/disable', id);\n\treturn deletedCategoryEntity.id;\n}\n\nexport function getAllCategories(entityclassId) {\n\treturn search(entityclassId);\n}\n","import { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport { createCategory, deleteCategory, getAllCategories, updateCategory } from '@/repository/category-repository.js';\nimport mainCategories from '@/assets/config/main-categories.json';\nimport { i18n } from '@/main';\n\nconst state = {\n\n\tcategories: [],\n\tentityclassId: null,\n\tattributesetId: null\n\n};\n\nconst getters = {\n\n\tbyKey: (state) => (key) => {\n\t\treturn state.categories.find(r => r.data.mainCategoryKey === key);\n\t},\n\n\tbyId: (state) => (id) => {\n\t\treturn state.categories.find(r => r.id === id);\n\t},\n\n\tbyIds: (state) => (categoryIds) => {\n\t\tif (!categoryIds) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn state.categories.filter(r => categoryIds.includes(r.id));\n\t},\n\n\tmainCategoryFromIds: (state, getters) => (totalEntries) => {\n\t\tfor (const id of totalEntries) {\n\t\t\tlet category = getters.byId(id);\n\t\t\tif(category !== undefined) {\n\t\t\t\tif (!category.data.parent && category.data.mainCategoryKey) {\n\t\t\t\t\treturn category;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\n\tpathToRoot: (state, getters) => (ids) => {\n\t\tif (!ids) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet entries = ids.slice(0);\n\t\tfor (const id of ids) {\n\t\t\tconst category = getters.byId(id);\n\t\t\tif (category && category.data.parent) {\n\t\t\t\tlet parent = getters.byId(category.data.parent);\n\t\t\t\twhile (parent) {\n\t\t\t\t\tif (!entries.includes(parent.id)) {\n\t\t\t\t\t\tentries.push(parent.id);\n\t\t\t\t\t}\n\n\t\t\t\t\tparent = getters.byId(parent.data.parent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn entries;\n\t},\n\n\tpathToRootOrdered: (state, getters) => (id) => {\n\t\tif (!id) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst entries = {};\n\n\t\tlet idx = 0;\n\t\tconst category = getters.byId(id);\n\n\t\tif (category) {\n\t\t\tentries[idx] = category;\n\t\t\t++idx;\n\n\t\t\tif (category.data.parent) {\n\t\t\t\tlet parent = getters.byId(category.data.parent);\n\t\t\t\twhile (parent) {\n\t\t\t\t\tentries[idx] = parent;\n\t\t\t\t\t++idx;\n\n\t\t\t\t\tparent = getters.byId(parent.data.parent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn entries;\n\t},\n\n\tnumberString: (state, getters) => (id) => {\n\t\tlet numberString = '';\n\t\tif (!id) {\n\t\t\treturn '';\n\t\t}\n\t\tlet result = getters.pathToRoot([ id ]);\n\t\tif (!result) return '';\n\t\tresult = result.reverse();\n\t\tlet index = 0;\n\t\twhile (result[index]) {\n\t\t\tlet category = getters.byId(result[index]);\n\t\t\tnumberString = numberString ? `${numberString}-${category.data.order}` : category.data.order;\n\t\t\tindex++;\n\t\t}\n\t\treturn numberString;\n\t},\n\n\tbyParent: (state) => (id) => {\n\t\treturn state.categories.filter(r => r.data.parent === id);\n\t},\n\n\troots: (state) => {\n\t\treturn state.categories.filter(r => !r.data.parent).sort((a, b) => {\n\t\t\treturn a.data.order < b.data.order ? -1 : 1;\n\t\t});\n\t},\n\n\tall: (state) => {\n\t\treturn state.categories;\n\t},\n\n\tbyRoot: (state, getters) => (rootId) => {\n\t\treturn state.categories.filter(category => {\n\t\t\treturn getters.pathToRoot([category.id]).includes(rootId);\n\t\t});\n\t}\n\n};\n\nconst actions = {\n\n\tasync create({ state, commit, getters }, { title, parentId, disabled, mainCategoryKey, order, number }) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('category');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('category');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\n\t\tlet entity = await createCategory(title, parentId, disabled, mainCategoryKey, number, state.entityclassId, state.attributesetId, order);\n\t\tcommit('addCategory', entity);\n\n\t\tif (parentId) {\n\t\t\tconst parent = getters.byId(parentId);\n\t\t\tcommit('addChild', { parent, child: entity });\n\t\t}\n\t},\n\n\tasync delete({ commit, dispatch, getters }, { entry }) {\n\t\tif (typeof entry === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof entry.children !== 'undefined') {\n\t\t\tlet list = new Set(entry.children);\n\t\t\tfor (let child of list) {\n\t\t\t\tawait dispatch('delete', { entry: child });\n\t\t\t}\n\t\t}\n\n\t\tawait deleteCategory(entry.id);\n\t\tcommit('deleteCategory', { id: entry.id });\n\n\t\tif (entry.data.parent) {\n\t\t\tconst parent = getters.byId(entry.data.parent);\n\t\t\tcommit('removeChild', { parent, childId: entry.id });\n\t\t}\n\t},\n\n\tasync loadAll({ commit, state }, { ifEmpty }) {\n\t\tif (ifEmpty && state.categories.length > 0) return;\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('category');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet list = await getAllCategories(state.entityclassId);\n\t\tcommit('setList', list);\n\t},\n\n\tasync update({ commit, state, getters }, category) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('category');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldCategory = getters.byId(category.id);\n\t\tlet updated = await updateCategory(oldCategory, category.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteCategory', { id: category.id });\n\t\t\tcommit('addCategory', updated);\n\n\t\t\tif (updated.data.parent) {\n\t\t\t\tconst parent = getters.byId(updated.data.parent);\n\t\t\t\tcommit('removeChild', { parent, childId: updated.id });\n\t\t\t\tcommit('addChild', { parent, child: updated });\n\t\t\t}\n\t\t}\n\t}\n\n};\n\nconst mutations = {\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\taddChild(state, { parent, child }) {\n\t\tif (!parent.children) {\n\t\t\tparent.children = [];\n\t\t}\n\n\t\tparent.children.push(child);\n\t},\n\tremoveChild(state, { parent, childId }) {\n\t\tif (!parent.children) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst idx = parent.children.findIndex(f => f.id === childId);\n\t\tparent.children.splice(idx, 1);\n\t},\n\taddCategory(state, entity) {\n\t\tif (!entity.children) {\n\t\t\tentity.children = [];\n\t\t}\n\n\t\tentity.children = getters.byParent(state)(entity.id);\n\t\tstate.categories.push(entity);\n\t},\n\tdeleteCategory(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.categories.indexOf(entity);\n\t\tstate.categories.splice(idx, 1);\n\t},\n\tresetList(state) {\n\t\tstate.categories = [];\n\t},\n\tsetList(state, categories) {\n\t\tcategories = categories.sort((a, b) => {\n\t\t\treturn a.data.order < b.data.order ? -1 : 1;\n\t\t});\n\t\tstate.categories = categories;\n\n\t\tfor (let entity of state.categories) {\n\t\t\tif (!entity.children) {\n\t\t\t\tentity.children = [];\n\t\t\t}\n\n\t\t\tentity.children = getters.byParent(state)(entity.id);\n\t\t}\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as SystemRepository from '@/repository/system.js';\n\nconst ENTITY_EXTERNAL_ID = 'category_text';\n\nconst state = {\n\n\tentityclassId: null,\n\tattributesetId: null,\n\tcategoryTexts: [],\n\tcheckedBaseline: false,\n\tcheckedRows: [],\n\tlistFilter: {\n\t\ttitle: '',\n\t\tdescription: '',\n\t\tlists: [],\n\t\tstandards: [],\n\t\tactive: {\n\t\t\tbooleanValue: true\n\t\t},\n\t\tlanguage: 'de_DE',\n\t\tcategory: []\n\t},\n\tlistTotalCount: 0\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.categoryTexts.find(category => category.id === id);\n\t},\n\n\tgetFilterByOption: state => option => {\n\t\tif (option === 'active') {\n\t\t\treturn state.listFilter[option].booleanValue;\n\t\t} else {\n\t\t\treturn state.listFilter[option];\n\t\t}\n\t},\n\n\tgetListFilter: state => filter => {\n\t\treturn state.listFilter[filter];\n\t},\n\n\tgetListAttributeFilter: (state, getters, rootState, rootGetters) => {\n\t\tconst filter = state.listFilter;\n\t\tlet $and = [];\n\t\tlet listFilter = [];\n\t\tif (filter.lists && filter.lists.length) {\n\t\t\tlistFilter = filter.lists;\n\t\t} else {\n\t\t\tlistFilter = rootGetters['list/root']\n\t\t\t\t.filter(list => rootGetters['auth/user/roles/canViewList'](list))\n\t\t\t\t.map(e => e.id);\n\t\t}\n\t\tlet $or = [];\n\t\tif (listFilter.length === 0) listFilter.push('-');\n\t\tfor (const list of listFilter) {\n\t\t\t$or.push({\n\t\t\t\tfield: '/data/list',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: list\n\t\t\t});\n\t\t}\n\t\t$and.push({ $or });\n\t\tif (filter.standards.length > 0) {\n\t\t\t$and.push({ $or: filter.standards.map(id => ({\n\t\t\t\tfield: '/data/standard',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: id\n\t\t\t}))});\n\t\t}\n\t\tif (filter.title && filter.language) {\n\t\t\t$and.push({\n\t\t\t\tfield: `/data/title/${filter.language}`,\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: filter.title,\n\t\t\t\tfuzzy: true,\n\t\t\t\tuse: 'ngram'\n\t\t\t});\n\t\t}\n\t\tif (filter.description && filter.language) {\n\t\t\t$and.push({\n\t\t\t\tfield: `/data/description/${filter.language}`,\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: filter.description,\n\t\t\t\tfuzzy: true,\n\t\t\t\tuse: 'ngram'\n\t\t\t});\n\t\t}\n\t\tif (filter.category && Array.isArray(filter.category) && filter.category.length) {\n\t\t\tlet orFilter = { $or: [] };\n\t\t\tfor (let category of filter.category) {\n\t\t\t\tlet categories = rootGetters['category/byRoot'](category);\n\t\t\t\tfor (let subCategory of categories) {\n\t\t\t\t\torFilter.$or.push({\n\t\t\t\t\t\tfield: '/data/category',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: subCategory.id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t$and.push(orFilter);\n\t\t}\n\t\tif (filter.active) {\n\t\t\t$and.push({\n\t\t\t\tfield: '/data/active',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: filter.active.booleanValue\n\t\t\t});\n\t\t}\n\t\treturn { $and };\n\t},\n\n\tbyIds: (state) => (categoryTextIds) => {\n\t\tif (!categoryTextIds || !Array.isArray(categoryTextIds)) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn state.categoryTexts.filter(category => categoryTextIds.includes(category.id));\n\t},\n\n\tgetAll: (state) => {\n\t\treturn state.categoryTexts;\n\t}\n\n};\n\nconst actions = {\n\n\tasync ensureAttributesetEntityclassLoaded({ commit }) {\n\t\tif (!state.entityclassId) {\n\t\t\tconst ec = await SystemRepository.getEntityclassByExternalId(ENTITY_EXTERNAL_ID);\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tconst as = await SystemRepository.getAttributesetByExternalId(ENTITY_EXTERNAL_ID);\n\t\t\tcommit('setAsId', { id: as.id });\n\t\t}\n\t},\n\n\tasync create({ state, commit, dispatch }, data) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tdata.category = data.category[0];\n\t\tdelete data.categoryTextId;\n\t\tconst newCategoryText = await SystemRepository.genericEntityCreate(state.entityclassId, state.attributesetId, data);\n\t\tcommit('addCategoryText', { text: newCategoryText });\n\t\treturn newCategoryText;\n\t},\n\n\tasync delete({ commit }, { id }) {\n\t\tif (!id) return;\n\t\tawait SystemRepository.genericEntityDelete({ id });\n\t\tcommit('deleteCategoryText', { id });\n\t},\n\n\tasync load({ dispatch, commit }, { filter, pagination, sorting }) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tlet list = await SystemRepository.search(state.entityclassId, filter, pagination, sorting);\n\t\tlet count = await SystemRepository.countEntries(state.entityclassId, filter);\n\t\tcommit('setListCount', count);\n\t\tlist.forEach(item => {\n\t\t\titem.data.category = [ item.data.category ];\n\t\t});\n\t\tcommit('setCategoryTexts', { texts: list });\n\t\treturn list;\n\t},\n\n\tasync update({ commit, dispatch, getters }, categoryText) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tcategoryText.category = categoryText.category[0];\n\t\tlet oldEntity = JSON.parse(JSON.stringify(getters.byId(categoryText.categoryTextId)));\n\t\tdelete categoryText.categoryTextId;\n\t\toldEntity.data.category = oldEntity.data.category[0];\n\t\tdelete oldEntity.data.categoryTextId;\n\t\tconst updated = await SystemRepository.genericEntityUpdate(oldEntity, categoryText);\n\t\tif (updated) {\n\t\t\tupdated.data.categoryTextId = updated.id;\n\t\t\tcommit('updateCategoryText', { text: updated });\n\t\t}\n\t\treturn updated;\n\t}\n\n};\n\nconst mutations = {\n\tsetFilterOption(state, { filter, value }) {\n\t\tif (filter === 'active') {\n\t\t\tstate.listFilter[filter].booleanValue = value;\n\t\t} else {\n\t\t\tstate.listFilter[filter] = value;\n\t\t}\n\t},\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\taddCategoryText(state, { text }) {\n\t\taddUpdateCategoryText(state, text);\n\t},\n\tupdateCategoryText(state, { text }) {\n\t\taddUpdateCategoryText(state, text);\n\t},\n\tdeleteCategoryText(state, { id }) {\n\t\tconst textIndex = state.categoryTexts.findIndex(categoryText => categoryText.id === id);\n\t\tif (textIndex === -1) throw new Error(`entity not found: ${id}`);\n\t\tstate.categoryTexts.splice(textIndex, 1);\n\t},\n\tsetCategoryTexts(state, { texts }) {\n\t\tif (!texts || !texts.length) {\n\t\t\tstate.categoryTexts = [];\n\t\t\treturn;\n\t\t}\n\t\tstate.categoryTexts = texts;\n\t},\n\tsetListCount(state, count) {\n\t\tstate.listTotalCount = count;\n\t}\n};\n\nfunction addUpdateCategoryText(state, text) {\n\tif (!text.id) return;\n\tconst oldTextIndex = state.categoryTexts.findIndex(categoryText => categoryText.id === text.id);\n\tif (oldTextIndex !== -1) {\n\t\tstate.categoryTexts.splice(oldTextIndex, 1, text);\n\t} else {\n\t\tstate.categoryTexts.push(text);\n\t}\n}\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as SystemRepository from '@/repository/system.js';\n\nconst ENTITY_EXTERNAL_ID = 'restriction_text';\n\nconst state = {\n\n\tentityclassId: null,\n\tattributesetId: null,\n\trestrictionTexts: [],\n\tcheckedBaseline: false,\n\tcheckedRows: [],\n\tlistFilter: {\n\t\ttext: '',\n\t\tstandards: [],\n\t\tcategories: [],\n\t\tlanguage: 'de_DE'\n\t},\n\tlistTotalCount: 0,\n\ttotalCount: 0\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.restrictionTexts.find(restriction => restriction.id === id);\n\t},\n\n\tgetFilterByOption: state => option => {\n\t\tif (option === 'active') {\n\t\t\treturn state.listFilter[option].booleanValue;\n\t\t} else {\n\t\t\treturn state.listFilter[option];\n\t\t}\n\t},\n\n\tgetListFilter: state => filter => {\n\t\treturn state.listFilter[filter];\n\t},\n\n\tgetListAttributeFilter: (state, getters, rootState, rootGetters) => {\n\t\tconst filter = state.listFilter;\n\t\tlet $and = [];\n\t\tif (filter.standards.length > 0) {\n\t\t\t$and.push({ $or: filter.standards.map(id => ({\n\t\t\t\tfield: '/data/standards',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: id\n\t\t\t}))});\n\t\t}\n\t\tif (filter.text && filter.language) {\n\t\t\t$and.push({\n\t\t\t\tfield: `/data/text/${filter.language}`,\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: filter.text,\n\t\t\t\tfuzzy: true,\n\t\t\t\tuse: 'ngram'\n\t\t\t});\n\t\t}\n\t\tif (filter.categories && Array.isArray(filter.categories) && filter.categories.length) {\n\t\t\tlet orFilter = { $or: [] };\n\t\t\tfor (let category of filter.categories) {\n\t\t\t\tlet categories = rootGetters['category/byRoot'](category);\n\t\t\t\tfor (let subCategory of categories) {\n\t\t\t\t\torFilter.$or.push({\n\t\t\t\t\t\tfield: '/data/categories',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: subCategory.id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t$and.push(orFilter);\n\t\t}\n\t\tif (filter.active) {\n\t\t\t$and.push({\n\t\t\t\tfield: '/data/active',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: filter.active.booleanValue\n\t\t\t});\n\t\t}\n\t\treturn { $and };\n\t},\n\n\tbyIds: (state) => (restrictionTextIds) => {\n\t\tif (!restrictionTextIds || !Array.isArray(restrictionTextIds)) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn state.restrictionTexts.filter(restriction => restrictionTextIds.includes(restriction.id));\n\t},\n\n\tgetAll: (state) => {\n\t\treturn state.restrictionTexts;\n\t},\n\n\trestrictonTextsByCategories: (state) => (categories) => {\n\t\tif (!categories || !categories.length) {\n\t\t\treturn state.restrictionTexts;\n\t\t}\n\t\tlet texts = state.restrictionTexts.filter(text => text.data.categories.find(categoryId => categories.includes(categoryId)));\n\t\treturn texts;\n\t}\n\n};\n\nconst actions = {\n\n\tasync ensureAttributesetEntityclassLoaded({ commit }) {\n\t\tif (!state.entityclassId) {\n\t\t\tconst ec = await SystemRepository.getEntityclassByExternalId(ENTITY_EXTERNAL_ID);\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tconst as = await SystemRepository.getAttributesetByExternalId(ENTITY_EXTERNAL_ID);\n\t\t\tcommit('setAsId', { id: as.id });\n\t\t}\n\t},\n\n\tasync create({ state, commit, dispatch }, data) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tdelete data.restrictionTextId;\n\t\tconst newRestrictionText = await SystemRepository.genericEntityCreate(state.entityclassId, state.attributesetId, data);\n\t\tcommit('addRestrictionText', { text: newRestrictionText });\n\t\treturn newRestrictionText;\n\t},\n\n\tasync delete({ commit }, { id }) {\n\t\tif (!id) return;\n\t\tawait SystemRepository.genericEntityDelete({ id });\n\t\tcommit('deleteRestrictionText', { id });\n\t},\n\n\tasync load({ dispatch, commit }, { filter, pagination, sorting }) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tlet list = await SystemRepository.search(state.entityclassId, filter, pagination, sorting);\n\t\tlet count = await SystemRepository.countEntries(state.entityclassId, filter);\n\t\tconsole.log('count?', count);\n\t\tcommit('setListCount', count);\n\t\tlist.forEach(item => {\n\t\t\titem.data.restrictionTextId = item.id;\n\t\t});\n\t\tcommit('setRestrictionTexts', { texts: list });\n\t\treturn list;\n\t},\n\n\tasync update({ commit, dispatch, getters }, restrictionText) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tlet oldEntity = JSON.parse(JSON.stringify(getters.byId(restrictionText.restrictionTextId)));\n\t\tdelete restrictionText.restrictionTextId;\n\t\tdelete oldEntity.data.restrictionTextId;\n\t\tconst updated = await SystemRepository.genericEntityUpdate(oldEntity, restrictionText);\n\t\tif (updated) {\n\t\t\tupdated.data.restrictionTextId = updated.id;\n\t\t\tcommit('updateRestrictionText', { text: updated });\n\t\t}\n\t\treturn updated;\n\t},\n\n\tasync loadAllByCategories({ commit, dispatch }, { categories }) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tlet filter = null;\n\t\tif (categories && categories.length) {\n\t\t\tfilter = { $or: [] };\n\t\t\tfor (let categoryId of categories) {\n\t\t\t\tfilter.$or.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: '/data/categories',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: categoryId\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tlet list = await SystemRepository.search(state.entityclassId, filter);\n\t\tcommit('setRestrictionTexts', { texts: list });\n\t},\n\n\tasync loadByIds({ commit }, ids) {\n\t\tlet list = await SystemRepository.getEntitiesById(ids);\n\t\tcommit('setRestrictionTexts', { texts: list });\n\t\treturn list;\n\t},\n\n\n};\n\nconst mutations = {\n\tsetFilterOption(state, { filter, value }) {\n\t\tif (filter === 'active') {\n\t\t\tstate.listFilter[filter].booleanValue = value;\n\t\t} else {\n\t\t\tstate.listFilter[filter] = value;\n\t\t}\n\t},\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\taddRestrictionText(state, { text }) {\n\t\taddUpdateRestrictionText(state, text);\n\t},\n\tupdateRestrictionText(state, { text }) {\n\t\taddUpdateRestrictionText(state, text);\n\t},\n\tdeleteRestrictionText(state, { id }) {\n\t\tconst textIndex = state.restrictionTexts.findIndex(restrictionText => restrictionText.id === id);\n\t\tif (textIndex === -1) throw new Error(`entity not found: ${id}`);\n\t\tstate.restrictionTexts.splice(textIndex, 1);\n\t},\n\tsetRestrictionTexts(state, { texts }) {\n\t\tif (!texts || !texts.length) {\n\t\t\tstate.restrictionTexts = [];\n\t\t\treturn;\n\t\t}\n\t\tstate.restrictionTexts = texts;\n\t},\n\tsetListCount(state, count) {\n\t\tstate.listTotalCount = count;\n\t}\n};\n\nfunction addUpdateRestrictionText(state, text) {\n\tif (!text.id) return;\n\tconst oldTextIndex = state.restrictionTexts.findIndex(restrictionText => restrictionText.id === text.id);\n\tif (oldTextIndex !== -1) {\n\t\tstate.restrictionTexts.splice(oldTextIndex, 1, text);\n\t} else {\n\t\tstate.restrictionTexts.push(text);\n\t}\n}\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post as sendPostRequest } from '@/util/request.js';\nimport { search, genericEntityUpdate, getEntityById } from './system.js';\n\nexport async function createBiostandard(data, entityclassId, attributesetId) {\n\treturn sendPostRequest('eav/entity/create', {\n\t\tentityclass: entityclassId,\n\t\tattributeset: attributesetId,\n\t\tdata\n\t});\n}\n\nexport function getBiostandardById(id) {\n\treturn getEntityById(id);\n}\n\nexport async function updateBiostandard(oldBiostandard, newData, set) {\n\tlet updatedBiostandard = await genericEntityUpdate(oldBiostandard, newData, set);\n\treturn updatedBiostandard;\n}\n\nexport async function deleteBiostandard(id) {\n\tlet deletedBiostandardEntity = await sendPostRequest('eav/entity/disable', id);\n\n\treturn deletedBiostandardEntity.id;\n}\n\nexport function getAllBiostandards(entityClassId) {\n\treturn search(entityClassId);\n}\n","import { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport { createBiostandard, deleteBiostandard, getAllBiostandards, updateBiostandard, getBiostandardById } from '@/repository/biostandard-repository.js';\nimport ApprovalWorkflowService from '@/util/approval-workflow-service';\nimport { toLocale } from '@/plugins/filters';\n\nconst state = {\n\tbiostandards: [],\n\tentityClassId: null,\n\tattributeSetId: null\n};\n\nconst getters = {\n\tbyId: (state) => (id) => {\n\t\treturn state.biostandards.find(biostandard => biostandard.id === id);\n\t},\n\tall: (state) => {\n\t\treturn state.biostandards;\n\t},\n\ttoRoot: (state, getters) => (id) => {\n\t\tlet elements = [];\n\t\tlet traverseToRoot = function(elements, standards, current) {\n\t\t\tconst parent = standards.find(f => f.id === current.data.dependency);\n\t\t\tif (!parent) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\telements.push(parent);\n\t\t\ttraverseToRoot(elements, standards, parent);\n\t\t};\n\n\t\tconst obj = getters.byId(id);\n\t\tif (!obj) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttraverseToRoot(elements, state.biostandards, obj);\n\n\t\treturn elements;\n\t},\n\tisBaseApproval: (state, getters) => (id) => {\n\t\tconst standard = getters.byId(id);\n\t\tif (!standard) return false;\n\t\treturn !!standard.data.baseApproval;\n\t},\n\tsortedByPublicOrder: (state) => {\n\t\tlet base = state.biostandards;\n\t\tlet sorted = base.slice(0);\n\t\tsorted.sort((a, b) => {\n\t\t\tlet valueA = parseInt(a.data.publicOrder) || 0;\n\t\t\tlet valueB = parseInt(b.data.publicOrder) || 0;\n\t\t\treturn valueA > valueB ? 1 : -1;\n\t\t});\n\t\treturn sorted;\n\t},\n\tsortedByName: (state) => {\n\t\tlet base = state.biostandards;\n\t\tlet sorted = base.slice(0);\n\t\tsorted.sort((a, b) => {\n\t\t\tlet valueA = toLocale(a.data.name) || '';\n\t\t\tlet valueB = toLocale(b.data.name) || '';\n\t\t\treturn valueA.localeCompare(valueB);\n\t\t});\n\t\treturn sorted;\n\t},\n\tgetDependencyLine: (state) => (id) => {\n\t\tlet res = [];\n\t\tlet addDep = (id) => {\n\t\t\tlet bs = state.biostandards.find(bs => bs.id === id);\n\t\t\tif (bs.data.dependency) {\n\t\t\t\tres.unshift(bs.data.dependency);\n\t\t\t\taddDep(bs.data.dependency);\n\t\t\t}\n\t\t};\n\t\taddDep(id);\n\t\treturn res;\n\t},\n\tcanBeApprovedWithDependencies: (state, getters, rootState, rootGetters) => (id) => {\n\t\t//check is current list or all other lists if an approval is set\n\t\tlet checkIn = [rootState.product.workingCopy];\n\t\tObject.keys(rootState.product.loadedData).forEach(listId => {\n\t\t\tif (listId !== rootState.product.currentList.id) {\n\t\t\t\tcheckIn.push(rootState.product.loadedData[listId]);\n\t\t\t}\n\t\t});\n\t\tfunction checkIfCurrentlyApproved(bsId, data) {\n\t\t\tif (!data) return false;\n\t\t\tif (!(data._approval && data._approval[bsId])) return false;\n\t\t\tlet approvalData = data._approval[bsId];\n\t\t\treturn approvalData.active && approvalData.active.booleanValue && ApprovalWorkflowService.checkDateForApproval(approvalData);\n\t\t}\n\t\tlet dependentOnApprovals = rootGetters['biostandard/getDependencyLine'](id);\n\t\tfor (let bsId of dependentOnApprovals) {\n\t\t\tlet valid = checkIn.reduce((c, listData) => c || checkIfCurrentlyApproved(bsId, listData), false);\n\t\t\t// console.log('dependency check', bsId, valid);\n\t\t\tif (!valid) return false;\n\t\t}\n\t\treturn true;\n\t}\n};\n\nconst actions = {\n\n\tasync create({state, commit}, data) {\n\t\tif (!state.entityClassId) {\n\t\t\tlet entityClass = await getEntityclassByExternalId('biostandard');\n\t\t\tcommit('setEntityClassId', entityClass);\n\t\t}\n\t\tif (!state.attributeSetId) {\n\t\t\tlet attributeSet = await getAttributesetByExternalId('biostandard');\n\t\t\tcommit('setAttributeSetId', { id: attributeSet.id });\n\t\t}\n\t\tlet entity = await createBiostandard(data, state.entityClassId, state.attributeSetId);\n\t\tcommit('addBiostandard', entity);\n\t},\n\n\tasync delete({state, commit}, {id}) {\n\t\tawait deleteBiostandard(id);\n\t\tcommit('deleteBiostandard', {id});\n\t},\n\n\tasync loadAll({ commit, state }, { ifEmpty }) {\n\t\tif (ifEmpty && state.biostandards.length > 0) return;\n\t\tif (!state.entityClassId) {\n\t\t\tlet entityClass = await getEntityclassByExternalId('biostandard');\n\t\t\tcommit('setEntityClassId', entityClass);\n\t\t}\n\t\tlet list = await getAllBiostandards(state.entityClassId);\n\t\tcommit('resetList', list);\n\t},\n\n\tasync update({ state, commit, getters }, standard) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('biostandard');\n\t\t\tcommit('setAttributeSetId', { id: ec.id });\n\t\t}\n\t\tlet old = getters.byId(standard.id);\n\t\tlet updated = await updateBiostandard(old, standard.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteBiostandard', { id: standard.id });\n\t\t\tcommit('addStandard', updated);\n\t\t}\n\t}\n};\n\nconst mutations = {\n\n\tsetEntityClassId(state, {id}) {\n\t\tstate.entityClassId = id;\n\t},\n\n\tsetAttributeSetId(state, {id}) {\n\t\tstate.attributeSetId = id;\n\t},\n\n\taddBiostandard(state, entity) {\n\t\tstate.biostandards.push(entity);\n\t},\n\n\tdeleteBiostandard(state, {id}) {\n\t\tlet entity = state.biostandards.find(biostandard => biostandard.id === id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet index = state.biostandards.indexOf(entity);\n\t\tstate.biostandards.splice(index, 1);\n\t},\n\n\tresetList(state, l) {\n\t\tstate.biostandards = l || [];\n\t},\n\taddStandard(state, entity) {\n\t\tstate.biostandards.push(entity);\n\t},\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post } from '@/util/request.js';\nimport { search, genericEntityUpdate } from './system.js';\n\nexport function createChecklistEntry(data, entityclassId, attributesetId) {\n\treturn post('eav/entity/create', {\n\t\tentityclass: entityclassId,\n\t\tattributeset: attributesetId,\n\t\tdata\n\t});\n}\n\nexport function getAllEntries(entityclassId) {\n\treturn search(entityclassId);\n}\n\nexport function updateEntry(oldEntry, newData, set) {\n\treturn genericEntityUpdate(oldEntry, newData, set);\n}\n\nexport async function deleteEntry(id) {\n\tlet field = await post('eav/entity/disable', id);\n\treturn field.id;\n}\n","import { toLocale } from '@/plugins/filters.js';\nimport * as Repo from '@/repository/checklist.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\n\nconst state = {\n\n\tentries: [],\n\tattributesetId: '',\n\tentityclassId: ''\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.entries.find(r => r.id === id);\n\t},\n\n\tall: (state) => {\n\t\treturn state.entries;\n\t},\n\n\tallActive: (state) => {\n\t\treturn state.entries.filter(entry => entry.data.active);\n\t}\n};\n\nconst actions = {\n\n\tasync create({ state, commit }, data) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('clentry');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('clentry');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet entity = await Repo.createChecklistEntry(data, state.entityclassId, state.attributesetId);\n\t\tcommit('addEntry', entity);\n\t},\n\n\tasync loadAll({ commit }, { ifEmpty }) {\n\t\tif (ifEmpty && state.entries.length > 0) return;\n\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('clentry');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet list = await Repo.getAllEntries(state.entityclassId);\n\t\tlist = list.sort((a, b) => toLocale(a.data.title).localeCompare(toLocale(b.data.title)));\n\t\tcommit('setEntries', list);\n\t},\n\n\tasync update({ state, commit, getters }, entry) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('clentry');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldEntry = getters.byId(entry.id);\n\t\tlet updated = await Repo.updateEntry(oldEntry, entry.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteEntry', { id: entry.id });\n\t\t\tcommit('addEntry', updated);\n\t\t}\n\t},\n\n\tasync delete({state, commit}, {id}) {\n\t\tawait Repo.deleteEntry(id);\n\t\tcommit('deleteEntry', {id});\n\t}\n\n};\n\nconst mutations = {\n\n\taddEntry(state, entity) {\n\t\tstate.entries.push(entity);\n\t},\n\tsetEntries(state, entries) {\n\t\tstate.entries = entries;\n\t},\n\tdeleteEntry(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.entries.indexOf(entity);\n\t\tstate.entries.splice(idx, 1);\n\t},\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { get, post } from '@/util/request.js';\nimport { search, genericEntityUpdate } from './system.js';\n\nexport async function createOption(data, entityclassId, attributesetId) {\n\tif (!data.order) data.order = 0;\n\tdata.order = parseInt(data.order);\n\treturn post('eav/entity/create', {\n\t\tentityclass: entityclassId,\n\t\tattributeset: attributesetId,\n\t\tdata\n\t});\n}\n\nexport function getAllOptions(entityclassId) {\n\treturn search(entityclassId);\n}\n\nexport function updateOption(oldEntry, newData, set) {\n\tif (!newData.order) newData.order = 0;\n\tnewData.order = parseInt(newData.order);\n\treturn genericEntityUpdate(oldEntry, newData, set);\n}\n","import * as Repo from '@/repository/selectoptions.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport SelectTypes from '@/assets/config/select-types.json';\nimport { toLocale } from '@/plugins/filters.js';\n\nconst state = {\n\n\ttypes: SelectTypes,\n\toptions: [],\n\tattributesetId: '',\n\tentityclassId: ''\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.options.find(r => r.id === id);\n\t},\n\n\tbyType: (state) => (type) => {\n\t\treturn state.options.filter(e => e.data.type === type);\n\t},\n\n\tbyTypeSorted: (state) => (type) => {\n\t\treturn state.options\n\t\t\t.filter(e => e.data.type === type && e.data.enabled)\n\t\t\t.sort((a, b) => {\n\t\t\t\treturn a.data.order < b.data.order ? -1 : 1;\n\t\t\t});\n\t},\n\n\tall: (state) => {\n\t\treturn state.options;\n\t},\n\n\tidToLabel: (state) => (id, type) => {\n\t\tconst allList = state.options.filter((opt) => opt.data.type === type);\n\t\tconst requiredList = allList.find((l) => l.id === id);\n\t\tif(requiredList.data.title) return toLocale(requiredList.data.title);\n\t\telse return id;\n\t},\n\n\tidFolderToLabel: (state) => (id, type) => {\n\t\tconst allList = state.options.filter((opt) => opt.data.type === type);\n\t\tconst requiredList = allList.find((l) => l.id === id);\n\t\tif(requiredList.data.title) return toLocale(requiredList.data.title);\n\t\telse return id;\n\t},\n\n};\n\nconst actions = {\n\n\tasync loadAll({ state, commit }, { ifEmpty }) {\n\t\tif (ifEmpty && state.options.length > 0) {\n\t\t\treturn;\n\t\t}\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('selectoptions');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet list = await Repo.getAllOptions(state.entityclassId);\n\t\tcommit('setOptions', list);\n\t},\n\n\tasync create({ state, commit }, data) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('selectoptions');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('selectoption');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet entity = await Repo.createOption(data, state.entityclassId, state.attributesetId);\n\t\tcommit('addOption', entity);\n\t},\n\n\tasync update({ state, commit, getters }, entry) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('selectoption');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldEntry = getters.byId(entry.id);\n\t\tlet updated = await Repo.updateOption(oldEntry, entry.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteOption', { id: entry.id });\n\t\t\tcommit('addOption', updated);\n\t\t}\n\t}\n\n};\n\nconst mutations = {\n\n\taddOption(state, entity) {\n\t\tstate.options.push(entity);\n\t},\n\tsetOptions(state, list) {\n\t\tstate.options = list;\n\t},\n\tdeleteOption(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.options.indexOf(entity);\n\t\tstate.options.splice(idx, 1);\n\t},\n\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post } from '@/util/request.js';\nimport { search, genericEntityUpdate } from './system.js';\n\nexport function createCountry(data, entityclassId, attributesetId) {\n\treturn post('eav/entity/create', {\n\t\tentityclass: entityclassId,\n\t\tattributeset: attributesetId,\n\t\tdata\n\t});\n}\n\nexport function getAllCountries(entityclassId) {\n\treturn search(entityclassId);\n}\n\nexport function updateCountry(oldEntry, newData, set) {\n\treturn genericEntityUpdate(oldEntry, newData, set);\n}\n","import * as Repo from '@/repository/country.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport { toLocale } from '@/plugins/filters';\n\nconst state = {\n\n\tcountries: [],\n\tattributesetId: '',\n\tentityclassId: ''\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.countries.find(r => r.id === id);\n\t},\n\n\tall: (state) => {\n\t\treturn state.countries;\n\t}\n\n};\n\nconst actions = {\n\n\tasync loadAll({ state, commit }, { ifEmpty }) {\n\t\tif (ifEmpty && state.countries.length > 0) return;\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('country');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet list = await Repo.getAllCountries(state.entityclassId);\n\t\tcommit('resetCountries', list);\n\t},\n\n\tasync create({ state, commit }, data) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('country');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('country');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet entity = await Repo.createCountry(data, state.entityclassId, state.attributesetId);\n\t\tcommit('addCountry', entity);\n\t},\n\n\tasync update({ state, commit, getters }, entry) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('country');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldEntry = getters.byId(entry.id);\n\t\tlet updated = await Repo.updateCountry(oldEntry, entry.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteCountry', { id: entry.id });\n\t\t\tcommit('addCountry', updated);\n\t\t}\n\t}\n\n};\n\nconst mutations = {\n\n\taddCountry(state, entity) {\n\t\tstate.countries.push(entity);\n\t},\n\tresetCountries(state, l) {\n\t\tl.sort((a, b) => {\n\t\t\treturn toLocale(a.data.title).localeCompare(toLocale(b.data.title));\n\t\t});\n\t\tstate.countries = l || [];\n\t},\n\tdeleteCountry(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.countries.indexOf(entity);\n\t\tstate.countries.splice(idx, 1);\n\t},\n\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { get, post } from '@/util/request.js';\nimport { search, genericEntityUpdate } from './system.js';\n\nexport async function createList(data, entityclassId, attributesetId) {\n\treturn post('eav/entity/create', {\n\t\tentityclass: entityclassId,\n\t\tattributeset: attributesetId,\n\t\tdata\n\t});\n}\n\nexport function getAllLists(entityclassId) {\n\treturn search(entityclassId);\n}\n\nexport function updateList(oldEntry, newData, changeset) {\n\treturn genericEntityUpdate(oldEntry, newData, changeset);\n}\n","import * as Repo from '@/repository/lists.js';\nimport { toLocale } from '@/plugins/filters';\nimport PdfLogoTypes from '@/assets/config/pdf-logo-types.json';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\n\nconst state = {\n\n\tloaded: false,\n\tlists: [],\n\tattributesetId: '',\n\tentityclassId: '',\n\tpdfLogoOptions: PdfLogoTypes\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.lists.find(r => r.id === id);\n\t},\n\n\troot: (state) => {\n\t\treturn state.lists;\n\t},\n\n\tbaseDataList: (state) => {\n\t\tlet list = state.lists.find(r => r.data.isBasedata === true);\n\t\tif (!list) throw new Error('base list is not loaded or does not exist');\n\t\treturn list;\n\t},\n\n\tgetPdfLogoOptions: (state) => {\n\t\treturn state.pdfLogoOptions;\n\t},\n\n\tallLists: (state) => {\n\t\treturn state.lists;\n\t},\n\n\teuList: (state) => {\n\t\treturn state.lists.find((e) => e.data.isBasedata);\n\t},\n\n};\n\nconst actions = {\n\n\tasync create({ state, commit }, data) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('list');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('lists');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet entity = await Repo.createList(data, state.entityclassId, state.attributesetId);\n\t\tcommit('addList', entity);\n\t},\n\n\tasync loadAll({ commit }, { ifEmpty }) {\n\t\tif (state.loaded && ifEmpty) return;\n\t\tcommit('setLoaded', true);\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('list');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet list = await Repo.getAllLists(state.entityclassId);\n\t\tlist = list.sort((a, b) => {\n\t\t\tlet valueA = toLocale(a.data.title);\n\t\t\tlet valueB = toLocale(b.data.title);\n\t\t\treturn valueA.localeCompare(valueB);\n\t\t});\n\t\tcommit('resetLists', list);\n\t},\n\n\tasync update({ state, commit, getters }, list) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('lists');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldList = getters.byId(list.id);\n\t\tlet updated = await Repo.updateList(oldList, list.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteList', { id: list.id });\n\t\t\tcommit('addList', updated);\n\t\t}\n\t}\n\n};\n\nconst mutations = {\n\n\tsetLoaded(state, l) {\n\t\tstate.loaded = l;\n\t},\n\taddList(state, entity) {\n\t\tstate.lists.push(entity);\n\t},\n\tresetLists(state, list) {\n\t\tstate.lists = list || [];\n\t},\n\tdeleteList(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.lists.indexOf(entity);\n\t\tstate.lists.splice(idx, 1);\n\t},\n\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { get, post } from '@/util/request.js';\nimport { search, genericEntityUpdate } from './system.js';\n\nexport async function createPermit(data, entityclassId, attributesetId) {\n\treturn post('eav/entity/create', {\n\t\tentityclass: entityclassId,\n\t\tattributeset: attributesetId,\n\t\tdata\n\t});\n}\n\nexport function getAllPermits(entityclassId) {\n\treturn search(entityclassId);\n}\n\nexport function updatePermit(oldEntry, newData, set) {\n\treturn genericEntityUpdate(oldEntry, newData, set);\n}\n\nexport async function deletePermit(id) {\n\tlet permit = await post('eav/entity/disable', id);\n\n\treturn permit.id;\n}\n","import * as Repo from '@/repository/permit.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\n\nconst state = {\n\n\tpermits: [],\n\tattributesetId: '',\n\tentityclassId: ''\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.permits.find(r => r.id === id);\n\t},\n\n\tall: (state) => {\n\t\treturn state.permits;\n\t},\n\n\tforListAndCategory: (state) => (listId, categoryId) => {\n\t\treturn state.permits.filter(\n\t\t\tp => (!p.data.lists || p.data.lists.length === 0 || p.data.lists.includes(listId))\n\t\t\t&& (!p.data.mainCategories || p.data.mainCategories.length === 0 || p.data.mainCategories.includes(categoryId))\n\t\t);\n\t}\n\n};\n\nconst actions = {\n\n\tasync loadAll({ state, commit }, { ifEmpty }) {\n\t\tif (ifEmpty && state.permits.length > 0) return;\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('permit');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet list = await Repo.getAllPermits(state.entityclassId);\n\t\tcommit('resetPermits', list);\n\t},\n\n\tasync create({ state, commit }, data) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('permit');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('permit');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet entity = await Repo.createPermit(data, state.entityclassId, state.attributesetId);\n\t\tcommit('addPermit', entity);\n\t},\n\n\tasync update({ state, commit, getters }, entry) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('permit');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldEntry = getters.byId(entry.id);\n\t\tlet updated = await Repo.updatePermit(oldEntry, entry.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deletePermit', { id: entry.id });\n\t\t\tcommit('addPermit', updated);\n\t\t}\n\t},\n\n\tasync delete({ commit }, {id}) {\n\t\tawait Repo.deletePermit(id);\n\t\tcommit('deletePermit', {id});\n\t},\n\n};\n\nconst mutations = {\n\n\taddPermit(state, entity) {\n\t\tstate.permits.push(entity);\n\t},\n\n\tresetPermits(state, l) {\n\t\tstate.permits = l || [];\n\t},\n\n\tdeletePermit(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.permits.indexOf(entity);\n\t\tstate.permits.splice(idx, 1);\n\t},\n\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as Repo from '@/repository/field-repository.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport FieldTypes from '@/assets/config/field-types.json';\n\nconst state = {\n\n\tfields: [],\n\toptions: [],\n\ttypes: FieldTypes,\n\tattributesetId: '',\n\tentityclassId: ''\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.fields.find(r => r.id === id);\n\t},\n\n\tbyType: (state) => (type) => {\n\t\treturn state.fields.filter(r => r.data.type === type);\n\t},\n\n\tbyPath: (state) => (p) => {\n\t\treturn state.fields.find(r => r.data.path === p);\n\t},\n\n\tall: (state) => {\n\t\treturn state.fields;\n\t},\n\n\tselectOptionById: (state) => (id) => {\n\t\treturn state.options.find(f => f.id === id);\n\t},\n\n\tforTab: (state) => (tab) => {\n\t\treturn state.fields.filter(f => f.data.displayType === 'tab' && f.data.displayKey === tab);\n\t},\n\n\tbyTable: (state) => (parentTableId) => {\n\t\treturn state.fields.filter(f => f.data.displayType === 'table' && f.data.displayKey === parentTableId);\n\t},\n\n\temptyInLists: (state) => {\n\t\treturn state.fields.filter(f => f.data.emptyInLists && f.data.emptyInLists.length);\n\t},\n\n\tgetDefaultValue: (state) => (id) => {\n\t\tconst field = state.fields.find(r => r.id === id);\n\t\tif (!field) throw new Error(`Field not found with id: ${id}`);\n\t\tswitch (field.data.type) {\n\t\t\tcase 'multitext': return {};\n\t\t\tcase 'textfield': return { textValue: '' };\n\t\t\tcase 'select': return { selectValue: '' };\n\t\t\tcase 'singleline-multitext': return {};\n\t\t\tcase 'singleline-textfield': return { textValue: '' };\n\t\t\tcase 'checkbox': return { booleanValue: false };\n\t\t\tcase 'table': return { table: [] };\n\t\t\tcase 'numberfield': return { numberValue: 0.0 };\n\t\t\tcase 'datefield': return { dateValue: '' };\n\t\t\tcase 'button': return {};\n\t\t\tcase 'multiselect': return { multiselectValue: [] };\n\t\t\tdefault: throw new Error(`Field type not found: ${field.data.type}, id: ${field.id}`);\n\t\t}\n\t}\n\n};\n\nconst actions = {\n\n\tasync create({ state, commit }, data) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('fields');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('fields');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet entity = await Repo.createField(data, state.entityclassId, state.attributesetId);\n\t\tcommit('addField', entity);\n\t},\n\n\tasync loadAll({ commit }, { ifEmpty }) {\n\t\tif (ifEmpty && state.fields.length > 0) {\n\t\t\treturn state.fields;\n\t\t}\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('fields');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet list = await Repo.getAllFields(state.entityclassId);\n\t\tcommit('setFields', list);\n\t\tcommit('setOptions');\n\n\t\treturn list;\n\t},\n\n\tasync update({ state, commit, getters }, list) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('fields');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldField = getters.byId(list.id);\n\t\tlet updated = await Repo.updateField(oldField, list.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteField', { id: list.id });\n\t\t\tcommit('addField', updated);\n\t\t}\n\t},\n\n\tasync delete({state, commit}, {id}) {\n\t\tawait Repo.deleteField(id);\n\t\tcommit('deleteField', {id});\n\t},\n\n};\n\nconst mutations = {\n\n\taddField(state, entity) {\n\t\tstate.fields.push(entity);\n\t},\n\tsetFields(state, fields) {\n\t\tstate.fields = fields;\n\t},\n\tdeleteField(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.fields.indexOf(entity);\n\t\tstate.fields.splice(idx, 1);\n\t},\n\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\tsetOptions(state) {\n\t\tstate.options = state.fields\n\t\t\t.filter(f => f.data.type === 'select' && typeof f.data.optionSource === 'undefined')\n\t\t\t.map(f => f.data.options)\n\t\t\t.flat();\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as SystemRepository from '@/repository/system.js';\nimport * as InvoiceRepository from '@/repository/invoice.js';\nimport { constructSelectionFilter } from '@/util/search/query-generator';\n\nconst ENTITY_EXTERNAL_ID = 'invoice';\nconst INDEX_DATA_ITEMS = [ 'customerNumber', 'invoiceNumber' ];\nconst BOOL_FILTER = [ 'isCancelled', 'isSent' ];\n\nconst state = {\n\n\tentityclassId: null,\n\tattributesetId: null,\n\tinvoices: [],\n\tcheckedBaseline: false,\n\tcheckedRows: [],\n\tlistFilter: {\n\t\ttype: '',\n\t\tinstitution: '',\n\t\ttargetYear: 0,\n\t\tsendDate: '',\n\t\tinvoiceDate: '',\n\t\tperiodDescription: {},\n\t\tcompanyId: '',\n\t\tcustomerNumber: '',\n\t\tinvoiceNumber: '',\n\t\tisCancelled: null,\n\t\tisSent: null,\n\t\tshowMarkedAsSent: false\n\t},\n\tcreationModal: {\n\t\tlists: [],\n\t\ttype: 'yearly',\n\t\tinstitution: '',\n\t\ttargetYear: parseInt(new Date().toJSON().substring(0, 4)),\n\t\tinvoiceDate: new Date().toJSON().substring(0, 10),\n\t\tstandardEndDateFrom: null,\n\t\tstandardEndDateTo: null,\n\t\tperiodDescription: {\n\t\t\tde_DE: ''\n\t\t},\n\t\temailText: {\n\t\t\tde_DE: ''\n\t\t},\n\t\tdryRun: false,\n\t\tourSignId: null,\n\t},\n\tselection: {\n\t\tblacklistMode: false,\n\t\titems: []\n\t},\n\tsendDateComparator: 'eq',\n\tinvoiceDateComparator: 'eq',\n\tlistTotalCount: 0,\n\tinvoicedInvoices: []\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.invoices.find(invoice => invoice.id === id);\n\t},\n\n\tgetFilterByOption: state => option => {\n\t\treturn state.listFilter[option];\n\t},\n\n\tgetCreationModalParamters: state => {\n\t\treturn state.creationModal;\n\t},\n\n\tgetCreationModalParamter: state => (name) => {\n\t\treturn state.creationModal[name];\n\t},\n\n\tgetListFilter: state => filter => {\n\t\treturn state.listFilter[filter];\n\t},\n\n\tgetComparator: state => comparator => {\n\t\treturn state[comparator];\n\t},\n\n\tgetListAttributeFilter: (state) => {\n\t\tlet $and = [];\n\t\tfunction getBoolFilter(item, data) {\n\t\t\tif (data === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (item === 'isSent') {\n\t\t\t\titem = 'sendDate';\n\t\t\t}\n\t\t\tif (item === 'isCancelled') {\n\t\t\t\titem = 'cancellationDate';\n\t\t\t}\n\t\t\tlet filter = {\n\t\t\t\tfield: '/data',\n\t\t\t\tcomparison: 'exists',\n\t\t\t\tvalue: item\n\t\t\t};\n\t\t\treturn data ? filter : { $not: filter };\n\t\t}\n\t\tfor (let [ item, data ] of Object.entries(state.listFilter)) {\n\t\t\tlet comparator = 'eq';\n\t\t\tif (item === 'showMarkedAsSent') {\n\t\t\t\tif (!data) {\n\t\t\t\t\t$and.push({\n\t\t\t\t\t\t$or: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: '/data/sendDate',\n\t\t\t\t\t\t\t\tcomparison: 'gte',\n\t\t\t\t\t\t\t\tvalue: new Date('2000').toJSON().substring(0, 10)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$not: {\n\t\t\t\t\t\t\t\t\tfield: '/data',\n\t\t\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\t\t\tvalue: 'sendDate'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!BOOL_FILTER.includes(item)) {\n\t\t\t\tif (!data || typeof data === 'object' && !Object.keys(data).length) continue;\n\t\t\t}\n\t\t\tif (INDEX_DATA_ITEMS.includes(item)) {\n\t\t\t\tif (item === 'customerNumber') {\n\t\t\t\t\t$and.push({\n\t\t\t\t\t\tfield: `/data/indexData/company/${item}`,\n\t\t\t\t\t\tcomparison: comparator,\n\t\t\t\t\t\tvalue: data\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t$and.push({\n\t\t\t\t\t\tfield: `/data/indexData/${item}`,\n\t\t\t\t\t\tcomparison: comparator,\n\t\t\t\t\t\tvalue: data\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (item.includes('Date')) {\n\t\t\t\t\tcomparator = state[`${item}Comparator`] ? state[`${item}Comparator`] : 'eq';\n\t\t\t\t}\n\t\t\t\tif (BOOL_FILTER.includes(item)) {\n\t\t\t\t\tlet filter = getBoolFilter(item, data);\n\t\t\t\t\tif (filter) {\n\t\t\t\t\t\t$and.push(filter);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$and.push({\n\t\t\t\t\t\tfield: `/data/${item}`,\n\t\t\t\t\t\tcomparison: comparator,\n\t\t\t\t\t\tvalue: data\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { $and };\n\t},\n\n\tbyIds: (state) => (invoicIds) => {\n\t\tif (!invoicIds || !Array.isArray(invoicIds)) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn state.invoices.filter(category => invoicIds.includes(category.id));\n\t},\n\n\tgetAll: (state) => {\n\t\treturn state.invoices;\n\t},\n\n\tgetListFinalFilter: (state, getters) => {\n\t\treturn constructSelectionFilter(getters.getListAttributeFilter, state.selection);\n\t},\n\n\tgetSelectedItems: (state) => {\n\t\treturn state.selection.items;\n\t},\n\n\tgetBlacklistMode: (state) => {\n\t\treturn state.selection.blacklistMode;\n\t},\n\n\tgetCheckedCount: (state, getters, rootState) => {\n\t\tif (state.selection.blacklistMode) {\n\t\t\treturn rootState.productlist.productSearchCount - state.selection.items.length;\n\t\t}\n\t\treturn state.selection.items.length;\n\t},\n\tgetInvoicedList: () => (sum, invoice, company) => {\n\t\treturn {\n\t\t\tid: invoice.id,\n\t\t\ttargetYear: invoice.data.targetYear,\n\t\t\tsendDate: invoice.data.sendDate,\n\t\t\tinvoiceDate: invoice.data.invoiceDate,\n\t\t\tlistId: sum.listId,\n\t\t\ttype: invoice.data.type,\n\t\t\tinvoiceNumber: invoice.data.indexData.invoiceNumber,\n\t\t\tcompanyName: company ? company.data.baseData.companyAbbreviation: '',\n\t\t\tcustomerNumber: company ? company.data.baseData.customerNumber : '',\n\t\t\tcancellationDate: invoice.data.cancellationDate,\n\t\t\tunindex: sum.unindex\n\t\t};\n\t}\n\n};\n\nconst actions = {\n\n\tasync ensureAttributesetEntityclassLoaded({ commit }) {\n\t\tif (!state.entityclassId) {\n\t\t\tconst ec = await SystemRepository.getEntityclassByExternalId(ENTITY_EXTERNAL_ID);\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tconst as = await SystemRepository.getAttributesetByExternalId(ENTITY_EXTERNAL_ID);\n\t\t\tcommit('setAsId', { id: as.id });\n\t\t}\n\t},\n\n\tasync load({ dispatch, commit }, { filter, pagination, sorting }) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tlet list = await SystemRepository.search(state.entityclassId, filter, pagination, sorting);\n\t\tlet count = await SystemRepository.countEntries(state.entityclassId, filter);\n\t\tlist = list.map(invoice => {\n\t\t\tinvoice.data.invoiceId = invoice.id;\n\t\t\treturn invoice;\n\t\t});\n\t\tcommit('setListCount', count);\n\t\tcommit('setInvoices', { invoices: list });\n\t\treturn list;\n\t},\n\n\tfindInvoicedSpecialItems({ rootGetters }, { ids }) {\n\t\tlet responsible = rootGetters['product/getValue']('_responsible');\n\t\tif (!responsible || !responsible.institution) {\n\t\t\treturn [];\n\t\t}\n\t\treturn InvoiceRepository.findInvoicedSpecialItems({ ids, institutionId: responsible.institution });\n\t},\n\n\tasync loadInvoicedInvoices({ commit, rootGetters, dispatch, getters }, { productId }) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tlet responsible = rootGetters['product/getValue']('_responsible');\n\t\tif (!responsible || !responsible.institution) {\n\t\t\tconsole.warn('No institution found for list.');\n\t\t\treturn [];\n\t\t}\n\t\tlet filter = { $and: [\n\t\t\t{\n\t\t\t\tfield: '/data/sums/productId',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: productId\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: '/data',\n\t\t\t\tcomparison: 'exists',\n\t\t\t\tvalue: 'sendDate'\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: '/data/institution',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: responsible.institution\n\t\t\t}\n\t\t]};\n\t\tlet list = await SystemRepository.search(state.entityclassId, filter);\n\t\tlet invoicedLists = [];\n\t\tlet companyIds = [ ...new Set(list.map(invoice => invoice.data.companyId))];\n\t\tlet companies = await dispatch('companylist/loadByIds', companyIds, { root: true });\n\t\tfor (let invoice of list) {\n\t\t\tlet company = companies.find(company => company.id === invoice.data.companyId);\n\t\t\tfor (let sum of invoice.data.sums) {\n\t\t\t\tif (sum.productId === productId) {\n\t\t\t\t\tlet invoicedList = getters.getInvoicedList(sum, invoice, company);\n\t\t\t\t\tinvoicedLists.push(invoicedList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcommit('setInvoicedInvoices', invoicedLists);\n\t\treturn invoicedLists;\n\t},\n\n\tasync update({ commit, dispatch, getters, state }, invoice) {\n\t\tawait dispatch('ensureAttributesetEntityclassLoaded');\n\t\tlet oldEntity = JSON.parse(JSON.stringify(getters.byId(invoice.invoiceId)));\n\t\tdelete oldEntity.data.invoiceId;\n\t\tlet invoiceCopy = JSON.parse(JSON.stringify(invoice));\n\t\tdelete invoiceCopy.invoiceId;\n\t\tconst updated = await InvoiceRepository.updateInvoice(oldEntity, invoiceCopy, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('updateInvoice', { invoice: updated });\n\t\t}\n\t\treturn updated;\n\t},\n\n\tdeleteSelected({ getters }) {\n\t\treturn InvoiceRepository.deleteSelection(getters.getListFinalFilter);\n\t},\n\n\tsendSelected({ getters }) {\n\t\treturn InvoiceRepository.sendSelection(getters.getListFinalFilter);\n\t},\n\n\tmarkForUnindex(_, data) {\n\t\treturn InvoiceRepository.markForUnindex(data);\n\t},\n\n\tmarkSelectedAsPseudoSent({ getters }) {\n\t\treturn InvoiceRepository.markAsPseudoSent(getters.getListFinalFilter);\n\t}\n\n};\n\nconst mutations = {\n\tsetFilterOption(state, { filter, value }) {\n\t\tif (filter === 'active') {\n\t\t\tstate.listFilter[filter].booleanValue = value;\n\t\t} else {\n\t\t\tstate.listFilter[filter] = value;\n\t\t}\n\t\tstate.selection.blacklistMode = false;\n\t\tstate.selection.items = [];\n\t},\n\tsetComparator(state, { comparator, value }) {\n\t\tif (comparator && comparator in state) {\n\t\t\tstate[comparator] = value;\n\t\t}\n\t},\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\taddInvoice(state, { invoice }) {\n\t\taddUpdateInvoice(state, invoice);\n\t},\n\tupdateInvoice(state, { invoice }) {\n\t\tif (!invoice.invoiceId) return;\n\t\tlet entry = state.invoices.find(old => old.id === invoice.invoiceId);\n\t\tentry.data = invoice;\n\t},\n\t// deleteInvoice(state, { id }) {\n\t// \tconst textIndex = state.categoryTexts.findIndex(categoryText => categoryText.id === id);\n\t// \tif (textIndex === -1) throw new Error(`entity not found: ${id}`);\n\t// \tstate.categoryTexts.splice(textIndex, 1);\n\t// },\n\tsetInvoices(state, { invoices }) {\n\t\tif (!invoices || !invoices.length) {\n\t\t\tstate.invoices = [];\n\t\t\treturn;\n\t\t}\n\t\tstate.invoices = invoices;\n\t},\n\tsetListCount(state, count) {\n\t\tstate.listTotalCount = count;\n\t},\n\tsetBlacklistMode(state, value) {\n\t\tstate.selection.blacklistMode = value;\n\t\tstate.selection.items = [];\n\t},\n\tsetSelectedItems(state, items) {\n\t\tstate.selection.items = items;\n\t},\n\tsetCreationModalParamter(state, { key, value }) {\n\t\tstate.creationModal[key] = value;\n\t},\n\tresetFilter(state) {\n\t\tstate.listFilter = {\n\t\t\ttype: '',\n\t\t\tinstitution: '',\n\t\t\ttargetYear: 0,\n\t\t\tsendDate: '',\n\t\t\tinvoiceDate: '',\n\t\t\tperiodDescription: {},\n\t\t\tcompanyId: '',\n\t\t\tcustomerNumber: '',\n\t\t\tinvoiceNumber: '',\n\t\t\tisCancelled: null,\n\t\t\tisSent: null\n\t\t};\n\t\tstate.sendDateComparator = 'eq';\n\t\tstate.invoiceDateComparator = 'eq';\n\t},\n\tsetInvoicedInvoices(state, list) {\n\t\tstate.invoicedInvoices = list || [];\n\t},\n\tupdateInvoicedList(state, invoicedList) {\n\t\tlet index = state.invoicedInvoices.findIndex(list => list.productId === invoicedList.productId && list.listId === invoicedList.listId);\n\t\tif (index > -1) {\n\t\t\tstate.invoicedInvoices.splice(index, 1, invoicedList);\n\t\t}\n\t}\n};\n\nfunction addUpdateInvoice(state, invoice) {\n\tif (!invoice.id) return;\n\tconst oldInvoice = state.invoices.findIndex(entry => entry.id === invoice.id);\n\tif (oldInvoice !== -1) {\n\t\tstate.invoices.splice(oldInvoice, 1, invoice);\n\t} else {\n\t\tstate.invoices.push(invoice);\n\t}\n}\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post as sendPostRequest } from '@/util/request.js';\nimport { search, genericEntityUpdate } from './system.js';\n\nexport async function createComponent(title, parentId, disabled, entityclass, attributeset) {\n\tlet data = {};\n\tdata.title = title;\n\tif (typeof parentId === 'string' && parentId !== '') data.parent = parentId;\n\tif (typeof disabled !== 'undefined') data.disabled = disabled;\n\tif (JSON.stringify(data.disabled) === '{}') data.disabled = false;\n\n\tlet entity = {\n\t\tentityclass,\n\t\tattributeset,\n\t\tdata\n\t};\n\n\tlet createdEntity = await sendPostRequest('eav/entity/create', entity);\n\n\treturn createdEntity;\n}\n\nexport function updateComponent(oldComponent, newData, set) {\n\treturn genericEntityUpdate(oldComponent, newData, set);\n}\n\nexport async function deleteComponent(id) {\n\tlet deletedEntity = await sendPostRequest('eav/entity/disable', id);\n\n\treturn deletedEntity.id;\n}\n\nexport function getAllComponents(entityclassId) {\n\treturn search(entityclassId);\n}\n","import * as Repo from '@/repository/component.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport { toLocale, toSortable } from '@/plugins/filters.js';\n\nconst state = {\n\n\tcomponents: [],\n\tattributesetId: '',\n\tentityclassId: ''\n\n};\n\nconst getters = {\n\tbyParent: (state) => (id) => {\n\t\treturn state.components.filter(c => c.data.parent === id);\n\t},\n\tbyId: (state) => (id) => {\n\t\treturn state.components.find(c => c.id === id);\n\t},\n\tall: (state) => {\n\t\treturn state.components;\n\t},\n\tgetLevel: (state, getters) => (id) => {\n\t\tlet actualDepth = 0;\n\t\tlet traverseElements = function(elements, depth) {\n\t\t\tfor (const el of elements) {\n\t\t\t\tif (el.id === id) {\n\t\t\t\t\tactualDepth = depth;\n\t\t\t\t}\n\n\t\t\t\tif (el.children && el.children.length > 0) {\n\t\t\t\t\ttraverseElements(el.children, depth + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\ttraverseElements(getters.roots, 0);\n\t\treturn actualDepth;\n\t},\n\tpathToRoot: (state, getters) => (ids) => {\n\t\tlet entries = ids;\n\t\tfor (const id of ids) {\n\t\t\tconst category = getters.byId(id);\n\t\t\tif (category?.data.parent) {\n\t\t\t\tlet parent = getters.byId(category.data.parent);\n\t\t\t\twhile (parent) {\n\t\t\t\t\tif (!entries.includes(parent.id)) {\n\t\t\t\t\t\tentries.push(parent.id);\n\t\t\t\t\t}\n\t\t\t\t\tparent = getters.byId(parent.data.parent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn entries;\n\t},\n\trootByMainCategory: (state) => (mainCategoryKey) => {\n\t\treturn getters.roots(state).find(f => f.data.mainCategoryMapping === mainCategoryKey);\n\t},\n\troots: (state) => {\n\t\treturn state.components.filter(r => !r.data.parent).sort((a, b) => {\n\t\t\treturn a.data.order < b.data.order ? -1 : 1;\n\t\t});\n\t},\n\tnumberString: (state, getters) => (id) => {\n\t\tlet numberString = '';\n\t\tif (!id) {\n\t\t\treturn '';\n\t\t}\n\t\tlet result = getters.pathToRoot([ id ]);\n\t\tif (!result) return '';\n\t\tresult = result.reverse();\n\t\tlet index = 0;\n\t\twhile (result[index]) {\n\t\t\tlet component = getters.byId(result[index]);\n\t\t\tnumberString = numberString ? `${numberString}-${component.data.order}` : component.data.order;\n\t\t\tindex++;\n\t\t}\n\t\treturn numberString;\n\t},\n};\n\nconst CLASS_ID = 'component';\n\nconst actions = {\n\n\tasync create({ state, commit, getters }, { title, parentId, disabled }) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId(CLASS_ID);\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId(CLASS_ID);\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet entity = await Repo.createComponent(title, parentId, disabled, state.entityclassId, state.attributesetId);\n\t\tcommit('addComponent', entity);\n\n\t\tif (parentId) {\n\t\t\tconst parent = getters.byId(parentId);\n\t\t\tcommit('addChild', { parent, child: entity });\n\t\t}\n\t},\n\n\tasync update({ commit, state, getters }, component) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId(CLASS_ID);\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldComponent = getters.byId(component.id);\n\t\tif(component.data.parent === '')\n\t\t\tdelete component.data.parent;\n\t\tlet updated = await Repo.updateComponent(oldComponent, component.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteComponent', { id: component.id });\n\t\t\tcommit('addComponent', updated);\n\t\t\tif (updated.data.parent) {\n\t\t\t\tconst parent = getters.byId(updated.data.parent);\n\t\t\t\tcommit('removeChild', { parent, childId: updated.id });\n\t\t\t\tcommit('addChild', { parent, child: updated });\n\t\t\t}\n\t\t}\n\t},\n\n\tasync delete({ commit, dispatch }, { entry }) {\n\t\tif (typeof entry === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof entry.children !== 'undefined') {\n\t\t\tlet list = new Set(entry.children);\n\t\t\tfor (let child of list) {\n\t\t\t\tawait dispatch('delete', {entry: child});\n\t\t\t}\n\t\t}\n\n\t\tawait Repo.deleteComponent(entry.id);\n\t\tcommit('deleteComponent', { id: entry.id });\n\n\t\tif (entry.data.parent) {\n\t\t\tconst parent = getters.byId(state)(entry.data.parent);\n\t\t\tcommit('removeChild', { parent, childId: entry.id });\n\t\t}\n\t},\n\n\tasync loadAll({ state, commit }, { ifEmpty }) {\n\t\tif (ifEmpty && state.components.length > 0) return;\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId(CLASS_ID);\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet list = await Repo.getAllComponents(state.entityclassId);\n\t\tcommit('setList', list);\n\t},\n\n};\n\nconst mutations = {\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\taddChild(state, { parent, child }) {\n\t\tif (!parent.children) {\n\t\t\tparent.children = [];\n\t\t}\n\n\t\tparent.children.push(child);\n\t},\n\tremoveChild(state, { parent, childId }) {\n\t\tif (!parent.children) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst idx = parent.children.findIndex(f => f.id === childId);\n\t\tparent.children.splice(idx, 1);\n\t},\n\tsetList(state, components) {\n\t\tcomponents = components.sort((a, b) => {\n\t\t\treturn a.data.order < b.data.order ? -1 : 1;\n\t\t});\n\t\tstate.components = components;\n\t\tfor (let entity of state.components) {\n\t\t\tif (!entity.children) {\n\t\t\t\tentity.children = [];\n\t\t\t}\n\n\t\t\tentity.children = getters.byParent(state)(entity.id);\n\t\t}\n\t},\n\taddComponent(state, entity) {\n\t\tif (!entity.children) {\n\t\t\tentity.children = [];\n\t\t}\n\n\t\tentity.children = getters.byParent(state)(entity.id);\n\t\tstate.components.push(entity);\n\t},\n\n\tdeleteComponent(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.components.indexOf(entity);\n\t\tstate.components.splice(idx, 1);\n\t},\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post as sendPostRequest } from '@/util/request.js';\nimport { search, genericEntityUpdate } from './system.js';\n\nexport async function createEntry(title, parentId, disabled, entityclass, attributeset) {\n\tlet data = {};\n\tdata.title = title;\n\tif (typeof parentId === 'string' && parentId !== '') data.parent = parentId;\n\tif (typeof disabled !== 'undefined') data.disabled = disabled;\n\tif (JSON.stringify(data.disabled) === '{}') data.disabled = false;\n\n\tlet entity = {\n\t\tentityclass,\n\t\tattributeset,\n\t\tdata\n\t};\n\n\tlet createdEntity = await sendPostRequest('eav/entity/create', entity);\n\n\treturn createdEntity;\n}\n\nexport function updateEntry(oldEntry, newData, set) {\n\treturn genericEntityUpdate(oldEntry, newData, set);\n}\n\nexport async function deleteEntry(id) {\n\tlet deletedEntity = await sendPostRequest('eav/entity/disable', id);\n\n\treturn deletedEntity.id;\n}\n\nexport function getAllEntries(entityclassId) {\n\treturn search(entityclassId);\n}\n","import * as Repo from '@/repository/hobbygarden.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\n\nconst state = {\n\n\tentries: [],\n\tattributesetId: '',\n\tentityclassId: ''\n\n};\n\nconst getters = {\n\troots: (state) => {\n\t\treturn state.entries.filter(c => !c.data.parent);\n\t},\n\tbyParent: (state) => (id) => {\n\t\treturn state.entries.filter(c => c.data.parent === id);\n\t},\n\tbyId: (state) => (id) => {\n\t\treturn state.entries.find(c => c.id === id);\n\t},\n\tall: (state) => {\n\t\treturn state.entries;\n\t},\n\tgetLevel: (state, getters) => (id) => {\n\t\tlet actualDepth = 0;\n\t\tlet traverseElements = function(elements, depth) {\n\t\t\tfor (const el of elements) {\n\t\t\t\tif (el.id === id) {\n\t\t\t\t\tactualDepth = depth;\n\t\t\t\t}\n\n\t\t\t\tif (el.children && el.children.length > 0) {\n\t\t\t\t\ttraverseElements(el.children, depth + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\ttraverseElements(getters.roots, 0);\n\t\treturn actualDepth;\n\t},\n\n\tpathToRoot: (state, getters) => (ids) => {\n\t\tlet entries = ids;\n\t\tfor (const id of ids) {\n\t\t\tconst entry = getters.byId(id);\n\t\t\tif (entry.data.parent) {\n\t\t\t\tlet parent = getters.byId(entry.data.parent);\n\t\t\t\twhile (parent) {\n\t\t\t\t\tif (!entries.includes(parent.id)) {\n\t\t\t\t\t\tentries.push(parent.id);\n\t\t\t\t\t}\n\n\t\t\t\t\tparent = getters.byId(parent.data.parent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn entries;\n\t}\n};\n\nconst CLASS_ID = 'hobbygarden';\n\nconst actions = {\n\n\tasync _setEntityClassId({ state, commit }) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId(CLASS_ID);\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t},\n\n\tasync _setAttributeSetId({ state, commit }) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId(CLASS_ID);\n\t\t\tcommit('setAsId', {id: ec.id});\n\t\t}\n\t},\n\n\tasync create({ state, commit, dispatch, getters }, { title, parentId, disabled }) {\n\t\tawait dispatch('_setEntityClassId');\n\t\tawait dispatch('_setAttributeSetId');\n\n\t\tlet entity = await Repo.createEntry(title, parentId, disabled, state.entityclassId, state.attributesetId);\n\t\tcommit('addEntry', entity);\n\n\t\tif (parentId) {\n\t\t\tconst parent = getters.byId(parentId);\n\t\t\tcommit('addChild', { parent, child: entity });\n\t\t}\n\t},\n\n\tasync update({ commit, state, dispatch, getters }, entry) {\n\t\tawait dispatch('_setAttributeSetId');\n\t\tlet oldEntry = getters.byId(entry.id);\n\n\t\tlet updated = await Repo.updateEntry(oldEntry, entry.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteEntry', { id: entry.id });\n\t\t\tcommit('addEntry', updated);\n\n\t\t\tif (updated.data.parent) {\n\t\t\t\tconst parent = getters.byId(updated.data.parent);\n\t\t\t\tcommit('removeChild', { parent, childId: updated.id });\n\t\t\t\tcommit('addChild', { parent, child: updated });\n\t\t\t}\n\t\t}\n\t},\n\n\tasync delete({ commit, dispatch }, { entry }) {\n\t\tif (typeof entry === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof entry.children !== 'undefined') {\n\t\t\tlet list = new Set(entry.children);\n\t\t\tfor (let child of list) {\n\t\t\t\tawait dispatch('delete', {entry: child});\n\t\t\t}\n\t\t}\n\n\t\tawait Repo.deleteEntry(entry.id);\n\t\tcommit('deleteEntry', { id: entry.id });\n\n\t\tif (entry.data.parent) {\n\t\t\tconst parent = getters.byId(state)(entry.data.parent);\n\t\t\tcommit('removeChild', { parent, childId: entry.id });\n\t\t}\n\t},\n\n\tasync loadAll({ state, commit, dispatch }, { ifEmpty }) {\n\t\tif (ifEmpty && state.entries.length > 0) return;\n\n\t\tawait dispatch('_setEntityClassId');\n\n\t\tlet list = await Repo.getAllEntries(state.entityclassId);\n\t\tcommit('setList', list);\n\t},\n\n};\n\nconst mutations = {\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\taddChild(state, { parent, child }) {\n\t\tif (!parent.children) {\n\t\t\tparent.children = [];\n\t\t}\n\n\t\tparent.children.push(child);\n\t},\n\tremoveChild(state, { parent, childId }) {\n\t\tif (!parent.children) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst idx = parent.children.findIndex(f => f.id === childId);\n\t\tparent.children.splice(idx, 1);\n\t},\n\tsetList(state, entries) {\n\t\tstate.entries = entries;\n\n\t\tfor (let entity of state.entries) {\n\t\t\tif (!entity.children) {\n\t\t\t\tentity.children = [];\n\t\t\t}\n\n\t\t\tentity.children = getters.byParent(state)(entity.id);\n\t\t}\n\t},\n\taddEntry(state, entity) {\n\t\tif (!entity.children) {\n\t\t\tentity.children = [];\n\t\t}\n\n\t\tentity.children = getters.byParent(state)(entity.id);\n\t\tstate.entries.push(entity);\n\t},\n\n\tdeleteEntry(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.entries.indexOf(entity);\n\t\tstate.entries.splice(idx, 1);\n\t},\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import Vue from 'vue';\nimport * as Repo from '@/repository/product.js';\nimport { search, getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport { generateSortFields } from '@/util/search/sort-util';\nimport {SimpleFilter} from '@/util/search/structures';\nimport {generateQueryFromSearchRoot} from '@/util/search/query-generator';\nimport ApprovalWorkflowService from '@/util/approval-workflow-service';\nimport { deepGet, deepSet } from '@/util/field-helper.js';\nimport { doNotUnlinkNewLists } from '@/util/component-helper.js';\nimport { toLocale } from '@/plugins/filters';\n\nconst state = {\n\tproducts: [],\n\tproductSearchCache: [],\n\tproductSearchCount: null,\n\tcompanyCache: [],\n\tattributesetId: '',\n\tentityclassId: '',\n\tsort: null,\n\tpaginationStart: 0,\n\tpaginationLimit: 10\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\t//component, subproductlist, cloning\n\t\treturn state.products.find(r => r.id === id);\n\t},\n\n\tall: (state) => {\t//unused\n\t\treturn state.products;\n\t},\n\n\tsearchCached: (state) => {\n\t\treturn state.productSearchCache;\n\t},\n\n\tgetDerivedProductId: (state) => (id) => {\t//subproductlist\n\t\tconst product = state.products.find(r => r.id === id);\n\t\tif (product && product.data.derivedProductId) {\n\t\t\treturn product.data.derivedProductId;\n\t\t}\n\n\t\treturn null;\n\t},\n\n\tgetDerivedProduct: (state, getters) => (id) => {\t//component, productui\n\t\tconst product = getters.byId(id);\n\t\tif (!product || !product.data.derivedProductId) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn getters.byId(product.data.derivedProductId);\n\t},\n\n\tgetBaseApproval: (state, getters) => (id) => {\t//not used\n\t\tconst product = getters.byId(id);\n\t\tif (!product) throw new Error(`product not loaded: ${id}`);\n\t\tif (product.data.baseApproval) {\n\t\t\treturn product.data.baseApproval;\n\t\t}\n\t\treturn null;\n\t},\n\n\tisCreatedByNationalPartner: (state, getters) => (id) => {\t//by many\n\t\tconst p = getters.byId(id);\n\t\tif (!p) return false;\n\t\treturn !!p.data.isNationalPartner;\n\t},\n\n\tisInitiatedByNationalPartner: (state, getters) => (id) => {\n\t\tconst p = getters.byId(id);\n\t\treturn p && !!p.data.isNationalPartnerInitial;\n\t},\n\n\tgetProductsByInstitutions: (state) => (institutions) => {\t//nur in notes\n\t\tlet productsByInstitutions = [];\n\n\t\tfor (const product of state.products) {\n\t\t\tif (productsByInstitutions.find(f => f.id === product.id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!product.data.listData) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (const list of Object.values(product.data.listData)) {\n\t\t\t\tconst responsible = list._responsible;\n\t\t\t\tif (responsible && responsible.institution && institutions.find(f => f.id === responsible.institution)) {\n\t\t\t\t\tproductsByInstitutions.push(product);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn productsByInstitutions;\n\t},\n\n\tgetSort: (state) => {\n\t\treturn state.sort;\n\t},\n};\n\nconst actions = {\n\n\tasync _setEntityClassId({ state, commit }) {\n\t\tif (!state.entityclassId) {\n\t\t\tconst ec = await getEntityclassByExternalId('products');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t},\n\n\tasync _setAttributeSetId({ state, commit }) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('products');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t},\n\n\tasync create({ commit, dispatch }, data) {\n\t\tawait dispatch('_setEntityClassId');\n\t\tawait dispatch('_setAttributeSetId');\n\t\tlet entity = await Repo.createProduct(data);\n\t\tcommit('addProduct', entity);\n\n\t\treturn entity.id;\n\t},\n\n\tasync setDerivedProduct({ commit, dispatch, rootGetters }, { id, derivedProductId }) {\n\t\tawait dispatch('_setAttributeSetId');\n\t\tconst result = await Repo.setDerivedProductId(id, derivedProductId, state.attributesetId, rootGetters['field/byPath'], rootGetters['field/getDefaultValue']);\n\t\tif (!result) return;\n\t\tcommit('setDerivedProduct', { id, derivedProductId });\n\t\tcommit('product/setLoadedList', { full: result.data.listData }, { root: true });\n\t\tdispatch('product/switchList', { list: rootGetters['product/getCurrentListId'] }, { root: true });\n\t},\n\n\tasync addList({ state, dispatch, rootGetters, commit }, { productId, listId }) {\n\t\tif (!productId || !listId) return false;\n\t\tawait dispatch('_setAttributeSetId');\n\t\tlet list = rootGetters['list/byId'](listId);\n\t\tif (!list) return false;\n\t\tconst baseListId = rootGetters['list/baseDataList'].id;\n\t\tlet product = await Repo.loadProductWithCache(productId);\n\t\tlet oldBaseListData = JSON.parse(JSON.stringify(product.data.listData[baseListId]));\n\t\tlet fieldsEmptyInList = rootGetters['field/emptyInLists'];\n\t\tfieldsEmptyInList = fieldsEmptyInList.filter(field => {\n\t\t\tlet parentField = rootGetters['field/byId'](field.data.displayKey);\n\t\t\treturn !(parentField && fieldsEmptyInList.find(parent => parent.id === field.data.displayKey));\n\t\t});\n\t\ttry {\n\t\t\tfieldsEmptyInList = fieldsEmptyInList.map(field => {\n\t\t\t\tlet parentField = rootGetters['field/byId'](field.data.displayKey);\n\t\t\t\tlet parentData = null;\n\t\t\t\tif (field.data.type === 'table') {\n\t\t\t\t\tparentData = { table: [] };\n\t\t\t\t\tparentField = null;\n\t\t\t\t} else if (parentField && parentField.data.emptyInLists && parentField.data.emptyInLists.find(emptyInList => emptyInList === listId)) {\n\t\t\t\t\tparentData = oldBaseListData[parentField.data.path];\n\t\t\t\t\tif (parentData) {\n\t\t\t\t\t\tif (parentData.table && parentData.table.length) {\n\t\t\t\t\t\t\tfor (let currentRow of parentData.table) {\n\t\t\t\t\t\t\t\tcurrentRow[field.data.path] = rootGetters['field/getDefaultValue'](field.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn { path: field.data.path,\n\t\t\t\t\temptyInLists: field.data.emptyInLists,\n\t\t\t\t\tdefaultValue: parentData ? parentData : rootGetters['field/getDefaultValue'](field.id)};\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t\tthrow e;\n\t\t}\n\t\tconst result = await Repo.addList(productId, listId, baseListId, state.attributesetId, rootGetters['auth/user/getCurrentAccountId'], fieldsEmptyInList);\n\t\tif (!result) return false;\n\t\tcommit('product/addList', { listId }, { root: true });\n\t\tcommit('product/setLoadedList', { list, data: result }, { root: true });\n\t\treturn true;\n\t},\n\n\tasync resetNationalPartnerStatus({ state, commit, dispatch }, { id }) {\n\t\tawait dispatch('_setAttributeSetId');\n\n\t\tawait Repo.resetNationalPartnerStatus(id, state.attributesetId);\n\t\tcommit('resetNationalPartnerStatus', { id });\n\t},\n\n\tasync archiveList({ rootGetters, dispatch, commit }, { id, listId, archived }) {\n\t\tawait dispatch('_setAttributeSetId');\n\n\t\tconst baseListId = rootGetters['list/baseDataList'].id;\n\n\t\tif (listId === baseListId) {\n\t\t\treturn;\n\t\t}\n\n\t\tawait Repo.setListArchived(id, listId, archived, state.attributesetId);\n\t\tcommit('product/setListArchived', { listId, archived }, { root: true });\n\t},\n\n\tasync delete({ commit }, { entry }) {\n\t\tif (typeof entry === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tawait Repo.deleteProduct(entry.id);\n\t\tcommit('deleteProduct', { id: entry.id });\n\t},\n\n\tasync _createCompanyCache({ state, commit, dispatch }) {\n\t\tif (!state.productSearchCache) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst productListData = state.productSearchCache\n\t\t\t.map(f => Object.values(f.data.listData));\n\n\t\tlet ids = [];\n\t\tfor (const product of productListData) {\n\t\t\tfor (const listData of product) {\n\t\t\t\tif (!('_companies' in listData)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tids = ids.concat(listData._companies.map(f => f.company));\n\t\t\t}\n\t\t}\n\n\t\tconst uniqueIds = [...new Set(ids)];\n\n\t\tconst companies = await dispatch('companylist/loadByIds', uniqueIds, { root: true });\n\t\tcommit('setCompanyCache', companies);\n\t},\n\n\tasync search({ state, commit, dispatch }, { filter, pagination, sorting }) {\n\t\tlet sortObj = sorting ? sorting : state.sort;\n\t\tsortObj = generateSortFields(sortObj);\n\n\t\tlet list = await Repo.searchProducts(filter, pagination, sortObj);\n\n\t\tif (pagination && list.length < pagination.limit) {\n\t\t\tcommit('setCount', { count: list.length + pagination.start });\n\t\t} else {\n\t\t\tlet count = await Repo.countProducts(filter);\n\t\t\tcommit('setCount', { count });\n\t\t}\n\t\tcommit('setProductCache', list);\n\n\t\tawait dispatch('_createCompanyCache');\n\t},\n\n\tgetProductCount(_, { filter }) {\n\t\treturn Repo.countProducts(filter);\n\t},\n\n\tasync ensureProductInCache({ commit, dispatch }, product) {\n\t\tif (typeof product === 'string') {\n\t\t\tproduct = await dispatch('loadById', product);\n\t\t\tif (product && product.length > 0) {\n\t\t\t\tcommit('addProduct', product[0]);\n\t\t\t}\n\t\t} else if (product) {\n\t\t\tcommit('addProduct', product);\n\t\t}\n\t},\n\n\tasync searchByName({ rootGetters }, { name, excludedIds, allowedCategoryId, extraFilter }) {\n\t\t// if (!name) return [];\n\t\tconst filter = {$and: []};\n\t\tconst baseListId = rootGetters['list/baseDataList'].id;\n\t\tif (name) {\n\t\t\tconst nameFilter = {\n\t\t\t\t$and: [{\n\t\t\t\t\t$or: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: `/data/listData/${baseListId}/basis-f1`,\n\t\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\t\tuse: 'keyword',\n\t\t\t\t\t\t\tvalue: name\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: `/data/listData/${baseListId}/basis-f1`,\n\t\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\t\tuse: 'text',\n\t\t\t\t\t\t\tvalue: name\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: `/data/listData/${baseListId}/basis-f1`,\n\t\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\t\tfuzzy: true,\n\t\t\t\t\t\t\tuse: 'ngram',\n\t\t\t\t\t\t\tvalue: name\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}]\n\t\t\t};\n\t\t\tfilter.$and.push(nameFilter);\n\t\t}\n\n\t\tfor (const id of excludedIds) {\n\t\t\tconst subFilter = {\n\t\t\t\t$not: {\n\t\t\t\t\t'field': '/id',\n\t\t\t\t\t'comparison': 'eq',\n\t\t\t\t\t'value': id\n\t\t\t\t}\n\t\t\t};\n\t\t\tfilter.$and.push(subFilter);\n\t\t}\n\t\tif (allowedCategoryId) {\n\t\t\tfilter.$and.push({\n\t\t\t\tfield: `/data/listData/${baseListId}/_categoryTree`,\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: allowedCategoryId\n\t\t\t});\n\t\t}\n\t\tif(extraFilter) {\n\t\t\tfilter.$and.push(extraFilter);\n\t\t}\n\t\tlet result = await Repo.searchProducts(filter, { start: 0, limit: 25 }, null);\n\t\tif (result && result.length) {\n\t\t\tlet exactMatches = result.filter(item => item.data.listData[baseListId] && toLocale(item.data.listData[baseListId]['basis-f1']).toLowerCase() === name.toLowerCase());\n\t\t\tif (exactMatches) {\n\t\t\t\tlet exactMatchesIds = exactMatches.map(match => match.id);\n\t\t\t\tresult = result.filter(item => !exactMatchesIds.includes(item.id));\n\t\t\t\tresult = exactMatches.concat(result);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t},\n\n\tasync loadApplicableAsParent({ state, commit, dispatch, rootGetters }, { productIdExcluded, name }) {\n\t\tawait dispatch('_setEntityClassId');\n\n\t\tlet queryNode;\n\t\tlet nameFilter;\n\t\tconst field = rootGetters['columnset/fieldByPath']('basis-f1');\n\t\tif (field) {\n\t\t\tqueryNode = {};\n\t\t\tqueryNode.search = new SimpleFilter();\n\t\t\tqueryNode.search.tab = 'main';\n\t\t\tqueryNode.search.fieldId = field.id;\n\t\t\tqueryNode.search.comparator = 'fuz';\n\t\t\tqueryNode.search.value = name;\n\n\t\t\tnameFilter = generateQueryFromSearchRoot(queryNode);\n\t\t}\n\n\t\tconst filter = {\n\t\t\t$and: [\n\t\t\t\t{\n\t\t\t\t\t$not: {\n\t\t\t\t\t\tfield: '/id',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: productIdExcluded\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t]\n\t\t};\n\n\t\tif (queryNode && nameFilter) {\n\t\t\tfilter.$and.push(nameFilter);\n\t\t}\n\n\t\tconst products = await Repo.searchProducts(filter);\n\t\treturn products;\n\t},\n\n\tasync loadById({ state, commit, dispatch }, productId) {\n\t\tawait dispatch('_setEntityClassId');\n\n\t\tconst filter = {\n\t\t\t$and: [\n\t\t\t\t{\n\t\t\t\t\tfield: '/id',\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: productId\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\n\t\tconst products = await Repo.searchProducts(filter);\n\t\treturn products;\n\t},\n\n\tasync loadByIds({ dispatch }, productIds) {\n\t\tif (!productIds.length) return [];\n\t\tawait dispatch('_setEntityClassId');\n\t\tconst filter = {\n\t\t\t$or: [\n\t\t\t]\n\t\t};\n\t\tfor (const productId of productIds) {\n\t\t\tif (!productId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfilter.$or.push(\n\t\t\t\t{\n\t\t\t\t\tfield: '/id',\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: productId\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\tconst products = await Repo.searchProducts(filter, { start: 0, limit: productIds.length });\n\t\treturn products;\n\t},\n\n\tasync loadReferencingProducts({ dispatch, rootGetters }, { productId }) {\n\t\tlet baseListId = rootGetters['list/baseDataList'].id;\n\t\tawait dispatch('_setEntityClassId');\n\t\tconst filter = {\n\t\t\tfield: `/data/listData/${baseListId}/_components/additional/_id`,\n\t\t\tcomparison: 'eq',\n\t\t\tvalue: productId\n\t\t};\n\t\treturn Repo.searchProducts(filter, { limit: 250 });\n\t},\n\n\tasync getProductsByInstitutions({ commit, rootGetters, dispatch }, { institute, user, list }) {\n\t\tawait dispatch('_setEntityClassId');\n\n\t\tlet lists = rootGetters['list/root'];\n\t\tlet filter = { $or: [] };\n\t\tfunction addForList(listId) {\n\t\t\tlet res = [];\n\t\t\tres.push({\n\t\t\t\tfield: `/data/listData/${listId}/_responsible/institution`,\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: institute\n\t\t\t});\n\t\t\tif (user) {\n\t\t\t\tres.push({\n\t\t\t\t\tfield: `/data/listData/${listId}/_responsible/account`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: user\n\t\t\t\t});\n\t\t\t}\n\t\t\tres.push({\n\t\t\t\tfield: `/data/listData/${listId}`,\n\t\t\t\tcomparison: 'exists',\n\t\t\t\tvalue: '_notes'\n\t\t\t});\n\t\t\treturn { $and: res };\n\t\t}\n\t\tif (list) {\n\t\t\tfilter.$or.push(addForList(list));\n\t\t} else {\n\t\t\tfor (let l of lists) {\n\t\t\t\tfilter.$or.push(addForList(l.id));\n\t\t\t}\n\t\t}\n\t\tlet res = await search(state.entityclassId, filter);\n\t\tres.forEach(row => commit('addProduct', row));\n\t\treturn res;\n\t},\n\n\tasync addYearToApprovalsInAllLists({ state, dispatch, rootGetters }, { productId }) {\n\t\tawait dispatch('_setEntityClassId');\n\n\t\tconst product = await Repo.loadProductWithCache(productId);\n\t\tif (!product) {\n\t\t\tthrow new Error(`Product with ID ${productId} not found.`);\n\t\t}\n\t\tconst baseListId = rootGetters['list/baseDataList'].id;\n\t\tconst baseListData = product.data.listData[baseListId];\n\t\tconst relevantLists = rootGetters['auth/user/roles/getAvailableLists'].filter(list => {\n\t\t\tlet listData = product.data.listData[list.id] || {};\n\t\t\treturn rootGetters['auth/user/roles/isResponsibleForProductGiven']({\n\t\t\t\tlistResponsible: listData._responsible,\n\t\t\t\tbaseResponsible: baseListData._responsible\n\t\t\t});\n\t\t});\n\t\tconst sortedStandards = rootGetters['biostandard/sortedByPublicOrder'];\n\n\t\tfunction checkIfCurrentlyApproved(bsId, listId, base) {\n\t\t\tif (!(product.data.listData[listId] && product.data.listData[listId]._approval && product.data.listData[listId]._approval[bsId])) {\n\t\t\t\tif (!base) {\n\t\t\t\t\t// console.log('cannot find standard', product.data.listData[listId]);\n\t\t\t\t\treturn checkIfCurrentlyApproved(bsId, baseListId, true);\n\t\t\t\t} else {\n\t\t\t\t\t// console.log('cannot find standard', product.data.listData[listId]);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet approvalData = product.data.listData[listId]._approval[bsId];\n\t\t\tif (!approvalData) {\n\t\t\t\t// console.log('no approval data');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// if (!(approvalData.active && approvalData.active.booleanValue)) console.log('not active');\n\t\t\treturn approvalData.active && approvalData.active.booleanValue && ApprovalWorkflowService.checkDateForApproval(approvalData);\n\t\t}\n\n\t\tlet hasProcessed = false;\n\t\tconst currentAccountId = rootGetters['auth/user/getCurrentAccountId'];\n\t\tfor (const relevantList of relevantLists) {\n\t\t\tconst listId = relevantList.id;\n\t\t\tconst listData = product.data.listData[listId];\n\t\t\tif (!listData) continue;\n\t\t\tconst listBase = rootGetters['list/byId'](listId);\n\t\t\tconst biostandards = listBase.data.biostandards;\n\t\t\tconst relevantApprovals = sortedStandards.filter(b => biostandards.includes(b.id));\n\t\t\tfor (const approvalBase of relevantApprovals) {\n\t\t\t\tlet dependentOnApprovals = rootGetters['biostandard/getDependencyLine'](approvalBase.id);\n\t\t\t\tdependentOnApprovals.push(approvalBase.id);\n\t\t\t\t// console.log('dependent standards', dependentOnApprovals);\n\t\t\t\tlet allValid = true;\n\t\t\t\tfor (let bsId of dependentOnApprovals) {\n\t\t\t\t\tlet valid = checkIfCurrentlyApproved(bsId, listId);\n\t\t\t\t\tif (!valid) {\n\t\t\t\t\t\tallValid = false;\n\t\t\t\t\t\t// console.log('failed dependncy check with ', bsId);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!allValid) continue;\n\t\t\t\tconst pathPrefix = `data.listData.${listId}._approval.${approvalBase.id}.`;\n\t\t\t\tconst beginPathParts = `${pathPrefix}begin.dateValue`.split('.');\n\t\t\t\tconst endPathParts = `${pathPrefix}end.dateValue`.split('.');\n\t\t\t\tconst updatedByPathParts = `${pathPrefix}updatedBy`.split('.');\n\t\t\t\tconst begin = deepGet(product, beginPathParts);\n\t\t\t\tconst end = deepGet(product, endPathParts);\n\t\t\t\tif (begin && end) {\n\t\t\t\t\tconst endDate = new Date(end);\n\t\t\t\t\tendDate.setFullYear(endDate.getFullYear() + 1);\n\t\t\t\t\tdeepSet(product, endPathParts, ApprovalWorkflowService._getDate(endDate).dateValue);\n\t\t\t\t\tdeepSet(product, updatedByPathParts, currentAccountId);\n\t\t\t\t\t// console.log('setting', endPathParts, endDate);\n\t\t\t\t\thasProcessed = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet updatedProduct = null;\n\t\tif (hasProcessed) {\n\t\t\tawait dispatch('_setAttributeSetId');\n\t\t\tupdatedProduct = await Repo.saveProductWrap(productId, product.data, state.attributesetId);\n\t\t}\n\t\treturn updatedProduct;\n\t},\n\n\tloadProductWithCache({ state }, { productId }) {\n\t\treturn Repo.loadProductWithCache(productId);\n\t},\n\n\tasync saveProductWrap({ state, dispatch }, { product }) {\n\t\tawait dispatch('_setAttributeSetId');\n\t\tawait Repo.saveProductWrap(product.id, product.data, state.attributesetId);\n\t},\n\n\tmoveDocumentsToTargetList(_, { data, documentsToMove, savedList }) {\n\t\tconst listData = data.listData;\n\t\tfor (const documentToMove of documentsToMove) {\n\t\t\tif (!listData[documentToMove.targetListId]) {\n\t\t\t\tthrow new Error(`List missing: ${documentToMove.targetListId}`);\n\t\t\t}\n\t\t\t// remove from working copy\n\t\t\tif (!documentToMove.onlyCopy) {\n\t\t\t\tconst baseList = listData[savedList];\n\t\t\t\tconst index = baseList._documents.findIndex(document => documentToMove.document.uploadTime === document.uploadTime && documentToMove.document.fileId === document.fileId);\n\t\t\t\tif (index > -1) {\n\t\t\t\t\tbaseList._documents.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// add to target list\n\t\t\tif (!listData[documentToMove.targetListId]._documents) listData[documentToMove.targetListId]._documents = [];\n\t\t\tlistData[documentToMove.targetListId]._documents.push(documentToMove.document);\n\t\t}\n\t},\n\n\tasync unlinkNewComponents({ rootGetters }, { id, data, savedList }) {\n\t\tconst newBaseData = data.listData[savedList];\n\t\tif (!newBaseData._components || !rootGetters['product/isBaseList']) return;\n\t\tconst product = await Repo.loadProductWithCache(id);\n\t\tconst baseListId = rootGetters['list/baseDataList'].id;\n\t\tconst oldBaseData = product.data.listData[baseListId];\n\t\tlet otherListIds = Object.keys(data.listData).filter(listId => listId !== baseListId);\n\n\t\tfunction _initComponents(data) {\n\t\t\tif (!data._components) {\n\t\t\t\tdata._components = { base: [], additional: [] };\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!data._components.base) {\n\t\t\t\tdata._components.base = [];\n\t\t\t}\n\t\t\tif (!data._components.additional) {\n\t\t\t\tdata._components.additional = [];\n\t\t\t}\n\t\t}\n\t\t//listData is from repo cache. repocache is wiped during save\n\t\t//product/setLoadedList probably not\n\n\t\tfunction _unlinkComponentsForType(type) {\n\t\t\tif (!newBaseData._components[type]) return;\n\t\t\tlet oldComponentIds = oldBaseData._components && oldBaseData._components[type] ? oldBaseData._components[type].map(comp => comp._id) : [];\n\t\t\tconst componentsAdded = [];\n\t\t\tfor (const component of newBaseData._components[type]) {\n\t\t\t\tif (!oldComponentIds.includes(component._id)) {\n\t\t\t\t\tlet secrecy = component.secrecy;\n\t\t\t\t\tif (secrecy) secrecy = secrecy.selectValue;\n\t\t\t\t\tif (secrecy !== 'base-data-responsible') secrecy = 'core-partners';\n\t\t\t\t\tcomponentsAdded.push([component._id, secrecy]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const [newId, newSecrecy] of componentsAdded) {\n\t\t\t\tfor (const otherListId of otherListIds) {\n\t\t\t\t\tif (doNotUnlinkNewLists.includes(otherListId)) continue;\n\t\t\t\t\t_initComponents(data.listData[otherListId]);\n\t\t\t\t\tif (!data.listData[otherListId]._components[type].find(comp => comp._id === newId)) {\n\t\t\t\t\t\t// add new component to target list\n\t\t\t\t\t\tconst unlinkedComponentData = {\n\t\t\t\t\t\t\t_id: newId,\n\t\t\t\t\t\t\tsecrecy: {\n\t\t\t\t\t\t\t\tselectValue: newSecrecy\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tdata.listData[otherListId]._components[type].push(unlinkedComponentData);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_initComponents(newBaseData);\n\t\t_unlinkComponentsForType('base');\n\t\t_unlinkComponentsForType('additional');\n\t},\n\n\tcleanDeletedComponents({ rootGetters }, { data, savedList }) {\n\t\tif (!rootGetters['product/isBaseList']) return;\n\t\tconst newBaseData = data.listData[savedList];\n\t\tconst baseListId = rootGetters['list/baseDataList'].id;\n\t\tfor (let [ listId, listData ] of Object.entries(data.listData)) {\n\t\t\tif (listId === baseListId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (listData._components) {\n\t\t\t\tfor (let type of [ 'base', 'additional' ]) {\n\t\t\t\t\tif (listData._components[type] && listData._components[type].length) {\n\t\t\t\t\t\tlet baseCopy = JSON.parse(JSON.stringify(listData._components[type]));\n\t\t\t\t\t\tfor (let component of baseCopy) {\n\t\t\t\t\t\t\tlet existsInBaseList = newBaseData._components[type] && newBaseData._components[type].find(entry => entry._id === component._id);\n\t\t\t\t\t\t\tif (!existsInBaseList) {\n\t\t\t\t\t\t\t\tlet index = listData._components[type].indexOf(component);\n\t\t\t\t\t\t\t\tlistData._components[type].splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tmoveList(_, params) {\n\t\treturn Repo.moveList(params);\n\t},\n\n\taggregateSearch(_, params) {\n\t\treturn Repo.aggregateSearch(params);\n\t}\n\n};\n\nconst mutations = {\n\n\taddProduct(state, entity) {\n\t\tlet idx = state.products.findIndex(p => p.id === entity.id);\n\t\tif (idx > -1) state.products.splice(idx, 1);\n\t\tstate.products.push(entity);\n\t},\n\tdeleteProduct(state, { id }) {\n\t\tlet idx = state.products.findIndex(p => p.id === id);\n\t\tif (idx === -1) throw new Error(`entity not found: ${id}`);\n\t\tstate.products.splice(idx, 1);\n\t},\n\tupdateProductList(state, { id, list, data, full }) {\n\t\tlet prod = state.products.find(p => p.id === id);\n\t\tif (!prod) return;\n\t\tif (full) {\n\t\t\tprod.data.listData = full;\n\t\t} else {\n\t\t\tprod.data.listData[list] = data;\n\t\t}\n\t},\n\tsetDerivedProduct(state, { id, derivedProductId }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tconst idx = state.products.indexOf(entity);\n\t\tVue.set(state.products[idx].data, 'derivedProductId', derivedProductId ? derivedProductId : '');\n\t},\n\tresetNationalPartnerStatus(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\n\t\tconst idx = state.products.indexOf(entity);\n\t\tVue.delete(state.products[idx].data, 'isNationalPartner');\n\t},\n\tresetProducts(state) {\n\t\tstate.products = [];\n\t},\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\tsetCount(state, { count }) {\n\t\tstate.productSearchCount = count;\n\t},\n\tsetProductCache(state, entries) {\n\t\tstate.productSearchCache = entries;\n\t},\n\taddProductToSearchCache(state, entity) {\n\t\tstate.productSearchCache.push(entity);\n\t},\n\tsetSort(state, sort) {\n\t\tstate.sort = sort;\n\t},\n\tsetCompanyCache(state, companies) {\n\t\tstate.companyCache = companies;\n\t},\n\tsetPagination(state, { start, limit }) {\n\t\tif (!isNaN(start)) state.paginationStart = start;\n\t\tif (!isNaN(limit)) {\n\t\t\tstate.paginationLimit = limit;\n\t\t\tstate.paginationStart = 0;\n\t\t}\n\t},\n\tsetApprovalHistoryCache(state,{ id, value }) {\n\t\tstate.approvalHistoryCache[id] = value;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import {createDocument, findIdentical, getDocument} from '@/repository/document-repository.js';\nimport SECRECY_LEVELS from '@/assets/config/secrecy-levels.json';\n\nconst state = {\n\tloadedDocuments: [],\t//cache for doc content\n\ttoUpload: [],\n\tsecrecyLevels: SECRECY_LEVELS\n};\n\nconst getters = {\n\tbyId: (state) => (id) => {\n\t\treturn state.loadedDocuments.find(d => d.id === id);\n\t}\n};\n\nconst actions = {\n\n\tasync uploadDocuments({state, commit, rootGetters, rootState}) {\n\t\tif (state.toUpload.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst uploadDoc = async function(doc) {\n\t\t\tdoc.uploadTime = new Date();\n\t\t\tdoc.fileName = doc.fileData.name;\n\t\t\tlet existingId = await findIdentical(doc.fileData);\n\t\t\tif (existingId) {\n\t\t\t\tdoc.fileId = existingId;\n\t\t\t} else {\n\t\t\t\tlet newFile = await createDocument(doc.fileData, doc.fileName);\n\t\t\t\tdoc.fileId = newFile.id;\n\t\t\t}\n\n\t\t\tdelete doc.fileData;\n\t\t\treturn doc;\n\t\t};\n\n\t\tlet docs = await Promise.all(state.toUpload.map(uploadDoc));\n\n\t\tcommit('resetUploadDocs');\n\n\t\treturn docs;\n\t},\n\n\tasync loadDocument({commit, getters}, {fileId, fileName}) {\n\t\tlet document = getters.byId(fileId);\n\t\tif (!document) {\n\t\t\tdocument = await getDocument(fileId, fileName);\n\t\t\tcommit('addToLoadedDocuments', document);\n\t\t}\n\t\treturn document;\n\t}\n};\n\nconst mutations = {\n\n\taddDocumentToUpload(state, document) {\n\t\tstate.toUpload.push(document);\n\t},\n\n\tresetUploadDocs(state) {\n\t\tstate.toUpload = [];\n\t},\n\n\tremoveDocFromTemp(state, doc) {\n\t\tlet idx = state.toUpload.indexOf(doc);\n\t\tif (idx === -1) return;\n\t\tstate.toUpload.splice(idx, 1);\n\t},\n\n\tdeleteDocument(state, {listId, document}) {\n\t\tstate.documents[listId].splice(state.documents[listId].findIndex(d => d === document), 1);\n\t},\n\n\taddToLoadedDocuments(state, doc) {\n\t\tstate.loadedDocuments.push(doc);\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { toLocale, toSortable } from '@/plugins/filters.js';\nimport Vue from 'vue';\n\nconst state = {\n\n\tcompany: null,\n\tchecklists: {}\n\n};\n\nconst VALID_KEYS = ['status', 'until', 'date', 'comment', 'updatedBy'];\n\nconst getters = {\n\n\tgetValue: (state) => (clid, key) => {\n\t\tlet cl = state.checklists[clid];\n\t\tif (!cl) return null;\n\t\treturn cl[key];\n\t},\n\n\tforSaving: (state) => {\n\t\tlet res = {};\n\t\tObject.entries(state.checklists).forEach(([k, v]) => {\n\t\t\tlet entry = Object.fromEntries(Object.entries(v).filter(([k, v]) => !!v));\n\t\t\tres[k] = entry;\n\t\t});\n\t\treturn res;\n\t}\n\n};\n\nconst actions = {\n\n\tinit({ commit, rootGetters }, { data, company }) {\n\t\tcommit('init', { data, company });\n\n\t\t// getters.getMandatoryChecklists.forEach(entry => {\n\t\t// \tif (!entry.data.isOptional && !(entry.id in state.checklists)) {\n\t\t// \t\tlet firstOption = entry.data.options[0];\n\t\t// \t\tif (!firstOption) return;\n\t\t// \t\tcommit('updateValue', {\n\t\t// \t\t\tclid: entry.id,\n\t\t// \t\t\tkey: 'status',\n\t\t// \t\t\tvalue: firstOption.id,\n\t\t// \t\t\tdefaultStatusOption: firstOption.id,\n\t\t// \t\t\taccount: rootGetters['auth/user/getCurrentAccountId']\n\t\t// \t\t});\n\t\t// \t}\n\t\t// });\n\t}\n\n};\n\nconst mutations = {\n\n\tinit(state, { data, company }) {\n\t\tstate.checklists = data;\n\t\tstate.company = company || null;\n\t},\n\n\tupdateValue(state, { clid, key, value, defaultStatusOption, account }) {\n\t\tlet cl = state.checklists[clid];\n\t\tif (!cl) {\n\t\t\tcl = {\n\t\t\t\tstatus: defaultStatusOption,\n\t\t\t\tuntil: '',\n\t\t\t\tdate: '',\n\t\t\t\tcomment: '',\n\t\t\t\tupdatedBy: ''\n\t\t\t};\n\t\t\tVue.set(state.checklists, clid, cl);\n\t\t}\n\t\tcl.updatedBy = account;\n\t\tif (!VALID_KEYS.includes(key)) throw new Error(`invalid checklist key: ${key}`);\n\t\tVue.set(cl, key, value); //cl[key] = value;\n\t},\n\n\tremoveRow(state, clid) {\n\t\tVue.delete(state.checklists, clid);\n\t},\n\n\taddRow(state, clid) {\n\t\tlet cl = state.checklists[clid];\n\t\tif (cl) return;\n\t\tcl = {\n\t\t\tstatus: '',\n\t\t\tuntil: '',\n\t\t\tdate: '',\n\t\t\tcomment: '',\n\t\t\tupdatedBy: ''\n\t\t};\n\t\tVue.set(state.checklists, clid, cl);\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import Store from '@/store/main';\n\nconst SORT_FIELD_MAPPING = {\n\t'baseAddressCountry': 'data.indexData.country',\n\t'data.baseData.owner': 'data.indexData.owner'\n};\n\nconst MULTI_LANG_FIELDS = ['data.indexData.owner'];\n\nfunction _generateMultiLangSearchField(column) {\n\tconst currentLanguage = Store.state.base.selectedUiLanguage || Store.state.base.fallbackLocale;\n\n\treturn `${column}.${currentLanguage}`;\n}\n\nexport function generateSearchField(sort) {\n\tif (!sort || !sort.column || !sort.order) {\n\t\treturn [];\n\t}\n\n\tlet actualColumn = sort.column in SORT_FIELD_MAPPING ? SORT_FIELD_MAPPING[sort.column] : sort.column;\n\n\tif (MULTI_LANG_FIELDS.includes(actualColumn)) {\n\t\tactualColumn = _generateMultiLangSearchField(actualColumn);\n\t}\n\n\treturn [ `${actualColumn}:${sort.order}` ];\n}\n","import * as Repo from '@/repository/company.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId, searchCursorWithGenerator } from '@/repository/system.js';\nimport Roles from '@/assets/config/company-roles.json';\nimport documents from './company/documents';\nimport checklist from './company/checklist';\nimport {countEntries} from '@/repository/system';\nimport {generateSearchField} from '@/util/company/sort';\nimport {toLocale} from '@/plugins/filters';\n\nconst ENTITY_CLASS_ID = 'company';\n\nconst modules = {\n\tdocuments,\n\tchecklist\n};\n\nconst state = {\n\n\tcompanies: [],\n\troles: Roles,\n\tsearch: null,\n\tsearchCount: 0,\n\tactivePageNum: 1,\n\tperPage: 25,\n\tattributesetId: '',\n\tentityclassId: '',\n\tsort: null,\n\tlastQuery: null,\n\tcompanyKept: null,\n\tcompanyDeleted: null\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.companies.find(r => r.id === id);\n\t},\n\n\tall: (state) => {\n\t\treturn state.companies;\n\t},\n\n\tgetSearch: (state) => {\n\t\treturn state.search;\n\t},\n\n\tgetActivePageNum: (state) => {\n\t\treturn state.activePageNum;\n\t},\n\n\tgetPerPage: (state) => {\n\t\treturn state.perPage;\n\t},\n\n\tgetSort: (state) => {\n\t\treturn state.sort;\n\t},\n\n\tgetCompanyTitle: (state, getters, rootState, rootGetters) => (company) => {\n\t\tlet str = company.baseData.name ? company.baseData.name : '-';\n\n\t\tlet suffix = [];\n\t\tif (company.baseData.customerNumber) {\n\t\t\tsuffix.push(company.baseData.customerNumber);\n\t\t}\n\n\t\tif (company.baseData.owner) {\n\t\t\tconst institution = rootGetters['auth/org/byId'](company.baseData.owner);\n\t\t\tif (institution) {\n\t\t\t\tsuffix.push(toLocale(institution.data.title));\n\t\t\t}\n\t\t}\n\n\t\tif (suffix.length > 0) {\n\t\t\tstr = `${str} (${suffix.join(', ')})`;\n\t\t}\n\n\t\treturn str;\n\t}\n\n};\n\nconst actions = {\n\tasync _setEntityClassId({ state, commit }) {\n\t\tif (!state.entityclassId) {\n\t\t\tconst entityClass = await getEntityclassByExternalId(ENTITY_CLASS_ID);\n\t\t\tcommit('setEcId', entityClass);\n\t\t}\n\t},\n\n\tasync _setAttributeSetId({ state, commit }) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId(ENTITY_CLASS_ID);\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t},\n\n\tasync getById(_, id) {\n\t\tlet entity = await Repo.getCompanyById(id);\n\t\treturn entity;\n\t},\n\n\tasync create({ state, commit, dispatch }, data) {\n\t\tawait dispatch('_setEntityClassId');\n\t\tawait dispatch('_setAttributeSetId');\n\t\tlet entity = await Repo.createCompany(state.entityclassId, state.attributesetId, data);\n\t\tcommit('addCompany', entity);\n\t\treturn entity;\n\t},\n\n\tasync update({ state, commit, dispatch, getters }, entry) {\n\t\tawait dispatch('_setAttributeSetId');\n\t\tlet oldEntry = getters.byId(entry.id);\n\t\tif (!oldEntry) oldEntry = await Repo.getCompanyById(entry.id);\n\t\tlet updated = await Repo.updateCompany(oldEntry, entry.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteCompany', { id: entry.id });\n\t\t\tcommit('addCompany', updated);\n\t\t}\n\t},\n\n\tasync delete({ commit, dispatch }, { entry }) {\n\t\tif (typeof entry === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tawait Repo.deleteCompany(entry.id);\n\t\tcommit('deleteCompany', { id: entry.id });\n\t},\n\n\tasync search({ commit, dispatch }, { filter, pagination, sorting, ifEmpty }) {\n\t\tif (ifEmpty && state.companies.length > 0) return;\n\t\tawait dispatch('_setEntityClassId');\n\n\t\tlet sortObj = sorting ? sorting : state.sort;\n\t\tsortObj = generateSearchField(sortObj);\n\n\t\tconst paging = pagination || { start: 0, limit: state.perPage };\n\t\tconst currentFilter = filter || state.lastQuery;\n\n\t\tlet list = await Repo.searchCompanies(state.entityclassId, currentFilter, paging, sortObj);\n\t\tif (pagination && list.length < paging.limit) {\n\t\t\tcommit('setCount', { count: list.length + paging.start });\n\t\t} else {\n\t\t\tlet count = await countEntries(state.entityclassId, currentFilter);\n\t\t\tcommit('setCount', { count });\n\t\t}\n\n\t\tcommit('resetCompanies', list);\n\t\treturn list;\n\t},\n\n\tasync getCompanyCount({ dispatch }, attributeFilter) {\n\t\tawait dispatch('_setEntityClassId');\n\t\treturn countEntries(state.entityclassId, attributeFilter);\n\t},\n\n\tasync loadBatch({ state, dispatch }, { filter }) {\n\t\tawait dispatch('_setEntityClassId');\n\t\tlet generator = searchCursorWithGenerator(state.entityclassId, filter, 'POST', 'search/search/cursor');\n\t\treturn generator;\n\t},\n\n\tasync loadAll({ commit, state, dispatch }, { ifEmpty }) {\n\t\tif (ifEmpty && state.companies.length > 0) return;\n\t\tawait dispatch('_setEntityClassId');\n\n\t\tlet list = await Repo.searchCompanies(state.entityclassId);\n\t\tcommit('resetCompanies', list);\n\t},\n\n\tasync loadByIds({ state, dispatch, commit }, ids) {\n\t\tconst filteredIds = ids.filter(id => id !== '' && !state.companies.find(e => e.id === id));\n\t\tif (filteredIds.length > 0) {\n\t\t\tawait dispatch('_setEntityClassId');\n\t\t\tconst data = await Repo.getCompaniesByIds(state.entityclassId, filteredIds);\n\t\t\tcommit('addCompany', data);\n\t\t}\n\t\treturn state.companies.filter(e => ids.includes(e.id));\n\t},\n\n\tasync reloadByIds({ state, dispatch, commit }, ids) {\n\t\tawait dispatch('_setEntityClassId');\n\t\tconst data = await Repo.getCompaniesByIds(state.entityclassId, ids);\n\t\tcommit('addCompany', data);\n\t\treturn data;\n\t},\n\n\tupdateProductsAfterMerge(_, companyIds) {\n\t\treturn Repo.updateProductsAfterMerge(companyIds);\n\t},\n\n\tasync loadByNameOrCustomerNumber({ state, dispatch }, value) {\n\t\tawait dispatch('_setEntityClassId');\n\t\tconst filter = { $or: [] };\n\t\tif (isNaN(value)) {\n\t\t\tfilter.$or.push({\n\t\t\t\tfield: '/data/baseData/name',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tuse: 'ngram',\n\t\t\t\tvalue\n\t\t\t});\n\t\t\tfilter.$or.push({\n\t\t\t\tfield: '/data/baseData/companyAbbreviation',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tuse: 'ngram',\n\t\t\t\tvalue\n\t\t\t});\n\t\t} else {\n\t\t\tfilter.$or.push({\n\t\t\t\tfield: '/data/baseData/customerNumber',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: ~~value\n\t\t\t})\n\t\t}\n\n\t\tconst data = await Repo.searchCompanies(state.entityclassId, filter);\n\t\treturn data;\n\t},\n\n\tasync findByCustomerNumber({ state, dispatch }, company) {\n\t\tawait dispatch('_setEntityClassId');\n\t\tif (!company.data) return [];\n\t\tconst customerNumber = ~~company.data.baseData.customerNumber;\n\t\tif (!customerNumber) return [];\n\t\tconst filter = {\n\t\t\t$and: [\n\t\t\t\t{\n\t\t\t\t\tfield: '/data/baseData/customerNumber',\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: customerNumber\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t\tif (company.id) {\n\t\t\tfilter.$and.push({\n\t\t\t\t$not: {\n\t\t\t\t\tfield: '/id',\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: company.id\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst data = await Repo.searchCompanies(state.entityclassId, filter);\n\t\treturn data;\n\t}\n\n};\n\nconst mutations = {\n\n\taddCompany(state, entity) {\n\t\tlet rows = Array.isArray(entity) ? entity : [entity];\n\t\tfor (let entity of rows) {\n\t\t\tlet idx = state.companies.findIndex(e => e.id === entity.id);\n\t\t\tif (idx > -1) {\n\t\t\t\tstate.companies.splice(idx, 1, entity);\n\t\t\t} else {\n\t\t\t\tstate.companies.push(entity);\n\t\t\t}\n\t\t}\n\t},\n\tdeleteCompany(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) return;\n\t\tlet idx = state.companies.indexOf(entity);\n\t\tstate.companies.splice(idx, 1);\n\t},\n\tresetCompanies(state, l) {\n\t\tstate.companies = l || [];\n\t},\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\tsetSearch(state, search) {\n\t\tstate.search = search;\n\t},\n\tsetActivePageNum(state, page) {\n\t\tstate.activePageNum = page;\n\t},\n\tsetPerPage(state, page) {\n\t\tstate.perPage = page;\n\t},\n\tsetCount(state, { count }) {\n\t\tstate.searchCount = count;\n\t},\n\tsetSort(state, sort) {\n\t\tstate.sort = sort;\n\t},\n\tsetLastQuery(state, query) {\n\t\tstate.lastQuery = query;\n\t},\n\tsetCompanyKept(state, company) {\n\t\tstate.companyKept = company;\n\t},\n\tsetCompanyDeleted(state, company) {\n\t\tstate.companyDeleted = company;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tmodules,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { get, post } from '@/util/request.js';\nimport { search, genericEntityUpdate } from './system.js';\n\nexport async function createLabel(data, entityclassId, attributesetId) {\n\treturn post('eav/entity/create', {\n\t\tentityclass: entityclassId,\n\t\tattributeset: attributesetId,\n\t\tdata\n\t});\n}\n\nexport function getAllLabels(entityclassId) {\n\treturn search(entityclassId);\n}\n\nexport function updateLabel(oldEntry, newData, changeset) {\n\treturn genericEntityUpdate(oldEntry, newData, changeset);\n}\n","import * as Repo from '@/repository/labels.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\n\nconst ENTITY_CLASS_ID = 'label';\n\nconst state = {\n\n\tlabels: [],\n\tattributesetId: '',\n\tentityclassId: ''\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.labels.find(r => r.id === id);\n\t},\n\n\tbyIds: (state) => (ids) => {\n\t\treturn state.labels.filter(f => ids.includes(f.id));\n\t},\n\n\tall: (state) => {\n\t\treturn state.labels;\n\t}\n\n};\n\nconst actions = {\n\n\tasync create({ state, commit }, data) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('label');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('label');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet entity = await Repo.createLabel(data, state.entityclassId, state.attributesetId);\n\t\tcommit('addLabel', entity);\n\t},\n\n\tasync loadAll({ commit }, { ifEmpty }) {\n\t\tif (ifEmpty && state.labels.length > 0) return;\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await getEntityclassByExternalId('label');\n\t\t\tcommit('setEcId', { id: ec.id });\n\t\t}\n\t\tlet label = await Repo.getAllLabels(state.entityclassId);\n\t\tcommit('resetLabels');\n\t\tlabel.forEach(row => commit('addLabel', row));\n\t},\n\n\tasync update({ state, commit, getters }, label) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('label');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldLabel = getters.byId(label.id);\n\t\tlet updated = await Repo.updateLabel(oldLabel, label.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteLabel', { id: label.id });\n\t\t\tcommit('addLabel', updated);\n\t\t}\n\t}\n\n};\n\nconst mutations = {\n\n\taddLabel(state, entity) {\n\t\tstate.labels.push(entity);\n\t},\n\tresetLabels(state) {\n\t\tstate.labels = [];\n\t},\n\tdeleteLabel(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.labels.indexOf(entity);\n\t\tstate.labels.splice(idx, 1);\n\t},\n\n\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post } from '@/util/request.js';\nimport { search, genericEntityUpdate } from '../system.js';\n\nexport async function createSearch(data, entityClassId, attributeSetId) {\n\tdata.search = stringifySearchValues(data.search);\n\tlet payload = {\n\t\tentityclass: entityClassId,\n\t\tattributeset: attributeSetId,\n\t\tdata\n\t};\n\tlet newSearch = await post('eav/entity/create', payload);\n\tnewSearch.data.search = restoreFromStorage(newSearch.data.search);\n\treturn newSearch;\n}\n\nexport async function updateSearch(oldEntity, newData, set) {\n\tnewData.search = stringifySearchValues(newData.search);\n\tlet updatedSearch = await genericEntityUpdate(oldEntity, newData, set);\n\tupdatedSearch.data.search = restoreFromStorage(updatedSearch.data.search);\n\treturn updatedSearch;\n}\n\nexport async function deleteSearch(id) {\n\tconst deletedEntity = await post('eav/entity/disable', id);\n\treturn deletedEntity.id;\n}\n\nexport async function getAllSearches(entityClassId) {\n\tlet savedSearches = await search(entityClassId);\n\tfor (let search of savedSearches) {\n\t\tsearch.data.search = restoreFromStorage(search.data.search);\n\t}\n\treturn savedSearches;\n}\n\nfunction stringifySearchValues(node) {\n\tif (node.value && typeof node.value !== 'string') {\n\t\tnode.value = JSON.stringify(node.value);\n\t}\n\tif (node.children && node.children.length) {\n\t\tfor (let childNode of node.children) {\n\t\t\tchildNode = stringifySearchValues(childNode);\n\t\t}\n\t}\n\treturn node;\n}\n\nfunction restoreFromStorage(node) {\n\tif (node.value) {\n\t\ttry {\n\t\t\tnode.value = JSON.parse(node.value);\n\t\t} catch (e) {\n\t\t\t// already a string, do nothing\n\t\t}\n\t}\n\tif (node.children && node.children.length) {\n\t\tfor (let childNode of node.children) {\n\t\t\tchildNode = restoreFromStorage(childNode);\n\t\t}\n\t}\n\treturn node;\n}\n","import Vue from 'vue';\nimport * as Repo from '@/repository/search/search.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\n\nconst CLASS_ID = 'search';\n\nconst state = {\n\tlastSearch: null,\n\tadhocSearch: null,\n\tsearches: [],\n\tactiveSearch: null,\n\tsearchFilter: null,\n\tactivePageNum: 1,\n\tattributesetId: '',\n\tentityclassId: '',\n\tselection: {\n\t\tblacklistMode: true,\n\t\titems: []\n\t},\n\tadditionalSearchFilters: {} // table header search filters\n};\n\nconst getters = {\n\tall: (state) => {\n\t\treturn state.searches;\n\t},\n\tbyId: (state) => (id) => {\n\t\treturn state.searches.find(f => f.id === id);\n\t},\n\tgetActivePageNum: (state) => {\n\t\treturn state.activePageNum;\n\t},\n\tgetSearchFilter: (state) => {\n\t\treturn state.searchFilter;\n\t},\n\tgetActiveSearch: (state) => {\n\t\treturn state.activeSearch;\n\t},\n\tgetAdhocSearch: (state) => {\n\t\treturn state.adhocSearch;\n\t},\n\tgetAdditionalSearchFilters: (state) => {\n\t\treturn state.additionalSearchFilters;\n\t},\n\tgetAdditionalSearchFilter: (state) => (path) => {\n\t\treturn state.additionalSearchFilters[path];\n\t},\n\tgetSelectedItems: (state) => {\n\t\treturn state.selection.items;\n\t},\n\tgetBlacklistMode: (state) => {\n\t\treturn state.selection.blacklistMode;\n\t},\n\tgetCheckedCount: (state, getters, rootState) => {\n\t\tif (state.selection.blacklistMode) {\n\t\t\treturn rootState.productlist.productSearchCount - state.selection.items.length;\n\t\t}\n\t\treturn state.selection.items.length;\n\t},\n\tgetVisible: (state, getters) => {\n\t\treturn state.searches.filter(s => getters.getIsVisible(s));\n\t},\n\tgetIsVisible: (state, getters, rootState, rootGetters) => (search) => {\n\t\tconst isAdmin = rootGetters['auth/user/roles/isAdmin'];\n\n\t\tif (isAdmin || !search.data || !search.data.search || search.data.search.isTemporary) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst creator = search.data.creator;\n\t\tconst currentAccountId = rootGetters['auth/user/getCurrentAccountId'];\n\t\tif (creator === currentAccountId) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (search.data.isPublic) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst institutions = search.data.visibleForInstitutions || [];\n\t\tif (institutions.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst currentInstitutions = rootGetters['auth/user/getUserInstitutionIds'];\n\t\tconst isInInstitution = currentInstitutions.filter(f => institutions.includes(f)).length > 0;\n\n\t\treturn isInInstitution;\n\t}\n};\n\nconst actions = {\n\tasync _loadEntityClass({ state, commit }) {\n\t\tif (state.entityclassId) {\n\t\t\treturn;\n\t\t}\n\t\tconst ec = await getEntityclassByExternalId(CLASS_ID);\n\t\tcommit('setEcId', { id: ec.id });\n\t},\n\tasync _loadAttributeSet({ state, commit }) {\n\t\tif (state.attributesetId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst as = await getAttributesetByExternalId(CLASS_ID);\n\t\tcommit('setAsId', { id: as.id });\n\t},\n\tasync loadAll({ state, commit, dispatch }, { ifEmpty }) {\n\t\tif (ifEmpty && state.searches.length > 0) return;\n\t\tawait dispatch('_loadEntityClass');\n\n\t\tconst list = await Repo.getAllSearches(state.entityclassId);\n\t\tcommit('resetList', list);\n\t\tcommit('sortSearches');\n\t},\n\tasync create({ state, commit, dispatch }, { node, inList, products, institution, accountId, isPublic, visibleForInstitutions, creator }) {\n\t\tawait dispatch('_loadEntityClass');\n\t\tawait dispatch('_loadAttributeSet');\n\n\t\tlet payload = {\n\t\t\tsearch: node,\n\t\t\tinList,\n\t\t\tisPublic,\n\t\t\tproducts,\n\t\t\tvisibleForInstitutions,\n\t\t\tcreator,\n\t\t\tinstitution: institution || '',\n\t\t\taccountId: accountId || ''\n\t\t};\n\n\t\tdelete payload.search.isTemporary;\n\n\t\tconst entity = await Repo.createSearch(payload, state.entityclassId, state.attributesetId);\n\t\tcommit('addSearch', entity);\n\t\tcommit('sortSearches');\n\t\treturn entity;\n\t},\n\tasync update({ state, commit, dispatch, getters }, node) {\n\t\tawait dispatch('_loadAttributeSet');\n\n\t\tconst oldSearch = getters.byId(node.id);\n\t\tlet payload = {\n\t\t\tsearch: node.data.search,\n\t\t\tinList: node.data.inList,\n\t\t\tproducts: node.data.products,\n\t\t\tisPublic: node.data.isPublic,\n\t\t\tinstitution: node.data.institution || '',\n\t\t\taccountId: node.data.accountId || '',\n\t\t\tvisibleForInstitutions: node.data.visibleForInstitutions,\n\t\t\tcreator: node.data.creator\n\t\t};\n\n\t\tconst updated = await Repo.updateSearch(oldSearch, payload, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteSearch', node.id);\n\t\t\tcommit('addSearch', updated);\n\t\t\tcommit('sortSearches');\n\n\t\t\tif (state.activeSearch && state.activeSearch.id === node.id) {\n\t\t\t\tcommit('setActiveSearch', updated);\n\t\t\t}\n\t\t}\n\t},\n\tasync delete({ commit }, node) {\n\t\tif (typeof node === 'undefined') return;\n\t\tawait Repo.deleteSearch(node.id);\n\t\tcommit('deleteSearch', node.id);\n\t\tcommit('sortSearches');\n\t}\n};\n\nconst mutations = {\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\tresetList(state, l) {\n\t\tstate.searches = l || [];\n\t},\n\taddSearch(state, node) {\n\t\tstate.searches.push(node);\n\t},\n\tdeleteSearch(state, id) {\n\t\tconst idx = state.searches.findIndex(f => f.id === id);\n\t\tstate.searches.splice(idx, 1);\n\t},\n\tsetAdhocSearch(state, root) {\n\t\tstate.adhocSearch = root;\n\t\tstate.activePageNum = 1;\n\t},\n\tsetActiveSearch(state, root) {\n\t\tstate.activeSearch = root;\n\t\tstate.activePageNum = 1;\n\t},\n\tsetAdditionalSearchFilters(state, filters) {\n\t\tstate.additionalSearchFilters = filters || {};\n\t},\n\tsetAdditionalSearchFilter(state, { path, subPath, value }) {\n\t\tif (!state.additionalSearchFilters[path]) {\n\t\t\tVue.set(state.additionalSearchFilters, path, {});\n\t\t}\n\n\t\tVue.set(state.additionalSearchFilters[path], subPath, value);\n\t},\n\tclearAdditionalSearchFilter(state, path) {\n\t\tif (state.additionalSearchFilters[path]) {\n\t\t\tstate.additionalSearchFilters[path] = '';\n\t\t}\n\t},\n\tresetAdditionalSearchFilters(state) {\n\t\tstate.additionalSearchFilters = {};\n\t},\n\tresetActiveSearch(state) {\n\t\tstate.activeSearch = null;\n\t\tstate.searchFilter = null;\n\t\tstate.additionalSearchFilters = {};\n\t\tstate.activePageNum = 1;\n\t},\n\tsetActivePageNum(state, page) {\n\t\tstate.activePageNum = page;\n\t},\n\tsetSearchFilter(state, filter) {\n\t\tstate.searchFilter = filter;\n\t},\n\tsetBlacklistMode(state, value) {\n\t\tstate.selection.blacklistMode = value;\n\t\tstate.selection.items = [];\n\t},\n\tsetSelectedItems(state, items) {\n\t\tstate.selection.items = items;\n\t},\n\tsetLastSearch(state, search) {\n\t\tstate.lastSearch = search;\n\t},\n\tsortSearches(state) {\n\t\tif (state.searches.length) {\n\t\t\tstate.searches = state.searches.sort((searchA, searchB) => {\n\t\t\t\tif (!searchA.data.search || !searchA.data.search.label) return 1;\n\t\t\t\tif (!searchB.data.search || !searchB.data.search.label) return -1;\n\t\t\t\treturn searchA.data.search.label.localeCompare(searchB.data.search.label);\n\t\t\t});\n\t\t}\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post } from '@/util/request.js';\nimport { search, genericEntityUpdate } from '../system.js';\n\nexport async function createColumnSet(data, entityClassId, attributeSetId) {\n\tlet payload = {\n\t\tentityclass: entityClassId,\n\t\tattributeset: attributeSetId,\n\t\tdata\n\t};\n\n\treturn await post('eav/entity/create', payload);\n}\n\nexport function updateColumnSet(oldEntity, newData, set) {\n\treturn genericEntityUpdate(oldEntity, newData, set);\n}\n\nexport async function deleteColumnSet(id) {\n\tconst deletedEntity = await post('eav/entity/disable', id);\n\treturn deletedEntity.id;\n}\n\nexport function getAllColumnSets(entityClassId) {\n\treturn search(entityClassId);\n}\n","import * as Repo from '@/repository/search/columnset.js';\nimport { getEntityclassByExternalId, getAttributesetByExternalId, getEntityById } from '@/repository/system.js';\nimport SearchFields from '@/assets/config/search/search-fields';\nimport ExportConfigPackages from '@/assets/config/search/export-config-packages';\nimport { i18n } from '@/main';\n\n// The columnset and export set share the same base logic (e. g. anyone gets a copy of the state design).\nexport default class BaseColumnsetStore {\n\tconstructor(classId) {\n\t\tthis.state = {\n\t\t\tcolumnsets: [],\n\t\t\tselectedColumnSet: null,\n\t\t\tavailableFields: [],\n\t\t\tattributesetId: '',\n\t\t\tentityclassId: ''\n\t\t};\n\n\t\tthis.getters = {\n\t\t\tall: (state) => {\n\t\t\t\treturn state.columnsets;\n\t\t\t},\n\t\t\tbyId: (state) => (id) => {\n\t\t\t\t// return state.columnsets.find(f => f.id === id);\n\t\t\t\tlet res = state.columnsets.filter(f => f.id === id);\n\t\t\t\tif (res.length > 1) {\n\t\t\t\t\tconsole.warn('byId', id, res.length, res);\n\t\t\t\t}\n\t\t\t\treturn res[0];\n\t\t\t},\n\t\t\thasColumnSetSelected: (state) => {\n\t\t\t\treturn state.selectedColumnSet !== null;\n\t\t\t},\n\t\t\tgetSelectedColumnSet: (state) => {\n\t\t\t\treturn state.selectedColumnSet;\n\t\t\t},\n\t\t\tgetAvailableFields: (state) => {\n\t\t\t\treturn state.availableFields;\n\t\t\t},\n\t\t\tfieldByPath: (state) => (path, displayKey) => {\n\t\t\t\t// return state.availableFields.find(f => f.data.pathInternal === path || f.data.path === path);\n\t\t\t\tlet res = state.availableFields.filter(f => f.data.pathInternal === path || f.data.path === path);\n\t\t\t\tif (res.length > 1) {\n\t\t\t\t\t// console.warn('fieldByPath', path, res.length, res);\n\t\t\t\t\tlet refinedResult = [];\n\t\t\t\t\tif (displayKey) {\n\t\t\t\t\t\tdisplayKey = displayKey.replace('_', '');\n\t\t\t\t\t\trefinedResult = res.filter(f => f.data.displayKey === displayKey);\n\t\t\t\t\t}\n\t\t\t\t\tif (refinedResult && refinedResult.length) res = refinedResult;\n\t\t\t\t}\n\t\t\t\treturn res[0];\n\t\t\t},\n\t\t\tfieldById: (state) => (id) => {\n\t\t\t\t// return state.availableFields.find(f => f.id === id);\n\t\t\t\tlet res = state.availableFields.filter(f => f.id === id);\n\t\t\t\tif (res.length > 1) {\n\t\t\t\t\tconsole.warn('fieldById', id, res.length, res);\n\t\t\t\t}\n\t\t\t\treturn res[0];\n\t\t\t},\n\t\t\tfieldsByType: (state) => (type) => {\n\t\t\t\treturn state.availableFields.filter(f => f.data.type === type);\n\t\t\t},\n\t\t\tfieldsByParent: (state) => (parent) => {\n\t\t\t\treturn state.availableFields.filter(f => f.data.displayKey === parent);\n\t\t\t}\n\t\t};\n\n\t\tthis.actions = {\n\t\t\tasync _loadEntityClass({ state, commit }) {\n\t\t\t\tif (state.entityclassId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst ec = await getEntityclassByExternalId(classId);\n\t\t\t\tcommit('setEcId', { id: ec.id });\n\t\t\t},\n\t\t\tasync _loadAttributeSet({ state, commit }) {\n\t\t\t\tif (state.attributesetId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst as = await getAttributesetByExternalId(classId);\n\t\t\t\tcommit('setAsId', { id: as.id });\n\t\t\t},\n\t\t\tasync init({ commit, dispatch, state }) {\n\t\t\t\tif (state.availableFields.length > 0) return;\n\t\t\t\tlet allFields = [];\n\n\t\t\t\tconst baseFields = await dispatch('field/loadAll', { ifEmpty: true }, { root: true });\n\t\t\t\tallFields = allFields.concat(baseFields);\n\n\t\t\t\tlet additionalFields = [];\n\t\t\t\tconst translateFieldTitle = function(field) {\n\t\t\t\t\tif (!field.data) {\n\t\t\t\t\t\treturn field;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet prefix = 'product.search.fieldTitles';\n\t\t\t\t\tif (field.data.translationPrefix) {\n\t\t\t\t\t\tprefix = field.data.translationPrefix;\n\t\t\t\t\t}\n\n\t\t\t\t\tfield.data.title = field.label = i18n.t(`${prefix}.${field.id}`);\n\n\t\t\t\t\treturn field;\n\t\t\t\t};\n\n\t\t\t\t// used to add the additional fields from JSON files to the total amount of fields.\n\t\t\t\tconst concatFields = function(base, additionalFields) {\n\t\t\t\t\tfor (const field of additionalFields) {\n\t\t\t\t\t\t// if (base.find(e => e.id === field.id)) {\n\t\t\t\t\t\t// \tconsole.warn(`duplicate id: ${field.id}`, field);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tbase = base.concat(translateFieldTitle(field));\n\n\t\t\t\t\t\tif (field.data && field.data.children) {\n\t\t\t\t\t\t\tbase = concatFields(base, field.data.children);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn base;\n\t\t\t\t};\n\t\t\t\t// console.log('additional start');\n\t\t\t\tadditionalFields = concatFields(additionalFields, JSON.parse(JSON.stringify(SearchFields)));\n\t\t\t\tadditionalFields = concatFields(additionalFields, JSON.parse(JSON.stringify(ExportConfigPackages)));\n\t\t\t\t// console.log('additional end');\n\t\t\t\tallFields = allFields.concat(additionalFields);\n\n\t\t\t\tcommit('setAvailableFields', allFields);\n\t\t\t},\n\t\t\tasync loadAll({ state, commit, dispatch }, { ifEmpty }) {\n\t\t\t\tif (ifEmpty && state.columnsets.length > 0) return;\n\t\t\t\tawait dispatch('_loadEntityClass');\n\n\t\t\t\tconst list = await Repo.getAllColumnSets(state.entityclassId);\n\t\t\t\tcommit('resetList', list);\n\t\t\t\tcommit('sortColumnsetsByName');\n\t\t\t},\n\t\t\tasync create({ state, commit, dispatch }, columnSet) {\n\t\t\t\tawait dispatch('_loadEntityClass');\n\t\t\t\tawait dispatch('_loadAttributeSet');\n\n\t\t\t\tconst entity = await Repo.createColumnSet(columnSet, state.entityclassId, state.attributesetId);\n\t\t\t\tcommit('addColumnSet', entity);\n\t\t\t\tcommit('sortColumnsetsByName');\n\t\t\t\treturn entity;\n\t\t\t},\n\t\t\tasync update({ state, commit, dispatch }, newSet) {\n\t\t\t\tawait dispatch('_loadAttributeSet');\n\n\t\t\t\tconst oldSet = state.columnsets.find(f => f.id === newSet.id);\n\n\t\t\t\tconst updated = await Repo.updateColumnSet(oldSet, newSet.data, state.attributesetId);\n\t\t\t\tif (updated) {\n\t\t\t\t\tcommit('deleteColumnSet', oldSet.id);\n\t\t\t\t\tcommit('addColumnSet', updated);\n\t\t\t\t\tcommit('sortColumnsetsByName');\n\t\t\t\t}\n\n\t\t\t\treturn updated;\n\t\t\t},\n\t\t\tasync delete({ commit }, set) {\n\t\t\t\tif (typeof set === 'undefined') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tawait Repo.deleteColumnSet(set.id);\n\t\t\t\tcommit('deleteColumnSet', set.id);\n\t\t\t},\n\t\t\tasync loadById({ commit, dispatch }, id) {\n\t\t\t\treturn await getEntityById(id);\n\t\t\t}\n\t\t};\n\n\t\tthis.mutations = {\n\t\t\tsetEcId(state, { id }) {\n\t\t\t\tstate.entityclassId = id;\n\t\t\t},\n\t\t\tsetAsId(state, { id }) {\n\t\t\t\tstate.attributesetId = id;\n\t\t\t},\n\t\t\tresetList(state, l) {\n\t\t\t\tstate.columnsets = l || [];\n\t\t\t},\n\t\t\taddColumnSet(state, columnset) {\n\t\t\t\tstate.columnsets.push(columnset);\n\t\t\t},\n\t\t\tdeleteColumnSet(state, id) {\n\t\t\t\tconst idx = state.columnsets.findIndex(f => f.id === id);\n\t\t\t\tstate.columnsets.splice(idx, 1);\n\t\t\t},\n\t\t\tsetSelectedColumnSet(state, columnSet) {\n\t\t\t\tstate.selectedColumnSet = columnSet;\n\t\t\t},\n\t\t\tresetSelectedColumnSet(state) {\n\t\t\t\tstate.selectedColumnSet = null;\n\t\t\t},\n\t\t\tsetAvailableFields(state, fields) {\n\t\t\t\tstate.availableFields = fields;\n\t\t\t},\n\t\t\tsortColumnsetsByName(state) {\n\t\t\t\tif (state.columnsets && state.columnsets.length) {\n\t\t\t\t\tstate.columnsets.sort((columnsetA, columnsetB) => {\n\t\t\t\t\t\tif (columnsetA.data.configuration && columnsetB.data.configuration) {\n\t\t\t\t\t\t\treturn columnsetA.data.configuration.name.trim().localeCompare(columnsetB.data.configuration.name.trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n}\n","import BaseColumnsetStore from './base';\nconst base = new BaseColumnsetStore('columnset');\n\nconst state = {\n\t...base.state,\n};\n\nconst getters = {\n\t...base.getters,\n};\n\nconst actions = {\n\t...base.actions,\n};\n\nconst mutations = {\n\t...base.mutations,\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import BaseColumnsetStore from '../columnset/base';\nconst base = new BaseColumnsetStore('exportset');\n\nconst state = {\n\t...base.state,\n};\n\nconst getters = {\n\t...base.getters,\n};\n\nconst actions = {\n\t...base.actions,\n};\n\nconst mutations = {\n\t...base.mutations,\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as Repo from '@/repository/auth.js';\nimport jwtDecode from 'jwt-decode';\nimport { backendUrl, KeycloakInfo } from '@/util/env.js';\nimport { setToken } from '@/util/jwt-cache.js';\nimport Keycloak from 'keycloak-js';\nimport EventBus from '@/util/eventbus.js';\n\nconst BML_DOMAIN = backendUrl.substr(backendUrl.lastIndexOf('/') + 1);\n\nconst keycloak = new Keycloak(KeycloakInfo);\n\nlet initPromise;\nlet refreshTimer;\nlet isInit = false;\nconst state = {\n\tmain: {\n\t\ttoken: null,\n\t\taccount: null,\n\t\tdetails: {}\n\t},\n\tssoToken: null,\n\tssoRefreshToken: null,\n\tssoRefreshTokenParsed: null,\n\tssoParsed: null,\n\tkeycloakAccountUrl: null\n};\n\n\nconst getters = {\n\n\tisLoggedIn: (state) => {\n\t\treturn !!state.main.token;\n\t},\n\n\tgetCurrentToken: (state) => {\n\t\treturn state.main.token;\n\t},\n\n\tssoUserId: (state) => {\n\t\treturn state.ssoParsed?.sub;\n\t},\n\n\tgetIsExpired: (state, getters) => {\n\t\treturn !getters.isLoggedIn;\n\t},\n\n\tisSsoTokenExpired: (state) => {\n\t\treturn !state.ssoParsed;\n\t},\n\n\thasAccountSelected: (state) => {\n\t\treturn state.main.account !== null;\n\t},\n\n\tgetValidTokenForAccount: (state) => (accountId) => {\n\t\tif (state.main.account === accountId) {\n\t\t\treturn state.main.token;\n\t\t}\n\t\treturn null;\n\t},\n\n\tgetKeycloakAccountUrl: (state) => {\n\t\treturn state.keycloakAccountUrl;\n\t},\n\n\thasSsoLogin: (state) => {\n\t\treturn state.ssoParsed;\n\t},\n\n\tcurrentAccountCompany: (state) =>{\n\t\tif (state.main.details && state.main.details.staticData && 'companyLink' in state.main.details.staticData) {\n\t\t\treturn state.main.details.staticData.companyLink;\n\t\t} else {\n\t\t\treturn null;\n\t\t\t// return '59dfb1a5-aa13-42e1-8a8e-cef1ddade200';\t//@TODO remove debugging\n\t\t}\n\t},\n\n\tcurrentAccountInstitution: (state, getters, rootState, rootGetters) => {\n\t\tconst institutions = rootGetters['auth/org/institutionsByCurrentAccount'];\n\t\tlet instis = institutions.filter((e) =>\n\t\t\te.data.users?.includes(state.main.account),\n\t\t);\n\t\treturn instis.map((e) => e.id);\n\t},\n\n\taccountId(state) {\n\t\treturn state.main.account;\n\t},\n\n\taccountDetails(state) {\n\t\treturn state.main.details;\n\t}\n\n};\n\nconst actions = {\n\n\n\t/**\n\t * should be called once at the start\n\t **/\n\tasync initApp({ dispatch, state, commit }) {\n\t\tif (!initPromise) {\n\t\t\tlet opts = {};\n\t\t\tif (state.ssoToken && state.ssoRefreshToken) {\n\t\t\t\topts.token = opts.idToken = state.ssoToken;\n\t\t\t\topts.refreshToken = state.ssoRefreshToken;\n\t\t\t\topts.onLoad = 'login-required';\n\t\t\t}\n\t\t\tinitPromise = keycloak.init(opts);\n\t\t}\n\t\tlet auth = await initPromise;\n\t\tif (isInit) return;\n\t\tisInit = true;\n\t\t// console.log('init', keycloak, auth);\n\t\tif (auth) {\n\t\t\tif (state.ssoToken && state.ssoRefreshToken) {\n\t\t\t\ttry {\n\t\t\t\t\tawait keycloak.updateToken(65);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.log('failed to update initial token', e);\n\t\t\t\t\tcommit('logout');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait dispatch('authenticate');\n\t\t} else {\n\t\t\tawait dispatch('authenticate');\n\t\t}\n\t\tif (!refreshTimer) {\n\t\t\trefreshTimer = setInterval(async() => {\n\t\t\t\tawait dispatch('refreshTokenAndLogin');\n\t\t\t}, 1000 * 30);\n\t\t}\n\t},\n\n\t/**\n\t * call to log in the user\n\t **/\n\tasync authenticate({ commit, dispatch, state }) {\n\t\tconsole.log('authenticate', keycloak);\n\t\tif (!keycloak.token) {\n\t\t\tawait keycloak.login({});\n\t\t}\n\t\tcommit('setSsoToken', keycloak);\n\t\tconst url = await keycloak.createAccountUrl();\n\t\tcommit('setKeycloakAccountUrl', url);\n\t\tlet data = await Repo.loginToDomain(state.ssoToken, state.main.account);\n\t\tcommit('login', data.jwt);\n\t\tawait dispatch('switchToFirstAvailableAccount');\n\t},\n\n\t/**\n\t * call to log out the user\n\t **/\n\tasync logout({ commit }) {\n\t\tcommit('logout');\n\t\tawait keycloak.logout();\n\t},\n\n\tasync switchAccountAndLogin({ state, commit, dispatch, getters }, accountId) {\n\t\tif (state.main.account && accountId === state.main.account) return;\n\t\tEventBus.emit('product.cache.clear');\n\t\tlet existing = getters.getValidTokenForAccount(accountId);\n\t\tif (existing) {\n\t\t\tcommit('login', existing);\n\t\t} else {\n\t\t\tlet data = await Repo.switchAccount(accountId);\n\t\t\tif (!data) throw new Error('Could not switch account.');\n\t\t\tcommit('login', data.jwt);\n\t\t}\n\t\tawait dispatch('auth/user/loadAccountData', null, { root: true });\n\t\tconst account = getters['auth/user/getCurrentAccount'];\n\t\tcommit('setAccountData', account);\n\t\tawait dispatch('auth/user/updateUserEmail', {}, { root: true });\n\t\twindow.location.reload();\n\t},\n\n\tasync switchToFirstAvailableAccount({ dispatch, getters, rootGetters, commit }) {\n\t\tawait dispatch('auth/user/loadAccounts', { ifEmpty: true }, { root: true });\n\t\tlet available = rootGetters['auth/user/getAccounts']();\n\t\tif (available.length > 0) {\n\t\t\tavailable = available.filter(account => account.data.active && account.data.registrationOptionName === 'editor');\n\t\t\tif (!getters.hasAccountSelected) {\n\t\t\t\t//2 account\n\t\t\t\tawait dispatch('switchAccountAndLogin', available[0].id);\n\t\t\t} else {\n\t\t\t\t//1 account\n\t\t\t\tawait dispatch('auth/user/loadAccountData', null, { root: true });\n\t\t\t\tawait dispatch('auth/user/updateUserEmail', {}, { root: true });\n\t\t\t}\n\t\t\tconst account = getters['auth/user/getCurrentAccount'];\n\t\t\tcommit('setAccountData', account);\n\t\t} else {\n\t\t\t//0 accounts\n\t\t\tconsole.warn('no accounts to switch to');\n\t\t}\n\t},\n\n\tasync refreshTokenAndLogin({ commit, dispatch, getters, state }) {\n\t\tif (!isInit || !initPromise) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!state.ssoRefreshTokenParsed || state.ssoRefreshTokenParsed.exp < ~~(Date.now()/1000)) {\n\t\t\tif (getters.isLoggedIn) await dispatch('logout');\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tlet refreshed = await keycloak.updateToken(65);\n\t\t\tif (refreshed) {\n\t\t\t\tcommit('setSsoToken', keycloak);\n\t\t\t\tlet data = await Repo.loginToDomain(state.ssoToken, state.main.account);\n\t\t\t\tcommit('login', data.jwt);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log('refresh token failed.');\n\t\t}\n\t}\n\n};\n\nconst mutations = {\n\n\tlogin(state, jwt) {\n\t\tlet { aud, sub, exp } = jwtDecode(jwt);\n\t\tif (aud !== BML_DOMAIN) {\n\t\t\tthrow new Error(`token expected for ${BML_DOMAIN} but received for ${aud}`);\n\t\t}\n\t\tlet expDate = new Date(exp * 1000);\n\t\tif (expDate < new Date()) {\n\t\t\tthrow new Error('token is expired');\n\t\t}\n\t\tif (!sub) sub = null;\n\t\tstate.main.token = jwt;\n\t\tstate.main.account = sub;\n\t\tsetToken(jwt);\n\t\t// EventHub.$emit('auth.login');\n\t},\n\n\tlogout(state) {\n\t\tstate.main.token = null;\n\t\tstate.main.account = null;\n\t\tstate.ssoToken = null;\n\t\tstate.ssoParsed = null;\n\t\tstate.keycloakAccountUrl = null;\n\t\tstate.ssoRefreshTokenParsed = null;\n\t\tsetToken(null);\n\t},\n\n\tsetSsoToken(state, { token, tokenParsed, refreshToken, refreshTokenParsed }) {\n\t\tstate.ssoToken = token;\n\t\tstate.ssoParsed = tokenParsed;\n\t\tstate.ssoRefreshToken = refreshToken;\n\t\tstate.ssoRefreshTokenParsed = refreshTokenParsed;\n\t},\n\n\tsetKeycloakAccountUrl(state, url) {\n\t\tstate.keycloakAccountUrl = url;\n\t},\n\n\tsetAccountData(state, data) {\n\t\tstate.main.details = data;\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { getProductTitle } from '@/util/field-helper';\nimport { _searchCursor, _search } from '@/repository/system.js';\n\nconst state = {\n\tentityClassId: '',\n\tnotes: [],\n\tneedsLoading: false,\n\tfilter: {\n\t\tinstitute: null,\n\t\tuser: null,\n\t\tlist: null,\n\t\tlabel: null,\n\t\tcategory: null,\n\t\tstatus: 'unread'\n\t},\n\tpage: 1\n};\n\nconst backendParamKeys = ['institute', 'user', 'list', 'label', 'category'];\nconst filterKeys = ['institute', 'user', 'list', 'status', 'label', 'category'];\n\nfunction extractInstitutionsFromProduct(product) {\n\tlet institutions = [];\n\tfor (const list of Object.values(product.data.listData)) {\n\t\tif (list._responsible && list._responsible.institution) {\n\t\t\tinstitutions.push(list._responsible.institution);\n\t\t}\n\t}\n\n\treturn [...new Set(institutions)];\n}\n\nconst getters = {\n\tgetNotes: (state) => {\n\t\treturn state.notes;\n\t},\n\n\tarchiveMode: (state) => {\n\t\treturn state.filter.status !== 'unread';\n\t}\n};\n\nconst actions = {\n\t// Calculates all notes for all products for an given institute (and user).\n\t// @TODO: This can be costly as we don't have an mechanism to join related data.\n\tasync loadNotes({ commit, rootGetters, dispatch, state }) {\n\t\tawait dispatch('category/loadAll', { ifEmpty: true }, { root: true });\n\t\tawait dispatch('list/loadAll', { ifEmpty: true }, { root: true });\n\t\tawait dispatch('label/loadAll', { ifEmpty: true }, { root: true });\n\t\tif (!state.needsLoading) return;\n\t\tlet params = {};\n\t\tbackendParamKeys.forEach(key => {\n\t\t\tif (state.filter[key]) params[key] = state.filter[key];\n\t\t});\n\t\tif (state.filter.status === 'unread') params.unread = true;\n\t\tconst relevantProducts = await dispatch('loadProducts', params) || [];\n\t\tlet notes = [];\n\t\tfor (const product of relevantProducts) {\n\t\t\tif (!product.data || !product.data.listData) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst filteredLists = Object.entries(product.data.listData)\n\t\t\t\t.filter(([_, listData]) => typeof listData._notes !== 'undefined');\n\n\t\t\tfor (const [listId, productListData] of filteredLists) {\n\t\t\t\tconst list = rootGetters['list/byId'](listId);\n\t\t\t\tconst categorySelection = productListData._category;\n\t\t\t\tlet categorySelectionEntities = rootGetters['category/byIds'](categorySelection);\n\n\t\t\t\tfor (const note of productListData._notes) {\n\t\t\t\t\tlet obj = note;\n\t\t\t\t\tif (!obj.read) {\n\t\t\t\t\t\tobj.read = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (obj.read && state.filter.status === 'unread') continue;\n\t\t\t\t\tconst label = obj.label ? rootGetters['label/byId'](obj.label) : null;\n\t\t\t\t\tobj.product = {\n\t\t\t\t\t\tid: product.id,\n\t\t\t\t\t\ttitle: getProductTitle(product),\n\t\t\t\t\t\tlist: {\n\t\t\t\t\t\t\tid: list.id,\n\t\t\t\t\t\t\ttitle: list.data.title\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcategories: categorySelectionEntities\n\t\t\t\t\t};\n\t\t\t\t\tif (label) {\n\t\t\t\t\t\tif (state.filter.label && label.id !== state.filter.label) continue;\n\t\t\t\t\t\tobj.product.label = {\n\t\t\t\t\t\t\tcolor: label.data.color,\n\t\t\t\t\t\t\ttitle: label.data.title\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobj.product.label = {\n\t\t\t\t\t\t\tcolor: '',\n\t\t\t\t\t\t\ttitle: {}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tlet institutions = extractInstitutionsFromProduct(product);\n\t\t\t\t\tobj.institutions = institutions;\n\t\t\t\t\tnotes.push(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcommit('resetNotes');\n\t\tcommit('setNotes', notes);\n\t},\n\n\tasync loadProducts({ rootGetters, dispatch, getters }, { institute, user, list, unread, label, category }) {\n\t\tawait dispatch('productlist/_setEntityClassId', null, { root: true });\n\t\tlet lists = rootGetters['list/root'];\n\t\tlet filter = { $or: [] };\n\t\tfunction addForList(listId) {\n\t\t\tlet res = [];\n\t\t\tres.push({\n\t\t\t\tfield: `/data/listData/${listId}/_responsible/institution`,\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: institute\n\t\t\t});\n\t\t\tif (user) {\n\t\t\t\tres.push({\n\t\t\t\t\tfield: `/data/listData/${listId}/_responsible/accountId`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: user\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (category) {\n\t\t\t\tres.push({\n\t\t\t\t\tfield: `/data/listData/${listId}/_categoryTree`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: category\n\t\t\t\t});\n\t\t\t}\n\t\t\tlet notesFilter = [];\n\t\t\tif (label) {\n\t\t\t\tnotesFilter.push({\n\t\t\t\t\tfield: `/data/listData/${listId}/_notes/label`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: label\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (unread) {\n\t\t\t\tnotesFilter.push({\n\t\t\t\t\tfield: `/data/listData/${listId}/_notes/read`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: false\n\t\t\t\t});\n\t\t\t} else if (notesFilter.length === 0) {\n\t\t\t\tnotesFilter.push({ $not: {\t//must be something nested because notes is not indexed in root doc\n\t\t\t\t\tfield: `/data/listData/${listId}/_notes/id`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: '0'\n\t\t\t\t} });\n\t\t\t}\n\t\t\tres.push({\n\t\t\t\t$nested: {\n\t\t\t\t\tmatch: { $and: notesFilter },\n\t\t\t\t\tpath: `/data/listData/${listId}/_notes`\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn { $and: res };\n\t\t}\n\t\tif (list) {\n\t\t\tfilter.$or.push(addForList(list));\n\t\t} else {\n\t\t\tfor (let l of lists) {\n\t\t\t\tfilter.$or.push(addForList(l.id));\n\t\t\t}\n\t\t}\n\t\tlet res;\n\t\tif (getters.archiveMode) {\n\t\t\tconst productsPerPage = 10;\n\t\t\tlet pagination = {\n\t\t\t\tstart: (state.page-1) * productsPerPage,\n\t\t\t\tlimit: productsPerPage\n\t\t\t};\n\t\t\tres = await _search(null, filter, 'post', 'bml/product/search', pagination);\n\t\t} else {\n\t\t\tres = await _searchCursor(null, filter, 'post', 'bml/product/search');\n\t\t}\n\t\treturn res;\n\t},\n\n\n};\n\nconst mutations = {\n\tresetNotes(state) {\n\t\tstate.notes = [];\n\t},\n\tsetNotes(state, notes) {\n\t\tstate.notes = notes;\n\t\tstate.needsLoading = false;\n\t},\n\tupdateFilter(state, f) {\n\t\tfilterKeys.forEach(key => {\n\t\t\tif (key in f && f[key] !== state.filter[key]) {\n\t\t\t\tstate.filter[key] = f[key];\n\t\t\t\tstate.needsLoading = true;\n\t\t\t}\n\t\t});\n\t},\n\tsetPage(state, { page }) {\n\t\tstate.page = page;\n\t\tstate.needsLoading = true;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as RoleService from '@/util/role.js';\n\nconst state = {\n\tcurrentRole: null\n};\n\nconst getters = {\n\tisAdmin: (state) => {\n\t\treturn state.currentRole === RoleService.ROLE.Admin;\n\t},\n\tisEditor: (state) => {\n\t\treturn state.currentRole === RoleService.ROLE.Editor;\n\t},\n\tgetRole: (state) => () => {\n\t\treturn state.currentRole;\n\t},\n\n\tisCorePartner: (state, getters, rootState, rootGetters) => {\n\t\tconst currentAccount = rootGetters['auth/user/getCurrentAccount']();\n\t\tif (!currentAccount) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst allInstitutions = rootGetters['auth/org/byAccountId'](currentAccount.id);\n\t\treturn allInstitutions.filter(f => f.data.corePartner === true).length > 0;\n\t},\n\n\tisNationalPartner: (state, getters) => {\n\t\tconst isCorePartner = getters.isCorePartner;\n\t\treturn !isCorePartner;\n\t},\n\n\tisInInstitute: (state, getters, rootState, rootGetters) => (institutes) => {\n\t\tif (!institutes || institutes.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst currentInstitutions = rootGetters['auth/user/getUserInstitutionIds'];\n\t\treturn currentInstitutions.filter(ci => institutes.includes(ci)).length > 0;\n\t},\n\n\tcanViewList: (state, getters) => (list) => {\n\t\tif (!list) {\n\t\t\tconsole.warn('No list provided.');\n\t\t\treturn false;\n\t\t}\n\t\tif (getters.isAdmin || getters.isCorePartner) {\n\t\t\treturn true;\n\t\t}\n\t\treturn getters.isInInstitute(list.data.institutes) || list.data.isBasedata;\n\t},\n\n\tbasicCanEditList: (state, getters, rootState, rootGetters) => (list) => {\n\t\tif (!list) {\n\t\t\treturn false;\n\t\t}\n\t\tif (rootGetters['product/isListArchived'](list.id)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\tcanEditList: (state, getters) => (list, responsibleData) => {\n\t\tif (getters.isAdmin) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!getters.basicCanEditList(list)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn getters.isResponsibleForProduct(true, responsibleData);\n\t},\n\n\tcanViewProduct: (state, getters) => (product, list) => {\n\t\tif (getters.isAdmin) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!getters.basicCanEditList(list)) {\n\t\t\treturn false;\n\t\t}\n\t\t// if (!product.data.isNationalPartner && !getters.isInInstitute(list.data.institutes)) {\n\t\t// \treturn false;\n\t\t// }\n\t\tif (getters.isCorePartner) {\n\t\t\treturn true;\n\t\t}\n\t\tconst listData = product.data.listData[list.id];\n\t\tif (!listData) {\n\t\t\treturn false;\n\t\t}\n\t\tlet canAccessList = false;\n\t\tif (listData._responsible) {\n\t\t\tcanAccessList = getters.isResponsibleForProductGiven({ listResponsible: listData._responsible });\n\t\t} else {\n\t\t\tcanAccessList = getters.isInInstitute(list.data.institutes);\n\t\t}\n\t\treturn canAccessList;\n\t},\n\n\tisResponsibleForProductGiven: (state, getters, rootState, rootGetters) => ({ listResponsible, baseResponsible }) => {\n\t\tif (getters.isAdmin) return true;\n\t\tconst responsibleData = listResponsible || baseResponsible;\n\t\tif (!responsibleData) return false;\n\t\tconst currentInstitutions = rootGetters['auth/user/getUserInstitutionIds'];\n\t\tlet isResponsible = currentInstitutions.includes(responsibleData.institution);\n\t\treturn isResponsible;\n\t},\n\n\tisResponsibleForProduct: (state, getters, rootState, rootGetters) => (skipAccount, responsibleData) => {\n\t\tif (getters.isAdmin) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!responsibleData) responsibleData = rootGetters['product/getValue']('_responsible');\n\t\tif (!responsibleData) {\n\t\t\tconsole.warn('no responsible data set');\n\t\t\treturn false;\n\t\t}\n\t\tconst currentInstitutions = rootGetters['auth/user/getUserInstitutionIds'];\n\t\tlet isResponsible = currentInstitutions.includes(responsibleData.institution);\n\t\tif (!skipAccount && responsibleData.accountId) {\n\t\t\tconst currentAccount = rootGetters['auth/user/getCurrentAccount']();\n\t\t\tisResponsible = isResponsible && currentAccount.id === responsibleData.accountId;\n\t\t}\n\t\treturn isResponsible;\n\t},\n\n\tcanApproveStandards: (state, getters, rootState, rootGetters) => {\n\t\tconst currentAccount = rootGetters['auth/user/getCurrentAccount']();\n\t\tif (currentAccount) {\n\t\t\treturn !!currentAccount.staticData.hasApprovalRight;\n\t\t}\n\t\treturn false;\n\t},\n\n\tisListReadonly: (state, getters) => (list) => {\n\t\treturn !getters.canEditList(list);\n\t},\n\n\tgetAvailableLists: (state, getters, rootState, rootGetters) => {\n\t\tconst allLists = rootGetters['list/root'];\n\t\treturn allLists.filter(f => f.data.isBasedata || getters.canViewList(f));\n\t}\n\n};\n\nconst actions = {\n};\n\nconst mutations = {\n\tsetRole(state, account) {\n\t\tstate.currentRole = RoleService.accountToRole(account);\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { ROLE } from '@/util/role';\nimport {uniq} from 'lodash';\n\nconst state = {\n\tgroups: [],\n\tcurrentRoutes: []\n};\n\nfunction hasFittingRole(userRole, routeRole) {\n\tif (userRole === ROLE.Admin) {\n\t\treturn true;\n\t}\n\n\tif (routeRole === ROLE.Registered) {\n\t\treturn userRole === ROLE.Editor || userRole === ROLE.Registered;\n\t}\n\n\treturn userRole === routeRole;\n}\n\nfunction doRouteFilter(userRole, group, route) {\n\tif (!group && !route.meta) {\n\t\treturn true;\n\t}\n\n\tif (route.meta.group !== group || route.meta.hideInNav) {\n\t\treturn false;\n\t}\n\n\tif (route.meta.permission) {\n\t\treturn hasFittingRole(userRole, route.meta.permission);\n\t}\n\n\treturn true;\n}\n\nconst getters = {\n\tgetGroups: (state) => () => {\n\t\treturn state.groups;\n\t},\n\tgetRoutesByGroup: (state) => (group) => {\n\t\treturn state.currentRoutes.filter(f => f.group === group);\n\t}\n};\n\nconst actions = {\n\tasync setRoutes({ commit }, { userRole }) {\n\t\tconst router = (await import('@/router.js')).default;\n\t\tcommit('setRoutes', { userRole, router });\n\t}\n};\n\nconst mutations = {\n\tsetRoutes(state, { userRole, router }) {\n\t\tconst groups = uniq(router.options.routes\n\t\t\t.filter(r => !!r.meta)\n\t\t\t.map(r => (r.meta.group ? r.meta.group : '')));\n\t\tlet actualGroups = [];\n\t\tlet routes = [];\n\t\tfor (const group of groups) {\n\t\t\tconst filteredRoutes = router.options.routes\n\t\t\t\t.filter(r => doRouteFilter(userRole, group, r));\n\t\t\tif (filteredRoutes.length > 0) {\n\t\t\t\tactualGroups.push(group);\n\t\t\t\tfor (const route of filteredRoutes) {\n\t\t\t\t\tlet routeObj = route;\n\t\t\t\t\trouteObj.group = group;\n\t\t\t\t\troutes.push(routeObj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstate.groups = actualGroups;\n\t\tstate.currentRoutes = routes;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as Repo from '@/repository/auth.js';\nimport { getEntitiesById } from '@/repository/system.js';\nimport EventHub from '@/util/eventbus.js';\nimport notes from './user/notes';\nimport roles from './user/roles';\nimport routes from './user/routes';\nimport { i18n } from '@/main';\n\nconst state = {\n\taccounts: [],\n\tcurrentAccount: null\n};\n\nconst modules = {\n\tnotes,\n\troles,\n\troutes\n};\n\nconst getters = {\n\n\tgetAccounts: (state) => () => {\n\t\treturn state.accounts;\n\t},\n\n\tgetCurrentAccount: (state) => () => {\n\t\treturn state.currentAccount;\n\t},\n\n\tgetCurrentAccountId: (state) => {\n\t\treturn state.currentAccount ? state.currentAccount.id : '';\n\t},\n\n\tgetUserInstitutionIds: (state, getters, rootState, rootGetters) => {\n\t\tconst account = state.currentAccount;\n\t\tif (account) {\n\t\t\tconst data = rootGetters['auth/org/byAccountId'](account.id);\n\t\t\treturn data.map(f => f.id);\n\t\t}\n\n\t\treturn [];\n\t},\n\n\tuserName: state => {\n\t\treturn state.currentAccount?.staticData?.fullname || '';\n\t},\n\n\tisAdmin: (state) => {\n\t\treturn state.currentAccount && state.currentAccount.staticData.isAdmin;\n\t}\n};\n\nconst actions = {\n\n\tasync loadAccounts({ commit, rootGetters }) {\n\t\tconst isExpired = rootGetters['auth/login/getIsExpired'];\n\t\tif (isExpired) return false;\n\t\tcommit('resetAccounts');\n\t\tconst accountIds = await Repo.listAccountsForUser();\n\t\tif (!accountIds.length) return false;\n\t\tconst accounts = await getEntitiesById(accountIds);\n\t\tfor (const account of accounts) {\n\t\t\tcommit('addAccount', account);\n\t\t}\n\t\treturn true;\n\t},\n\n\tasync loadAccountData({ commit, getters, dispatch, rootGetters }) {\n\t\tlet accountDetails = await Repo.getAccountDetails();\n\t\tif (!accountDetails) {\n\t\t\tcommit('setAccountData', null);\n\t\t\tcommit('roles/setRole', null);\n\t\t\tdispatch('routes/setRoutes', { userRole: null });\n\t\t\tconsole.warn('Could not load account details.');\n\t\t\treturn;\n\t\t}\n\t\tcommit('setAccountData', accountDetails);\n\t\tcommit('roles/setRole', accountDetails);\n\t\tconst role = getters['roles/getRole']();\n\t\tdispatch('routes/setRoutes', { userRole: role });\n\t\tif (accountDetails.userData.selectedUiLanguage) {\n\t\t\tcommit('base/setUiLanguage', accountDetails.userData.selectedUiLanguage, { root: true });\n\t\t}\n\t\tif (accountDetails.userData.userLanguagesForMultiLangFields) {\n\t\t\tcommit('base/setUserLangForFields', accountDetails.userData.userLanguagesForMultiLangFields, { root: true });\n\t\t}\n\t\tlet searches = accountDetails.userData.searches && accountDetails.userData.searches.length ? accountDetails.userData.searches : [];\n\t\tcommit('base/setFavoredSearches', searches, { root: true });\n\t\tcommit('base/setReceiveMailsNotes', { enabled: accountDetails.userData.sendNotificationMailsNotes, email: accountDetails.userData.email }, { root: true });\n\t\tcommit('base/setReceiveMailsMessages', { enabled: accountDetails.userData.sendNotificationMailsMessages, email: accountDetails.userData.email }, { root: true });\n\t\tcommit('base/setOverrideMultitextLanguages', { enabled: accountDetails.userData.overrideMultiLangFieldsWithListData }, { root: true });\n\t\tif (accountDetails.userData.defaultProductColumns) {\n\t\t\tawait dispatch('columnset/loadAll', { ifEmpty: true }, { root: true });\n\t\t\tlet obj = rootGetters['columnset/all'].find(e => e.id === accountDetails.userData.defaultProductColumns);\n\t\t\tif (obj) {\n\t\t\t\tcommit('columnset/setSelectedColumnSet', obj, { root: true });\n\t\t\t}\n\t\t} else {\n\t\t\tawait commit('columnset/resetSelectedColumnSet', {}, { root: true });\n\t\t}\n\t\tEventHub.emit('auth.updateLists');\n\t},\n\n\tresetMultiLanguageFields({ commit }) {\n\t\tif (!state.currentAccount) {\n\t\t\treturn;\n\t\t}\n\t\tif (state.currentAccount.userData.userLanguagesForMultiLangFields) {\n\t\t\tcommit('base/setUserLangForFields', state.currentAccount.userData.userLanguagesForMultiLangFields, { root: true });\n\t\t}\n\t},\n\n\tasync updateUserData({ state, dispatch, rootState }, { selectedUiLanguage, userLanguagesForMultiLangFields, favoredSearches, receiveMailsNotes, receiveMailsMessages, email, defaultProductFilter, defaultProductColumns, overrideMultiLangFieldsWithListData }) {\n\t\tlet payload = {};\n\t\tif (!state.currentAccount) {\n\t\t\tthrow new Error('No account set.');\n\t\t}\n\n\t\tlet hasChanged = false;\n\n\t\tif (selectedUiLanguage) {\n\t\t\tpayload.selectedUiLanguage = selectedUiLanguage;\n\t\t\thasChanged = true;\n\t\t\ti18n.locale = selectedUiLanguage;\n\t\t} else {\n\t\t\tpayload.selectedUiLanguage = rootState.base.selectedUiLanguage;\n\t\t}\n\n\t\tif (userLanguagesForMultiLangFields) {\n\t\t\tpayload.userLanguagesForMultiLangFields = userLanguagesForMultiLangFields;\n\t\t\thasChanged = true;\n\t\t} else {\n\t\t\tpayload.userLanguagesForMultiLangFields = rootState.base.userLanguagesForMultiLangFields;\n\t\t}\n\n\t\tif (favoredSearches) {\n\t\t\tpayload.searches = favoredSearches;\n\t\t\thasChanged = true;\n\t\t} else {\n\t\t\tpayload.searches = rootState.base.favoredSearches;\n\t\t}\n\n\t\tif (typeof receiveMailsNotes !== 'undefined') {\n\t\t\tpayload.sendNotificationMailsNotes = receiveMailsNotes;\n\t\t\thasChanged = true;\n\t\t} else {\n\t\t\tpayload.sendNotificationMailsNotes = rootState.base.receiveMailsNotes;\n\t\t}\n\n\t\tif (typeof receiveMailsMessages !== 'undefined') {\n\t\t\tpayload.sendNotificationMailsMessages = receiveMailsMessages;\n\t\t\thasChanged = true;\n\t\t} else {\n\t\t\tpayload.sendNotificationMailsMessages = rootState.base.receiveMailsMessages;\n\t\t}\n\n\t\tif (typeof overrideMultiLangFieldsWithListData !== 'undefined') {\n\t\t\tpayload.overrideMultiLangFieldsWithListData = overrideMultiLangFieldsWithListData;\n\t\t\thasChanged = true;\n\t\t} else {\n\t\t\tpayload.overrideMultiLangFieldsWithListData = rootState.base.overrideMultitextLanguages;\n\t\t}\n\n\t\tif (defaultProductColumns) {\n\t\t\tpayload.defaultProductColumns = defaultProductColumns;\n\t\t\thasChanged = true;\n\t\t} else {\n\t\t\tpayload.defaultProductColumns = state.currentAccount.userData.defaultProductColumns;\n\t\t}\n\n\t\tif (defaultProductFilter) {\n\t\t\tpayload.defaultProductFilter = defaultProductFilter;\n\t\t\thasChanged = true;\n\t\t} else {\n\t\t\tpayload.defaultProductFilter = state.currentAccount.userData.defaultProductFilter;\n\t\t}\n\n\t\tif (email) {\n\t\t\tpayload.email = email;\n\t\t\thasChanged = true;\n\t\t} else if (rootState.base.notificationEmail) {\n\t\t\thasChanged = true;\n\t\t\tpayload.email = rootState.base.notificationEmail;\n\t\t}\n\n\t\tif (hasChanged) {\n\t\t\tawait Repo.updateAccount(payload);\n\t\t\tawait dispatch('loadAccountData');\n\t\t}\n\t},\n\n\tasync acceptInvite({ rootState, dispatch }, { inviteId, registrationName }) {\n\t\tlet { ssoToken } = rootState.auth.login;\n\t\tlet accountId = await Repo.registerWithDomainByInvite(inviteId, registrationName, ssoToken);\n\t\tawait dispatch('auth/login/switchAccountAndLogin', accountId, { root: true });\n\t},\n\n\tasync updateUserEmail({ rootState, dispatch }) {\n\t\tlet ssoMail = rootState.auth.login.ssoParsed.email;\n\t\tlet existing = rootState.base.notificationEmail;\n\t\tif (ssoMail === existing || !ssoMail) return;\n\t\tawait dispatch('updateUserData', { email: ssoMail });\n\t}\n\n};\n\nconst mutations = {\n\n\tresetAccounts(state) {\n\t\tstate.accounts = [];\n\t},\n\n\taddAccount(state, account) {\n\t\tif (account.data.registrationOptionName !== 'editor'\n\t\t\t|| state.accounts.find(f => f.id === account.id)) {\n\t\t\treturn;\n\t\t}\n\t\tstate.accounts.push(account);\n\t},\n\n\tsetAccountData(state, account) {\n\t\tstate.currentAccount = account;\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tmodules,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as Repo from '@/repository/auth.js';\nimport { getEntityclassByExternalId, search } from '@/repository/system.js';\nimport { basePath } from '@/util/env.js';\n\nconst state = {\n\taccountsForAllUsers: [],\n\tregistrationOptions: []\n};\n\nconst ACCOUNT_ENTITY_CLASS_ID = 'account';\n\nconst getters = {\n\tgetAccountsForAllUsers: (state) => {\n\t\treturn state.accountsForAllUsers;\n\t},\n\tgetAccountsForActiveUsers: (state) => {\n\t\treturn state.accountsForAllUsers.filter(e => e.data.active);\n\t},\n\tgetAccountById: (state) => (id) => {\n\t\treturn state.accountsForAllUsers.find(f => f.id === id);\n\t},\n\tgetRegistrationOptions: (state) => () => {\n\t\treturn state.registrationOptions;\n\t},\n\tgetInviteLinkUrl: () => (accountId, inviteId, registrationName) => {\n\t\tlet invite;\n\t\tif (!inviteId.includes('__')) {\n\t\t\tinvite = `${accountId}__${inviteId}`;\n\t\t} else {\n\t\t\tinvite = inviteId;\n\t\t}\n\t\treturn `${document.location.origin}${basePath}auth/acceptinvite?id=${invite}®istrationName=${registrationName}`;\n\t},\n\tgetInvites: (state) => {\n\t\treturn state.accountsForAllUsers\n\t\t\t.filter(f => f.data.invites && Object.keys(f.data.invites).length > 0)\n\t\t\t.map(f => {\n\t\t\t\tconst name = f.data.staticData.fullname ? f.data.staticData.fullname : '-';\n\n\t\t\t\treturn {\n\t\t\t\t\taccountId: f.id,\n\t\t\t\t\taccountName: name,\n\t\t\t\t\tinvites: f.data.invites\n\t\t\t\t};\n\t\t\t});\n\t}\n};\n\nconst actions = {\n\tasync loadAccountsForAllUsers({ state, commit, rootGetters }, { ifEmpty }) {\n\t\tif (ifEmpty && state.accountsForAllUsers.length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// load entity class from backend\n\t\tif (!state.entityClassId) {\n\t\t\tlet entityClass = await getEntityclassByExternalId(ACCOUNT_ENTITY_CLASS_ID);\n\t\t\tcommit('setEntityClassId', entityClass);\n\t\t}\n\n\t\tlet accountList = await search(state.entityClassId, null, { limit: 1000 });\n\t\tcommit('resetAccountsForAllUsers');\n\n\t\tfor (const account of accountList) {\n\t\t\taccount.orgs = rootGetters['auth/org/byAccountId'](account.id);\n\t\t}\n\t\tcommit('addAccountForAllUsers', accountList);\n\t}\n};\n\nconst mutations = {\n\tsetEntityClassId(state, { id }) {\n\t\tstate.entityClassId = id;\n\t},\n\tresetAccountsForAllUsers(state) {\n\t\tstate.accountsForAllUsers = [];\n\t},\n\taddAccountForAllUsers(state, accounts) {\n\t\tif (accounts && accounts.length) {\n\t\t\taccounts = accounts.sort((account1, account2) => {\n\t\t\t\tconst fullname1 = account1?.data?.staticData?.fullname || '';\n\t\t\t\tconst fullname2 = account2?.data?.staticData?.fullname || '';\n\t\t\t\treturn fullname1.localeCompare(fullname2);\n\t\t\t});\n\t\t}\n\t\tstate.accountsForAllUsers = accounts;\n\t},\n\tsetRegistrationOptions(state, registrationOptions) {\n\t\tstate.registrationOptions = registrationOptions;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post } from '@/util/request.js';\nimport { search, genericEntityUpdate, getEntityById } from './system.js';\n\nexport async function createOrganisation(data, entityClassId, attributeSetId) {\n\tlet payload = {\n\t\tentityclass: entityClassId,\n\t\tattributeset: attributeSetId,\n\t\tdata\n\t};\n\n\treturn await post('eav/entity/create', payload);\n}\n\nexport function updateOrganisation(oldEntity, newData, set) {\n\treturn genericEntityUpdate(oldEntity, newData, set);\n}\n\nexport async function deleteOrganisation(id) {\n\tconst deletedEntity = await post('eav/entity/disable', id);\n\treturn deletedEntity.id;\n}\n\nexport function getAllOrganisations(entityClassId) {\n\treturn search(entityClassId);\n}\n\nexport function getOrganisationById(id) {\n\treturn getEntityById(id);\n}\n","import { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport * as Repo from '@/repository/org.js';\nimport { toLocale } from '@/plugins/filters';\nimport * as SearchRepo from '@/repository/system';\n\nconst ENTITY_CLASS_ID = 'orgas';\nconst ATTRIBUTE_SET_ID = 'org';\n\nconst state = {\n\torganisations: [],\n\tentityClassId: null,\n\tattributesetId: null,\n\tfiblUsers: []\n};\n\nconst getters = {\n\tbyId: (state) => (id) => {\n\t\treturn state.organisations.find(organisation => organisation.id === id);\n\t},\n\tbyIds: (state) => (ids) => {\n\t\treturn state.organisations.filter(f => ids.includes(f.id));\n\t},\n\tall: (state) => {\n\t\treturn state.organisations;\n\t},\n\tbyAccountId: (state) => (accountId) => {\n\t\treturn state.organisations.filter(org => org.data.users.includes(accountId));\n\t},\n\tinstitutionsByCurrentAccount: (state, getters, rootState, rootGetters) => {\n\t\tif (rootGetters['auth/user/roles/isAdmin']) {\n\t\t\treturn state.organisations;\n\t\t}\n\n\t\tconst currentAccount = rootGetters['auth/user/getCurrentAccount']();\n\t\tif (!currentAccount) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn getters.byAccountId(currentAccount.id);\n\t},\n\tgetFiblUsers: (state) => {\n\t\treturn state.fiblUsers;\n\t}\n};\n\nconst actions = {\n\n\tasync loadAll({ commit, state }, { ifEmpty }) {\n\t\tif (ifEmpty && state.organisations.length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!state.entityClassId) {\n\t\t\tlet entityClass = await getEntityclassByExternalId(ENTITY_CLASS_ID);\n\t\t\tcommit('setEntityClassId', entityClass);\n\t\t}\n\n\t\tlet list = await Repo.getAllOrganisations(state.entityClassId);\n\t\tcommit('resetList', list);\n\t},\n\n\tasync create({ state, commit }, data) {\n\t\tif (!state.entityClassId) {\n\t\t\tlet ec = await getEntityclassByExternalId(ENTITY_CLASS_ID);\n\t\t\tcommit('setEntityClassId', { id: ec.id });\n\t\t}\n\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId(ATTRIBUTE_SET_ID);\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\n\t\tlet entity = await Repo.createOrganisation(data, state.entityClassId, state.attributesetId);\n\t\tcommit('addOrganisation', entity);\n\t},\n\n\tasync update({ state, commit, getters }, entry) {\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId(ATTRIBUTE_SET_ID);\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\t\tlet oldEntry = getters.byId(entry.id);\n\t\tlet updated = await Repo.updateOrganisation(oldEntry, entry.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteOrganisation', { id: entry.id });\n\t\t\tcommit('addOrganisation', updated);\n\t\t}\n\t},\n\n\tasync delete({ commit }, id) {\n\t\tawait Repo.deleteOrganisation(id);\n\t\tcommit('deleteOrganisation', {id});\n\t},\n\n\tasync loadFiblUsers({ state, commit, getters }) {\n\t\tif (state.fiblUsers.length) return;\n\t\tlet ecaccount = await SearchRepo.getEntityclassByExternalId('account');\n\t\tlet res = await SearchRepo.search(ecaccount.id, undefined, { limit: 900 });\n\t\tcommit('setFiblUsers', res);\n\t},\n\n};\n\nconst mutations = {\n\tsetEntityClassId(state, { id }) {\n\t\tstate.entityClassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\tresetList(state, l) {\n\t\tl = l.sort((a, b) => {\n\t\t\treturn toLocale(a.data.title).localeCompare(toLocale(b.data.title));\n\t\t});\n\t\tstate.organisations = l || [];\n\t},\n\taddOrganisation(state, entity) {\n\t\tstate.organisations.push(entity);\n\t},\n\tdeleteOrganisation(state, { id }) {\n\t\tlet entity = getters.byId(state)(id);\n\t\tif (!entity) throw new Error(`entity not found: ${id}`);\n\t\tlet idx = state.organisations.indexOf(entity);\n\t\tstate.organisations.splice(idx, 1);\n\t},\n\tsetFiblUsers(state, fiblUsers) {\n\t\tstate.fiblUsers = fiblUsers;\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import login from './login.js';\nimport user from './user.js';\nimport admin from './admin.js';\nimport org from './org.js';\n\nconst modules = {\n\tlogin,\n\tuser,\n\tadmin,\n\torg\n};\n\nexport default {\n\tnamespaced: true,\n\tmodules\n};\n","import { search } from './system.js';\nimport { post as sendPostRequest } from '@/util/request.js';\nimport { createPatch } from 'rfc6902';\n\nexport function createConversation(data) {\n\treturn sendPostRequest('bml/conversation/create', data);\n}\n\nexport function getAllConversationsForUser(entityclassId, accountId, productId) {\n\tconst accountFilter = { $or: [\n\t\t{\n\t\t\t'field': '/data/initiator',\n\t\t\t'comparison': 'eq',\n\t\t\t'value': accountId\n\t\t},\n\t\t{\n\t\t\t'field': '/data/rcpt',\n\t\t\t'comparison': 'eq',\n\t\t\t'value': accountId\n\t\t}\n\t]};\n\n\tlet attributeFilter;\n\tif (productId) {\n\t\tattributeFilter = { $and: [\n\t\t\t{\n\t\t\t\t'field': '/data/productId',\n\t\t\t\t'comparison': 'eq',\n\t\t\t\t'value': productId\n\t\t\t}\n\t\t]};\n\n\t\tattributeFilter.$and.push(accountFilter);\n\t} else {\n\t\tattributeFilter = accountFilter;\n\t}\n\n\tconst sorting = [ 'updated:desc' ];\n\n\treturn search(entityclassId, attributeFilter, null, sorting);\n}\n\nexport function getSingleConversation(entityclassId, id) {\n\tlet attributeFilter = id ? { $and: {\n\t\t'field': '/id',\n\t\t'comparison': 'eq',\n\t\t'value': id\n\t} } : null;\n\n\treturn search(entityclassId, attributeFilter);\n}\n\nexport function updateConversation(oldEntity, newData, changeset) {\n\tif (!oldEntity) {\n\t\treturn null;\n\t}\n\tconst patch = createPatch(oldEntity.data, newData);\n\tif (patch.length === 0) {\n\t\treturn null;\n\t}\n\tlet payload = {\n\t\tid: oldEntity.id,\n\t\trev: oldEntity.rev,\n\t\tpatch\n\t};\n\tif (changeset && changeset !== oldEntity.attributeset) {\n\t\tpayload.changeset = changeset;\n\t}\n\treturn sendPostRequest('bml/conversation/save', payload);\n}\n\nexport function setArchived(oldEntry, changeset) {\n\tconst newData = JSON.parse(JSON.stringify(oldEntry.data));\n\tnewData.archived = true;\n\n\tlet entity = updateConversation(oldEntry, newData, changeset);\n\treturn entity;\n}\n","import * as Repo from '@/repository/messages';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport Vue from 'vue';\n\nconst CLASS_ID = 'conversation';\n\nconst state = {\n\tconversations: [],\n\tattributesetId: '',\n\tentityclassId: ''\n};\n\nconst getters = {\n\tallConversations: (state) => {\n\t\treturn state.conversations;\n\t},\n\tarchivedConversations: (state) => {\n\t\treturn state.conversations.filter(f => f.data.archived);\n\t},\n\tnonArchivedConversations: (state) => {\n\t\treturn state.conversations.filter(f => !f.data.archived);\n\t},\n\tconversationById: (state) => (id) => {\n\t\treturn state.conversations.find(f => f.id === id);\n\t},\n\tmessagesByConversation: (state) => (id) => {\n\t\tconst conversation = state.conversations.find(f => f.id === id);\n\t\tif (!conversation) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn conversation.data.messages;\n\t}\n};\n\nconst actions = {\n\tasync _loadEntityClass({ state, commit }) {\n\t\tif (state.entityclassId) {\n\t\t\treturn;\n\t\t}\n\t\tconst ec = await getEntityclassByExternalId(CLASS_ID);\n\t\tcommit('setEcId', { id: ec.id });\n\t},\n\tasync _loadAttributeSet({ state, commit }) {\n\t\tif (state.attributesetId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst as = await getAttributesetByExternalId(CLASS_ID);\n\t\tcommit('setAsId', { id: as.id });\n\t},\n\tasync loadAllConversations({ state, commit, dispatch, rootGetters }, { productId }) {\n\t\tawait dispatch('_loadEntityClass');\n\n\t\tconst accountId = rootGetters['auth/user/getCurrentAccountId'];\n\n\t\tconst list = await Repo.getAllConversationsForUser(state.entityclassId, accountId, productId);\n\t\tcommit('resetList');\n\t\tlist.forEach(conversation => commit('addConversation', conversation));\n\t},\n\tasync reloadConversation({ state, commit, dispatch }, { id }) {\n\t\tawait dispatch('_loadEntityClass');\n\n\t\tconst conversation = await Repo.getSingleConversation(state.entityclassId, id);\n\t\tcommit('deleteConversation', id);\n\t\tcommit('addConversation', conversation);\n\t},\n\tasync create({ state, commit, dispatch }, payload) {\n\t\tawait dispatch('_loadEntityClass');\n\t\tawait dispatch('_loadAttributeSet');\n\n\t\tconst entity = await Repo.createConversation(payload, state.entityclassId, state.attributesetId);\n\t\tcommit('addConversation', entity);\n\t\treturn entity;\n\t},\n\tasync addMessage({ state, commit, dispatch, getters }, { conversation, payload }) {\n\t\tawait dispatch('_loadAttributeSet');\n\n\t\tconst oldData = JSON.parse(JSON.stringify(getters.conversationById(conversation.id)));\n\t\tcommit('addSingleMessage', { conversation, payload });\n\t\tconst newData = getters.conversationById(conversation.id);\n\n\t\tconst updated = await Repo.updateConversation(oldData, newData.data, state.attributesetId);\n\t\tif (updated) {\n\t\t\tcommit('deleteConversation', conversation.id);\n\t\t\tcommit('addConversation', updated);\n\t\t}\n\t},\n\tasync archive({ state, commit, dispatch, getters }, { conversation }) {\n\t\tawait dispatch('_loadAttributeSet');\n\n\t\tconst oldEntry = JSON.parse(JSON.stringify(getters.conversationById(conversation.id)));\n\t\tawait Repo.setArchived(oldEntry, state.attributesetId);\n\t\tcommit('setArchived', conversation.id);\n\t}\n};\n\nconst mutations = {\n\tsetEcId(state, { id }) {\n\t\tstate.entityclassId = id;\n\t},\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\tresetList(state) {\n\t\tstate.conversations = [];\n\t},\n\taddConversation(state, conversation) {\n\t\tstate.conversations.push(conversation);\n\t},\n\taddSingleMessage(state, { conversation, payload }) {\n\t\tconst idx = state.conversations.findIndex(f => f.id === conversation.id);\n\t\tstate.conversations[idx].data.messages.push(payload);\n\t},\n\tdeleteConversation(state, id) {\n\t\tconst idx = state.conversations.findIndex(f => f.id === id);\n\t\tstate.conversations.splice(idx, 1);\n\t},\n\tsetArchived(state, id) {\n\t\tconst idx = state.conversations.findIndex(f => f.id === id);\n\t\tVue.set(state.conversations[idx].data, 'archived', true);\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import * as Repo from '@/repository/system.js';\nimport Types from '@/assets/config/paiduser-types.json';\nimport * as AccountRepo from '@/repository/auth.js';\n\nconst state = {\n\n\tlistAso: [],\n\tentityclassId: '',\n\troleOptions: Types,\n\tcheckedBaseline: false,\n\tcheckedRows: [],\n\tlistFilter: {\n\t\tname: '',\n\t\troles: [],\n\t\tactiveUntil: '',\n\t\thasLinkedUsers: '',\n\t\thasSubAccountFlags: '',\n\t\tcompanyLink: '',\n\t\tcustomerNumber: '',\n\t\tactiveSmaller: '',\n\t\thasCustomerNumber: ''\n\t},\n\tlistTotalCount: 0\n};\n\nconst ENTITY_CLASS_ID = 'paiduser';\n\nconst getters = {\n\n\tisChecked: (state) => (item) => {\n\t\treturn state.checkedRows.includes(item) ? !state.checkedBaseline : state.checkedBaseline;\n\t},\n\n\tgetListFilter: state => filter => {\n\t\treturn state.listFilter[filter];\n\t},\n\n\tgetListAttributeFilter: state => {\n\t\tconst filter = state.listFilter;\n\t\tlet $and = [];\n\t\tlet roles = filter.roles.map(e => {\n\t\t\treturn {\n\t\t\t\tfield: '/data/staticData/role',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: e\n\t\t\t};\n\t\t});\n\t\tif (roles.length) {\n\t\t\t$and.push({ $or: roles });\n\t\t}\n\t\tif (filter.name) {\n\t\t\t$and.push({\n\t\t\t\tfield: '/indexfields/search',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: filter.name,\n\t\t\t\tuse: 'ngram'\n\t\t\t});\n\t\t}\n\t\tif (filter.activeUntil) {\n\t\t\t$and.push({\n\t\t\t\tfield: '/data/staticData/paidPeriodEnds',\n\t\t\t\tcomparison: 'gte',\n\t\t\t\tvalue: filter.activeUntil\n\t\t\t});\n\t\t}\n\t\tif (filter.hasLinkedUsers && filter.hasLinkedUsers === 'linked') {\n\t\t\t$and.push({\n\t\t\t\tfield: '/data',\n\t\t\t\tcomparison: 'exists',\n\t\t\t\tvalue: 'linkedUsers'\n\t\t\t});\n\t\t}\n\t\tif (filter.hasLinkedUsers && filter.hasLinkedUsers === 'not-linked') {\n\t\t\t$and.push({\n\t\t\t\t$not: {\n\t\t\t\t\tfield: '/data',\n\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\tvalue: 'linkedUsers'\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (filter.hasSubAccountFlags) {\n\t\t\tfilter.hasSubAccountFlags.forEach((sf) => {\n\t\t\t\t$and.push({\n\t\t\t\t\tfield: '/data/userData/subAccountFlags',\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: sf\n\t\t\t\t});\n\t\t\t})\n\t\t}\n\t\tif (filter.companyLink) {\n\t\t\t$and.push({\n\t\t\t\tfield: '/data/staticData/companyLink',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: filter.companyLink\n\t\t\t});\n\t\t}\n\t\tif (filter.customerNumber) {\n\t\t\t$and.push({\n\t\t\t\tfield: '/data/staticData/customerNumber',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: filter.customerNumber\n\t\t\t});\n\t\t} else if (filter.hasCustomerNumber) {\n\t\t\tif (filter.hasCustomerNumber === 'linked') {\n\t\t\t\t$and.push({\n\t\t\t\t\tfield: '/data/staticData',\n\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\tvalue: 'customerNumber'\n\t\t\t\t});\n\t\t\t\t$and.push({ $not: {\n\t\t\t\t\tfield: '/data/staticData/customerNumber',\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: '0'\n\t\t\t\t}});\n\t\t\t} else if (filter.hasCustomerNumber === 'not-linked') {\n\t\t\t\t$and.push({\n\t\t\t\t\t$or: [{\n\t\t\t\t\t\t$not: {\n\t\t\t\t\t\t\tfield: '/data/staticData',\n\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\tvalue: 'customerNumber'\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {\n\t\t\t\t\t\tfield: '/data/staticData/customerNumber',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: '0'\n\t\t\t\t\t}]\n\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif (filter.activeSmaller) {\n\t\t\t$and.push({\n\t\t\t\tfield: '/data/staticData/paidPeriodEnds',\n\t\t\t\tcomparison: 'lte',\n\t\t\t\tvalue: filter.activeSmaller\n\t\t\t});\n\t\t}\n\t\treturn { $and };\n\t},\n\n\tgetListFinalFilter: (state, getters) => {\n\t\tconst base = getters.getListAttributeFilter;\n\t\tconst checkedAsIds = state.checkedRows.map(id => {\n\t\t\treturn {\n\t\t\t\tfield: '/id',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: id\n\t\t\t};\n\t\t});\n\t\tif (state.checkedBaseline) {\n\t\t\tif (state.checkedRows.length === 0) {\n\t\t\t\treturn base;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t$and: [\n\t\t\t\t\tbase,\n\t\t\t\t\t{ $not: { $or: checkedAsIds } }\n\t\t\t\t]\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\t$and: [\n\t\t\t\t\tbase,\n\t\t\t\t\t{ $or: checkedAsIds }\n\t\t\t\t]\n\t\t\t};\n\t\t}\n\t},\n\n\tcheckedCount: state => {\n\t\treturn state.checkedBaseline ? state.listTotalCount - state.checkedRows.length : state.checkedRows.length;\n\t},\n\n\tgetAsoUsers: state => {\n\t\treturn state.listAso;\n\t},\n};\n\nconst actions = {\n\n\tasync ensureAsoUsersLoaded({ state, dispatch, commit }) {\n\t\tif (state.listAso.length === 0) {\n\t\t\tlet list = await dispatch('load', { filter: {\n\t\t\t\tfield: '/data/staticData/role',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: 'aso'\n\t\t\t}});\n\t\t\tcommit('setAsoCache', list);\n\t\t}\n\t\treturn state.listAso;\n\t},\n\n\tasync load({ dispatch, commit }, { filter, sorting, pagination }) {\n\t\tlet ec = await dispatch('getEntityclass');\n\t\tlet list = await Repo.search(ec, filter, pagination, sorting);\n\t\tlet count = await Repo.countEntries(ec, filter);\n\t\tcommit('setListCount', count);\n\t\treturn list;\n\t},\n\n\tloadBatch({ state }, { filter }) {\n\t\tlet generator = Repo.searchCursorWithGenerator(state.entityclassId, filter, 'POST', 'search/search/cursor');\n\t\treturn generator;\n\t},\n\n\tasync getEntityclass({ state, commit }) {\n\t\tif (!state.entityclassId) {\n\t\t\tlet ec = await Repo.getEntityclassByExternalId(ENTITY_CLASS_ID);\n\t\t\tcommit('setEntityclass', ec);\n\t\t}\n\t\treturn state.entityclassId;\n\t},\n\n\tasync findAdminUsersForCompany({ state, dispatch }, { company }) {\n\t\tconst ec = await dispatch('getEntityclass');\n\t\tconst filter = {\n\t\t\t$and: [\n\t\t\t\t{\n\t\t\t\t\tfield: '/data/staticData/companyLink',\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: company,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfield: '/data/userData/subAccountFlags',\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: 'admin',\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t\tlet ids = await Repo._search(ec, filter, null, 'search/search/execute', null, null, true);\n\t\treturn ids;\n\t},\n\n\tcreate(_, { registrationName, userData, staticData }) {\n\t\treturn AccountRepo.createNewAccount({ registrationName, userData, staticData });\n\t},\n\n\tupdate(_, { account, userData, staticData, maxUsers, active }) {\n\t\treturn AccountRepo.updateExistingAccount({ account, userData, staticData, maxUsers, active });\n\t},\n\n\tremove(_, { account }) {\n\t\treturn AccountRepo.removeAccount({ account });\n\t}\n\n};\n\nconst mutations = {\n\n\tsetEntityclass(state, ec) {\n\t\tstate.entityclassId = ec.id;\n\t},\n\n\tsetAsoCache(state, list) {\n\t\tstate.listAso = list;\n\t},\n\n\tsetChecked(state, { base, item, value }) {\n\t\tif (base) {\n\t\t\tstate.checkedBaseline = value;\n\t\t\tstate.checkedRows = [];\n\t\t} else {\n\t\t\tlet idx = state.checkedRows.findIndex(e => e === item);\n\t\t\tif (idx > -1) {\n\t\t\t\tstate.checkedRows.splice(idx, 1);\n\t\t\t} else if (idx === -1) {\n\t\t\t\tstate.checkedRows.push(item);\n\t\t\t}\n\t\t}\n\t},\n\n\tresetChecked(state) {\n\t\tstate.checkedBaseline = false;\n\t\tstate.checkedRows = [];\n\t},\n\n\tsetListFilter(state, { filter, value }) {\n\t\tif (!(filter in state.listFilter)) throw new Error(`unknown filter: ${filter}`);\n\t\tstate.listFilter[filter] = value;\n\t},\n\n\tsetListCount(state, count) {\n\t\tstate.listTotalCount = count;\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import Languages from '@/assets/config/languages.json';\nimport LanguageTitles from '@/assets/config/language-titles.json';\n\nconst state = {\n\n\tselectedUiLanguage: 'de_DE',\n\tfallbackLocale: 'en_GB',\n\tlanguageTitles: LanguageTitles,\n\tlanguages: Languages,\n\tuserLanguagesForMultiLangFields: [ 'de_DE', 'en_GB' ],\n\troute: {},\n\tfavoredSearches: [],\n\treceiveMailsNotes: false,\n\treceiveMailsMessages: false,\n\toverrideMultitextLanguages: false,\n\tnotificationEmail: '',\n\tloading: false,\n\tmaintenanceMode: false,\n\n\tuserTimeFormat: 'H:mm:ss',\n\tuserDateFormat: 'DD.MM.YY',\n\n\tback: {\n\t\turl: '',\n\t\tparams: {}\n\t}\n};\n\nconst getters = {\n\tgetLanguageTitle: (state) => (languageCode) => {\n\t\tlet entry = state.languageTitles.find(x => x.key === languageCode);\n\n\t\tif (!entry) {\n\t\t\tthrow new Error(`Language code ${languageCode} not defined`);\n\t\t}\n\n\t\treturn entry.title;\n\t},\n\tgetLanguagesForSelect: (state, getters) => {\n\t\treturn state.languages.map(code => {\n\t\t\treturn { value: code, text: getters.getLanguageTitle(code) };\n\t\t}).sort((a, b) => a.text.localeCompare(b.text));\n\t},\n\tisInProduct: (state) => {\n\t\treturn state.route.name && state.route.name.startsWith('product-tab-');\n\t},\n\tgetMultitextLanguages: (state, getters, rootState) => {\n\t\tif (!state.overrideMultitextLanguages || !getters.isInProduct) {\n\t\t\treturn state.userLanguagesForMultiLangFields;\n\t\t}\n\t\tlet list = rootState.product.currentList;\n\t\tif (!list) return [];\n\t\treturn list.data.languages;\n\t},\n\tgetFavoriteSearches: (state) => {\n\t\treturn state.favoredSearches;\n\t},\n\tgetLanguages: (state) => {\n\t\treturn state.languages;\n\t},\n\tgetBackUrl: (state) => {\n\t\treturn state.back.url ? state.back : null;\n\t}\n};\n\nconst actions = {\n\n\n};\n\nconst mutations = {\n\n\tsetUiLanguage(state, lang) {\n\t\tif (!state.languages.includes(lang)) throw new Error(`invalid lang: ${lang}`);\n\t\tstate.selectedUiLanguage = lang;\n\t},\n\n\tsetUserLangForFields(state, langs) {\n\t\tif (!Array.isArray(langs)) throw new Error('must be an array');\n\t\tlangs.forEach(lang => {\n\t\t\tif (!state.languages.includes(lang)) throw new Error(`invalid lang: ${lang}`);\n\t\t});\n\t\tstate.userLanguagesForMultiLangFields = [...new Set(langs)];\n\t},\n\n\tsetReceiveMailsNotes(state, { enabled, email }) {\n\t\tif (typeof enabled !== 'undefined') state.receiveMailsNotes = !!enabled;\n\t\tif (typeof email !== 'undefined') state.notificationEmail = email || '';\n\t},\n\n\tsetReceiveMailsMessages(state, { enabled, email }) {\n\t\tif (typeof enabled !== 'undefined') state.receiveMailsMessages = !!enabled;\n\t\tif (typeof email !== 'undefined') state.notificationEmail = email || '';\n\t},\n\n\tsetOverrideMultitextLanguages(state, { enabled }) {\n\t\tstate.overrideMultitextLanguages = !!enabled;\n\t},\n\n\tupdateFavoriteSearch(state, searchId) {\n\t\tif (state.favoredSearches.includes(searchId)) {\n\t\t\tconst idx = state.favoredSearches.findIndex(f => f === searchId);\n\t\t\tstate.favoredSearches.splice(idx, 1);\n\t\t} else {\n\t\t\tstate.favoredSearches.push(searchId);\n\t\t}\n\t},\n\n\tremoveFavoriteSearch(state, searchId) {\n\t\tconst idx = state.favoredSearches.findIndex(f => f === searchId);\n\t\tstate.favoredSearches.splice(idx, 1);\n\t},\n\n\tsetFavoredSearches(state, searches) {\n\t\tstate.favoredSearches = searches;\n\t},\n\n\tsetBackLink(state, { url, params }) {\n\t\tstate.back.url = url;\n\t\tstate.back.params = params || null;\n\t},\n\n\tresetBackLink(state) {\n\t\tstate.back.url = null;\n\t\tstate.back.params = null;\n\t},\n\n\tsetLoadingState(state, loading) {\n\t\tstate.loading = loading;\n\t},\n\n\tsetIsMaintenance(state) {\n\t\tstate.maintenanceMode = true;\n\t},\n\n\tsetRoute(state, route) {\n\t\tstate.route = {\n\t\t\tfullPath: route.fullPath,\n\t\t\tname: route.name,\n\t\t\tparams: {\n\t\t\t\t...route.params\n\t\t\t},\n\t\t\tpath: route.path,\n\t\t\tquery: {\n\t\t\t\t...route.query\n\t\t\t}\n\t\t};\n\t}\n\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post } from '@/util/request.js';\nimport BmlCommon from '@fibl/bml-common';\n\nconst FIBL_DE = 'ab2e5fd7-9ebb-43d8-a0ab-5aedfb43708b';\n\nexport async function loadConversation(\n\tcontextKey,\n\tid,\n) {\n\tconst config = {\n\t\tcontext: {},\n\t};\n\tif (contextKey === 'invoiceId') config.context.invoiceId = id;\n\telse if (contextKey === 'confirmationId') config.context.confirmationId = id;\n\telse if (contextKey === 'productId') config.context.productId = id;\n\telse if (contextKey === 'requestId') config.context.requestId = id;\n\tconfig.recipientOrg = FIBL_DE;\n\tconst entity = await post('bml/message/loadmessage', config);\n\tconst loadedMessage = new BmlCommon.MessageClass();\n\tloadedMessage.fromEntity(entity);\n\treturn loadedMessage;\n}\n\nexport async function sendConversation(conversation) {\n\tconst config = {\n\t\tcontext: {},\n\t\tmessage: conversation.messages[conversation.messages.length - 1].content,\n\t};\n\tif (conversation.recipient.fiblorg) config.recipientOrg = conversation.recipient.fiblorg;\n\tif (conversation.recipient.company) config.recipientCompany = conversation.recipient.company;\n\tif (conversation.recipient.fibluser) config.recipientUser = conversation.recipient.fibluser;\n\tif (conversation.context) {\n\t\tif (conversation.context.requestId)\n\t\t\tconfig.context.requestId = conversation.context.requestId;\n\t\telse if (conversation.context.confirmationId)\n\t\t\tconfig.context.confirmationId = conversation.context.confirmationId;\n\t\telse if (conversation.context.invoiceId)\n\t\t\tconfig.context.invoiceId = conversation.context.invoiceId;\n\t\telse if (conversation.context.productId)\n\t\t\tconfig.context.productId = conversation.context.productId;\n\t}\n\tif (\n\t\tconversation.messages[conversation.messages.length - 1].attachments !== undefined &&\n\t\tconversation.messages[conversation.messages.length - 1].attachments?.length\n\t) {\n\t\tconfig.attachments = conversation.messages[conversation.messages.length - 1].attachments;\n\t}\n\tif (conversation.subject) {\n\t\tconfig.subject = conversation.subject;\n\t}\n\tconst entity = await post('bml/message/sendmessage', config);\n\tconversation.fromEntity(entity);\n}\n","import * as SearchRepo from '@/repository/system';\nimport * as MessageRepo from '@/repository/messagecenter';\nimport { toLocale } from '@/plugins/filters';\nimport PdfLogoTypes from '@/assets/config/pdf-logo-types.json';\nimport { getEntityclassByExternalId, getAttributesetByExternalId } from '@/repository/system.js';\nimport Store from \"@/store/main.js\";\nimport { getSubjectFromContext } from \"@/util/message-center\";\nimport * as MessagingService from \"@/service/messaging\";\nimport { transformErrorObject } from '@/util/error.js';\nimport { debounce } from 'debounce';\nimport BmlCommon from '@fibl/bml-common';\nimport { getCopyOfConversation } from \"@/util/portal-store-helper\";\n\nconst defaultTableFilter = {\n\tuser: 'all',\n\tinstitution: '',\n\tarchived: false,\n\tunread: false,\n\tfolder: '',\n\tsubject: '',\n\tproductName: '',\n\tsender: '',\n\trecipient: '',\n};\n\nconst debouncedLoadMessages = debounce(async function load(\n\tstore\n) {\n\tconst accountId = Store.getters['auth/login/accountId'];\n\tlet conversations = [];\n\tconst filter = Store.getters['messagecenter/searchFilter'];\n\tconst ec = await getEntityclassByExternalId('message');\n\tconst pagination = Store.getters['messagecenter/pagination'];\n\tconst sorting = Store.getters['messagecenter/getSorting'];\n\tconst pageSize = Store.getters['messagecenter/getPageSize'];\n\tconst res = await SearchRepo.search(\n\t\tec.id,\n\t\tfilter,\n\t\tpagination,\n\t\t'indexfields.lastMessageDate:' + sorting\n\t);\n\tif (res.length < pageSize) {\n\t\tlet totalResults = pagination.start + res.length;\n\t\tStore.commit('messagecenter/setTotalResults', totalResults);\n\t} else {\n\t\tlet totalResults = await SearchRepo.countEntries(ec.id, filter);\n\t\tStore.commit('messagecenter/setTotalResults', totalResults);\n\t}\n\tlet notifCount = 0;\n\tlet allConvo = []\n\ttry {\n\t\tallConvo = await Promise.all(\n\t\t\tres.map(async (row, index) => {\n\t\t\t\tlet obj = new BmlCommon.MessageClass();\n\t\t\t\tobj.fromStorage(row);\n\t\t\t\tlet party = MessagingService.getParty(obj, accountId);\n\t\t\t\tobj.setCurrentParty(party);\n\t\t\t\tif (row.data.notification && party === 'recipient') {\n\t\t\t\t\tnotifCount += 1;\n\t\t\t\t}\n\t\t\t\tlet sub = await getSubjectFromContext(obj);\n\t\t\t\tobj.setSubjectFromContext(sub);\n\t\t\t\treturn obj;\n\t\t\t}),\n\t\t)\n\t} catch(error) {\n\t\tthrow new Error(`Failed to load Conversation: ` + error);\n\t}\n\tif (notifCount !== Store.getters['messagecenter/getNotificationCount']) {\n\t\tStore.commit('messagecenter/setNotificationCount', notifCount);\n\t}\n\tStore.commit('messagecenter/setConversations', allConvo);\n},\n350);\n\nconst state = {\n\tinstitutionSelect: '',\n\tmessageEc: '',\n\tcompanyLinks: [],\n\tconversations: [],\n\tconversationForRequest: null,\n\tcurrentRequestContext: '',\n\tnotificationCount: 0, //@TODO make computed\n\tunreadMessageCount: 0,\n\t// table and pagination\n\tpageSize: 10,\n\ttotalResults: 0,\n\tcurrentPage: 1,\n\tsorting: 'desc',\n\ttableFilter: JSON.parse(JSON.stringify(defaultTableFilter)),\n\tloadedOnce: false,\n\tidFiblDE: 'ab2e5fd7-9ebb-43d8-a0ab-5aedfb43708b', // remove hard coding if more than fiblDE is involved!\n};\n\nconst getters = {\n\tgetFiblDEId: (state) => {\n\t\treturn state.idFiblDE;\n\t},\n\tgetConversationId: (state) => {\n\t\treturn state.conversations[0].getId();\n\t},\n\tsearchFilter: (state) => {\n\t\tconst filter = { $and: [] };\n\t\tconst meFilter = [];\n\t\tif (state.tableFilter.user === 'mine') {\n\t\t\tlet account = Store.getters['auth/user/getCurrentAccount']();\n\t\t\tmeFilter.push({ field: '/data/%P/fibluser', comparison: 'eq', value: account ? account.id : '-' });\n\t\t} else if (state.tableFilter.user === 'unassigned') {\n\t\t\tmeFilter.push({\n\t\t\t\t$not: { field: '/data/%P', comparison: 'exists', value: 'fibluser' },\n\t\t\t});\n\t\t} else if (state.tableFilter.user !== 'all') {\n\t\t\tmeFilter.push({\n\t\t\t\tfield: '/data/%P/fibluser',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: state.tableFilter.user,\n\t\t\t});\n\t\t}\n\t\tif (state.tableFilter.unread) {\n\t\t\tmeFilter.push({\n\t\t\t\tfield: `/indexfields/%PUnread`,\n\t\t\t\tcomparison: 'gt',\n\t\t\t\tvalue: 0,\n\t\t\t});\n\t\t}\n\t\tconst addOnBothSides = function (key, val) {\n\t\t\tfilter.$and.push({\n\t\t\t\t$or: [\n\t\t\t\t\t{ field: '/data/sender/' + key, comparison: 'eq', value: val },\n\t\t\t\t\t{ field: '/data/recipient/' + key, comparison: 'eq', value: val },\n\t\t\t\t],\n\t\t\t});\n\t\t};\n\t\tif (state.tableFilter.institution) {\n\t\t\taddOnBothSides('fiblorg', state.tableFilter.institution);\n\t\t}\n\n\t\tif (state.tableFilter.folder) {\n\t\t\t//my side\n\t\t\tmeFilter.push({\n\t\t\t\tfield: '/data/%P/folder',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: state.tableFilter.folder,\n\t\t\t});\n\t\t} else {\n\t\t\tmeFilter.push({\n\t\t\t\t$not: {\n\t\t\t\t\tfield: '/data/%P',\n\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\tvalue: 'folder',\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\n\t\tif (state.tableFilter.archived) {\n\t\t\t//my side\n\t\t\tmeFilter.push({\n\t\t\t\tfield: '/data/%P/archived',\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: state.tableFilter.archived,\n\t\t\t});\n\t\t} else {\n\t\t\tmeFilter.push({\n\t\t\t\t$or: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: '/data/%P/archived',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: false,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t$not: {\n\t\t\t\t\t\t\tfield: '/data/%P',\n\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\tvalue: 'archived',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t});\n\t\t}\n\t\tif (state.tableFilter.sender) {\n\t\t\tfilter.$and.push({\n\t\t\t\t$or: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: '/data/sender/company',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: state.tableFilter.sender,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: '/data/recipient/company',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: state.tableFilter.sender,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t});\n\t\t}\n\t\tif (state.tableFilter.subject) {\n\t\t\tstate.tableFilter.subject.length === 36\n\t\t\t\t? filter.$and.push({\n\t\t\t\t\t\tfield: '/data/subject',\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: state.tableFilter.subject,\n\t\t\t\t })\n\t\t\t\t: filter.$and.push({\n\t\t\t\t\t\tfield: '/data/context',\n\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\tvalue: state.tableFilter.subject,\n\t\t\t\t });\n\t\t}\n\t\tif (meFilter.length) {\n\t\t\tfilter.$and.push(MessagingService.getMeFilterBothSides({ $and: meFilter }));\n\t\t}\n\t\treturn filter;\n\t},\n\tpagination: (state) => {\n\t\treturn {\n\t\t\tstart: (state.currentPage - 1) * state.pageSize,\n\t\t\tlimit: state.pageSize,\n\t\t};\n\t},\n\tgetCompanyLinks: (state) => {\n\t\treturn state.companyLinks;\n\t},\n\tgetConversations: (state) => {\n\t\treturn state.conversations;\n\t},\n\tgetUnreadMessageCount: (state) => {\n\t\treturn state.unreadMessageCount;\n\t},\n\tgetSorting: (state) => {\n\t\treturn ['asc','desc'].includes(state.sorting) ? state.sorting : 'desc';\n\t},\n\tgetNotificationCount: (state) => {\n\t\treturn state.notificationCount;\n\t},\n\n\tgetTableFilter: (state) => {\n\t\treturn state.tableFilter;\n\t},\n\n\tgetPageSize: (state) => {\n\t\treturn state.pageSize;\n\t},\n\n\tgetCurrentPage: (state) => {\n\t\treturn state.currentPage;\n\t},\n\n\tgetTotalResults: (state) => {\n\t\treturn state.totalResults;\n\t},\n\n\tgetName: (state) => (id, ec) => {\n\t\tif (id === null) return '';\n\t\tlet res = Store.getters['related/byId'](id);\n\t\tif (res) {\n\t\t\tif (ec === 'company') {\n\t\t\t\tlet data = res.data;\n\t\t\t\treturn data.baseData.name;\n\t\t\t} else if (ec === 'orgas') {\n\t\t\t\tlet data = res.data;\n\t\t\t\treturn toLocale(data.title);\n\t\t\t} else if (ec === 'fibluser') {\n\t\t\t\tlet data = res.data;\n\t\t\t\treturn data.staticData.fullname;\n\t\t\t}\n\t\t}\n\t\tStore.dispatch('related/addRequiredEntity', {id: id});\n\t\treturn '';\n\t},\n\tgetSpecificConversation: (state) => (id) => {\n\t\treturn state.conversations.find((convo) => convo.getId() === id);\n\t}\n};\n\nconst actions = {\n\tresetFilters({ state, commit, getters }) {\n\t\tfor (let [key, entry] of Object.entries(defaultTableFilter)) {\n\t\t\tcommit('setTableFilter',{ key: key, entry: entry });\n\t\t}\n\t},\n\tloadConversations({ state, commit, getters }) {\n\t\tdebouncedLoadMessages(state);\n\t},\n\tasync loadUnreadMessageCount({ state, commit, getters }) {\n\t\tconst accountId = Store.getters['auth/user/getCurrentAccount'];\n\t\tif (!accountId) return;\n\t\tconst filter = MessagingService.getMeFilterBothSides({\n\t\t\tfield: `/indexfields/%PUnread`,\n\t\t\tcomparison: 'gt',\n\t\t\tvalue: 0,\n\t\t});\n\t\tconst ec = await getEntityclassByExternalId('message');\n\t\tconst unreadMessageCount = await SearchRepo.countEntries(ec.id, filter);\n\t\tcommit('setUnreadMessageCount', unreadMessageCount);\n\t},\n\tasync saveConversation({ state, commit, getters }, conversation) {\n\t\ttry {\n\t\t\tawait SearchRepo.updateEntity(conversation, 'anr');\n\t\t\tcommit('setSpecificConversation', conversation);\n\t\t} catch (error) {\n\t\t\tconst message = await transformErrorObject(error);\n\t\t\tif (message.includes('eav: there is no change after applying the patch'))\n\t\t\t\tconsole.log(message, error);\n\t\t\telse throw new Error('Failed to save conversation: ' + error);\n\t\t}\n\t},\n\tasync firstTimeInit({ state, commit, getters, root, dispatch }) {\n\t\tif (state.loadedOnce) return;\n\t\tcommit('setLoaded', true);\n\t\tawait Promise.all([\n\t\t\tdispatch('messagecenter/loadCompanyLinks', null, { root: true }),\n\t\t\tdispatch('auth/org/loadFiblUsers', null, { root: true }),\n\t\t\tdispatch(\"selectoptions/loadAll\", { ifEmpty: true }, { root: true }),\n\t\t\tdispatch(\"auth/org/loadAll\", { ifEmpty: true }, { root: true }),\n\t\t]);\n\t},\n\tasync loadCompanyLinks({ state, commit, getters }) {\n\t\tlet res = await SearchRepo.aggregateRun('paiduser', {\n\t\t\tfield: '/data/staticData/companyLink',\n\t\t\tkey: 'companyLinks',\n\t\t\ttype: 'term',\n\t\t});\n\t\tlet links = [];\n\t\tlet buckets = res.aggregations.companyLinks.buckets;\n\t\tfor (let i = 0; i < buckets.length; i++) {\n\t\t\tlet entry = buckets[i];\n\t\t\tlinks.push(entry.key);\n\t\t}\n\t\tcommit('setCompanyLinks', links);\n\t},\n\tasync initNewConvo( { state, commit, getters, root },\n\t\tcontextKey,\n\t\tcontextId,\n\t\trecipientCompany,\n\t) {\n\t\tconst account = Store.getters[\"auth/login/accountId\"];\n\t\tconst accountDetails = Store.getters[\"auth/login/accountDetails\"];\n\t\tconst now = new Date().toJSON();\n\t\tconst isFibl = true;\n\t\tconst conversation = new BmlCommon.MessageClass();\n\t\tlet ec = await SearchRepo.getEntityclassByExternalId('message');\n\t\tlet as = await SearchRepo.getAttributesetByExternalId('message');\n\t\tconversation.fromStorage({\n\t\t\tentityclass: ec.id,\n\t\t\tattributeset: as.id,\n\t\t\tid: '',\n\t\t\trev: 0,\n\t\t\tdata: {},\n\t\t\tcreated: '',\n\t\t\tupdated: '',\n\t\t});\n\t\tconst payload = {\n\t\t\tsender: {\n\t\t\t\tfiblorg: state.idFiblDE,\n\t\t\t\tfibluser: account,\n\t\t \t},\n\t\t\tmessages: [],\n\t\t};\n\t\tconversation.fromData(payload);\n\t\tconversation.setCurrentParty('sender');\n\t\tif (contextKey && contextId) {\n\t\t\tconversation.context = {\n\t\t\t\t[contextKey]: contextId,\n\t\t\t};\n\t\t\tif (!conversation.recipient) {\n\t\t\t\tconversation.recipient = {\n\t\t\t\t\tcompany: recipientCompany,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn conversation;\n\t},\n\tasync updateConversation({ state, commit, getters, root },\n\t\t{\n\t\t\tconversation,\n\t\t\tnewMessage,\n\t\t\tnewAttachments,\n\t\t\tasDraft,\n\t\t\tsubject,\n\t\t\trecipient\n\t\t}\n\t) {\n\t\tconst now = new Date();\n\t\tif(!conversation.getCurrentParty().fiblorg) {\t//@TODO move further up\n\t\t\tif(conversation.getCurrentParty().company === null) delete conversation.getCurrentParty().company;\n\t\t\tconversation.getCurrentParty().fiblorg = Store.getters[\"messagecenter/getFiblDEId\"];\n\t\t\tconst accountId = Store.getters['auth/user/getCurrentAccount'];\n\t\t\tif(accountId) {\n\t\t\t\tconversation.getCurrentParty().fibluser = accountId;\n\t\t\t}\n\t\t}\n\t\tif (recipient) {\n\t\t\tconversation.recipient = recipient;\n\t\t}\n\t\tif (subject) {\n\t\t\tconversation.subject = subject;\n\t\t}\n\t\tif (asDraft) {\n\t\t\tconversation.getCurrentParty().draft = {\n\t\t\t\tmessage: newMessage,\n\t\t\t\tattachments: newAttachments,\n\t\t\t};\n\t\t} else {\n\t\t\tconversation.getCurrentParty().draft = undefined;\n\t\t\tconversation.messages.push({\n\t\t\t\tparty: conversation.getCurrentPartyName(),\n\t\t\t\tsent: now.toJSON(),\n\t\t\t\tcontent: newMessage,\n\t\t\t\tattachments: newAttachments && newAttachments.length ? newAttachments : undefined,\n\t\t\t});\n\t\t}\n\t\tif (conversation.getId()) {\n\t\t\tawait SearchRepo.updateEntity(conversation, 'anr');\n\t\t\tcommit('setSpecificConversation', conversation);\n\t\t} else {\n\t\t\tif (conversation.context && !asDraft) await MessageRepo.sendConversation(conversation);\n\t\t\telse await SearchRepo.createEntity(conversation);\n\t\t}\n\t\tlet sub = await getSubjectFromContext(conversation);\n\t\tconversation.setSubjectFromContext(sub);\n\t\tlet inList = state.conversations.find((e) => e.getId() === conversation.getId());\n\t\tconst convoClass = getCopyOfConversation(conversation);\n\t\tif (inList) {\n\t\t\tcommit('setInListConversation', convoClass);\n\t\t} else {\n\t\t\tcommit('setUnshiftConversations', convoClass);\n\t\t}\n\t\tcommit('setLastReadForConversation', conversation.getId());\n\t},\n\tasync setLastRead({ state, commit, getters, root }, conversation) {\n\t\tlet lastmessagesent = conversation.messages[conversation.messages.length - 1]?.sent;\n\t\tif (!lastmessagesent) return;\n\t\tlet now = new Date().toJSON();\n\t\tlet party = conversation.getCurrentParty();\n\t\tif (!party.lastReadMessages || party.lastReadMessages < lastmessagesent) {\n\t\t\tcommit('setLastReadForConversation', conversation.getId());\n\t\t\tconversation.getCurrentParty().lastReadMessages = now;\n\t\t\tawait Store.dispatch('messagecenter/saveConversation', conversation);\n\t\t\tif (state.unreadMessageCount > 0) {\n\t\t\t\tconst newCount = state.unreadMessageCount;\n\t\t\t\tcommit('setUnreadMessageCount', newCount - 1);\n\t\t\t}\n\t\t}\n\t},\n\tasync initializeConversation({ state, commit, getters, root },\n\t\tcontextKey,\n\t\tcontextId,\n\t\trecipientCompany,\n\t) {\n\t\tlet conversation;\n\t\ttry {\n\t\t\tconversation = await MessageRepo.loadConversation(contextKey, contextId);\n\t\t} catch (error) {\n\t\t\tif (error.previous.message.includes('No conversations found')) {\n\t\t\t\tconsole.log(error);\n\t\t\t\tconversation = await dispatch('messagecenter/initNewConvo', {contextKey, contextId, recipientCompany}) ;\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Failed to open conversation: ` + error);\n\t\t\t}\n\t\t}\n\t\treturn conversation;\n\t},\n};\n\nconst mutations = {\n\n\tsetTableFilter(state, {key,entry}) {\n\t\tstate.tableFilter[key] = entry;\n\t},\n\n\tsetUnreadMessageCount(state, count) {\n\t\tstate.unreadMessageCount = count;\n\t},\n\n\tsetConversationForRequest(state, convo) {\n\t\tstate.conversationForRequest = convo;\n\t},\n\n\tsetCurrentRequestContext(state,context) {\n\t\tstate.currentRequestContext = context\n\t},\n\n\tsetLoaded(state, isLoad) {\n\t\tstate.loadedOnce = isLoad;\n\t},\n\n\tsetCompanyLinks(state, links) {\n\t\tstate.companyLinks = links;\n\t},\n\n\tsetConversations (state, convos) {\n\t\tstate.conversations = convos;\n\t},\n\n\tsetUnshiftConversations(state, conversation) {\n\t\tstate.conversations.unshift(conversation);\n\t},\n\n\t setNotificationCount: (state,val) => {\n\t\t state.notificationCount = val;\n\t},\n\n\tsetPageSize: (state,val) => {\n\t\t state.pageSize= val;\n\t},\n\n\tsetCurrentPage: (state,val) => {\n\t\t state.currentPage= val;\n\t},\n\n\tsetTotalResults: (state,val) => {\n\t\t state.totalResults= val;\n\t},\n\n\tsetSorting: (state, val) => {\n\t\treturn state.sorting = val;\n\t},\n\n\tsetLastReadForConversation: (state, id) => {\n\t\tconst index = state.conversations.findIndex((e) => e.getId() === id);\n\t\tstate.conversations[index].getCurrentParty().lastReadMessages = new Date().toJSON();\n\t},\n\n\tsetInListConversation: (state, conversation) => {\n\t\tstate.conversations.find((e) => e.getId() === conversation.getId()).fromEntity(conversation.toEntity());\n\t},\n\n\tsetSpecificConversation: (state, conversation) => {\n\t\tconst index = state.conversations.findIndex((e) => e.getId() === conversation.getId());\n\t\tif(index < 0) {\n\t\t\tstate.conversations.push(conversation);\n\t\t} else {\n\t\t\tstate.conversations.splice(index, 1, conversation);\n\t\t}\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","\nexport function createDeferred() {\n\tconst ret = {\n\t\tresolve: () => {},\n\t\treject: () => {},\n\t\tpromise: null,\n\t};\n\tret.promise = new Promise((res, rej) => {\n\t\tret.resolve = res;\n\t\tret.reject = rej;\n\t});\n\treturn ret;\n}\n\nexport function wait(ms, rej) {\n\treturn new Promise(function (resolve, reject) {\n\t\tsetTimeout(rej ? reject : resolve, ms);\n\t});\n}\n\nexport async function waitUntilTrue(fn, retry, max) {\n\tif (!max) max = 2000;\n\tif (!retry) retry = 100;\n\tlet start = Date.now();\n\tdo {\n\t\tlet res = await fn();\n\t\tif (res) return true;\n\t\tawait wait(retry);\n\t\t// console.log(Date.now() - start);\n\t} while (Date.now() - start < max);\n\treturn false;\n}\n","import { debounce } from \"debounce\";\nimport * as SystemRepo from '@/repository/system';\nimport Store from \"@/store/main.js\";\nimport * as ProductRepo from '@/repository/product';\nimport { createDeferred } from'@/util/flow-helper';\n\nconst maxEntitiesPerCall = 400;\nconst maxProductsPerCall = 200;\n\nconst state = {\n\tidsWanted: [],\n\tidsWantedProduct: [],\n\tidsUnavailable: [],\n\tentities: [],\n\tpromises: {}\n};\nconst getters = {\n\tbyId: state => id => {\n\t\treturn state.entities.find(e => e && e.id === id);\n\t}\n};\nconst actions = {\n\taddRequiredEntity({ state, commit, dispatch }, { id, ec }) {\n\t\tif (!id) throw new Error('must give id');\n\t\tif(!state.promises[id]) {\n\t\t\tcommit('createPromise', id);\n\t\t\tif(ec === 'product') {\n\t\t\t\tcommit('addProductId', id);\n\t\t\t\tdispatch('debouncedLoadProduct');\n\t\t\t} else {\n\t\t\t\tcommit('addId', id);\n\t\t\t\tdispatch('debouncedLoad');\n\t\t\t}\n\t\t}\n\t\treturn state.promises[id].promise;\n\t},\n\tdebouncedLoad: debounce(async function loadRelated({ state, commit, dispatch }) {\n\t\tlet ids = JSON.parse(JSON.stringify(state.idsWanted));\n\t\tif (ids.length === 0) return;\n\t\tlet res = await SystemRepo.getEntitiesById(ids);\n\t\tlet unavailable = [];\n\t\tres = res.filter((e, i) => {\n\t\t\tif (!e) {\n\t\t\t\tunavailable.push(ids[i]);\n\t\t\t}\n\t\t\treturn !!e;\n\t\t});\n\t\tif (unavailable.length > 0) {\n\t\t\tcommit('addUnavailable', unavailable);\n\t\t}\n\t\tcommit('clearIds', ids);\n\t\tcommit('addEntities', res);\n\t}, 100),\n\tdebouncedLoadProduct: debounce(async function loadRelated({ state, commit, dispatch }) {\n\t\tlet ids = JSON.parse(JSON.stringify(state.idsWantedProduct));\n\t\tif (ids.length === 0) return;\n\t\tlet productIds = ids.slice(0, maxProductsPerCall);\n\t\tlet restIds = ids.slice(maxProductsPerCall);\n\t\tcommit('setIdsWantedProduct', restIds);\n\t\tlet pagination = { limit: maxProductsPerCall };\n\t\tlet list = [];\n\t\tlet isFibl = Store.getters[\"auth/login/currentAccountInstitution\"].length > 0;\n\t\tif (isFibl) {\n\t\t\tlet filter = {\n\t\t\t\t$or: productIds.map((id) => ({ field: '/id', comparison: 'eq', value: id })),\n\t\t\t};\n\t\t\tlist = await ProductRepo.searchProducts(filter, pagination);\n\t\t} else {\n\t\t\tlet found = await ProductRepo.listProductsForOwner(\n\t\t\t\tundefined,\n\t\t\t\tproductIds,\n\t\t\t\tundefined,\n\t\t\t\tpagination,\n\t\t\t);\n\t\t\tlist = found.list;\n\t\t}\n\t\tlet unavailable = ids.filter((id) => {\n\t\t\treturn !list.find((entity) => entity.id === id);\n\t\t});\n\t\tcommit('addEntities', list);\n\t\tcommit('addUnavailable', unavailable);\n\t\tif (restIds.length > 0) {\n\t\t\tdispatch('debouncedLoadProduct')\n\t\t}\n\t}, 100),\n\n\tclearWantedProducts({ state, commit }, keepIds) {\n\t\tif (keepIds && keepIds.length) {\n\t\t\tcommit('setIdsWantedProduct', keepIds);\n\t\t} else if (state.idsWantedProduct.length > 0) {\n\t\t\tcommit('setIdsWantedProduct', []);\n\t\t}\n\t},\n};\n\nconst mutations = {\n\taddId(state, id) {\n\t\tstate.idsWanted.push(id);\n\t},\n\taddProductId(state, id) {\n\t\tstate.idsWantedProduct.push(id);\n\t},\n\taddEntities(state, entities) {\n\t\tif (entities.length === 0) return;\n\t\tstate.entities = state.entities.concat(entities);\n\t\tfor (let ent of entities) {\n\t\t\tlet key = ent.id;\n\t\t\tif (key in state.promises) {\n\t\t\t\tstate.promises[key].resolve(ent);\n\t\t\t}\n\t\t}\n\t},\n\tclearIds(state, ids) {\n\t\tstate.idsWanted = state.idsWanted.filter(id => !ids.includes(id));\n\t},\n\tclearAllIds(state) {\n\t\tstate.idsWanted = [];\n\t},\n\tclearEntities(state) {\n\t\tstate.entities = [];\n\t},\n\taddUnavailable(state, ids) {\n\t\tstate.idsUnavailable = state.idsUnavailable.concat(ids);\n\t\tfor (let id of ids) {\n\t\t\tlet key = id;\n\t\t\tif (key in state.promises) {\n\t\t\t\tstate.promises[key].reject(new Error('id not found: '+id));\n\t\t\t}\n\t\t}\n\t},\n\tcreatePromise(state, id) {\n\t\tstate.promises[id] = createDeferred();\n\t},\n\tsetIdsWantedProduct(state, val) {\n\t\tstate.idsWantedProduct = val;\n\t}\n};\n\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n\n","import Vue from 'vue';\nimport Vuex from 'vuex';\nimport createPersistedState from 'vuex-persistedstate';\nimport product from './modules/product.js';\nimport category from './modules/category.js';\nimport categorytext from './modules/categorytext.js';\nimport restrictiontext from './modules/restrictiontext.js';\nimport biostandard from './modules/biostandard.js';\nimport checklist from './modules/checklist.js';\nimport selectoptions from './modules/selectoptions.js';\nimport country from './modules/country.js';\nimport list from './modules/list.js';\nimport permit from './modules/permit.js';\nimport field from './modules/field.js';\nimport invoice from './modules/invoice.js';\nimport component from './modules/component.js';\nimport hobbygarden from './modules/hobbygarden.js';\nimport productlist from './modules/productlist.js';\nimport companylist from './modules/companylist.js';\nimport label from './modules/label.js';\nimport search from './modules/search/main.js';\nimport columnset from './modules/columnset/main.js';\nimport exportset from './modules/exportset/main.js';\nimport auth from './modules/auth/main.js';\nimport messages from './modules/messages';\nimport batchtemplate from './modules/batchtemplate';\nimport paiduser from './modules/paiduser';\nimport base from './modules/base.js';\nimport messagecenter from './modules/messagecenter.js';\nimport related from './modules/related.js';\nVue.use(Vuex);\n\nconst persistence = createPersistedState({\n\tkey: 'bml_auth',\n\tstorage: window.localStorage,\n\tpaths: ['auth.login', 'messagecenter.tableFilter']\n});\n\nconst logger = store => {\n\t// called when the store is initialized\n\tstore.subscribe((mutation) => {\n\t\tconsole.debug('mutation: ', mutation);\n\t});\n};\n\n// disabled createLogger in dev mode as it really slows down the dev process\nconst plugins = process.env.NODE_ENV !== 'development'\n\t? [ persistence ]\n\t: [ persistence, logger ];\n\nexport default new Vuex.Store({\n\tmodules: {\n\t\tproduct,\n\t\tcategory,\n\t\tcategorytext,\n\t\trestrictiontext,\n\t\tbiostandard,\n\t\tchecklist,\n\t\tselectoptions,\n\t\tcountry,\n\t\tlist,\n\t\tdocument,\n\t\tpermit,\n\t\tfield,\n\t\tcomponent,\n\t\thobbygarden,\n\t\tproductlist,\n\t\tcompanylist,\n\t\tlabel,\n\t\tinvoice,\n\t\tsearch,\n\t\tcolumnset,\n\t\texportset,\n\t\tauth,\n\t\tmessages,\n\t\tbatchtemplate,\n\t\tpaiduser,\n\t\tbase,\n\t\tmessagecenter,\n\t\trelated\n\t},\n\tstrict: true,\n\tplugins\n});\n","import { post } from '@/util/request.js';\n\nexport async function getTemplateByName(name) {\n\treturn await post('batch/template/getbyname', name);\n}\n\nexport async function enqueueJob(templateId, attributeFilter, flagId) {\n\tconst payload = {\n\t\ttemplate: templateId,\n\t\tconfig: {\n\t\t\tflagId\n\t\t}\n\t};\n\n\tif (attributeFilter && Object.keys(attributeFilter).length > 0) {\n\t\tpayload.attributeFilter = attributeFilter;\n\t}\n\n\t// get the actual job id.\n\treturn await post('batch/job/run', payload);\n}\n\nexport async function getJobStatusById(jobId) {\n\treturn await post('batch/job/checkstatus', jobId);\n}\n","import * as Repo from '@/repository/batchjob.js';\nimport { getEntityById } from '@/repository/system';\nimport { constructSelectionFilter } from '@/util/search/query-generator';\n\nexport const SET_PRODUCT_FLAGS_TEMPLATE = 'SetProductFlags';\nexport const REMOVE_PRODUCT_FLAGS_TEMPLATE = 'RemoveProductFlags';\n\nconst ALL_TEMPLATES = [SET_PRODUCT_FLAGS_TEMPLATE, REMOVE_PRODUCT_FLAGS_TEMPLATE];\n\nconst state = {\n\ttemplates: {},\n\tjobStatus: {}\n};\n\nconst getters = {\n\n\ttemplateByName: (state) => (name) => {\n\t\treturn state.templates[name];\n\t},\n\n\tjobStatusByJobId: (state) => (jobId) => {\n\t\treturn state.jobStatus[jobId];\n\t}\n\n};\n\nconst actions = {\n\n\tasync loadTemplates({ commit }) {\n\t\tconst templates = {};\n\n\t\tfor (const templateName of ALL_TEMPLATES) {\n\t\t\tconst template = await Repo.getTemplateByName(templateName);\n\t\t\ttemplates[templateName] = template.id;\n\t\t}\n\n\t\tcommit('setTemplates', templates);\n\t},\n\n\tasync setFlag({ getters, dispatch, rootState, rootGetters }, { flagId, templateName }) {\n\t\tif (!flagId) {\n\t\t\tconsole.warn('No flag id provided.');\n\t\t\treturn;\n\t\t}\n\n\t\tawait dispatch('loadTemplates');\n\n\t\tconst templateId = getters.templateByName(templateName);\n\t\tif (!templateId) {\n\t\t\tconsole.warn(`Template ${templateName} not found. Aborting.`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst productSelection = rootState.search.selection;\n\n\t\tlet attributeFilter = rootGetters['search/getSearchFilter'];\n\t\tattributeFilter = constructSelectionFilter(attributeFilter, productSelection);\n\n\t\tconst job = await Repo.enqueueJob(templateId, attributeFilter, flagId);\n\t\tif (!job) {\n\t\t\tconsole.warn('Could not enqueue job. Aborting.');\n\t\t\treturn;\n\t\t}\n\n\t\tconst jobId = job.id;\n\t\tconst jobResult = await dispatch('updateJobStatus', jobId);\n\n\t\treturn { jobId, status: jobResult.status, errors: jobResult.errors };\n\t},\n\n\tasync updateJobStatus({ commit }, jobId) {\n\t\tif (!jobId) {\n\t\t\tconsole.warn('No job id provided.');\n\t\t\treturn;\n\t\t}\n\n\t\tconst response = await Repo.getJobStatusById(jobId);\n\t\tconst status = response.status;\n\t\tlet errors = null;\n\n\t\tif (status === 'complete' || status === 'abort') {\n\t\t\tconst jobEntity = await getEntityById(jobId);\n\t\t\tif (jobEntity) {\n\t\t\t\terrors = jobEntity.data.errors;\n\t\t\t}\n\t\t}\n\n\t\tcommit('setJobStatus', { jobId, status: response.status, errors });\n\t\treturn { status: response.status, errors };\n\t}\n};\n\nconst mutations = {\n\tsetTemplates(state, templates) {\n\t\tstate.templates = templates;\n\t},\n\n\tsetJobStatus(state, { jobId, status, errors }) {\n\t\tstate.jobStatus[jobId] = {\n\t\t\tstatus,\n\t\t\terrors\n\t\t};\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { createDocument, findIdentical, getDocument } from '@/repository/document-repository.js';\nimport SECRECY_LEVELS from '@/assets/config/secrecy-levels.json';\nimport { searchCursorWithGenerator} from '@/repository/system.js';\nimport { toLocale } from '@/plugins/filters.js';\n\nconst state = {\n\n\tloadedDocuments: [],\t//cache for doc content\n\ttoUpload: [],\t\t\t//queue to upload on product global save\n\tdocumentsToMove: [],\t//queue to move documents on product global save\n\tsecrecyLevels: SECRECY_LEVELS\n\n};\n\nconst getters = {\n\n\tbyId: (state) => (id) => {\n\t\treturn state.loadedDocuments.find(d => d.id === id);\n\t},\n\n\tgetDocuments: (state, getters, rootState, rootGetters) => (listId) => {\n\t\tif (!rootState.product.currentList) return [];\n\t\tlet documents = [];\n\t\tif (listId === rootState.product.currentList.id) {\n\t\t\tdocuments = rootState.product.workingCopy._documents ?\n\t\t\t\trootState.product.workingCopy._documents.slice(0) : [];\n\t\t} else {\n\t\t\tdocuments = rootState.product.loadedData[listId]\n\t\t\t\t\t&& rootState.product.loadedData[listId]._documents ?\n\t\t\t\trootState.product.loadedData[listId]._documents.slice(0) : [];\n\t\t}\n\t\treturn documents.sort((a, b) => {\n\t\t\tfunction getOptionTitle(id) {\n\t\t\t\tlet option = rootGetters['selectoptions/byId'](id);\n\t\t\t\treturn option ? toLocale(option.data.title) : '';\n\t\t\t}\n\t\t\tlet titleA = getOptionTitle(a.type);\n\t\t\tlet titleB = getOptionTitle(b.type);\n\t\t\tlet result = titleA.localeCompare(titleB);\n\t\t\tlet data = result ? result : new Date(b.uploadTime) - new Date(a.uploadTime);\n\t\t\treturn data;\n\t\t});\n\t},\n\n\tgetDocumentsToMove: (state) => {\n\t\treturn state.documentsToMove;\n\t}\n\n};\n\nconst actions = {\n\n\tasync uploadDocuments({ state, commit, rootGetters }, workingCopy) {\n\t\tif (state.toUpload.length === 0) return;\n\t\tconst path = '_documents';\n\t\tconst uploadDoc = async function(doc) {\n\t\t\tdoc.uploadTime = new Date();\n\t\t\tdoc.fileName = doc.fileData.name;\n\t\t\tlet existingId = await findIdentical(doc.fileData);\n\t\t\tif (existingId) {\n\t\t\t\tdoc.fileId = existingId;\n\t\t\t} else {\n\t\t\t\tlet newFile = await createDocument(doc.fileData, doc.fileName);\n\t\t\t\tdoc.fileId = newFile.id;\n\t\t\t}\n\t\t\tdelete doc.fileData;\n\t\t\treturn doc;\n\t\t};\n\t\tlet docs = await Promise.all(state.toUpload.map(uploadDoc));\n\t\tlet fields = rootGetters['product/getValue'](path);\n\t\tif (fields) fields = fields.concat(docs);\n\t\telse fields = docs;\n\t\tworkingCopy[path] = fields;\n\t\tcommit('product/updateField', { path, value: fields }, { root: true });\n\t\tcommit('resetUploadDocs');\n\t},\n\n\tasync loadDocument({ commit, getters }, { fileId, fileName }) {\n\t\tlet document = getters.byId(fileId);\n\t\tif (!document) {\n\t\t\tdocument = await getDocument(fileId, fileName);\n\t\t\tcommit('addToLoadedDocuments', document);\n\t\t}\n\t\treturn document;\n\t},\n\n\tloadBatch(_, { filter }) {\n\t\tlet generator = searchCursorWithGenerator(null, filter, 'POST', 'bml/product/search');\n\t\treturn generator;\n\t},\n\n\tmoveDocument({ commit }, moveEntry) {\n\t\tcommit('addToMovedDocuments', moveEntry);\n\t},\n\n\tclearMoveDocuments({ commit }) {\n\t\tcommit('resetDocumentsToMove');\n\t},\n\n};\n\nconst mutations = {\n\n\taddDocumentToUpload(state, document) {\n\t\tstate.toUpload.push(document);\n\t},\n\n\tresetUploadDocs(state) {\n\t\tstate.toUpload = [];\n\t},\n\n\tremoveDocFromTemp(state, doc) {\n\t\tlet idx = state.toUpload.indexOf(doc);\n\t\tif (idx === -1) return;\n\t\tstate.toUpload.splice(idx, 1);\n\t},\n\n\tdeleteDocument(state, { listId, document }) {\n\t\tstate.documents[listId].splice(state.documents[listId].findIndex(d => d === document), 1);\n\t},\n\n\taddToLoadedDocuments(state, doc) {\n\t\tstate.loadedDocuments.push(doc);\n\t},\n\n\taddToMovedDocuments(state, entry) {\n\t\tlet index = state.documentsToMove.findIndex(doc => doc.document.fileId === entry.document.fileId && doc.document.uploadTime === entry.document.uploadTime);\n\t\tif (index > -1) {\n\t\t\tstate.documentsToMove.splice(index, 1, entry)\n\t\t} else {\n\t\t\tstate.documentsToMove.push(entry);\n\t\t}\n\t},\n\n\tresetDocumentsToMove(state) {\n\t\tstate.documentsToMove = [];\n\t}\n\n};\n\nexport default {\n\tnamespaced: false,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import DisplayModule from '@fibl/bml-display';\nconst Display = DisplayModule.display.default;\n\nconst state = {\n\tcategoryPath: '_category',\n\tusedCompanies: [],\n\tusedRestrictionTexts: [],\n\tdisplay: null,\n};\n\nconst PROPERTY_VALUE = 'value';\nconst PROPERTY_OVERRIDE = 'override';\n\n\nconst getters = {\n\t/**\n\t * Returns an array of all products currently held in memory or an empty array.\n\t */\n\tgetAllProducts: (state, getters, rootState, rootGetters) => {\n\t\tconst currentProductId = rootGetters['product/getCurrentProductId'];\n\n\t\tif (typeof currentProductId === 'undefined') {\n\t\t\tconsole.warn('No product ID defined!');\n\t\t\treturn [1];\n\t\t}\n\n\t\treturn [ currentProductId ];\n\t},\n\n\t/**\n\t * Returns an array of all product standards currently held in memory or an empty array.\n\t */\n\tgetAllStandards: (state, getters, rootState, rootGetters) => {\n\t\treturn rootGetters['biostandard/all'];\n\t},\n\n\t/**\n\t * Gets all displayed fields.\n\t */\n\tgetDisplayFields: (state) => () => {\n\t\treturn state.display.getDisplayFields();\n\t},\n\n\t/**\n\t * Returns an array with all field data.\n\t */\n\tgetFieldData: (state, getters, rootState, rootGetters) => {\n\t\treturn rootGetters['field/all'];\n\t},\n\n\t/**\n\t * Returns an array with all permit data.\n\t */\n\tgetPermitData: (state, getters, rootState, rootGetters) => {\n\t\treturn rootGetters['permit/all'];\n\t},\n\n\t/**\n\t * Returns an array with all component data.\n\t */\n\tgetComponentData: (state, getters, rootState, rootGetters) => {\n\t\treturn rootGetters['component/all'];\n\t},\n\n\t/**\n\t * Returns an array with all biostandard data.\n\t */\n\n\tgetBiostandardData: (state, getters, rootState, rootGetters) => {\n\t\treturn rootGetters['biostandard/all'];\n\t},\n\n\t/**\n\t * Returns an array with all approval data.\n\t */\n\n\tgetApprovalData: (state, getters, rootState, rootGetters) => {\n\t\tif (!rootState.product.currentList) return [];\n\t\tconst listId = rootState.product.currentList.id;\n\t\treturn rootGetters['product/getApprovalDataWithParent']({ listId });\n\t},\n\n\tgetCategoryData: (state, getters, rootState, rootGetters) => {\n\t\treturn rootGetters['category/all'];\n\t},\n\n\tgetRestrictionTextData: (state) => {\n\t\treturn state.usedRestrictionTexts;\n\t},\n\n\tgetCompanyBaseData: (state) => {\n\t\treturn state.usedCompanies;\n\t},\n\n\tgetCompanyData: (state, getters, rootState, rootGetters) => {\n\t\treturn rootGetters['product/getValue']('_companies');\n\t},\n\n\t/**\n\t * Returns the actual main category of the selected category in the category tree.\n\t */\n\tgetSelectedMainCategory: (state, getters, rootState, rootGetters) => {\n\t\tconst v = rootGetters['product/getValue'](state.categoryPath);\n\t\tif (!v) {\n\t\t\treturn null;\n\t\t}\n\t\tconst totalEntries = rootGetters['product/getTotalSelection']('category', JSON.parse(JSON.stringify(v)));\n\t\tfor (const id of totalEntries) {\n\t\t\tlet category = rootGetters['category/byId'](id);\n\t\t\tif (!category.data.parent && category.data.mainCategoryKey) {\n\t\t\t\treturn category;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t},\n\n\tgetPrintLanguage: (state, getters, rootState) => () => {\n\t\treturn rootState.base.selectedUiLanguage;\n\t},\n\n\tgetFallbackLanguage: (state, getters, rootState) => () => {\n\t\treturn rootState.base.fallbackLocale;\n\t},\n\n\tgetPrintStandard: (state, getters, rootState, rootGetters) => () => {\n\t\treturn rootGetters['product/getValue']('_display.selectedStandard');\n\t},\n\n\tgetProductData: (state, getters, rootState, rootGetters) => () => {\n\t\tlet workingCopy = JSON.parse(JSON.stringify(rootGetters['product/getWorkingCopy']));\n\n\t\tif (!workingCopy._components) {\n\t\t\tworkingCopy._components = {};\n\t\t}\n\n\t\tif (!workingCopy._components.base) {\n\t\t\tworkingCopy._components.base = [];\n\t\t} else {\n\t\t\tworkingCopy._components.base = Object.values(workingCopy._components.base);\n\t\t}\n\n\t\t// merge additional components\n\t\tif (workingCopy._components.additional) {\n\t\t\tfor (let v of Object.values(workingCopy._components.additional)) {\n\t\t\t\tworkingCopy._components.base.push(v);\n\t\t\t}\n\t\t}\n\n\t\tworkingCopy._components.base = Object.values(workingCopy._components.base).filter(e => e.secrecy && (e.secrecy === 'public' || e.secrecy.selectValue === 'public'));\n\n\t\treturn workingCopy;\n\t},\n\n\t/**\n\t * Get default display value for field (shown above the field)\n\t */\n\tgetDisplayValue: (state) => (language, fieldKey) => {\n\t\treturn state.display.getDisplayValue(language, fieldKey);\n\t},\n\n\tgetHeaderValue: (state) => (fieldKey) => {\n\t\treturn state.display.getHeaderValue(fieldKey);\n\t},\n\n\t/**\n\t * Returns an saved field value written with the WYSIWYG editor\n\t */\n\tgetValueFromField: (state, getters, rootState, rootGetters) => (mainCategoryKey, sourceKey, language, standard, property) => {\n\t\tconst data = rootGetters['product/getValue']('_display.data');\n\t\tif (!data || !Array.isArray(data)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst obj = data.find(f =>\n\t\t\tf.category === mainCategoryKey &&\n\t\t\tf.field === sourceKey &&\n\t\t\tf.language === language &&\n\t\t\tf.standard === standard);\n\n\t\tif (!obj) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn obj[property];\n\t},\n\n\t/**\n\t * Returns an array of JSON object which consist of information for each field currently\n\t * shown in the table (dependent on the category selection).\n\t * Has: override value (value was overridden in the WYSIWYG editor) and the saved value or the actual fallback.\n\t */\n\tgetDynamicValues: (state, getters) => (languages, standard) => {\n\t\tconst fields = state.display.getDisplayFields();\n\t\tconst mainCategory = getters.getSelectedMainCategory;\n\n\t\tif (!mainCategory) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst mainCategoryKey = mainCategory.data.mainCategoryKey;\n\n\t\tlet ret = [];\n\t\tfor (const language of languages) {\n\t\t\tlet l = {};\n\t\t\tl.language = language;\n\t\t\tl.data = [];\n\n\t\t\tfor (const field of fields) {\n\t\t\t\tconst value = getters.getValueFromField(mainCategoryKey, field.key, language, standard, PROPERTY_VALUE);\n\t\t\t\tconst override = getters.getValueFromField(mainCategoryKey, field.key, language, standard, PROPERTY_OVERRIDE);\n\t\t\t\tconst editable = typeof field.editable === 'undefined' ? false : field.editable;\n\n\t\t\t\tlet r = {};\n\t\t\t\tr.key = field.key;\n\t\t\t\tr.title = field.label;\n\t\t\t\tr.data = {\n\t\t\t\t\teditable,\n\t\t\t\t\tvalue,\n\t\t\t\t\toverride\n\t\t\t\t};\n\n\t\t\t\tl.data.push(r);\n\t\t\t}\n\n\t\t\tret.push(l);\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\t/**\n\t * Creates the HTML output of the template\n\t */\n\tgetPrintDataHTML: (state, getters, rootState) => () => {\n\t\tif (!state.display) {\n\t\t\treturn '';\n\t\t}\n\t\treturn state.display.getPrintDataHTML(rootState.base.userLanguagesForMultiLangFields);\n\t}\n};\n\nconst actions = {\n\tasync loadNecessaryCompanies({ getters, dispatch, commit }) {\n\t\tconst productData = getters.getProductData();\n\n\t\tif (!productData._companies) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst uniqueCompanyIds = [...new Set(productData._companies.map(f => f.company))];\n\t\tif (uniqueCompanyIds.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst list = await dispatch('companylist/loadByIds', uniqueCompanyIds, { root: true });\n\t\tcommit('setUsedCompanies', list);\n\t},\n\tasync loadRestrictionTexts({ getters, dispatch, commit, rootState }) {\n\t\tlet baseData = rootState.product.baseData;\n\t\tconst productData = getters.getProductData();\n\n\t\tif (!productData._approval) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet ids = [];\n\t\tfor (let approval of Object.values(productData._approval)) {\n\t\t\tif (approval.restrictionTextId && approval.restrictionTextId.selectValue) {\n\t\t\t\tids.push(approval.restrictionTextId.selectValue);\n\t\t\t}\n\t\t}\n\t\tif (baseData && baseData._approval) {\n\t\t\tfor (let approval of Object.values(baseData._approval)) {\n\t\t\t\tif (approval.restrictionTextId && approval.restrictionTextId.selectValue) {\n\t\t\t\t\tids.push(approval.restrictionTextId.selectValue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst uniqueRestrictionTextIds = [...new Set(ids)];\n\t\tif (uniqueRestrictionTextIds.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst list = await dispatch('restrictiontext/loadByIds', uniqueRestrictionTextIds, { root: true });\n\t\tcommit('setUsedRestrictionTexts', list);\n\t},\n\t/**\n\t * Set default state.\n\t */\n\tasync init({ commit, dispatch, getters, rootGetters, rootState }, { standard }) {\n\t\tconst selectOptions = rootGetters['selectoptions/all'];\n\n\t\tawait dispatch('loadNecessaryCompanies');\n\t\tawait dispatch('loadRestrictionTexts');\n\t\tconst listId = rootState.product.currentList.id;\n\t\tcommit('init',\n\t\t\t{\n\t\t\t\tproductData: getters.getProductData(),\n\t\t\t\tselectOptions,\n\t\t\t\tmainCategory: getters.getSelectedMainCategory,\n\t\t\t\tlanguage: getters.getPrintLanguage(),\n\t\t\t\tstandard,\n\t\t\t\tfieldData: getters.getFieldData,\n\t\t\t\tpermits: getters.getPermitData,\n\t\t\t\tcomponents: getters.getComponentData,\n\t\t\t\tbiostandards: getters.getBiostandardData,\n\t\t\t\tapprovals: getters.getApprovalData,\n\t\t\t\tcategories: getters.getCategoryData,\n\t\t\t\trestrictionTexts: getters.getRestrictionTextData,\n\t\t\t\tfallbackLanguage: getters.getFallbackLanguage(),\n\t\t\t\tcompanyData: getters.getCompanyData,\n\t\t\t\tcompanyBase: getters.getCompanyBaseData,\n\t\t\t\tlist: rootGetters['list/byId'](listId)\n\t\t\t});\n\t},\n\n\tupdateProductData({ state, commit, getters }) {\n\t\tif (!state.display) {\n\t\t\treturn;\n\t\t}\n\n\t\tcommit('updateProductData', {\n\t\t\tproductData: getters.getProductData(),\n\t\t\tlanguage: getters.getPrintLanguage(),\n\t\t\tstandard: getters.getPrintStandard(),\n\t\t\tproductIds: getters.getAllProducts\n\t\t});\n\t},\n\n\tasync updateCompanyData({ commit, getters, dispatch, state }) {\n\t\tif (!state.display) return;\n\t\tawait dispatch('loadNecessaryCompanies');\n\t\tcommit('updateCompanyData', {\n\t\t\tcompanyData: getters.getCompanyData,\n\t\t\tcompanyBase: getters.getCompanyBaseData\n\t\t});\n\t}\n};\n\nconst mutations = {\n\tinit(state, { selectOptions, mainCategory, language, standard, fieldData, permits, components, biostandards,\n\t\tapprovals, categories, fallbackLanguage, companyData, companyBase, list, restrictionTexts }) {\n\t\tstate.display = new Display({\n\t\t\tselectOptions,\n\t\t\tmainCategory,\n\t\t\tlanguage,\n\t\t\tstandard,\n\t\t\tfieldData,\n\t\t\tpermits,\n\t\t\tcomponents,\n\t\t\tbiostandards,\n\t\t\tapprovals,\n\t\t\tcategories,\n\t\t\tfallbackLanguage,\n\t\t\tcompanyData,\n\t\t\tcompanyBase,\n\t\t\trestrictionTexts,\n\t\t\tlist\n\t\t});\n\t},\n\n\tupdateProductData(state, { productData, language, standard, productIds }) {\n\t\tstate.display.updateProductData(productData);\n\t\tstate.display.updateLanguage(language);\n\t\tstate.display.updateStandard(standard);\n\t\tstate.display.updateProductIds(productIds);\n\t},\n\n\tsetUsedCompanies(state, usedCompanies) {\n\t\tstate.usedCompanies = usedCompanies;\n\t},\n\n\tsetUsedRestrictionTexts(state, usedRestrictionTexts) {\n\t\tstate.usedRestrictionTexts = usedRestrictionTexts;\n\t},\n\n\tupdateCompanyData(state, { companyData, companyBase }) {\n\t\tstate.display.updateCompanyData(companyData, companyBase);\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { toLocale } from '@/plugins/filters';\n\nconst state = {};\n\nconst getters = {\n\n\t// returns all possible approvals (base data) for an given list\n\tgetRelevantApprovals: (state, getters, rootState, rootGetters) => ({listId}) => {\n\t\tif (!rootState.product.currentList) return [];\n\t\tconst list = rootGetters['list/byId'](listId);\n\t\tif (!list) return [];\n\t\tconst standards = list.data.biostandards;\n\t\treturn rootGetters['biostandard/sortedByPublicOrder'].filter(b => standards.includes(b.id));\n\t},\n\n\t// returns an array containing all approval base data\n\t// only includes entries for an given list where the approval was actually approved\n\tgetApprovedApprovals: (state, getters, rootState, rootGetters) => ({listId}) => {\n\t\tconst data = rootGetters['product/getApprovalData'](listId);\n\t\tconst relevantApprovals = getters.getRelevantApprovals({listId});\n\n\t\treturn relevantApprovals.filter((approval) => {\n\t\t\tconst id = approval.id;\n\n\t\t\tif (!data[id] || !data[id].begin) return false;\n\n\t\t\tlet now = rootGetters['product/referenceTime'];\n\t\t\tlet begin = new Date(data[id].begin);\n\t\t\tif (begin > now) return false;\n\t\t\tif (data[id].end) {\n\t\t\t\tlet end = new Date(data[id].end);\n\t\t\t\tif (end < now) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t},\n\n\tgetApprovalDataWithParent: (state, getters, rootState, rootGetters) => ({listId}) => {\n\t\tlet currentApprovalRows = JSON.parse(JSON.stringify(rootGetters['product/getApprovalData'](listId)));\n\t\tlet baseListId = rootGetters['list/baseDataList'].id;\n\t\tlet baseApprovalRows = JSON.parse(JSON.stringify(rootGetters['product/getApprovalData'](baseListId)));\n\t\tlet relevantBiostandards = JSON.parse(JSON.stringify(getters.getRelevantApprovals({listId})));\n\n\t\t// filter only those biostandards that are currently relevant for this list\n\t\trelevantBiostandards = relevantBiostandards\n\t\t\t.filter((approval) => {\n\t\t\t\tconst id = approval.id;\n\n\t\t\t\tif (!currentApprovalRows[id] || !currentApprovalRows[id].begin) return false;\n\n\t\t\t\tlet now = rootGetters['product/referenceTime'];\n\t\t\t\tlet begin = new Date(currentApprovalRows[id].begin);\n\t\t\t\tif (begin > now) return false;\n\t\t\t\tif (currentApprovalRows[id].end) {\n\t\t\t\t\tlet end = new Date(currentApprovalRows[id].end);\n\t\t\t\t\tif (end < now) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\n\n\t\tconst isRestrictionEmpty = function(value) {\n\t\t\tif ((!value.restriction || !toLocale(value.restriction).trim() || toLocale(value.restriction) === '---') && (!value.restrictionTextId || !value.restrictionTextId.selectValue)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tlet isEmpty = !toLocale(value.restriction).trim() || toLocale(value.restriction) === '---';\n\t\t\tif (isEmpty && value.restrictionTextId && value.restrictionTextId.selectValue) {\n\t\t\t\tlet text = rootGetters['restrictiontext/byId'](value.restrictionTextId.selectValue);\n\t\t\t\treturn !text || toLocale(text.data.text) === '---';\n\t\t\t}\n\n\t\t\treturn isEmpty;\n\t\t};\n\n\t\t// now find the approvals that don't have any restriction and swap those restrictions with the corresponding parents\n\t\tfor (let [id, value] of Object.entries(currentApprovalRows)) {\n\t\t\t// check if current restriction is empty\n\t\t\tif (!relevantBiostandards.find(f => f.id === id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isRestrictionEmpty(value)) {\n\t\t\t\tlet parentStandard = rootGetters['biostandard/byId'](id);\n\t\t\t\twhile (parentStandard) {\n\t\t\t\t\tlet parentApproval = currentApprovalRows[parentStandard.id] ? currentApprovalRows[parentStandard.id] : baseApprovalRows[parentStandard.id];\n\t\t\t\t\tif (!parentApproval) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isRestrictionEmpty(parentApproval) && parentStandard.data.dependency) {\n\t\t\t\t\t\tlet dep = parentStandard.data.dependency;\n\t\t\t\t\t\tparentStandard = rootGetters['biostandard/byId'](dep);\n\t\t\t\t\t\tif (parentStandard) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvalue.restriction = parentApproval.restriction;\n\t\t\t\t\tif ((!toLocale(value.restriction).trim() || toLocale(value.restriction) === '---') && parentApproval.restrictionTextId && parentApproval.restrictionTextId.selectValue) {\n\t\t\t\t\t\tlet text = rootGetters['restrictiontext/byId'](parentApproval.restrictionTextId.selectValue);\n\t\t\t\t\t\tif (text && toLocale(text.data.text) !== '---') {\n\t\t\t\t\t\t\tvalue.restriction = text.data.text;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn currentApprovalRows;\n\t},\n\n\tgetApprovalData: (state, getters, rootState) => (listId) => {\n\t\tif (!rootState.product.currentList) return {};\n\t\tif (listId === rootState.product.currentList.id) {\n\t\t\treturn rootState.product.workingCopy._approval ?\n\t\t\t\trootState.product.workingCopy._approval : {};\n\t\t} else {\n\t\t\treturn rootState.product.loadedData[listId]\n\t\t\t&& rootState.product.loadedData[listId]._approval ?\n\t\t\t\trootState.product.loadedData[listId]._approval : {};\n\t\t}\n\t},\n\n\tisBaseCheckApproved: (state, getters, rootState) => (listId) => {\n\t\tconst approvalData = getters.getRelevantApprovals({listId});\n\t\tlet hasRelevantApprovals = false;\n\t\tfor (const biostandard of approvalData) {\n\t\t\tif (biostandard.data.baseApproval) {\n\t\t\t\thasRelevantApprovals = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!hasRelevantApprovals) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst approvals = getters.getApprovedApprovals({listId});\n\n\t\tfor (const approval of approvals) {\n\t\t\tif (approval.data.baseApproval) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n};\n\nconst actions = {};\n\nconst mutations = {\n};\n\nexport default {\n\tnamespaced: false,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { post } from '@/util/request.js';\nimport { waitForTicket } from './pdf.js';\n\nexport async function createListingConfirmationPdf({ confirmationId }) {\n\tlet { ticket, pdf } = await post('bml/product/pdflistingconfirmation', { confirmationId });\n\tif (!pdf) {\n\t\tpdf = await waitForTicket(ticket);\n\t}\n\treturn pdf;\n}\n\nexport function createListingConfirmation(params) {\n\treturn post('bml/product/createlistingconfirmation', params, null, true);\n}\n\nexport function sendListingConfirmation(params) {\n\treturn post('bml/product/sendlistingconfirmation', params);\n}\n\nexport async function createInvoicePdf(params) {\n\tlet { ticket } = await post('bml/invoice/createinvoicepdf', params);\n\treturn ticket;\n}\n","import * as Repository from '@/repository/listingconfirmation';\nimport { genericEntityUpdate, genericEntityDelete, search, getEntityclassByExternalId } from '@/repository/system';\n\nconst state = {\n\tentityClassId: null,\n\tlistingConfirmations: []\n};\n\nconst getters = {\n\n\tgetListingConfirmations: (state) => (productId) => {\n\t\treturn state.listingConfirmations.filter(confirmation => {\n\t\t\treturn confirmation.data.productId === productId;\n\t\t});\n\t},\n\n\tbyId: (state) => confirmationId => {\n\t\treturn state.listingConfirmations.find(confirmation => confirmation.id === confirmationId);\n\t}\n\n};\n\nconst actions = {\n\n\tasync loadAll({ commit, state }, { productId }) {\n\t\tif (!state.entityClassId) {\n\t\t\tlet entityClass = await getEntityclassByExternalId('listing_confirmation');\n\t\t\tcommit('setEntityClassId', entityClass.id);\n\t\t}\n\t\tlet filter = {\n\t\t\tfield: '/data/productId',\n\t\t\tcomparison: 'eq',\n\t\t\tvalue: productId\n\t\t};\n\t\tlet list = await search(state.entityClassId, filter);\n\t\tcommit('resetList', list);\n\t},\n\n\tasync createConfirmation({ commit }, { productId, listIds, institutionId, companyId, language, type}) {\n\t\tlet confirmation = await Repository.createListingConfirmation({ productId, listIds, institutionId, companyId, language, type });\n\t\tcommit('addConfirmation', confirmation);\n\t},\n\n\tasync updateConfirmationLanguage({ commit, getters }, { confirmationId, language }) {\n\t\tlet oldConfirmation = getters.byId(confirmationId);\n\t\tlet newConfirmation = JSON.parse(JSON.stringify(oldConfirmation));\n\t\tnewConfirmation.data.language = language;\n\t\tlet confirmation = await genericEntityUpdate(oldConfirmation, newConfirmation.data);\n\t\tcommit('updateConfirmation', confirmation);\n\t},\n\n\tasync sendConfirmation({ commit }, { confirmationId }) {\n\t\tlet confirmation = await Repository.sendListingConfirmation({ confirmationId });\n\t\tif (confirmation && confirmation.data.sendDate) {\n\t\t\tcommit('updateConfirmation', confirmation);\n\t\t}\n\t},\n\n\tasync deleteConfirmation({ commit }, { confirmationId }) {\n\t\tawait genericEntityDelete({ id: confirmationId });\n\t\tcommit('deleteConfirmation', confirmationId);\n\t},\n\n\tgetPdf(_, { confirmationId }) {\n\t\treturn Repository.createListingConfirmationPdf({ confirmationId });\n\t}\n\n};\n\nconst mutations = {\n\tsetEntityClassId(state, id) {\n\t\tstate.entityClassId = id;\n\t},\n\tresetList(state, list) {\n\t\tstate.listingConfirmations = list;\n\t},\n\taddConfirmation(state, confirmation) {\n\t\tstate.listingConfirmations.push(confirmation);\n\t},\n\tdeleteConfirmation(state, confirmationId) {\n\t\tlet oldIndex = state.listingConfirmations.findIndex(entry => entry.id === confirmationId);\n\t\tstate.listingConfirmations.splice(oldIndex, 1);\n\t},\n\tupdateConfirmation(state, confirmation) {\n\t\tlet oldIndex = state.listingConfirmations.findIndex(entry => entry.id === confirmation.id);\n\t\tstate.listingConfirmations.splice(oldIndex, 1, confirmation);\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","\n\nconst state = {\n\n};\n\nconst getters = {\n\n\tgetNotes: (state, getters, rootState, rootGetters) => {\n\t\tif (!rootState.product.currentList) return {};\n\t\treturn rootState.product.workingCopy._notes ?\n\t\t\trootState.product.workingCopy._notes : [];\n\t},\n\n\tgetUnreadNoteCount: (state, getters, rootState, rootGetters) => {\n\t\tconst notes = getters.getNotes;\n\t\treturn notes.length;\n\t}\n};\n\nconst actions = {\n\n};\n\nconst mutations = {\n\n};\n\nexport default {\n\tnamespaced: false,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { toLocale, toSortable } from '@/plugins/filters.js';\nimport SECRECY_LEVELS from '@/assets/config/secrecy-levels';\nimport {getSelectListFromArray} from '@/util/select-helper';\nimport AddressTypes from '@/assets/config/address-types.json';\nimport CompanyRoles from '@/assets/config/company-roles.json';\nimport { i18n } from '@/main';\n// import Router from '@/router';\nlet Router;\n\n(async function() {\n\tRouter = await import('@/router');\n}());\n\n// Maps an key to an select-list option to clean up the switch case\nconst KEY_OPTIONSOURCE_MAPPING = {\n\t'controlbody': 'controlbody',\n\t'cert-standards': 'cert-standards',\n\t'risk-phrase': 'risk-phrase',\n\t'origin': 'origin',\n\t'quality': 'quality',\n\t'keeping-type': 'keeping-type',\n\t'nutrient': 'nutrient',\n\t'nutrient-fum': 'nutrient-fum',\n\t'unit': 'unit',\n\t'person-types': 'person-types',\n\t'company.type': 'company.type',\n\t'company.person.title': 'company.person.title',\n\t'invoice-flags': 'invoice-flags'\n};\n\n// maps an given option source key to an fixed getter to return the values\nconst KEY_GETTER_OPTIONS = {\n\t'maincategory': 'category/roots',\n\t'checklist': 'checklist/allActive',\n\t'institutions': 'auth/org/institutionsByCurrentAccount',\n\t'countries': 'country/all',\n\t'lists': 'list/root',\n\t'permits': 'permit/forListAndCategory',\n\t'selectoptions': 'selectoptions/all'\n};\n\nfunction replaceSpecials(el) {\n\treturn el.replace(/\\[_/g, '')\n\t\t.replace(/_\\]/g, '')\n\t\t.replace(/\\[\\^/g, '')\n\t\t.replace(/\\^\\]/g, '');\n}\n\nconst getters = {\n\tgetOptionsBySource: (state, getters, rootState, rootGetters) => (source, exporting) => {\n\t\tconst sourceValue = KEY_OPTIONSOURCE_MAPPING[source];\n\n\t\tif (sourceValue) {\n\t\t\tconst selectOpts = rootGetters['selectoptions/byTypeSorted'](sourceValue);\n\t\t\tif (selectOpts.length === 0) {\n\t\t\t\tconsole.warn(`no select options from type \"${source}\" found`);\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn selectOpts.map(sel => {\n\t\t\t\treturn { value: sel.id, text: replaceSpecials(toLocale(sel.data.title)) };\n\t\t\t});\n\t\t}\n\n\t\tconst getterValue = KEY_GETTER_OPTIONS[source];\n\n\t\tif (getterValue) {\n\t\t\tconst options = rootGetters[getterValue];\n\t\t\tif (typeof options === 'function') {\n\t\t\t\tlet opts;\n\t\t\t\tif (source === 'permits') {\n\t\t\t\t\tif (Router.default.currentRoute.name.substr(0, 11) === 'product-tab' && rootState.product && rootState.product.currentList) {\n\t\t\t\t\t\topts = options(\n\t\t\t\t\t\t\trootState.product.currentList.id,\n\t\t\t\t\t\t\trootGetters['product/getCurrentMainCategoryId']\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\topts = rootGetters['permit/all'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\topts = options();\n\t\t\t\t}\n\t\t\t\treturn getSelectListFromArray(opts, 'title', false).sort((a, b) => a.text.localeCompare(b.text));\n\t\t\t} else {\n\t\t\t\treturn getSelectListFromArray(options, 'title', false).sort((a, b) => a.text.localeCompare(b.text));\n\t\t\t}\n\t\t}\n\n\t\t// default behaviour\n\t\tswitch (source) {\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`invalid optionSource: ${source}`);\n\n\t\t\tcase 'biostandard':\n\t\t\t\tlet bioopts = rootState.biostandard.biostandards;\n\t\t\t\treturn bioopts.map(bio => {\n\t\t\t\t\treturn { text: toLocale(bio.data.name), value: bio.id };\n\t\t\t\t});\n\n\t\t\tcase 'company':\n\t\t\t\tlet companies = rootGetters['companylist/all'];\n\t\t\t\tif (companies.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\treturn companies.map(sel => {\n\t\t\t\t\treturn { value: sel.id, text: sel.data.baseData.name };\n\t\t\t\t});\n\n\t\t\tcase 'company-cache': {\n\t\t\t\tlet companyCache = rootState.productlist.companyCache;\n\t\t\t\tif (companyCache.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\treturn companyCache.map(sel => {\n\t\t\t\t\treturn {value: sel.id, text: rootGetters['companylist/getCompanyTitle'](sel.data) };\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcase 'company-cache-export': {\n\t\t\t\tlet companyCache = rootState.product.exports.companyCache;\n\t\t\t\tif (companyCache.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\treturn companyCache.map(sel => {\n\t\t\t\t\treturn {value: sel.id, text: rootGetters['companylist/getCompanyTitle'](sel.data) };\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcase 'company-cache-export-full': {\n\t\t\t\tlet companyCache = rootState.product.exports.companyCache;\n\t\t\t\tif (companyCache.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\treturn companyCache;\n\t\t\t}\n\n\t\t\tcase 'secrecy-levels':\n\t\t\t\treturn SECRECY_LEVELS.map(f => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvalue: f,\n\t\t\t\t\t\ttext: i18n.t(`default.secrecyLevels.${f}`)\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\tcase 'roles':\n\t\t\t\treturn CompanyRoles.map(f => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvalue: f,\n\t\t\t\t\t\ttext: i18n.t(`default.companyRoles.${f}`)\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\tcase 'users':\n\t\t\t\tlet userOpts = exporting ? rootGetters['auth/admin/getAccountsForAllUsers'] : rootGetters['auth/admin/getAccountsForActiveUsers'];\n\t\t\t\tuserOpts = JSON.parse(JSON.stringify(userOpts));\n\t\t\t\tuserOpts = userOpts.sort((user1, user2) => {\n\t\t\t\t\tlet name1 = user1.data.staticData.fullname || '';\n\t\t\t\t\tlet name2 = user2.data.staticData.fullname || '';\n\t\t\t\t\treturn name1.localeCompare(name2);\n\t\t\t\t});\n\t\t\t\treturn userOpts\n\t\t\t\t\t.map(f => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tvalue: f.id,\n\t\t\t\t\t\t\ttext: f.data.staticData.fullname || f.id\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\n\t\t\tcase 'checklist-status':\n\t\t\t\tconst checklistStatus = rootGetters['checklist/all'];\n\t\t\t\tlet sources = [];\n\t\t\t\tfor (const entry of checklistStatus) {\n\t\t\t\t\tconst parentId = entry.id;\n\n\t\t\t\t\tfor (const row of entry.data.options) {\n\t\t\t\t\t\tsources.push({\n\t\t\t\t\t\t\tvalue: row.id,\n\t\t\t\t\t\t\ttext: toLocale(row.title),\n\t\t\t\t\t\t\tparentRowId: parentId\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn sources;\n\n\t\t\tcase 'checklist-status-nok':\n\t\t\t\tconst checklistNOkStatus = rootGetters['checklist/all'];\n\t\t\t\tlet src = [];\n\t\t\t\tfor (const entry of checklistNOkStatus) {\n\t\t\t\t\tconst parentId = entry.id;\n\n\t\t\t\t\tfor (const row of entry.data.options.filter(f => !f.okay)) {\n\t\t\t\t\t\tsrc.push({\n\t\t\t\t\t\t\tvalue: row.id,\n\t\t\t\t\t\t\ttext: toLocale(row.title),\n\t\t\t\t\t\t\tparentRowId: parentId\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn src;\n\n\t\t\tcase 'languages':\n\t\t\t\treturn rootGetters['base/getLanguagesForSelect'];\n\n\t\t\tcase 'address-types':\n\t\t\t\treturn AddressTypes.map(f => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvalue: f,\n\t\t\t\t\t\ttext: i18n.t(`default.addressTypes.${f}`)\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\tcase 'restrictionText':\n\t\t\t\tlet list = rootState.restrictiontext.restrictionTexts;\n\t\t\t\treturn list.map(text => {\n\t\t\t\t\treturn { text: toLocale(text.data.text), value: text.id };\n\t\t\t\t});\n\n\t\t\tcase 'boolean':\n\t\t\t\treturn [\n\t\t\t\t\t{\n\t\t\t\t\t\tvalue: '',\n\t\t\t\t\t\ttext: '-'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tvalue: 'true',\n\t\t\t\t\t\ttext: i18n.t('admin.crud.yes')\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tvalue: 'false',\n\t\t\t\t\t\ttext: i18n.t('admin.crud.no')\n\t\t\t\t\t}\n\t\t\t\t];\n\t\t}\n\t},\n\n\tgetOptions: (state, getters, rootState, rootGetters) => (path, source) => {\n\t\tif (source) {\n\t\t\treturn getters.getOptionsBySource(source);\n\t\t}\n\n\t\tlet field = getters.getField(path);\n\t\tif (!field) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet locale = rootState.base.selectedUiLanguage;\n\n\t\tif (field.data.optionSource) {\n\t\t\t//generate from source\n\t\t\treturn getters.getOptionsBySource(field.data.optionSource);\n\t\t}\n\n\t\tif (!field.data.options) {\n\t\t\tconsole.warn(`no options in path: ${path}`);\n\t\t\treturn [];\n\t\t}\n\t\tlet sortByText = function(a, b) {\n\t\t\tlet va = toSortable(a.label);\n\t\t\tlet vb = toSortable(b.label);\n\t\t\treturn va.localeCompare(vb);\n\t\t};\n\t\tlet isGrouped = getters.hasGroupedOptions(path);\n\t\tif (isGrouped) {\n\t\t\tlet res = field.data.options\n\t\t\t\t.filter(opt => opt.enabled)\n\t\t\t\t.reduce((res, opt) => {\n\t\t\t\t\tlet grpId = opt.group;\n\t\t\t\t\tlet grpLabel;\n\t\t\t\t\tif (grpId) {\n\t\t\t\t\t\tlet grp = field.data.optionGroups.find(g => g.id === grpId);\n\t\t\t\t\t\tif (!grp) throw new Error(`invalid group designation: ${grpId}`);\n\t\t\t\t\t\tgrpLabel = toLocale(grp.title);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgrpId = '-';\n\t\t\t\t\t\tgrpLabel = {};\n\t\t\t\t\t\tgrpLabel[locale] = 'NOGROUP';\n\t\t\t\t\t}\n\t\t\t\t\tlet grpContainer = res.find(g => g.id === grpId);\n\t\t\t\t\tif (!grpContainer) {\n\t\t\t\t\t\tgrpContainer = {\n\t\t\t\t\t\t\tid: grpId,\n\t\t\t\t\t\t\tlabel: grpLabel,\n\t\t\t\t\t\t\toptions: []\n\t\t\t\t\t\t};\n\t\t\t\t\t\tres.push(grpContainer);\n\t\t\t\t\t}\n\t\t\t\t\tgrpContainer.options.push({\n\t\t\t\t\t\tvalue: opt.id,\n\t\t\t\t\t\tlabel: toLocale(opt.title)\n\t\t\t\t\t});\n\t\t\t\t\treturn res;\n\t\t\t\t}, []);\n\t\t\tres.sort(sortByText);\n\t\t\tres.forEach(grp => {\n\t\t\t\tgrp.options.sort(sortByText);\n\t\t\t});\n\t\t\treturn res;\n\t\t} else {\n\t\t\treturn field.data.options\n\t\t\t\t.filter(opt => opt.enabled)\n\t\t\t\t.map(opt => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvalue: opt.id,\n\t\t\t\t\t\ttext: toLocale(opt.title)\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.sort(sortByText);\n\t\t}\n\t},\n\n\thasGroupedOptions: (state, getters) => (path, source) => {\n\t\tif (source) return false;\n\t\tconst field = getters.getField(path);\n\t\tif (!field || field.data.optionSource) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!field.data.options.find(o => o.enabled && o.group);\n\t},\n};\n\nexport default {\n\tnamespaced: false,\n\tgetters\n};\n","import { updatePresenceStatus } from '@/repository/product';\n\nconst SECTION = 'equipoProducts';\n\nconst state = {\n\tpresentUsers: []\n};\n\nconst getters = {\n\tgetPresentUsers: (state) => {\n\t\treturn state.presentUsers;\n\t}\n};\n\nconst actions = {\n\tasync updatePresenceStatus({ state, commit, rootState, rootGetters }, id) {\n\t\tconst name = rootGetters['auth/user/userName'];\n\t\tconst users = await updatePresenceStatus(SECTION, name, id);\n\t\tcommit('setPresentUsers', users);\n\t},\n\tasync clearPresenceStatus({ state, commit, rootGetters }) {\n\t\tconst name = rootGetters['auth/user/userName'];\n\t\tawait updatePresenceStatus(SECTION, name);\n\t\tcommit('setPresentUsers', []);\n\t}\n};\n\nconst mutations = {\n\tsetPresentUsers(state, users) {\n\t\tstate.presentUsers = users;\n\t}\n};\n\nexport default {\n\tnamespaced: false,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","\n\nexport default class ChangeEmitter {\n\n\tconstructor() {\n\t\tthis.events = new Map();\n\t\tthis.cache = new Map();\n\t}\n\n\ton(evt, listener) {\n\t\tlet match = this._getMatchRegex(evt);\n\t\t// console.log('set',evt,match);\n\t\tthis.events.set(evt, { match, listener });\n\t\tthis.cache.clear();\n\t}\n\n\thas(evt) {\n\t\treturn this.events.has(evt);\n\t}\n\n\tremove(evt) {\n\t\tthis.events.delete(evt);\n\t}\n\n\temit(evt, data, origEvt) {\n\t\tlet listeners = this._getMatchingListeners(evt);\n\t\t// if (listeners.length) console.log(`emitting ${evt} to ${listeners.length} listeners`);\n\t\tfor (let listener of listeners) {\n\t\t\tlistener(origEvt ? origEvt : evt, data);\n\t\t}\n\t}\n\n\temitAll(evt, data) {\n\t\tlet parts = evt.split('.');\n\t\tfor (let i=parts.length; i>0; i--) {\n\t\t\tlet re = parts.slice(0, i).join('.');\n\t\t\tthis.emit(re, data, evt);\n\t\t}\n\t}\n\n\t_getMatchingListeners(evt) {\n\t\tif (this.cache.has(evt)) {\n\t\t\treturn this.cache.get(evt);\n\t\t}\n\t\tlet res = [];\n\t\tfor (let [ , { match, listener } ] of this.events) {\n\t\t\tif (this._matchingEvent(match, evt)) {\n\t\t\t\tres.push(listener);\n\t\t\t}\n\t\t}\n\t\t// console.log('calculated listeners',evt,res);\n\t\tthis.cache.set(evt, res);\n\t\treturn res;\n\t}\n\n\t_getMatchRegex(evt) {\n\t\tlet reg = evt.replace('.', '\\\\.')\n\t\t\t.replace('-', '\\\\-')\n\t\t\t.replace('*', '[^\\\\.]+');\n\t\treturn new RegExp(`^${reg}$`, '');\n\t}\n\n\t_matchingEvent(match, evt) {\n\t\treturn match.test(evt);\n\t}\n}\n","import Vue from 'vue';\nimport { loadProduct, syncListData, loadProductWithCache } from '@/repository/product.js';\nimport Tabs from '@/assets/config/tabs.json';\nimport BmlCommon from \"@fibl/bml-common\";\nimport checklist, { traverseToData } from './product/checklist.js';\nimport documents from './product/documents.js';\nimport display from './product/display.js';\nimport approvals from './product/approvals.js';\nimport history from './product/history.js';\nimport listingconfirmation from './product/listingconfirmation.js';\nimport notes from './product/notes.js';\nimport options from './product/options.js';\nimport presence from './product/presence';\nimport exports from './product/exports';\nimport flatten, { unflatten } from 'flat';\nimport EventBus from '@/util/eventbus.js';\nimport ChangeEmitter from '@/util/change-emitter.js';\nimport { getAttributesetByExternalId } from '@/repository/system.js';\nimport { deepSet, deepGet } from '@/util/field-helper.js';\n\nconst modules = {\n\tchecklist,\n\tdocuments,\n\tdisplay,\n\tapprovals,\n\tnotes,\n\thistory,\n\toptions,\n\tpresence,\n\texports,\n\tlistingconfirmation\n};\n\nexport const listOfPathsForDeepLinking = [\n\t'_components',\n\t'_risklabels'\n];\n\nexport const doNotMergePaths = [\n\t'_documents',\n\t'_checklist',\n\t'_approval',\n\t'_notes',\n\t'_display',\n\t'_active',\n\t'_nameHistory',\n\t'basis-f2',\n\t'_companies',\n\t'_categoryTree',\n\t'_responsible',\n\t'_hobbygarden',\n\t'_hobbygardenTree',\n\t'_invoiceSpecialItems',\n\t'_linked',\n\t'activatedOn',\n\t'activatedBy',\n\t'deactivatedOn',\n\t'activatedBy',\n\t'deactivatedBy',\n\t'_preventPublicDisplay'\n];\n\nexport const componentUnlinkableFields = [\n\t'secrecy',\n\t'printlabel'\n];\n\nconst langSuffixMatch = /.[a-z]{2}_[A-Z]{2}$/;\nexport function sanitizeLinkPath(p) {\n\t//removes language suffix from path\n\tif (langSuffixMatch.test(p)) {\n\t\tp = p.substr(0, p.length-6);\n\t}\n\treturn p;\n}\nfunction makeComponentIndex(isBase) {\n\treturn function(c, e) {\n\t\tc[e._id] = e;\n\t\tcomponentUnlinkableFields.forEach(f => {\n\t\t\tif (e[f]) e[f]._isBase = isBase;\n\t\t});\n\t\treturn c;\n\t};\n}\nfunction flatMerge(base, list) {\n\tlet flatBase = flatten(base);\n\tlet flatList = flatten(list);\n\tlet flatCombined = { ...flatBase, ...flatList };\n\treturn unflatten(flatCombined, { overwrite: true });\n}\nfunction pruneComponentIndex(list, base) {\n\tObject.keys(list).forEach(key => {\n\t\tif (!(key in base)) {\n\t\t\tdelete list[key];\n\t\t}\n\t});\n}\nfunction componentMerge(baseData, v) {\n\tlet listComponentIndex = v.base && Array.isArray(v.base) ? v.base.reduce(makeComponentIndex(!baseData), {}) : {};\n\tlet listAdditionalIndex = v.additional && Array.isArray(v.additional) ? v.additional.reduce(makeComponentIndex(!baseData), {}) : {};\n\tlet mergeBase, mergedAdditional;\n\tif (baseData && baseData._components) {\n\t\tlet baseComponentIndex = baseData._components.base && Array.isArray(baseData._components.base) ? baseData._components.base.reduce(makeComponentIndex(true), {}) : {};\n\t\tpruneComponentIndex(listComponentIndex, baseComponentIndex);\n\t\tmergeBase = flatMerge(baseComponentIndex, listComponentIndex);\n\n\t\tlet baseAdditionalIndex = baseData._components.additional && Array.isArray(baseData._components.additional) ? baseData._components.additional.reduce(makeComponentIndex(true), {}) : {};\n\t\tpruneComponentIndex(listAdditionalIndex, baseAdditionalIndex);\n\t\tmergedAdditional = flatMerge(baseAdditionalIndex, listAdditionalIndex);\n\t} else {\n\t\tmergeBase = listComponentIndex;\n\t\tmergedAdditional = listAdditionalIndex;\n\t}\n\treturn {\n\t\tbase: mergeBase,\n\t\tadditional: mergedAdditional\n\t};\n}\nexport function mergeListAndBase(listData, baseData) {\n\tconst merged = {};\n\tObject.keys(listData).forEach(key => {\n\t\tlet v = JSON.parse(JSON.stringify(listData[key]));\n\t\tif (key === '_components') {\n\t\t\tmerged[key] = componentMerge(baseData, v);\n\t\t} else if (listOfPathsForDeepLinking.includes(key) && baseData && baseData[key]) {\n\t\t\tmerged[key] = flatMerge(baseData[key], v);\n\t\t} else {\n\t\t\tmerged[key] = v;\n\t\t}\n\t});\n\tif (baseData) {\n\t\tObject.keys(baseData).forEach(key => {\n\t\t\tif (key in merged || doNotMergePaths.includes(key)) return;\n\t\t\tlet v = JSON.parse(JSON.stringify(baseData[key]));\n\t\t\tif (key === '_components') {\n\t\t\t\tmerged[key] = componentMerge(null, v);\n\t\t\t} else {\n\t\t\t\tmerged[key] = v;\n\t\t\t}\n\t\t});\n\t}\n\treturn merged;\n}\n\nfunction initializeWorkingCopy(baseData, listData, linked, out) {\n\tObject.keys(listData).forEach(key => {\n\t\tlet v = JSON.parse(JSON.stringify(listData[key]));\n\t\tif (key === '_components') {\n\t\t\tout[key] = componentMerge(baseData, v);\n\t\t} else if (listOfPathsForDeepLinking.includes(key) && baseData && baseData[key]) {\n\t\t\tout[key] = flatMerge(baseData[key], v);\n\t\t} else {\n\t\t\tout[key] = v;\n\t\t}\n\t\tif (linked && baseData && !doNotMergePaths.includes(key)) {\n\t\t\tif (listOfPathsForDeepLinking.includes(key)) {\n\t\t\t\tlet flat;\n\t\t\t\tif (key === '_components') {\n\t\t\t\t\tflat = {};\n\t\t\t\t\tObject.entries(out[key].base).forEach(([id, row]) => {\n\t\t\t\t\t\tcomponentUnlinkableFields.forEach(f => {\n\t\t\t\t\t\t\tif (!(row[f] && row[f]._isBase)) {\n\t\t\t\t\t\t\t\tflat[`base.${id}.${f}`] = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\tObject.entries(out[key].additional).forEach(([id, row]) => {\n\t\t\t\t\t\tcomponentUnlinkableFields.forEach(f => {\n\t\t\t\t\t\t\tif (!(row[f] && row[f]._isBase)) {\n\t\t\t\t\t\t\t\tflat[`additional.${id}.${f}`] = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tflat = flatten(v);\n\t\t\t\t}\n\t\t\t\tObject.keys(flat).forEach(subkey => {\n\t\t\t\t\tlet fullKey = sanitizeLinkPath(`${key}.${subkey}`);\n\t\t\t\t\tVue.set(linked, fullKey, 'direct');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\tif (baseData) {\n\t\tObject.keys(baseData).forEach(key => {\n\t\t\tif (key in out || doNotMergePaths.includes(key)) return;\n\t\t\tlet v = JSON.parse(JSON.stringify(baseData[key]));\n\t\t\tif (key === '_components') {\n\t\t\t\tout[key] = componentMerge(null, v);\n\t\t\t} else {\n\t\t\t\tout[key] = v;\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport const emitter = new ChangeEmitter();\n\nconst state = {\n\t//all cached loaded lists\n\tloadedData: {},\t\t\t//caches several lists of 1 product for quicker switching\n\tcanLink: true,\t\t\t//true if baseList is loaded\n\tlistHasCompaniesOnOpening: false,\t//is set when opening a list\n\tbaseData: {},\t\t\t//data loaded for base list\n\tlistData: {},\t\t\t//data loaded for list\n\tworkingCopy: {},\t\t//idx of data by path\n\tfields: [],\t\t\t\t//copy of available fields\n\tlinked: {},\t\t\t\t//idx of linked paths\n\tlists: [],\t\t\t\t//lists available in current product\n\tallLists: [],\t\t\t//copy of all available lists\n\trootList: null,\t\t\t// eu / base list\n\tcurrentList: null,\t\t//currently open list\n\trev: null,\t\t\t\t// set to product data if revision was used\n\trevNo: null,\n\tworkingCopyHasChanges: false,\n\ttabs: Tabs,\n\tinit: false,\n\tcurrentProductId: '',\n\tfieldErrors: {},\t\t\t//mirror to workingCopy but values are true if valid or a string if error\n\tattributesetId: null,\n\tpatch: null,\n\tcompanySeeingRecipe: []\n};\n\nconst getters = {\n\n\tgetValue: (state) => (path) => {\n\t\tlet parts = path.split('.');\n\t\treturn deepGet(state.workingCopy, parts);\n\t},\n\n\tgetLinked: (state) => (path) => {\n\t\tpath = sanitizeLinkPath(path);\n\t\tif (!(path in state.linked)) {\n\t\t\treturn state.baseData ? 'basis' : 'direct';\n\t\t}\n\t\treturn state.linked[path];\n\t},\n\n\tgetField: (state) => (id) => {\n\t\tif (typeof id !== 'string') throw new Error(`invalid path: ${JSON.stringify(id)}`);\n\t\tif (id.indexOf('.') > -1) id = id.substr(id.lastIndexOf('.') + 1, id.length);\n\t\tlet def = state.fields.find(field => {\n\t\t\treturn field.data.path === id;\n\t\t});\n\n\t\tif (!def) {\n\t\t\tconsole.warn(`no definition found for path: ${id}`);\n\t\t}\n\n\t\treturn def;\n\t},\n\n\textendSelection: (state, getters) => (workingData, item, flattened) => {\n\t\tlet persistedItem = flattened.find(x => x.id === item);\n\t\tif (!persistedItem || !persistedItem.data.parent || persistedItem.data.parent === 'undefined') {\n\t\t\t// item is root, stop iteration\n\t\t\treturn;\n\t\t}\n\n\t\tpersistedItem = persistedItem.data;\n\n\t\tconst parent = flattened.find(x => x.id === persistedItem.parent);\n\t\tif (parent) {\n\t\t\tworkingData.push(persistedItem.parent);\n\n\t\t\tgetters.extendSelection(workingData, parent, flattened);\n\t\t}\n\t},\n\n\ttraverseSelectionTree: (state, getters, rootState, rootGetters) => (type, workingData) => {\n\t\t// flatten hierarchical tree and traverse array upwards\n\t\tlet flattenArray = function flattenArray(arr) {\n\t\t\tconst flattened = [];\n\t\t\tarr.forEach(item => {\n\t\t\t\tflattened.push(item);\n\n\t\t\t\tif (item.children && Array.isArray(item.children)) {\n\t\t\t\t\tflattened.push(...flattenArray(item.children));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn flattened;\n\t\t};\n\n\t\tlet addChildren = function addChildren(arr, parent) {\n\t\t\tif (!parent.children) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const child of parent.children) {\n\t\t\t\tarr.push(child);\n\t\t\t\taddChildren(arr, child);\n\t\t\t}\n\t\t};\n\n\t\tlet ordered = [];\n\t\tfor (const entry of rootGetters[`${type}/roots`]) {\n\t\t\tordered.push(entry);\n\t\t\taddChildren(ordered, entry);\n\t\t}\n\n\t\tlet flattened = flattenArray(ordered);\n\n\t\tfor (const item of workingData) {\n\t\t\tgetters.extendSelection(workingData, item, flattened);\n\t\t}\n\n\t\tlet ret = [];\n\t\tfor (const element of ordered) {\n\t\t\tif (workingData.find(x => x === element.id)) {\n\t\t\t\tret.push(element.id);\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\t// initial recursive call\n\tgetTotalSelection: (state, getters) => (type, workingData) => {\n\t\tconst selection = getters.traverseSelectionTree(type, workingData);\n\t\treturn new Set(selection);\n\t},\n\n\tgetFieldDefinitions: (state, getters) => ({ displayKey, displayType, path }) => {\n\t\tlet selectedCategories = new Set(state.workingCopy._category);\n\t\tlet workingData = state.workingCopy._category ? JSON.parse(JSON.stringify(state.workingCopy._category)) : [];\n\n\t\tselectedCategories = getters.getTotalSelection('category', workingData);\n\n\t\treturn state.fields.filter(field => {\n\t\t\tif (displayType === 'table' && path) {\n\t\t\t\tdisplayKey = getters.getField(path).id;\n\t\t\t}\n\t\t\t//check tab/table/special display\n\t\t\tif (field.data.displayKey !== displayKey || field.data.displayType !== displayType) return false;\n\n\t\t\t// check if there is an main category selected for the field\n\t\t\tlet visibleInMainCategories = field.data.visibleInMainCategories || [];\n\t\t\tlet visibleInAnyCategory = visibleInMainCategories.length > 0;\n\n\t\t\tif (visibleInAnyCategory) {\n\t\t\t\t// check if the corresponding main category was selected in the tree\n\t\t\t\tconst overlap = visibleInMainCategories.find(x => selectedCategories.has(x));\n\t\t\t\tif (!overlap) return false;\n\t\t\t}\n\n\t\t\t//check for list\n\t\t\tif (field.data.visibleInLists.length > 0) {\n\t\t\t\tif (!field.data.visibleInLists.includes(state.currentList.id)) return false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}).sort((a, b) => {\n\t\t\treturn a.data.sorting > b.data.sorting ? 1 : -1;\n\t\t});\n\t},\n\n\tisValid: (state) => {\n\t\tlet flat = flatten(state.fieldErrors);\n\t\tfor (let value of Object.values(flat)) {\n\t\t\tif (value !== true\n\t\t\t\t&& (!(Array.isArray(value) && value.length === 0))\n\t\t\t\t&& !(typeof value === 'object' && value && Object.keys(value).length === 0)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t},\n\n\tisFieldValid: (state) => ({ path, def=true }) => {\n\t\tlet entry = deepGet(state.fieldErrors, path.split('.'));\n\t\treturn entry === null ? def : entry === true;\n\t},\n\n\tisBaseList: (state) => {\n\t\treturn !state.baseData;\n\t},\n\n\tgetCurrentProductId: (state) => {\n\t\treturn state.currentProductId;\n\t},\n\n\tgetWorkingCopy: (state) => {\n\t\treturn JSON.parse(JSON.stringify(state.workingCopy));\n\t},\n\n\tgetCurrentListId: (state) => {\n\t\treturn state.currentList ? state.currentList.id : '';\n\t},\n\n\tgetCurrentMainCategoryId: (state, getters, rootState, rootGetters) => {\n\t\tlet idx = state.workingCopy._categoryTree;\n\t\tif (!idx) return null;\n\t\tfor (let id of idx) {\n\t\t\tlet cat = rootGetters['category/byId'](id);\n\t\t\tif (!cat) continue;\n\t\t\tif (!cat.data.parent) return cat.id;\n\t\t}\n\t\treturn null;\n\t},\n\n\tisListArchived: (state) => (listId) => {\n\t\tconst listData = state.loadedData[listId];\n\n\t\tif (!listData) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn listData._archived;\n\t},\n\n\tcanLinkField: (state, getters, rootState, rootGetters) => (fieldPath) => {\n\t\tlet field = rootGetters['field/byPath'](fieldPath);\n\t\tif (!field) return true;\n\t\tif (field.data.displayKey === 'hobbygarden' && field.data.displayType === 'tab') return false;\n\t\tif (field.data.type === 'comment') return false; // decouple basis-f2\n\t\treturn true;\n\t},\n\n\treferenceTime: (state) => {\n\t\treturn state.rev ? new Date(state.rev.updated) : new Date()\n\t},\n\n\tisLocalChecklist: (state, getters, rootState, rootGetters) => (fieldPath) => {\n\t\tlet clId = fieldPath.split('.')[1];\n\t\tlet clEntry = rootGetters['checklist/byId'](clId);\n\t\tif (!clEntry) {\n\t\t\tconsole.warn('unknown checklist id: ', clId);\n\t\t\treturn false;\n\t\t}\n\t\tif (clEntry.data.modus === 'reference') {\n\t\t\t// console.debug('modus is reference', getters.isBaseList, clId, clEntry.data.title.de_DE);\n\t\t\treturn getters.isBaseList;\n\t\t}\n\t\tif (clEntry.data.listRestrict && clEntry.data.listRestrict.length) {\n\t\t\tlet restricted = clEntry.data.listRestrict.includes(getters.getCurrentListId);\n\t\t\t// console.debug('cl included in list-restrict', restricted, clId, clEntry.data.title.de_DE);\n\t\t\treturn restricted;\n\t\t}\n\t\t// console.debug('cl unrestricted', clId, clEntry.data.title.de_DE);\n\t\treturn true;\n\t},\n\n\tgetCurrentPatch: (state) => {\n\t\treturn state.patch;\n\t},\n\n\tgetCompanyWhichSeeRecipe: (state, getters, rootState, rootGetters) => {\n\t\tconst baseList = state.baseData || state.listData;\n\t\tconst responsibleOrg = baseList._responsible?.institution;\n\t\tif (responsibleOrg !== rootState.messagecenter.idFiblDE) return [];\n\t\tlet companySeeingRecipe = [];\n\t\tlet relevantCompaniesId = new Set();\n\t\tconst product = new BmlCommon.ProductClass();\n\t\tproduct.fromData({listData: state.loadedData});\n\t\tconst listKeys = Object.keys(product.listData);\n\t\tfor(let i in listKeys) {\n\t\t\tproduct.listData[listKeys[i]]['_companies']?.forEach((data) => {\n\t\t\t\trelevantCompaniesId.add(data.company);\n\t\t\t})\n\t\t}\n\t\tfor (let id of relevantCompaniesId.values()) {\n\t\t\tconst comp = rootGetters['companylist/byId'](id);\n\t\t\tif(comp && product.companyHasAccessToRecipe(comp.id)) {\n\t\t\t\tcompanySeeingRecipe.push({id:comp.id, name: comp.data.baseData.name});\n\t\t\t}\n\t\t}\n\t\treturn companySeeingRecipe;\n\t}\n};\n\nconst actions = {\n\n\tasync init({ state, commit, dispatch, rootGetters }) {\n\t\tcommit('setCurrentRev', null);\n\t\tcommit('setRevData', null);\n\n\t\tif (state.init) return;\n\t\tawait Promise.all([\n\t\t\tdispatch('list/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('field/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('biostandard/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('selectoptions/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('category/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('component/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('hobbygarden/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('checklist/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('permit/loadAll', { ifEmpty: true }, { root: true }),\n\t\t\tdispatch('auth/org/loadAll', { ifEmpty: true }, { root: true })\n\t\t]);\n\t\tlet baseList = rootGetters['list/baseDataList'];\n\t\tlet allLists = rootGetters['auth/user/roles/getAvailableLists'];\n\t\tcommit('setModuleInitialized', { root: baseList, lists: allLists });\n\t},\n\n\tasync save({ state, commit, dispatch, getters }) {\n\t\tlet wk = JSON.parse(JSON.stringify(state.workingCopy));\n\t\tawait EventBus.emit('beforeProductSave', wk, state.currentProductId );\n\t\tlet listSaveFlat = {};\n\t\tlet flatState = flatten(wk);\n\t\tconsole.log('beforesave flag', flatState);\n\t\tObject.keys(flatState).forEach(key => {\n\t\t\tlet baseKey = key.indexOf('.') > -1 ? key.substr(0, key.indexOf('.')) : key;\n\t\t\tconst isRemoteChecklist = baseKey === '_checklist' && !getters.isLocalChecklist(key);\n\t\t\tlet testkey = baseKey === '_components' ? key.substr(0, key.lastIndexOf('.')) : key;\t//remove .de_de or .selectvalue from component paths\n\t\t\tif (state.canLink\n\t\t\t\t&& !(baseKey === '_components' && key.includes('_id'))\n\t\t\t\t&& (baseKey === '_components' && state.baseData && (getters.getLinked(testkey) !== 'direct' || !componentUnlinkableFields.find(field => testkey.includes(field))))\n\t\t\t\t&& (!doNotMergePaths.includes(baseKey) || isRemoteChecklist)\n\t\t\t\t&& getters.canLinkField(baseKey)) return;\n\n\t\t\tif (!state.baseData && !(baseKey in state.linked) && !listOfPathsForDeepLinking.includes(baseKey) && !doNotMergePaths.includes(baseKey)) {\n\t\t\t\tstate.linked[baseKey] = 'direct';\n\t\t\t}\n\t\t\tlistSaveFlat[key] = flatState[key];\n\t\t});\n\t\tif (Object.keys(listSaveFlat).length === 0) {\n\t\t\tconsole.log('list save empty?', { wk, listSaveFlat });\n\t\t\tthrow new Error('refusing to save empty product');\n\t\t}\n\t\tlet listSave = unflatten(listSaveFlat);\n\t\tawait EventBus.emit('beforeProductSaveCleanup', listSave, state.currentProductId );\n\t\t// console.log({ wk, listSave, listSaveFlat });\n\t\t// return;\n\t\tif (!state.attributesetId) {\n\t\t\tlet ec = await getAttributesetByExternalId('products');\n\t\t\tcommit('setAsId', { id: ec.id });\n\t\t}\n\n\n\t\tif (!listSave._linked) {\n\t\t\tlistSave._linked = {};\n\t\t}\n\n\t\tfor (const entry of Object.entries(state.linked)) {\n\t\t\tconst key = entry[0];\n\t\t\tif (key.includes('.')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlistSave._linked[key] = entry[1];\n\t\t}\n\t\tif (listSave._categoryTree && !listSave._category) delete listSave._categoryTree;\n\t\tlet savedData = await syncListData(state.currentProductId, state.currentList.id, listSave, state.attributesetId);\n\t\t// await EventBus.emit('afterProductSaved');\t//not in use\n\t\tcommit('setPatch', savedData.patch);\n\t\tif (!savedData.savedData) {\n\t\t\tcommit('setWorkingCopyHasChanges', false);\n\t\t\treturn;\n\t\t}\n\t\tlet product = await loadProductWithCache(state.currentProductId);\n\t\tcommit('setLoadedList', { full: product.data.listData });\n\t\tcommit('productlist/updateProductList', { id: state.currentProductId, full: product.data.listData }, { root: true });\n\t\tdispatch('switchList', { list: state.currentList.id });\n\n\t\t//reload all related companies\n\t\tconst companySet = new Set();\n\t\tObject.values(product.data.listData).forEach(ld => {\n\t\t\tconst companies = ld._companies || [];\n companies.forEach(c => companySet.add(c.company));\n\t\t});\n\t\tawait dispatch('companylist/reloadByIds', Array.from(companySet), { root: true });\n\t},\n\n\tasync openProduct({ state, commit, rootGetters }, { id, rev }) {\n\t\tif (!state.init) throw new Error('module is not initialized');\n\n\t\tconst product = await loadProduct(id, rev);\n\n\t\tif (rev) {\n\t\t\tcommit('setRevData', product);\n\t\t} else {\n\t\t\tcommit('setRevData', null);\n\t\t}\n\t\tcommit('setCurrentRev', product.rev);\n\n\t\tcommit('productlist/addProduct', product, { root: true });\n\t\tconst data = JSON.parse(JSON.stringify( product.data.listData ));\n\n\t\tconst listIds = Object.keys(product.data.listData);\n\n\t\tlet allLists = rootGetters['list/root'];\n\t\t// const baseList = rootGetters['list/baseDataList'];\n\t\t// let baseResponsible = data[baseList.id] ? data[baseList.id]._responsible : null;\n\t\t// allLists = allLists.filter(l => {\n\t\t// \treturn l.data.isBasedata\n\t\t// \t\t|| rootGetters['auth/user/roles/isResponsibleForProductGiven']({\n\t\t// \t\t\tlistResponsible: data[l.id] ? data[l.id]._responsible : null,\n\t\t// \t\t\tbaseResponsible\n\t\t// \t\t});\n\t\t// });\n\t\tlet lists = listIds.map(id => {\n\t\t\treturn allLists.find(l => l.id === id);\n\t\t}).filter(l => !!l);\n\t\tif (lists.length === 0) {\n\t\t\tlists = [state.rootList];\n\t\t}\n\t\tcommit('changeCurrentProduct', { id, lists });\n\t\tlet list = null;\n\n\t\tfor (const l of lists) {\n\t\t\tif (rootGetters['auth/user/roles/canViewList'](l)) {\n\t\t\t\tlist = l;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!list) {\n\t\t\tlist = lists[0];\n\t\t}\n\t\tcommit('setLoadedList', { full: data });\n\t\tcommit('changeCurrentList', { list });\n\t\tcommit('init', { listData: state.loadedData[list.id] });\n\t\tcommit('setAllLists', { lists: allLists });\n\t},\n\n\tswitchList({ state, commit, rootState }, { list }) {\n\t\tlet listEntity = state.allLists.find(l => l.id === list);\n\t\tif (!listEntity) throw new Error(`invalid list: ${list}`);\n\t\tlet fields = JSON.parse(JSON.stringify(rootState.field.fields));\n\t\tEventBus.emit('beforeSwitchList');\n\t\tcommit('setFields', []);\n\t\tif (!(list in state.loadedData)) {\n\t\t\tcommit('setLoadedList', { list: listEntity, data: {} });\n\t\t}\n\t\tcommit('changeCurrentList', { list: listEntity });\n\t\tlet base = state.rootList.id;\n\t\tif (base === state.currentList.id) {\n\t\t\tcommit('init', { listData: state.loadedData[base] });\n\t\t} else {\n\t\t\tcommit('init', { baseData: state.loadedData[base], listData: state.loadedData[state.currentList.id] });\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\t//this is used to clear all fields for a moment and then re-initialize them,\n\t\t\t//so the fields do not call updateLink and cause a workingCopy change\n\t\t\tcommit('setFields', fields);\n\t\t\tEventBus.emit('afterSwitchList');\n\t\t\tcommit('setWorkingCopyHasChanges', false);\n\t\t}, 0);\n\n\t\tcommit('resetFieldErrors');\n\t},\n\n\tchangeFieldValid({ commit, getters }, { path, valid, message, def=null }) {\n\t\tlet stored = getters.isFieldValid({ path, def });\n\t\tif (stored !== valid) {\n\t\t\tcommit('setFieldValid', { path, valid, message });\n\t\t}\n\t},\n\n\tregisterFieldTest({ dispatch, getters }, { path, test, def=null }) {\n\t\tif (emitter.has(path)) {\n\t\t\temitter.remove(path);\n\t\t\t//console.warn('listener already installed for path', { path });\n\t\t}\n\t\tfunction setStatus(path, valid) {\n\t\t\tlet message;\n\t\t\tif (valid === true) {\n\t\t\t\tmessage = null;\n\t\t\t\tvalid = true;\n\t\t\t} else if (valid === false) {\n\t\t\t\tmessage = 'Pflichtfeld';\n\t\t\t\tvalid = false;\n\t\t\t} else if (typeof valid === 'string') {\n\t\t\t\tmessage = valid;\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdispatch('changeFieldValid', { path, valid, message, def });\n\t\t}\n\t\tconst opts = {\n\t\t\tget: p => getters.getValue(p),\n\t\t\tsetStatus\n\t\t};\n\t\temitter.on(path, (path, value) => {\n\t\t\tlet valid = test(path, value, opts);\n\t\t\tsetStatus(path, valid);\n\t\t});\n\t},\n\n\tupdateLinked({ state, commit, rootGetters }, { path, linked, linkPath }) {\n\t\tif (!linkPath) linkPath = path;\t//linkPath is different with e.g. risklabels\n\t\tlet field = rootGetters['field/byPath'](path);\n\t\tlet value = rootGetters['product/getValue'](path);\n\t\tlet baseContainer;\n\t\tif (linked === 'related-product') {\n\t\t\tif (!rootGetters['productlist/getDerivedProductId']) {\n\t\t\t\tthrow new Error('Trying to link without derived product set.');\n\t\t\t}\n\t\t\tconst derivedProduct = rootGetters['productlist/getDerivedProduct'](state.currentProductId);\n\t\t\tif (!derivedProduct) throw new Error('derivedProduct not loaded');\n\t\t\tconst currentListId = state.currentList.id;\n\t\t\tif (derivedProduct.data.listData[currentListId]) {\n\t\t\t\tbaseContainer = derivedProduct.data.listData[currentListId];\n\t\t\t}\n\t\t} else if (linked === 'basis') {\n\t\t\tlet baseListId = rootGetters['list/baseDataList'].id;\n\t\t\tbaseContainer = state.loadedData[baseListId];\n\t\t}\n\t\tif (linked !== 'direct') {\n\t\t\tlet baseValue;\n\t\t\tif (baseContainer) {\n\t\t\t\tif (path.includes('components')) {\n\t\t\t\t\tbaseValue = value;\n\t\t\t\t} else {\n\t\t\t\t\tbaseValue = traverseToData(baseContainer, path);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (baseValue || typeof baseValue === 'boolean') {\n\t\t\t\tvalue = baseValue;\n\t\t\t} else if (field) {\n\t\t\t\tvalue = rootGetters['field/getDefaultValue'](field.id);\n\t\t\t} else {\n\t\t\t\tvalue = undefined;\n\t\t\t}\n\t\t\tif (typeof value === 'object') value = JSON.parse(JSON.stringify(value));\n\t\t\tcommit('updateField', { path, value });\n\t\t}\n\t\tcommit('updateLink', { path: linkPath, linked });\n\t}\n};\n\nconst mutations = {\n\t/**\n\t * for eu list call without baseData\n\t * for other lists call with eu list as baseData\n\t **/\n\tinit(state, { baseData, listData }) {\n\t\tif (!listData) listData = {};\n\t\tstate.baseData = baseData;\n\t\tstate.listData = listData;\n\t\tconst w = {};\n\t\tstate.linked = listData._linked ? JSON.parse(JSON.stringify(listData._linked)) : {};\n\t\tinitializeWorkingCopy(state.baseData, state.listData, state.linked, w);\n\t\tstate.workingCopy = w;\n\t\tstate.workingCopyHasChanges = false;\n\t\tEventBus.emit('afterWorkingCopyInit');\n\t},\n\n\tsetAsId(state, { id }) {\n\t\tstate.attributesetId = id;\n\t},\n\n\tsetFields(state, f) {\n\t\tstate.fields = f;\n\t},\n\n\tupdateField(state, { path, value, noChange }) {\n\t\t// console.log('updateField', { path, value, noChange });\n\t\tlet parts = path.split('.');\n\t\tlet noChangeInt = deepSet(state.workingCopy, parts, value);\n\t\tnoChange = noChange || noChangeInt;\n\t\tif (!noChange) {\n\t\t\tstate.workingCopyHasChanges = true;\n\t\t}\n\t\temitter.emitAll(path, value);\n\t},\n\n\tsetFieldValid(state, { path, valid, message }) {\n\t\tlet parts = path.split('.');\n\t\tdeepSet(state.fieldErrors, parts, valid ? true : message);\n\t},\n\n\tupdateLink(state, { path, linked }) {\n\t\t// console.log('updateLink', path, linked);\n\t\tpath = sanitizeLinkPath(path);\n\t\tif (state.linked[path] === linked) return;\n\t\tVue.set(state.linked, path, linked);\n\t\tstate.workingCopyHasChanges = true;\n\t},\n\n\tremoveTableRow(state, { key, row }) {\n\t\tlet parts = key.split('.');\n\t\tlet list = deepGet(state.workingCopy, parts);\n\t\tlist.splice(row, 1);\n\t\tstate.workingCopyHasChanges = true;\n\t\tlet validList = deepGet(state.fieldErrors, parts);\n\t\tif (Array.isArray(validList)) {\n\t\t\tvalidList.splice(row, 1);\n\t\t}\n\t\temitter.emitAll(key, list);\n\t},\n\n\tremoveComponentRow(state, { group, id }) {\n\t\tconst path = ['_components', group, id];\n\t\tdeepSet(state.workingCopy, path, null);\n\t\tif (id in state.fieldErrors._components?.[group]) {\n\t\t\tdelete state.fieldErrors._components[group][id];\n\t\t}\n\t\tstate.workingCopyHasChanges = true;\n\t\temitter.emitAll(path.join('.'), value);\n\t},\n\n\tsetListArchived(state, { listId, archived }) {\n\t\tlet entity = state.loadedData[listId];\n\t\tif (!entity) {\n\t\t\treturn;\n\t\t}\n\n\t\tVue.set(entity, '_archived', archived);\n\t},\n\n\tsetLoadedList(state, { list, data, full }) {\n\t\tif (full) {\n\t\t\tstate.loadedData = full;\n\t\t} else {\n\t\t\tif (!list.id) throw new Error(`expected list object, got ${JSON.stringify(list)}`);\n\t\t\tVue.set(state.loadedData, list.id, data);\n\t\t}\n\t},\n\n\tchangeCurrentList(state, { list }) {\n\t\tif (!list.id) throw new Error(`expected list object, got ${JSON.stringify(list)}`);\n\t\tstate.currentList = list;\n\t\tconst ld = state.loadedData[list.id];\n\t\tstate.listHasCompaniesOnOpening = !!ld._companies?.length;\n\t},\n\n\tchangeCurrentProduct(state, { id, lists }) {\n\t\tif (!Array.isArray(lists)) throw new Error('expected array of lists');\n\t\tstate.currentProductId = id;\n\t\tstate.lists = lists;\n\t\tstate.currentList = lists[0];\n\t\tif (!state.currentList.id) throw new Error(`expected list object, got ${JSON.stringify(state.currentList)}`);\n\t\tstate.loadedData = {};\n\t},\n\n\tsetRevData(state, product) {\n\t\tstate.rev = product;\n\t},\n\n\tsetCurrentRev(state, revNo) {\n\t\tstate.revNo = revNo;\n\t},\n\n\tsetModuleInitialized(state, { root, lists }) {\n\t\tstate.init = true;\n\t\tstate.rootList = root;\n\t\tstate.allLists = lists;\n\t},\n\n\tsetAllLists(state, { lists }) {\n\t\tstate.allLists = lists;\n\t},\n\n\taddList(state, { listId }) {\n\t\tif (state.lists.find(l => l.id === listId)) throw new Error(`already exists: ${listId}`);\n\t\tlet list = state.allLists.find(l => l.id === listId);\n\t\tif (!list) throw new Error(`invalid listId: ${listId}`);\n\t\tstate.lists.push(list);\n\t\tstate.workingCopyHasChanges = true;\n\t},\n\n\tsetWorkingCopyHasChanges(state, workingCopyHasChanges) {\n\t\tstate.workingCopyHasChanges = workingCopyHasChanges;\n\t},\n\n\tresetFieldErrors(state) {\n\t\tstate.fieldErrors = {};\n\t},\n\n\tcloseProduct(state) {\n\t\tstate.currentList = null;\n\t\tstate.currentProductId = '';\n\t\tstate.rev = null;\n\t\tstate.revNo = null;\n\t},\n\n\tupdateListCacheForApproal(state, { productListData }) {\n\t\tfor (const [currentKey, currentListData] of Object.entries(productListData)) {\n\t\t\tif (state.loadedData[currentKey]) state.loadedData[currentKey]._approval = currentListData._approval;\n\t\t}\n\t},\n\n\tsetPatch(state, patch) {\n\t\tstate.patch = patch;\n\t},\n};\n\nexport default {\n\tnamespaced: true,\n\tmodules,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { toLocale, toSortable } from '@/plugins/filters.js';\n\nexport function traverseToData(container, path) {\n\tlet parts = path.split('.');\n\tlet v = container;\n\tfor (let i=0, ii=parts.length; i entry.data.showInTabs.includes(tab))) return false;\n\t}\n\tif (entry.data.listRestrict && entry.data.listRestrict.length && currentListId && !entry.data.listRestrict.includes(currentListId)) {\n\t\treturn false;\n\t}\n\tif (entry.data.categoryRestrict && entry.data.categoryRestrict.length\n\t\t&& (!currentCategory || !entry.data.categoryRestrict.includes(currentCategory.id))) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nconst state = {\n\n\n};\n\nconst getters = {\n\n\tgetChecklistEntries: (state, getters, rootState, rootGetters) => ({ tabs, onlyOptionals, forCompany }) => {\n\t\t// console.log('getChecklistEntries', { tabs, onlyOptionals, forCompany });\n\t\treturn rootState.checklist.entries.filter(entry => {\n\t\t\tif (!entry.data.active) return false;\n\t\t\tif (!forCompany) {\n\t\t\t\t//filter out wrong tabs\n\t\t\t\tif (!checkEntry(entry, rootState.product.currentList?.id, rootGetters['product/display/getSelectedMainCategory'], tabs)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (entry.data.modus === 'company') return false;\n\t\t\t} else if (entry.data.modus !== 'company') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// use onlyOptionals to get the display list for the optionals selection dialogue\n\t\t\tif (onlyOptionals && entry.data.isOptional) {\n\t\t\t\tif (!forCompany && (entry.data.modus === 'default' || rootGetters['product/isBaseList'])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (forCompany && entry.data.modus === 'company') return true;\n\t\t\t}\n\t\t\tif (!onlyOptionals) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\n\t\t}).sort((a, b) => {\n\t\t\tlet va = toSortable(toLocale(a.data.title));\n\t\t\tlet vb = toSortable(toLocale(b.data.title));\n\t\t\treturn va > vb ? 1 : -1;\n\t\t});\n\t},\n\n\tgetChecklistApprovalStatus: (state, getters, rootState, rootGetters) => {\n\t\tconst checklistData = rootGetters['product/getValue']('_checklist');\n\t\tconst companyLinks = rootGetters['product/getValue']('_companies');\n\t\tconst relevantProductChecklists = getters.getChecklistEntries({ forCompany: false }).filter(e => e.data.mandatory);\n\t\tlet baseChecklistData = {};\n\t\tif (rootState.product.baseData) {\n\t\t\tbaseChecklistData = traverseToData(rootState.product.baseData, '_checklist');\n\t\t}\n\t\tconst isBaseList = rootGetters['product/isBaseList'];\n\t\tconst uncheckedEntries = [];\n\t\tfunction addProblem(cl) {\n\t\t\tuncheckedEntries.push(toLocale(cl.data.title));\n\t\t}\n\t\tfunction checkData(cl, rowData) {\n\t\t\tif (!rowData) {\n\t\t\t\tif (!cl.data.isOptional) addProblem(cl);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet status = cl.data.options.find(o => o.id === rowData.status);\n\t\t\tif (!status.okay) {\n\t\t\t\taddProblem(cl);\n\t\t\t}\n\t\t}\n\t\tfor (let cl of relevantProductChecklists) {\n\t\t\tlet rowData = null;\n\t\t\tif (cl.data.modus === 'reference' && !isBaseList) {\n\t\t\t\tif (cl.id in baseChecklistData) {\n\t\t\t\t\trowData = baseChecklistData[cl.id];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trowData = checklistData[cl.id];\n\t\t\t}\n\t\t\tcheckData(cl, rowData);\n\t\t}\n\t\tlet distributor = Array.isArray(companyLinks) ? companyLinks.find(e => e.role === 'distributor') : null;\n\t\tlet distributorId = distributor ? distributor.company : null;\n\t\tlet company = rootGetters['companylist/byId'](distributorId);\n\t\tif (company) {\n\t\t\tconst relevantCompanyChecklists = getters.getChecklistEntries({ forCompany: true }).filter(e => e.data.mandatory);\n\t\t\tfor (let cl of relevantCompanyChecklists) {\n\t\t\t\tif (!checkEntry(cl, rootState.product.currentList.id, rootGetters['product/display/getSelectedMainCategory'])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlet rowData = company.data._checklist ? company.data._checklist[cl.id] : null;\n\t\t\t\tcheckData(cl, rowData);\n\t\t\t}\n\t\t}\n\t\treturn uncheckedEntries;\n\t}\n};\n\nconst actions = {\n\n\n};\n\nconst mutations = {\n\n\n};\n\nexport default {\n\tnamespaced: false,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { getProductTitle } from '@/util/field-helper';\nimport { toLocale, booleanDisplay, invoiceFlagDisplay, toDateTimeFormat } from '@/plugins/filters';\nimport { getProductColumnValue, pathToColumnSet, columnSetToPath, getValueFromForeignObject, replaceLineBreaksWithSeparator } from '@/util/search/columnset';\nimport { generateSortFields } from '@/util/search/sort-util';\nimport { constructSelectionFilter } from '@/util/search/query-generator';\nimport { searchCursorWithGenerator } from '@/repository/system';\nimport { loadProduct, countProducts, getProductTimeline } from '@/repository/product';\nimport { i18n } from '@/main';\nimport { deepGet } from '@/util/field-helper.js';\nimport { chunk } from 'lodash';\nimport { mergeListAndBase } from '../product';\n\nconst DESTRUCTIBLE_FIELDS = [{\n\tkeyMapping: 'category',\n\tpath: '_categoryTree',\n\tsearchPath: '_category',\n\tgetter: 'category/pathToRootOrdered',\n\tmultiGetter: 'category/byIds',\n\tsingleGetter: 'category/byId',\n\tmaxColumnCount: 5,\n\tdisplayValues: ['title', 'order']\n}];\n\nconst BATCH_SIZE = 5;\n\nfunction _insertArrayAt(array, index, arrayToInsert) {\n\tArray.prototype.splice.apply(array, [index, 0].concat(arrayToInsert));\n\treturn array;\n}\n\nconst INVOICE_FIELDS = [\n\t{\n\t\tkey: 'invoiceFlag'\n\t},\n\t{\n\t\tkey: 'invoiceFlagDate'\n\t}\n];\n\nfunction _getProductsWithFlag(products, invoiceFlag) {\n\treturn products.filter(f => f.data.invoiceFlags && f.data.invoiceFlags[invoiceFlag]);\n}\n\nconst state = {\n\tfields: [],\n\tfinalFields: [],\n\tcompanyCache: [],\n\ttimelines: {},\n\texportLanguage: null\n};\n\nfunction getColumn(columnset, index) {\n\treturn columnset.data.configuration.columns[index];\n}\n\nexport function constructSheet(headers, rows) {\n\tlet sheet = [];\n\tfor (const row of rows) {\n\t\tlet rowObj = {};\n\t\tfor (const header of headers) {\n\t\t\tconst value = row[header.key];\n\t\t\trowObj[header.label] = value || '';\n\t\t}\n\n\t\tsheet.push(rowObj);\n\t}\n\n\treturn sheet;\n}\n\n/**\n * Unwraps a package column to the corresponding subcolumns.\n * @param fieldId\n * @returns {*[]}\n * @private\n */\nfunction _unwrapPackage(getters, fieldId) {\n\tconst field = getters['exportset/fieldById'](fieldId);\n\tif (!field || !field.data.isPackage) {\n\t\treturn [];\n\t}\n\n\tconst subColumns = getters['exportset/fieldsByParent'](field.id);\n\treturn subColumns;\n}\n\nfunction _unwrapSinglePackageField(columnSet, parentField, subField, parentKey) {\n\t// inject data source of parent into the sub field.\n\tconst subFieldCopy = JSON.parse(JSON.stringify(subField));\n\n\tif (parentField.data.filter) {\n\t\t// we furthermore need to apply the option source to the fields.\n\t\tsubFieldCopy.data.exportSource = parentField.data.foreignKeySource;\n\n\t\t// the getProductColumnValue function might now be able to extract\n\t\t// the corresponding company id from the product and\n\t\t// fetch the foreign key data from the cache.\n\t\t// this can be used to extract the actual value from the foreign key data.\n\n\t\tconst currentSet = JSON.parse(JSON.stringify(columnSet));\n\t\tcurrentSet.subFieldId = subField.id;\n\t\tsubFieldCopy.data.pathInternal = columnSetToPath(currentSet);\n\t\tsubFieldCopy.data.path = subField.data.pathPrefix ? `${subField.data.pathPrefix}.${subField.data.path}` : subField.data.path;\n\t\tsubFieldCopy.key = subFieldCopy.data.pathInternal;\n\t\tsubFieldCopy.data.isPackageField = true;\n\t} else {\n\t\tsubFieldCopy.key = subFieldCopy.id;\n\t}\n\n\tsubFieldCopy.data.applyFilter = !!parentField.data.listRows;\n\n\tif (parentField.data.filter) {\n\t\t// copy root filter to be applied onto the row source\n\t\tsubFieldCopy.data.rootRowFilter = parentField.data.filter;\n\n\t\tif (!subField.data.filter) {\n\t\t\t// copy the parent filter to the current element.\n\t\t\tsubFieldCopy.data.filter = parentField.data.filter;\n\t\t}\n\n\t\tif (parentKey) {\n\t\t\tconst parentSet = pathToColumnSet(parentKey);\n\t\t\tsubFieldCopy.data.rootRowFilter.filterValue = parentSet.packageFilter;\n\t\t}\n\t}\n\n\treturn subFieldCopy;\n}\n\nfunction _destructureRows(row, product, listId, fieldKey, getters) {\n\tconst _cloneRow = function(row) {\n\t\treturn JSON.parse(JSON.stringify(row));\n\t};\n\n\t// assume there is only 1 top-level root element selected\n\tconst _findDiffingSubtrees = function(treeData, getters, fieldMapping) {\n\t\tconst _getTreeStructure = function() {\n\t\t\tconst objectData = JSON.parse(JSON.stringify(getters[fieldMapping.multiGetter](treeData)));\n\t\t\treturn objectData;\n\t\t};\n\n\t\tconst _buildSubtrees = function(leafs) {\n\t\t\tconst subtrees = [];\n\t\t\tfor (const leaf of leafs) {\n\t\t\t\tconst pathToRoot = getters[fieldMapping.getter](leaf.id);\n\t\t\t\tif (pathToRoot) {\n\t\t\t\t\tconst currentSubtree = [];\n\t\t\t\t\tfor (let idx = Object.keys(pathToRoot).length - 1; idx >= 0; idx--) {\n\t\t\t\t\t\tcurrentSubtree.push(pathToRoot[idx]);\n\t\t\t\t\t}\n\n\t\t\t\t\tsubtrees.push(currentSubtree);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn subtrees;\n\t\t};\n\n\t\tconst tree = _getTreeStructure(treeData);\n\t\treturn _buildSubtrees(tree);\n\t};\n\n\tconst rowResults = [];\n\n\tconst columnset = pathToColumnSet(fieldKey);\n\tif (!columnset) {\n\t\treturn [];\n\t}\n\n\tconst fieldMapping = DESTRUCTIBLE_FIELDS.find(f => f.path === columnset.fieldId);\n\tif (!fieldMapping) {\n\t\treturn [];\n\t}\n\n\tconst baseListId = getters['list/baseDataList'].id;\n\tlet listData = product.data.listData[listId];\n\tlet baseData = product.data.listData[baseListId];\n\tlet mergedData = listData && baseData ? mergeListAndBase(listData, baseData) : baseData;\n\tconst values = deepGet(mergedData, fieldMapping.searchPath.split('.'));\n\n\t// 1) find an array of subtrees based on the current input data\n\tconst subTrees = _findDiffingSubtrees(values, getters, fieldMapping);\n\n\t// for each subtree parent, generate a new row following the rule:\n\t// create an n-ary array where each array contains the elements of the current leaf-to-root path\n\n\t// 2) create a new row per entry in the n-ary array and override the field value by the current iterator value\n\tfor (const subTree of subTrees) {\n\t\t// 3.n) push the row to the result array\n\t\tconst newRow = _cloneRow(row);\n\n\t\t// cleanup source columns\n\t\tfor (let i = 0; i < fieldMapping.maxColumnCount; ++i) {\n\t\t\tnewRow[fieldKey + (i + 1)] = '';\n\t\t}\n\n\t\tlet idx = 1;\n\t\tconst fieldCount = fieldMapping.displayValues ? fieldMapping.displayValues.length : 1;\n\t\tconst maxCount = fieldCount * fieldMapping.maxColumnCount;\n\t\tconst displayValues = fieldMapping.displayValues || [ 'title' ];\n\n\t\tfor (const subtreeEntry of subTree) {\n\t\t\tfor (let displayIndex = 0; displayIndex < fieldCount; ++displayIndex) {\n\t\t\t\tconst displayValue = displayValues[displayIndex];\n\t\t\t\tconst path = `${fieldKey}/${displayValue}/${idx}`;\n\t\t\t\tnewRow[path] = toLocale(subtreeEntry.data[displayValues[displayIndex]]);\n\t\t\t}\n\n\t\t\t++idx;\n\n\t\t\tif (idx > maxCount) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\trowResults.push(newRow);\n\t}\n\n\treturn rowResults;\n}\n\nfunction filterArchivedLists(products) {\n\tfor (let product of products) {\n\t\tif (product.data.listData) {\n\t\t\tfor (let [listId, listData] of Object.entries(product.data.listData)) {\n\t\t\t\tif (listData._archived && typeof listData._archived === 'boolean') {\n\t\t\t\t\tdelete product.data.listData[listId];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn products.filter(product => !!Object.keys(product.data.listData).length);\n}\n\nconst getters = {\n\tgetFields: (state) => {\n\t\treturn state.fields;\n\t},\n\tgetFinalFields: (state) => {\n\t\treturn state.finalFields;\n\t},\n\tgetFinalFieldsWithExpandedCategory: (state) => {\n\t\tlet base = state.finalFields;\n\t\tlet idx = base.findIndex(e => e.id === 'category');\n\t\tif (idx < 0) return base;\n\t\tlet fields = base.slice(0);\n\t\tlet catField = JSON.stringify(base[idx]);\n\t\tlet newFields = [];\n\t\tfor (let i=1; i<=5; i++) {\n\t\t\tlet copy = JSON.parse(catField);\n\t\t\tcopy.key += `/title/${i}`;\n\t\t\tcopy.label += ` ${i18n.t('product.search.export.packageColumns.category.title')} ${i}`;\n\t\t\tnewFields.push(copy);\n\t\t\tcopy = JSON.parse(catField);\n\t\t\tcopy.key += `/order/${i}`;\n\t\t\tcopy.label += ` ${i18n.t('product.search.export.packageColumns.category.number')} ${i}`;\n\t\t\tnewFields.push(copy);\n\t\t}\n\t\tfields.splice(idx, 1, ...newFields);\n\t\treturn fields;\n\t}\n};\n\nconst actions = {\n\t// generates the list of companies that are actually needed for an given set of products\n\tasync _createCompanyCache({ commit, dispatch }, products) {\n\t\tconst uniqueIds = new Set();\n\t\tfor (const product of products) {\n\t\t\tfor (const listData of Object.values(product.data.listData)) {\n\t\t\t\tif (!('_companies' in listData)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlistData._companies.forEach(f => uniqueIds.add(f.company));\n\t\t\t}\n\t\t}\n\t\tconst companies = await dispatch('companylist/loadByIds', Array.from(uniqueIds), { root: true });\n\t\tcommit('setCompanyCache', companies);\n\t},\n\n\tasync _loadProductsByInvoiceFlag(_, { products, invoiceFlag }) {\n\t\tif (!invoiceFlag) {\n\t\t\treturn products;\n\t\t}\n\n\t\tlet productData = [];\n\t\tconst batches = chunk(products, BATCH_SIZE);\n\n\t\tasync function _loadAndAddProduct(productId, revision) {\n\t\t\tconst product = await loadProduct(productId, revision);\n\t\t\tproductData.push(product);\n\t\t}\n\n\t\tfor (const batch of batches) {\n\t\t\tconst promises = [];\n\t\t\tconst productsWithFlag = _getProductsWithFlag(batch, invoiceFlag);\n\n\t\t\tfor (const product of productsWithFlag) {\n\t\t\t\tconst revision = product.data.invoiceFlags[invoiceFlag];\n\t\t\t\tpromises.push(_loadAndAddProduct(product.id, revision));\n\t\t\t}\n\n\t\t\tawait Promise.all(promises);\n\t\t}\n\n\t\treturn productData;\n\t},\n\n\tloadCount({ rootGetters }) {\n\t\tconst filter = rootGetters['search/getSearchFilter'];\n\t\treturn countProducts(filter);\n\t},\n\n\tasync loadExportHeader({ commit, getters, state, rootGetters, dispatch }, { invoiceFlag }) {\n\t\tif (invoiceFlag) {\n\t\t\t// we need to make sure we can display the invoice flag description text in an additional column.\n\t\t\tawait dispatch('selectoptions/loadAll', { ifEmpty: true }, { root: true });\n\t\t}\n\n\t\t// the company cache contains all companies ever used in the set of products to be exported.\n\t\tconst fields = state.fields;\n\t\tconst columnset = rootGetters['exportset/getSelectedColumnSet'];\n\n\t\t// unwrap packages\n\t\tconst allFields = JSON.parse(JSON.stringify(fields));\n\t\tlet colIdx = 0;\n\n\t\tconst headersToExpand = new Map();\n\t\tfor (const field of fields) {\n\t\t\tconst fieldData = rootGetters['exportset/fieldById'](field.id);\n\t\t\t// convert any given package field into a set of subsequential sub fields\n\t\t\tif (fieldData && field.key !== 'name') {\n\t\t\t\tconst parentPath = getColumn(columnset, colIdx - 1);\n\t\t\t\tif (!parentPath) {\n\t\t\t\t\t++colIdx;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst currentColumnSet = pathToColumnSet(parentPath);\n\n\t\t\t\tif (fieldData.data.isPackage && fieldData.data.children) {\n\t\t\t\t\t// if necessary, get the child package fields\n\t\t\t\t\tconst subColumns = _unwrapPackage(rootGetters, fieldData.id);\n\t\t\t\t\t// console.log('unwrapped subcols', subColumns);\n\t\t\t\t\t// push all child fields with their corresponding filters at the current pointer\n\t\t\t\t\tsubColumns.forEach(subColumn => {\n\t\t\t\t\t\tif (!allFields.find(currentField => currentField.label === subColumn.label)) {\n\t\t\t\t\t\t\tallFields.push(_unwrapSinglePackageField(currentColumnSet, fieldData, subColumn, field.key));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.warn('duplicate label', subColumn.label);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// remove the parent (package field) from the list of all fields\n\t\t\t\t\tallFields.splice(colIdx, 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++colIdx;\n\t\t}\n\n\t\t// insert additional fields.\n\t\tif (invoiceFlag) {\n\t\t\tfor (let invoiceField of INVOICE_FIELDS) {\n\t\t\t\tinvoiceField.label = i18n.t(`product.search.export.invoiceFlag.${invoiceField.key}`);\n\t\t\t}\n\n\t\t\t_insertArrayAt(allFields, 1, INVOICE_FIELDS);\n\t\t}\n\n\t\t// commit all fields we'll finally need to display\n\t\t// those are:\n\t\t// * default fields (selected in the export set)\n\t\t// * invoice flag fields (if option was selected)\n\t\t// * package subfields with their corresponding filter data\n\t\tcommit('setFinalFields', allFields);\n\n\t\t// generate additional header columns\n\t\tfor (const [key, length] of headersToExpand) {\n\t\t\tcommit('expandHeaders', { key, length });\n\t\t}\n\t\treturn getters.getFinalFieldsWithExpandedCategory.map(f => replaceLineBreaksWithSeparator(f.label));\n\t},\n\n\tasync* loadExportRow({ rootState, state, rootGetters, getters, dispatch }, { invoiceFlag, outputRevision }) {\n\n\t\t// the company cache contains all companies ever used in the set of products to be exported.\n\t\tconst fields = state.fields;\n\t\tconst columnset = rootGetters['exportset/getSelectedColumnSet'];\n\n\t\t// check if an given default column (revision, created, ...) was checked for displaying\n\t\tconst hasColumn = function(column) {\n\t\t\treturn !!fields.find(f => f.key === column);\n\t\t};\n\n\t\tlet websiteKey = '';\n\n\n\t\tconst headersToExpand = new Map();\n\n\t\tconst allFields = state.finalFields;\n\t\tconst countAll = await dispatch('loadCount');\n\t\tlet loadCache = [];\n\t\tlet loadLimit = 250;\n\n\t\tconst productSelection = rootState.search.selection;\n\t\tconst productFilter = constructSelectionFilter(rootGetters['search/getSearchFilter'], productSelection);\n\t\tconst sorting = rootGetters['productlist/getSort'];\n\t\tlet sortObj = sorting ? sorting : state.sort;\n\t\tsortObj = generateSortFields(sortObj);\n\t\tif (!sortObj.length) sortObj = null;\n\t\tconst productGenerator = searchCursorWithGenerator(null, productFilter, 'POST', 'bml/product/search', sortObj);\n\t\tlet doneLoading = false;\n\t\tconst loadProductBatch = async() => {\n\t\t\tlet products = [];\n\t\t\tfor (let i=0; i {\n\t\t\t// console.log('toRow', result, state.finalFields);\n\t\t\treturn getters.getFinalFieldsWithExpandedCategory.map(f => {\n\t\t\t\tlet v = result[f.key] || '';\n\t\t\t\treturn v;\n\t\t\t});\n\t\t};\n\n\t\t// iterate over each products and extract the row data depending on the current field data\n\t\tfor (let i=0; i {\n\t\t\t\t\tlet listFallback = rootState.base.fallbackLocale;\n\t\t\t\t\tif (currentSet.listId) {\n\t\t\t\t\t\tlet list = rootGetters['list/byId'](currentSet.listId);\n\t\t\t\t\t\tif (list && list.data.fallbackLanguage) {\n\t\t\t\t\t\t\tlistFallback = list.data.fallbackLanguage;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn listFallback;\n\t\t\t\t};\n\t\t\t\t// package fields, like company data, need to resolve the foreign object (for example product -> company)\n\t\t\t\tif (field.data && field.data.isPackageField) {\n\t\t\t\t\t// pathInternal is used to prevent duplicated paths in our list of possible columns\n\t\t\t\t\tcurrentSet = pathToColumnSet(field.data.pathInternal, true);\n\t\t\t\t\tlet listFallbackLanguage = loadFallbackLanguage(currentSet);\n\t\t\t\t\t// extract the value and append it to the current column.\n\t\t\t\t\t// the parameters get resolved from the package-fields json description\n\t\t\t\t\t// @todo: some of the filters depend on the IDs as there was no other unique identifier available. this is dangerous.\n\t\t\t\t\tval = toLocale(getValueFromForeignObject(product, currentSet, field.data.exportSource, field.data.rootRowFilter, field.data.rootRowFilter.filterValue,\n\t\t\t\t\t\tfield.data.path, field.data.applyFilter, field.data.filter, field.data.optionSource), null, listFallbackLanguage);\n\t\t\t\t\tif (field.key in row) {\n\t\t\t\t\t\tconsole.log('Doublicated field in export config. Field name is: ', field.key);\n\t\t\t\t\t}\n\t\t\t\t\tif (field.data.override && field.data.override.substituteField) {\n\t\t\t\t\t\tlet newField = field.data.override.substituteField;\n\t\t\t\t\t\tlet overrideValue = toLocale(getValueFromForeignObject(\n\t\t\t\t\t\t\tproduct,\n\t\t\t\t\t\t\tcurrentSet,\n\t\t\t\t\t\t\tfield.data.exportSource,\n\t\t\t\t\t\t\tfield.data.rootRowFilter,\n\t\t\t\t\t\t\tfield.data.rootRowFilter.filterValue,\n\t\t\t\t\t\t\tnewField.data.path,\n\t\t\t\t\t\t\tfield.data.applyFilter,\n\t\t\t\t\t\t\tnewField.data.filter,\n\t\t\t\t\t\t\tfield.data.optionSource\n\t\t\t\t\t\t), null, listFallbackLanguage);\n\t\t\t\t\t\tif (overrideValue && overrideValue !== '---') {\n\t\t\t\t\t\t\trow[field.key] = overrideValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trow[field.key] = val;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\trow[field.key] = val;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst currentSetIndex = columnset.data.configuration.columns.findIndex(f => f === field.key);\n\t\t\t\t\tif (currentSetIndex === -1) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentSet = pathToColumnSet(getColumn(columnset, currentSetIndex));\n\t\t\t\t\tlet listFallbackLanguage = loadFallbackLanguage(currentSet);\n\n\t\t\t\t\t// in any other case, just extract the product column value like in the product list\n\t\t\t\t\tval = toLocale(getProductColumnValue(product, currentSet, true), null, listFallbackLanguage);\n\n\t\t\t\t\t// do some additional post-processing, if necessary\n\n\t\t\t\t\t// used to split categories into sub-fields\n\t\t\t\t\tif (field.splitArray) {\n\t\t\t\t\t\tlet separatedValues = val.split(';');\n\n\t\t\t\t\t\tif (field.reverseValues) {\n\t\t\t\t\t\t\tseparatedValues = separatedValues.reverse();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// use only n values, if there is a maximum amount of columns provided for the corresponding field\n\t\t\t\t\t\tif (field.maxColumns && separatedValues.length >= field.maxColumns) {\n\t\t\t\t\t\t\tseparatedValues = separatedValues.slice(0, field.maxColumns);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// create the actual column values\n\t\t\t\t\t\tfor (let i = 0; i < separatedValues.length; ++i) {\n\t\t\t\t\t\t\trow[field.key + (i + 1)] = separatedValues[i].trim();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// convert a single header column into a list of n (maximum provided)\n\t\t\t\t\t\t// or arbitrary amount of columns. this just prepares an map that stores\n\t\t\t\t\t\t// the maximum amount of columns for any given key (e. g. _categories)\n\t\t\t\t\t\tconst maxHeaderLength = headersToExpand.get(field.key);\n\t\t\t\t\t\tif (!maxHeaderLength) {\n\t\t\t\t\t\t\tlet newCount = separatedValues.length;\n\t\t\t\t\t\t\tconst fieldMapping = DESTRUCTIBLE_FIELDS.find(f => f.keyMapping === field.id);\n\t\t\t\t\t\t\tif (fieldMapping && fieldMapping.maxColumnCount) {\n\t\t\t\t\t\t\t\tconst displayValuesCount = fieldMapping.displayValues ? fieldMapping.displayValues.length : 1;\n\t\t\t\t\t\t\t\tnewCount = fieldMapping.maxColumnCount * displayValuesCount;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\theadersToExpand.set(field.key, newCount);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (field.key in row) {\n\t\t\t\t\t\t\tconsole.log('Doublicated field in export config. Field name is: ', field.key);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trow[field.key] = val;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfield.listId = currentSet.listId;\n\n\t\t\t\t// BML-607 copy website from basis to address data if empty\n\t\t\t\tif (field.id === 'website' && val) {\n\t\t\t\t\twebsiteKey = field.key;\n\t\t\t\t}\n\t\t\t\tif (field.id === 'websiteAddress' && val === '---' && websiteKey) {\n\t\t\t\t\trow[field.key] = row[websiteKey];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet isSplit = false;\n\t\t\t// all fields have been processed, now split the rows, if neccessary\n\t\t\t// this is necessary as tree columns like _categories need to be separated\n\t\t\t// so that any sub-tree gets shown as additional product row.\n\t\t\t// this basically replaces a single product row with n product rows\n\t\t\t// whereas n = count of sub-trees\n\t\t\tfor (const field of allFields) {\n\t\t\t\tif ((!field.data || !field.data.isPackageField) && field.splitArray && field.splitRows) {\n\t\t\t\t\tconst newRows = _destructureRows(row, product, field.listId, field.key, rootGetters);\n\t\t\t\t\tfor (let row of newRows) {\n\t\t\t\t\t\tyield toRow(row);\n\t\t\t\t\t}\n\t\t\t\t\tisSplit = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isSplit) {\n\t\t\t\tyield toRow(row);\n\t\t\t}\n\t\t}\n\n\t},\n\n\n};\n\nconst mutations = {\n\tsetFields(state, fields) {\n\t\tstate.fields = fields.filter(f => f.key !== 'actions' && f.key !== 'check');\n\t},\n\tsetTimelines(state, timelines) {\n\t\tstate.timelines = timelines;\n\t},\n\tsetFinalFields(state, fields) {\n\t\tstate.finalFields = fields;\n\t},\n\tsetCompanyCache(state, companies) {\n\t\tstate.companyCache = companies;\n\t},\n\tsetExportLanguage(state, language) {\n\t\tstate.exportLanguage = language;\n\t},\n\texpandHeaders(state, { key, length }) {\n\t\t// Creates the header-columns for cases where we need n*m separate columns where n = amount of columns per field (e. g. category 1-5) and m = count of subcolumns (e. g. title, number, ...)\n\t\tconst _getColumnTitle = function(id, displayValue, index) {\n\t\t\t// columns titles are formatted with the current index as suffix\n\t\t\treturn `${i18n.t(`product.search.export.packageColumns.${id}.${displayValue}`)} ${index}`;\n\t\t};\n\n\t\tconst baseIndex = state.finalFields.findIndex(f => f.key === key);\n\n\t\t// insert n copies with separate key and title\n\t\tconst baseField = state.finalFields[baseIndex];\n\t\tconst newElements = [];\n\t\tconsole.log('expandHeaders', baseField);\n\t\tconst fieldMapping = DESTRUCTIBLE_FIELDS.find(f => f.keyMapping === baseField.id);\n\t\tconst displayValues = fieldMapping.displayValues || [ 'title' ];\n\t\tconst fieldCount = displayValues.length;\n\n\t\tfor (let i = 0; i < length / fieldCount; ++i) {\n\t\t\tfor (let j = 0; j < fieldCount; ++j) {\n\t\t\t\tconst newField = JSON.parse(JSON.stringify(baseField));\n\t\t\t\tconst displayValue = displayValues[j];\n\t\t\t\tnewField.key += `/${displayValue}/${i + 1}`;\n\t\t\t\tnewField.label += ` ${_getColumnTitle(newField.id, displayValue, i + 1)}`;\n\t\t\t\tnewElements.push(newField);\n\t\t\t}\n\t\t}\n\n\t\tstate.finalFields.splice(baseIndex, 1);\n\t\t_insertArrayAt(state.finalFields, baseIndex, newElements);\n\t}\n};\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import { getProductTimeline } from '@/repository/product.js';\nimport flatten, { unflatten } from 'flat';\nimport { i18n } from '@/main';\nimport { toDateTimeFormat } from '../../../plugins/filters';\n\nconst PATH_FILTER = ['indexData', 'componentIndex', '_system', 'approvalHistory', '_nameHistory', '_linked', '_id'];\nconst BASE_PATHS = ['invoiceFlags', 'isNationalPartner', 'isNationalPartnerInitial'];\n\nexport function unrollEntries(list) {\n\tlist.forEach(entry => {\n\t\tlet newPatches = [];\n\t\tentry.patch.forEach(p => {\n\t\t\tif (p.value && typeof p.value === 'object') {\n\t\t\t\tlet value = flatten(p.value);\n\t\t\t\tObject.keys(value).forEach(key => {\n\t\t\t\t\tlet path = `${p.path}.${key}`;\n\t\t\t\t\tnewPatches.push({\n\t\t\t\t\t\top: p.op,\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tvalue: value[key]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tnewPatches.push(p);\n\t\t\t}\n\t\t});\n\t\tentry.patch = newPatches;\n\t});\n\treturn list;\n}\n\nfunction parsePath(path) {\n\tlet totalPath = path;\n\n\tif (path.substr(0, 1) === '/') {\n\t\ttotalPath = totalPath.substring(1);\n\t}\n\tconst [l, id, p] = totalPath.split('/');\n\n\tif (BASE_PATHS.includes(l)) {\n\t\treturn totalPath;\n\t}\n\n\tif (p) {\n\t\tconst [a, b, f, f2] = p.split('.');\n\t\tif (!f && !f2) {\n\t\t\ttotalPath = a;\n\t\t}\n\n\t\tif (f2) {\n\t\t\ttotalPath = f2;\n\t\t}\n\t} else if (id) {\n\t\tconst [i, f, idx] = id.split('.');\n\t\ttotalPath = f;\n\t}\n\n\treturn totalPath;\n}\n\nfunction matchesPathFilter(path, pathFilter) {\n\tfor (const filter of pathFilter) {\n\t\tif (path.includes(filter)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction aggregateHistory(data) {\n\treturn data.map(rev => {\n\t\tlet aggregatedFields = {};\n\t\tfor (const op of rev.patch) {\n\t\t\tconst path = parsePath(op.path);\n\t\t\tif (matchesPathFilter(op.path, PATH_FILTER)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!aggregatedFields[path]) {\n\t\t\t\taggregatedFields[path] = [];\n\t\t\t}\n\t\t\taggregatedFields[path].push(op);\n\t\t}\n\t\tif (Object.keys(aggregatedFields).length > 0) {\n\t\t\trev.aggregatedFields = aggregatedFields;\n\t\t}\n\t\treturn rev;\n\t}).filter(e => 'aggregatedFields' in e);\n}\n\nconst state = {\n\n\tproductId: '',\n\ttimeline: []\n\n};\n\nconst getters = {\n\n\tgetHistory: (state) => ({ begins, includeBasePaths, regex }) => {\n\t\tconst pathMatches = (p) => {\n\t\t\tif (includeBasePaths && matchesPathFilter(p, BASE_PATHS)) return true;\n\t\t\tif (begins && p.startsWith(begins)) return true;\n\t\t\tif (regex && regex.test(p)) return true;\n\t\t\treturn false;\n\t\t};\n\t\treturn state.timeline.filter(e => {\n\t\t\treturn !!e.patch.find(p => pathMatches(p.path));\n\t\t});\n\t},\n\n\tgetTimelineEntryCount: (state) => () => {\n\t\treturn state.timeline.length;\n\t},\n\n\tgetInvoiceFlagTimeStamp: (state) => (invoiceFlagValue) => {\n\t\tconst revisionData = state.timeline.find(update => {\n\t\t\treturn update.rev === invoiceFlagValue;\n\t\t});\n\t\treturn revisionData && revisionData.updated ? toDateTimeFormat(revisionData.updated) : invoiceFlagValue;\n\t}\n\n};\n\nconst actions = {\n\n\tasync loadTimeline({ state, commit }, { productId, refresh }) {\n\t\tif (state.productId === productId && !refresh) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet data = await getProductTimeline(productId);\n\t\tdata = unrollEntries(data);\n\t\tdata = aggregateHistory(data);\n\t\tcommit('cache', { productId, data });\n\t}\n\n};\n\nconst mutations = {\n\n\tcache(state, { productId, data }) {\n\t\tstate.productId = productId;\n\t\tstate.timeline = data;\n\t}\n\n};\n\nexport default {\n\tnamespaced: false,\n\tstate,\n\tgetters,\n\tactions,\n\tmutations\n};\n","import Store from '@/store/main';\nimport { i18n } from '@/main';\n\nexport default class ApprovalWorkflowService {\n\tstatic _basePath = '_approval';\n\n\tconstructor(listId, currentAccountId) {\n\t\tthis._listId = listId;\n\t\tthis._currentAccountId = currentAccountId;\n\t}\n\n\tstatic _getPath(id, key) {\n\t\treturn `${this._basePath}.${id}.${key}`;\n\t}\n\n\tstatic _getRowValue(item, key) {\n\t\treturn Store.getters['product/getValue'](this._getPath(item.id, key));\n\t}\n\n\tstatic _updateField(id, path, value) {\n\t\tStore.commit('product/updateField', {\n\t\t\tpath: this._getPath(id, path),\n\t\t\tvalue\n\t\t});\n\t\tif (path !== 'updatedBy' && Store.getters['product/getValue'](this._getPath(id, 'updatedBy')) !== Store.getters['auth/user/getCurrentAccountId']) {\n\t\t\tStore.commit('product/updateField', {\n\t\t\t\tpath: this._getPath(id, 'updatedBy'),\n\t\t\t\tvalue: Store.getters['auth/user/getCurrentAccountId']\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic _getDate(d) {\n\t\td.setHours(d.getHours() + 4);\n\t\treturn { dateValue: d.toJSON().substr(0, 10) };\n\t}\n\n\tstatic _getDateObject(dateWrap) {\n\t\tif (!dateWrap || !dateWrap.dateValue) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn new Date(dateWrap.dateValue);\n\t}\n\n\tstatic _getDateValue(id, key) {\n\t\tlet dateStr = ApprovalWorkflowService._getRowValue( { id }, key);\n\n\t\tif (dateStr && dateStr.dateValue) {\n\t\t\tdateStr = dateStr.dateValue;\n\t\t}\n\n\t\treturn dateStr;\n\t}\n\n\tisActiveRow(id) {\n\t\tlet data = Store.getters['product/getApprovalData'](Store.getters['product/getCurrentListId']);\n\t\tlet obj = data[id];\n\t\tif (!obj) {\n\t\t\tdata = Store.getters['product/getApprovalData'](Store.getters['list/baseDataList'].id);\n\t\t\tobj = data[id];\n\t\t}\n\t\tif (!obj) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn obj.active && obj.active.booleanValue;\n\t}\n\n\tgetInitiator(item) {\n\t\treturn ApprovalWorkflowService._getRowValue(item, 'approvalInitiatorAccountId') || ApprovalWorkflowService._getRowValue(item, 'updatedBy');\n\t}\n\n\t_hasApprovalDateSet(item, temporary) {\n\t\tconst prefix = temporary ? 'tmp_' : '';\n\n\t\tconst begin = ApprovalWorkflowService._getRowValue(item, `${prefix}begin`);\n\t\tconst end = ApprovalWorkflowService._getRowValue(item, `${prefix}end`);\n\n\t\treturn begin && end;\n\t}\n\n\thasTemporaryApprovalDateSet(item) {\n\t\treturn this._hasApprovalDateSet(item, true);\n\t}\n\n\thasApprovalDateSet(item) {\n\t\treturn this._hasApprovalDateSet(item, false);\n\t}\n\n\tcanInitiateApproval(item, isProductCreatedByNationalPartner) {\n\t\tif (!Store.getters['auth/user/roles/canApproveStandards']) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!item.data.baseApproval) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst base = !this.isApprovalInitiated(item) && !this.hasBeenFinallyApproved(item);\n\t\tif (!base) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst active = ApprovalWorkflowService._getRowValue(item, 'active');\n\t\treturn active && !isProductCreatedByNationalPartner;\n\t}\n\n\tisApprovalInitiated(item) {\n\t\tif (!this.isActiveRow(item.id)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.hasApprovalDateSet(item) || this.hasTemporaryApprovalDateSet(item)) {\n\t\t\tconst initiator = this.getInitiator(item);\n\t\t\treturn !!initiator;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\thasBeenFinallyApproved(item) {\n\t\treturn !!ApprovalWorkflowService._getRowValue(item, 'hasEverBeenApproved');\n\t}\n\n\tisActiveAndApproved(item) {\n\t\treturn this.isActiveRow(item.id) && this.hasBeenFinallyApproved(item);\n\t}\n\n\tcanResetApprovalDate(item) {\n\t\treturn this.isActiveRow(item.id) && this.hasBeenFinallyApproved(item);\n\t}\n\n\tcanRemoveApprovalDate(item) {\n\t\tif (!this.canResetApprovalDate(item)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.hasApprovalDateSet(item);\n\t}\n\n\tcanSetFinalApproval(item) {\n\t\tif (!this.isActiveRow(item.id)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.hasBeenFinallyApproved(item)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!item.data.baseApproval) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.isApprovalInitiated(item)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst initiatorAccountId = ApprovalWorkflowService._getRowValue(item, 'approvalInitiatorAccountId') || ApprovalWorkflowService._getRowValue(item, 'updatedBy');\n\t\treturn initiatorAccountId && this._currentAccountId !== initiatorAccountId;\n\t}\n\n\tgetApprovalStateText(item) {\n\t\tlet state = 'none';\n\t\tif (this.hasBeenFinallyApproved(item) && this.hasApprovalDateSet(item)) {\n\t\t\tconst data = Store.getters['product/getApprovalData'](this._listId);\n\t\t\tif (ApprovalWorkflowService.checkDateForApproval(data[item.id])) {\n\t\t\t\tstate = 'finallyApproved';\n\t\t\t} else {\n\t\t\t\tstate = 'approvalExpired';\n\t\t\t}\n\t\t} else if (this.isApprovalInitiated(item) && this.hasTemporaryApprovalDateSet(item)) {\n\t\t\tstate = 'initiated';\n\t\t}\n\t\treturn i18n.t(`product.tabs.approval.state.${state}`);\n\t}\n\n\tinitializeApproval(item, begin, end) {\n\t\tconst itemId = item.id;\n\n\t\tlet beginFinal = ApprovalWorkflowService._getDateObject(begin) || new Date();\n\t\tlet endFinal = ApprovalWorkflowService._getDateObject(end) || new Date();\n\t\tif (!end) {\n\t\t\tendFinal.setFullYear(endFinal.getFullYear() + 1);\n\t\t}\n\n\t\tApprovalWorkflowService._updateField(itemId, 'tmp_begin', ApprovalWorkflowService._getDate(beginFinal));\n\t\tApprovalWorkflowService._updateField(itemId, 'tmp_end', ApprovalWorkflowService._getDate(endFinal));\n\t\tApprovalWorkflowService._updateField(itemId, 'approvalInitiatorAccountId', this._currentAccountId);\n\t\tApprovalWorkflowService._updateField(itemId, 'approvalInitiationDate', ApprovalWorkflowService._getDate(new Date()));\n\t}\n\n\tapproveFinally(item) {\n\t\tconst itemId = item.id;\n\n\t\tApprovalWorkflowService._updateField(itemId, 'hasEverBeenApproved', true);\n\t\tApprovalWorkflowService._updateField(itemId, 'finalApprovalAccountId', this._currentAccountId);\n\t\tApprovalWorkflowService._updateField(itemId, 'finalApprovalDate', ApprovalWorkflowService._getDate(new Date()));\n\n\t\t// copy over the temporary date values.\n\t\tconst begin = ApprovalWorkflowService._getRowValue(item, 'tmp_begin');\n\t\tconst end = ApprovalWorkflowService._getRowValue(item, 'tmp_end');\n\n\t\tthis.updateApprovalDate(item, begin, end);\n\t}\n\n\tupdateApprovalDate(item, begin, end) {\n\t\tApprovalWorkflowService._updateField(item.id, 'begin', begin);\n\t\tApprovalWorkflowService._updateField(item.id, 'end', end);\n\t}\n\n\toverrideApprovalDate(item, begin, end) {\n\t\tif (!this.hasBeenFinallyApproved(item)) {\n\t\t\tthis.initializeApproval(item, begin, end);\n\t\t} else {\n\t\t\tthis.updateApprovalDate(item, begin, end);\n\t\t}\n\t}\n\n\tremoveApprovalDate(item) {\n\t\tthis.updateApprovalDate(item, null, null);\n\t}\n\n\tstatic checkDateForApproval(item) {\n\t\tif (!item || !item.begin || !item.begin.dateValue) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst now = Store.getters['product/referenceTime'];\n\t\tlet begin = new Date(item.begin.dateValue);\n\t\tif (begin > now) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (item.end && item.end.dateValue) {\n\t\t\tlet end = new Date(item.end.dateValue);\n\t\t\tif (end < now) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tisApproved(item) {\n\t\tconst id = item.id;\n\n\t\tconst data = Store.getters['product/getApprovalData'](this._listId);\n\t\treturn ApprovalWorkflowService.checkDateForApproval(data[id]);\n\t}\n\n\taddYearToApproval(item) {\n\t\tconst itemId = item.id;\n\n\t\tlet beginStr = ApprovalWorkflowService._getDateValue(itemId, 'begin');\n\n\t\t// if, for any reason, the approval was not yet accomplished, then do it now.\n\t\tif (!beginStr) {\n\t\t\tthis.initializeApproval(item);\n\t\t\tthis.approveFinally(item);\n\t\t\treturn;\n\t\t}\n\n\t\t// create the new date object based on the existing end or begin date and add one year.\n\t\tconst endStr = ApprovalWorkflowService._getDateValue(itemId, 'end');\n\t\tlet end = new Date(endStr || beginStr);\n\t\tend.setFullYear(end.getFullYear() + 1);\n\n\t\tApprovalWorkflowService._updateField(itemId, 'end', ApprovalWorkflowService._getDate(end));\n\t}\n\n\tsetApprovalToOneYear(item) {\n\t\tconst begin = new Date();\n\t\tconst end = new Date();\n\t\tend.setFullYear(end.getFullYear() + 1);\n\n\t\tthis.updateApprovalDate(item, ApprovalWorkflowService._getDate(begin), ApprovalWorkflowService._getDate(end));\n\t}\n}\n","import { deepSet } from '@/util/field-helper.js';\nimport { componentUnlinkableFields } from '@/store/modules/product.js';\nimport deepIterator from 'deep-iterator';\n\nexport const doNotUnlinkNewLists = [\n\t'3c57d0fe-64d5-4aae-8471-b3e9746b7086', // DE\n\t'd23c9774-1c42-415b-8995-b9c8e06e4e8b', // ES\n\t'6b4afd7c-6cb8-4b64-b921-2dad1f2d9cd3', // DE BG\n];\n\nexport function stripUnusedData(workingCopy) {\n\t// the external components are created temporarily to allow displaying of other product's component data in the component table\n\tif (workingCopy._components && workingCopy._components.external) {\n\t\tdelete workingCopy._components.external;\n\t}\n\tif (typeof workingCopy._checklist === 'object') {\n\t\tObject.values(workingCopy._checklist).forEach(row => {\n\t\t\tfor (let [key, val] of Object.entries(row)) {\n\t\t\t\tif (!val) delete row[key];\n\t\t\t}\n\t\t});\n\t}\n\tif (Array.isArray(workingCopy._companies)) {\n\t\tworkingCopy._companies = workingCopy._companies.filter(company => !!company.company);\n\t}\n\tlet toRemove = [];\n\tfor (let { value, path } of deepIterator(workingCopy)) {\n\t\tif (value === '' && path[path.length-1] === 'dateValue') {\n\t\t\ttoRemove.push(path);\n\t\t}\n\t}\n\tfor (let path of toRemove) {\n\t\tdeepSet(workingCopy, path, undefined);\n\t}\n}\n\nexport function rebuildComponents(workingCopy) {\n\tif (workingCopy._components && workingCopy._components.base) {\n\t\tfor (let [id, row] of Object.entries(workingCopy._components.base)) {\n\t\t\tcomponentUnlinkableFields.forEach(f => {\n\t\t\t\tif (row[f]) delete row[f]._isBase;\n\t\t\t});\n\t\t\trow._id = id;\n\t\t\tif (Object.values(row).length < 2) {\n\t\t\t\tdelete workingCopy._components.base[id];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (row.amount && 'numberValue' in row.amount && typeof row.amount.numberValue !== 'number') {\n\t\t\t\tworkingCopy._components.base[id].amount.numberValue = 0;\n\t\t\t}\n\t\t}\n\t\tworkingCopy._components.base = Object.values(workingCopy._components.base);\n\t}\n\tif (workingCopy._components && workingCopy._components.additional) {\n\t\tfor (let [id, row] of Object.entries(workingCopy._components.additional)) {\n\t\t\tcomponentUnlinkableFields.forEach(f => {\n\t\t\t\tif (row[f]) delete row[f]._isBase;\n\t\t\t});\n\t\t\tif (Object.values(row).length < 2 || !row._id) {\n\t\t\t\tdelete workingCopy._components.additional[id];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (row.amount && 'numberValue' in row.amount && typeof row.amount.numberValue !== 'number') {\n\t\t\t\tworkingCopy._components.additional[id].amount.numberValue = 0;\n\t\t\t}\n\t\t}\n\t\tworkingCopy._components.additional = Object.values(workingCopy._components.additional);\n\t}\n}\n","import { saveAs } from 'file-saver';\n\nexport function base64EncodeFile(file) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst reader = new FileReader();\n\t\treader.readAsDataURL(file);\n\t\treader.onload = () => resolve(reader.result);\n\t\treader.onerror = error => reject(error);\n\t});\n}\n\nexport function base64DecodeFile(encodedFile, fileName) {\n\tlet dataUrlParts = encodedFile.split(',');\n\n\tlet mimeType;\n\tlet decoded;\n\n\tif (dataUrlParts.length > 1) {\n\t\tmimeType = dataUrlParts[0].match(/:(.*?);/)[1];\n\t\tdecoded = atob(dataUrlParts[1]);\n\t} else {\n\t\tdecoded = atob(dataUrlParts[0]);\n\t}\n\n\tlet bits = new Uint8Array(decoded.length);\n\n\tfor (let i = 0; i < decoded.length; i++) {\n\t\tbits[i] = decoded.charCodeAt(i);\n\t}\n\n\tconst options = {};\n\tif (mimeType) {\n\t\toptions.type = mimeType;\n\t}\n\n\treturn new File([bits], fileName, options);\n}\n\nexport async function downloadDocument(document, state, $store) {\n\tif (state.link) {\n\t\tURL.revokeObjectURL(state.link);\n\t\tstate.link = '';\n\t}\n\tstate.fileName = document.fileName;\n\tlet { file } = await $store.dispatch('companylist/documents/loadDocument', document);\n\tstate.link = URL.createObjectURL(file);\n\tlet a = global.document.createElement('a');\n\ta.setAttribute('target', '_blank');\n\ta.setAttribute('href', state.link);\n\ta.setAttribute('download', state.fileName);\n\ta.click();\n}\n\nexport function dataUriToBlob(dataURI) {\n\t// convert base64 to raw binary data held in a string\n\t// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\n\tlet mime = 'application/octet-stream';\n\tlet content;\n\tif (dataURI.substr(0, 5) === 'data:') {\n\t\tlet match = dataURI.match(/^data:(?[\\w/\\-.]+)(;(?\\w+))?,(?.*$)/s);\n\t\tif (!match) throw new Error('invalid data uri');\n\t\tcontent = match.groups.encoding === 'base64' ? atob(match.groups.data) : match.groups.data;\n\t\tmime = match.groups.mime;\n\t} else {\n\t\tcontent = dataURI;\n\t}\n\t// write the bytes of the string to an ArrayBuffer\n\tlet ab = new ArrayBuffer(content.length);\n\t// create a view into the buffer\n\tlet ia = new Uint8Array(ab);\n\t// set the bytes of the buffer to the correct values\n\tfor (let i = 0; i < content.length; i++) {\n\t\tia[i] = content.charCodeAt(i);\n\t}\n\t// write the ArrayBuffer to a blob, and you're done\n\tlet blob = new Blob([ab], { type: mime });\n\treturn blob;\n}\n\nexport function downloadUpload(blob, name) {\n\ttry {\n\t\t!!new Blob();\n\t} catch (e) {\n\t\tconsole.log('no save support', e);\n\t\treturn;\n\t}\n\tname = name.replace(/[^a-z0-9\\- _.]ig/, '');\n\tsaveAs(blob, name);\n}","export const backendUrl = process.env.VUE_APP_BASE_URL || 'https://demoapi.ecodb.de/bml';\nexport const pubUrl = process.env.VUE_APP_PUB_URL || 'https://demostatic.ecodb.de/bmlpub/';\nexport const basePath = process.env.VUE_APP_BASE_PATH || '/';\nexport const disablePresence = !!process.env.VUE_APP_DISABLE_PRESENCE || false;\nexport const CommitSha = process.env.VUE_APP_COMMIT_SHA || 'dev';\nexport const LogUrl = process.env.VUE_APP_LOG_URL || 'https://demostatic.ecodb.de/csp/';\n\nlet tmp = backendUrl.replace(/\\/$/, '');\nexport const DOMAIN = tmp.substr(tmp.lastIndexOf('/') + 1);\n\nexport const KeycloakInfo = process.env.VUE_APP_KEYCLOAK_INFO\n\t? JSON.parse(process.env.VUE_APP_KEYCLOAK_INFO)\n\t: {\n\t\t'realm': 'zdb',\n\t\t'url': 'http://localhost/auth/',\n\t\t'clientId': 'bml'\n\t};\n","import EventBus from '@/util/eventbus.js';\nimport Vue from 'vue';\nimport { i18n } from '@/main.js';\n\nexport function transformErrorObject(err) {\n\tlet lines = [];\n\tif (err.code === 503) {\n\t\tlines.push(i18n.t('default.common.error.backendMaintenance'));\n\t\treturn lines;\n\t}\n\tif (err.code) {\n\t\tlines.push(`Code: ${err.code}`);\n\t}\n\tif (err.reqId) {\n\t\tlines.push(`Request ID: ${err.reqId}`);\n\t}\n\tif (err.url) {\n\t\tlines.push(`Request URL: ${err.url}`);\n\t}\n\tif (err.message) {\n\t\tlines.push(`Message: ${err.message}`);\n\t}\n\treturn lines;\n}\n\n\nif (process.env.NODE_ENV !== 'development') {\n\twindow.onerror = function(message, source, lineno, colno, error) {\n\t\tEventBus.$emit('error', error);\n\t\tconsole.log(message, error);\n\t};\n\n\tVue.config.errorHandler = function(err, vm, info) {\n\t\tEventBus.$emit('error', err);\n\t\tconsole.log(err, info);\n\t};\n}\n","import Emitter from 'promise-events';\n\nconst bus = new Emitter();\n\n//compat to vue emitter\nbus.$on = bus.on;\nbus.$emit = bus.emit;\nbus.$off = bus.off;\n\nexport default bus;\n","import Store from '@/store/main.js';\nimport Vue from 'vue';\nimport { toLocale } from '@/plugins/filters';\n\nexport function hasAnyKeyFilled(language) {\n\tif (!language || typeof language !== 'object') {\n\t\treturn false;\n\t}\n\n\tconst values = Object.values(language);\n\treturn values.some(f => f.trim() !== '');\n}\n\nexport function getProductTitle(p) {\n\tconst unknown = { de_DE: 'Unbenannt' };\n\tif (!p || !p.data || !p.data.listData) {\n\t\treturn unknown;\n\t}\n\tlet lists = p.data.listData;\n\tlet title = null;\n\tlet key = 'basis-f1';\n\n\tconst baseListId = Store.getters['list/baseDataList'].id;\n\ttitle = lists[baseListId][key];\n\n\tif (!toLocale(title).trim()) {\n\t\tif (toLocale(p.data.indexData[baseListId].name).trim()) {\n\t\t\treturn p.data.indexData[baseListId].name;\n\t\t} else {\n\t\t\tfor (let entry of Object.values(lists[baseListId][key])) {\n\t\t\t\tif (entry.trim()) {\n\t\t\t\t\ttitle = {};\n\t\t\t\t\ttitle[`${title[Store.state.base.selectedUiLanguage]}`] = entry;\n\t\t\t\t\ttitle[`${title[Store.state.base.fallbackLocale]}`] = entry;\n\t\t\t\t\treturn title;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn unknown;\n\t}\n\n\treturn title;\n}\n\nexport function getFieldValue(valueObj, fieldKey, defaultValue) {\n\tif (!valueObj || valueObj === null || typeof valueObj !== 'object' || !(fieldKey in valueObj)) {\n\t\treturn defaultValue;\n\t}\n\n\treturn valueObj[fieldKey];\n}\n\nexport function isFieldVisibleInList(field, listId) {\n\tif (!field.data) {\n\t\treturn true;\n\t}\n\n\tconst visibleInLists = field.data.visibleInLists;\n\tif (!visibleInLists || visibleInLists.length === 0) {\n\t\treturn true;\n\t}\n\n\treturn visibleInLists.includes(listId);\n}\n\n\nexport function deepSet(node, parts, value) {\n\tlet noChange = false;\n\tparts.forEach((p, i) => {\n\t\tif (!isNaN(p)) p = ~~p;\n\t\tif (i === parts.length - 1) {\n\t\t\tif (value === null) {\n\t\t\t\tif (!(p in node)) {\n\t\t\t\t\tnoChange = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tVue.delete(node, p);\n\t\t\t} else {\n\t\t\t\tif (node[p] === value) {\n\t\t\t\t\tnoChange = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tVue.set(node, p, value);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!(p in node)) {\n\t\t\t\tlet v = isNaN(parts[i+1]) ? {} : [];\n\t\t\t\tVue.set(node, p, v);\n\t\t\t}\n\t\t\tnode = node[p];\n\t\t}\n\t});\n\treturn noChange;\n}\n\nexport function deepGet(v, parts) {\n\tfor (let i=0, ii=parts.length; i f.parentRowId === tableRowId);\n\t\t}\n\n\t\treturn s;\n\t}\n\n\tconst options = field.data.options.map(f => {\n\t\treturn {\n\t\t\tvalue: f.id,\n\t\t\ttext: toLocale(f.title)\n\t\t};\n\t});\n\n\tif (includeNull) {\n\t\toptions.unshift({\n\t\t\tvalue: '',\n\t\t\ttext: '-'\n\t\t});\n\t}\n\n\treturn options;\n}\n\nexport function traverse(\n\tdata ,\n\tvisitor,\n\topts,\n) {\n\tconst depthFirst = opts && opts.depthFirst;\n\tfunction run(layer, stack) {\n\t\tif (!depthFirst) visitor(layer, stack, data);\n\t\tif (Array.isArray(layer)) {\n\t\t\tlayer.forEach((item, i) => {\n\t\t\t\tlet ns = stack.slice(0);\n\t\t\t\tns.push(i);\n\t\t\t\trun(item, ns);\n\t\t\t});\n\t\t} else if (typeof layer === 'object' && layer !== null) {\n\t\t\tObject.keys(layer).forEach((key) => {\n\t\t\t\tlet val = layer[key];\n\t\t\t\tlet ns = stack.slice(0);\n\t\t\t\tns.push(key);\n\t\t\t\trun(val, ns);\n\t\t\t});\n\t\t}\n\t\tif (depthFirst) visitor(layer, stack, data);\n\t}\n\trun(data, []);\n}\n\nexport function ensureValueInOptions(value, options, hasGroups) {\n\t// console.debug('ensureValueInOptions', { value, options, hasGroups });\n\tif (!value) return;\n\tlet key = typeof value === 'object' ? value.value : ''+value;\n\tlet label = typeof value === 'object' ? value.text : ''+value;\n\tlet allOptValues = new Set();\n\tif (!hasGroups) {\n\t\toptions.forEach(e => allOptValues.add(e.value));\n\t} else {\n\t\toptions.forEach(g => {\n\t\t\tg.options.forEach(o => {\n\t\t\t\tallOptValues.add(o.value)\n\t\t\t})\n\t\t})\n\t}\n\tif (!allOptValues.has(key)) {\n\t\tconsole.debug('-- opt is missing', { key, label })\n\t\tif (!hasGroups) {\n\t\t\toptions.unshift({\n\t\t\t\ttext: label,\n\t\t\t\tvalue: key\n\t\t\t})\n\t\t} else {\n\t\t\tlet noG = options.find(g => g.id === '-');\n\t\t\tif (!noG) {\n\t\t\t\tnoG = {\n\t\t\t\t\tid: '-',\n\t\t\t\t\tlabel: { de_DE: 'NOGROUP' },\n\t\t\t\t\toptions: []\n\t\t\t\t}\n\t\t\t\toptions.unshift(noG);\n\t\t\t}\n\t\t\tnoG.options.unshift({\n\t\t\t\ttext: label,\n\t\t\t\tvalue: key\n\t\t\t})\n\t\t}\n\t}\n\n}","/*\n * extra cache for setting the current JWT\n * needed because the request.js cannot require the store\n * without creating a recursive dependency\n */\nlet currentToken = null;\n\nexport function getToken() {\n\t// console.log('getToken', currentToken);\n\treturn currentToken;\n}\n\nexport function setToken(t) {\n\t// console.log('setToken', t);\n\tcurrentToken = t;\n}\n","import Store from '@/store/main.js';\nimport BmlCommon from '@fibl/bml-common';\nimport { getCopyOfConversation } from './portal-store-helper';\n\nconst LIST_EU = \"3bbeaa3b-92cf-4630-b80d-3e0b69790d45\";\n\nexport async function getSubjectFromContext(convo) {\n\tconst conversation = getCopyOfConversation(convo);\n\tif (!conversation.context) return \"\";\n\tconst context = Object.keys(conversation.context);\n\tconst id = Object.values(conversation.context);\n\tif (context[0] === \"invoiceId\") {\n\t\tconst invoiceDetail= await getInvoiceNumber(id[0]);\n\t\tif (invoiceDetail)\n\t\t\treturn invoiceDetail.productName\n\t\t\t\t? `Invoice: ${invoiceDetail.invoiceNumber}.\\nProduct: ${invoiceDetail.productName}.\\nCompany: ${invoiceDetail.companyName}`\n\t\t\t\t: `Invoice: ${invoiceDetail.invoiceNumber}. \\nCompany: ${invoiceDetail.companyName}`;\n\t\telse return \"\";\n\t}\n\tif (context[0] === \"productId\") {\n\t\tconst productName = await getProductName(id[0]);\n\t\treturn productName ? `Product: ${productName}` : \"\";\n\t}\n\tif (context[0] === \"confirmationId\") {\n\t\tconst confirmationDetail = await getConfirmationDetail(id[0]);\n\n\t\tif (confirmationDetail)\n\t\t\treturn `Confirmation type: ${confirmationDetail.type}.\\nProduct: ${confirmationDetail.productName}.\\nCompany: ${confirmationDetail.companyName}`;\n\t\telse return \"\";\n\t}\n\tif (context[0] === \"requestId\") {\n\t\tconst requestDetail = await getRequestDetail(id[0]);\n\t\tif (requestDetail)\n\t\t\treturn requestDetail.productName\n\t\t\t\t? `Request type: ${requestDetail.type}.\\nProduct: ${requestDetail.productName}.\\nCompany: ${requestDetail.companyName}`\n\t\t\t\t: `Request type: ${requestDetail.type}. \\nCompany: ${requestDetail.companyName}`;\n\t\telse return \"\";\n\t}\n\treturn `${context}: ${id}`;\n}\n\nasync function getInvoiceNumber(id) {\n\tif (!id) return \"\";\n\tconst entity = await Store.dispatch('related/addRequiredEntity', {id: id});\n\tconst invoiceNumber = entity.data.indexData.invoiceNumber;\n\tconst companyName = entity.data.indexData.company.name;\n\treturn { invoiceNumber, companyName};\n}\n\nasync function getProductName(id) {\n\tif (!id) return \"\";\n\ttry {\n\t\tconst entity = await Store.dispatch('related/addRequiredEntity', { id: id, ec: 'product' });\n\t\tconst copyEntity = JSON.parse(JSON.stringify(entity));\n\t\tconst productClass = new BmlCommon.ProductClass();\n\t\tproductClass.fromData(copyEntity.data);\n\t\treturn productClass.getName();\n\t} catch (error) {\n\t\tif (error.message.includes(\"id not found\")) return;\n\t\telse throw new Error(error);\n\t}\n}\n\nasync function getCompanyName(id) {\n\tif (!id) return \"\";\n\tconst entity = await Store.dispatch('related/addRequiredEntity', {id: id});\n\treturn entity.data.baseData.name;\n}\n\nasync function getConfirmationDetail(id) {\n\tif (!id) return \"\";\n\tconst entity = await Store.dispatch('related/addRequiredEntity', {id: id});\n\tconst type = entity.data.type;\n\tlet productName = '';\n\tif(entity.data.productId) productName = await getProductName(entity.data.productId);\n\telse if(entity.data.requestId) productName = await getProductNameFromRequestId(entity.data.requestId);\n\tconst companyName = await getCompanyName(entity.data.companyId);\n\treturn { type, productName, companyName };\n}\n\nasync function getRequestDetail(id) {\n\tif (!id) return \"\";\n\tconst entity = await Store.dispatch(\"related/addRequiredEntity\", {\n\t\tid: id,\n\t});\n\tconst type = entity.data.type;\n\tlet productName = \"\";\n\tif (type.includes(\"company\"))\n\t\tproductName = await getCompanyName(entity.data.targetId);\n\telse if (type.includes(\"product\"))\n\t\tif (!entity.data.targetId)\n\t\t\tproductName = await getProductNameFromRequestId(entity.id);\n\t\telse productName = await getProductName(entity.data.targetId);\n\tconst companyName = await getCompanyName(entity.data.company);\n\treturn { type, companyName, productName };\n}\n\nasync function getProductNameFromRequestId(id) {\n\tif (!id) return '';\n\ttry {\n\t\tconst language = Store.state.base.selectedUiLanguage || Store.state.base.fallbackLocale;\n\t\tconst entity = await Store.dispatch(\"related/addRequiredEntity\", {\n\t\t\tid: id,\n\t\t});\n\t\tconst prodListData = JSON.parse(entity.data.productListData);\n\t\tlet reqProdName = '';\n\t\tif (\n\t\t\tprodListData[LIST_EU] &&\n\t\t\tprodListData[LIST_EU]['basis-f1'] &&\n\t\t\tprodListData[LIST_EU]['basis-f1'][language]\n\t\t)\n\t\t\treqProdName = prodListData[LIST_EU]['basis-f1'][language];\n\t\telse reqProdName = Object.values(Object.values(prodListData)[0]['basis-f1'])[0];\n\t\treturn reqProdName;\n\t} catch (error) {\n\t\tif (error.message.includes('id not found')) return;\n\t\telse throw new Error(error);\n\t}\n}","import BmlCommon from '@fibl/bml-common';\n\nexport function getCopyOfConversation(conversation) {\n\tconst convoToUpdate = JSON.parse(JSON.stringify(conversation.toEntity()));\n\tconst convoClass = new BmlCommon.MessageClass();\n\tconvoClass.fromEntity(convoToUpdate);\n\tconvoClass.setCurrentParty(conversation.getCurrentPartyName());\n\tconvoClass.setSubjectFromContext(conversation.getSubjectFromContext());\n\treturn convoClass;\n}","import favloader from 'favloader';\nimport Store from '../store/main.js';\n\nconst MIN_SPINNER_DURATION_MS = 500;\n\nfavloader.init({\n\tcolor: '#2ab561',\n\tduration: MIN_SPINNER_DURATION_MS\n});\n\nlet requestCounter = 0;\nlet spinnerVisibleUntil = null;\nlet spinnerTimer = null;\n\nfunction _refreshSpinner() {\n\tspinnerVisibleUntil = new Date(Date.now() + MIN_SPINNER_DURATION_MS);\n}\nfunction _isRequestQueueEmpty() {\n\treturn requestCounter < 1;\n}\n\nfunction _isSpinnerExpired() {\n\treturn _isRequestQueueEmpty() && Date.now() >= spinnerVisibleUntil;\n}\n\nfunction _isSpinnerCleared() {\n\treturn spinnerVisibleUntil === null;\n}\n\nexport function tryStartSpinner() {\n\trequestCounter += 1;\n\t// console.log('tryStartSpinner', requestCounter);\n\tif (_isSpinnerCleared()) {\n\t\t// favloader.start();\n\t\tStore.commit('base/setLoadingState', true);\n\t}\n\t_refreshSpinner();\n}\n\nexport function tryStopSpinner() {\n\trequestCounter -= 1;\n\t// console.log('tryStopSpinner', requestCounter);\n\tif (_isSpinnerExpired() || !spinnerVisibleUntil) {\n\t\thideSpinner();\n\t} else if (!spinnerTimer) {\n\t\tspinnerTimer = setTimeout(hideSpinner, spinnerVisibleUntil - Date.now());\n\t}\n}\n\nfunction hideSpinner() {\n\tconst now = Date.now();\n\tif (spinnerVisibleUntil && spinnerVisibleUntil > now) {\n\t\tspinnerTimer = setTimeout(hideSpinner, spinnerVisibleUntil - now);\n\t\treturn;\n\t}\n\tspinnerVisibleUntil = null;\n\t// favloader.stop();\n\tclearInterval(spinnerTimer);\n\tspinnerTimer = null;\n\tStore.commit('base/setLoadingState', false);\n}\n","import EventBus from '@/util/eventbus.js';\nimport { backendUrl, LogUrl } from './env.js';\nimport { getToken } from './jwt-cache.js';\nimport { tryStartSpinner, tryStopSpinner } from './load-indicator.js';\n\nlet backoffTimer = 0;\nlet backoffInterval = 500;\n\nasync function request(path, data, post, auth, surpressError, allowEmptyPayload, hideProgress, retries) {\n\tif (!data && !allowEmptyPayload) data = {};\n\tif (isNaN(retries)) retries = 0;\n\tif (path.substr(0, 1) !== '/') {\n\t\tpath = `/${path}`;\n\t}\n\tlet url = backendUrl + path;\n\tlet opts = {};\n\topts.mode = 'cors';\n\t// opts.cache = 'no-cache';\n\topts.headers = { 'Content-Type': 'application/json' };\n\topts.redirect = 'follow';\n\tif (auth) {\n\t\topts.headers.Authorization = `Bearer ${auth}`;\n\t} else {\n\t\tconsole.warn(`no auth supplied for request: ${path}`);\n\t\t// return;\n\t}\n\tif (!post) {\n\t\topts.method = 'GET';\n\t\tif (typeof payload === 'undefined') {\n\t\t\turl += `?__payload=${JSON.stringify(data)}`;\n\t\t}\n\t} else {\n\t\topts.method = 'POST';\n\t\topts.body = JSON.stringify(data);\n\t}\n\tif (!hideProgress) tryStartSpinner();\n\n\tEventBus.$emit('request.start', { url, opts, hideProgress });\n\tconst res = await global.fetch(url, opts);\n\tif (res.status === 429) {\t//too many requests\n\t\tif (retries > 5) {\n\t\t\tconst error = new Error('failed after 5 retries');\n\t\t\terror.url = url;\n\t\t\tEventBus.$emit('error', error);\n\t\t\ttryStopSpinner();\n\t\t\tthrow error;\n\t\t}\n\t\treturn retry(path, data, post, auth, surpressError, allowEmptyPayload, true, retries+1);\n\t}\n\ttry {\n\t\tif (res.status > 299) throw new Error(`http status ${res.status}`);\n\t\tlet ct = res.headers.get('Content-Type');\n\t\tif (!ct.includes('application/json')) throw new Error(`invalid content-type was returned: ${ct}`);\n\t\tconst json = await res.json();\n\t\tif (!json.ok) {\n\t\t\tlet error = new Error();\n\t\t\terror.message = json.message ? json.message : 'unknown error';\n\t\t\tif (!json.message) console.error('unknown error', json);\n\t\t\terror.code = json.code;\n\t\t\terror.reqId = json.id;\n\t\t\terror.url = url;\n\t\t\tthrow error;\n\t\t}\n\t\tif (!hideProgress) tryStopSpinner();\n\t\tEventBus.$emit('request.end', { url, opts, json });\n\t\tif (backoffTimer > 0) backoffTimer -= backoffInterval;\n\t\treturn json.data;\n\t} catch (error) {\n\t\tif (!surpressError) {\n\t\t\tif (!error.url) error.url = url;\n\t\t\tEventBus.$emit('error', error);\n\t\t}\n\t\tif (!hideProgress) tryStopSpinner();\n\t\tEventBus.$emit('request.end', { url, opts, error });\n\t\tthrow error;\n\t}\n}\n\nasync function retry(path, data, post, auth, surpressError, allowEmptyPayload, hideProgress, retries) {\n\tbackoffTimer += backoffInterval;\n\tconsole.debug('backing off', backoffTimer);\n\tawait sleep(backoffTimer);\n\treturn request(path, data, post, auth, surpressError, allowEmptyPayload, hideProgress, retries);\n}\n\nfunction sleep(ms) {\n\treturn new Promise(function(resolve) {\n\t\tsetTimeout(resolve, ms);\n\t});\n}\n\nexport function get(path, data, auth, supe, emptyPayload, hideProgress) {\n\tif (!auth) auth = getToken();\n\treturn request(path, data, false, auth, supe, emptyPayload, hideProgress);\n}\n\nexport function post(path, data, auth, supe, emptyPayload, hideProgress) {\n\tif (!auth) auth = getToken();\n\treturn request(path, data, true, auth, supe, emptyPayload, hideProgress);\n}\n\nexport function log(data) {\n\tglobal.fetch(LogUrl, {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-type': 'application/json'\n\t\t},\n\t\tbody: JSON.stringify(data)\n\t});\n}\n","export const ROLE = {\n\tAdmin: 'Admin',\n\tEditor: 'Editor',\n\tRegistered: 'Registered',\n\tNone: 'None'\n};\n\nexport function accountToRole(accountData) {\n\tif (!accountData) {\n\t\treturn ROLE.None;\n\t}\n\n\tconst staticData = accountData.staticData;\n\n\tif (staticData) {\n\t\tif (staticData.isAdmin) {\n\t\t\treturn ROLE.Admin;\n\t\t} else {\n\t\t\treturn ROLE.Editor;\n\t\t}\n\t}\n\n\treturn ROLE.Registered;\n}\n","import Store from '@/store/main.js';\nimport { treeDisplay, toDateFormat, toLocale } from '@/plugins/filters';\nimport { deepGet } from '@/util/field-helper.js';\nimport { i18n } from '@/main';\n\nconst CORRESPONDENCE_MAIN = '1c4f00c7-325c-4d54-839c-143f29dcfe12'; // Hauptansprechperson\nconst CORRESPONDENCE_NATIONAL = '2fae1eb4-8337-4051-bc01-ba5d01247c3d'; // Konaktperson fachliches nationale Liste\nconst CORRESPONDENCE_INVOICE = 'c11245c2-88b1-4662-8760-9a259473598d'; // Kontaktperson Rechnung nationale Liste\"\n\nexport function replaceLineBreaksWithSeparator(label, separator = ' - ') {\n\treturn label\n\t\t.split('
')\n\t\t.join(separator)\n\t\t.replace(/(?:\\r\\n|\\r|\\n)/g, separator);\n}\n\nexport function booleanDisplay(obj) {\n\tlet booleanValue = false;\n\tif (typeof obj !== 'undefined') {\n\t\tbooleanValue = obj;\n\t}\n\n\tif (booleanValue) {\n\t\treturn i18n.t('admin.crud.yes');\n\t}\n\n\treturn i18n.t('admin.crud.no');\n}\n\n// general path helpers\nexport function columnSetToPath(columnSet) {\n\tconst appendField = function(path, value) {\n\t\treturn `${path}/${value || ''}`;\n\t};\n\n\tlet p = `${columnSet.listId}/${columnSet.fieldId}`;\n\n\t// implicit empty path, if table row id is not filled\n\tp = appendField(p, columnSet.tableRowId);\n\tp = appendField(p, columnSet.tableColumnId);\n\tp = appendField(p, columnSet.subFieldId);\n\tp = appendField(p, columnSet.packageFilter);\n\n\treturn p;\n}\n\nexport function pathToColumnSet(path) {\n\tconst [l, f, r, t, s, z] = path.split('/');\n\n\treturn {\n\t\tlistId: l,\n\t\tfieldId: f,\n\t\ttableColumnId: t || '',\n\t\ttableRowId: r || '',\n\t\tsubFieldId: s || '',\n\t\tpackageFilter: z || ''\n\t};\n}\n\nfunction _getFieldById(fieldId) {\n\tconst field = Store.getters['columnset/fieldByPath'](fieldId);\n\treturn field;\n}\n\n\nfunction _getTableRowsForField(field) {\n\tif (!field || !field.data.rowSource) {\n\t\treturn [];\n\t}\n\n\treturn Store.getters['product/getOptionsBySource'](field.data.rowSource)\n\t\t.slice(0)\n\t\t.sort((a, b) => {\n\t\t\tif (!a.text || !b.text) return 0;\n\t\t\treturn a.text.localeCompare(b.text);\n\t\t});\n}\n\nexport function getTableRows(fieldPath) {\n\tconst field = _getFieldById(fieldPath);\n\treturn _getTableRowsForField(field);\n}\n\nexport function extractTableRowTitle(columnset) {\n\tif (!columnset.tableRowId) {\n\t\treturn '';\n\t}\n\n\treturn extractTableRowTitleByRowAndColumn(columnset.tableRowId, columnset.fieldId);\n}\n\nexport function extractTableRowTitleByRowAndColumn(tableRowId, fieldId) {\n\tconst tableRows = getTableRows(fieldId);\n\tconst row = tableRows.find(f => f.value === tableRowId);\n\n\treturn row ? row.text : '';\n}\n\nexport function unwrapValue(obj) {\n\tif (!obj) {\n\t\treturn null;\n\t}\n\n\t// allowed attributes for unwrapping\n\tconst allowedAttributes = ['textValue', 'numberValue', 'booleanValue', 'selectValue', 'multiselectValue', 'dateValue'];\n\n\tif (typeof obj === 'object') {\n\t\tfor (const attribute of allowedAttributes) {\n\t\t\tif (attribute in obj) {\n\t\t\t\treturn obj[attribute];\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t}\n\n\treturn obj;\n}\n\nfunction _getValueFromOptionSource(source, value, exporting) {\n\tconst sourceData = Store.getters['product/getOptionsBySource'](source, exporting);\n\tif (!sourceData) {\n\t\treturn value;\n\t}\n\tconst option = sourceData.find(f => f.value === value);\n\tif (option) {\n\t\treturn option.text;\n\t}\n\t// console.warn('no option found for source', { value, source, sourceData });\n\treturn null;\n}\n\nfunction _extractSelectValue(field, value, exporting) {\n\tlet optionData = null;\n\n\tlet source;\n\tif (exporting && field.data.exportSource) {\n\t\tsource = field.data.exportSource;\n\t} else {\n\t\tsource = field.data.optionSource;\n\t}\n\tif (source) {\n\t\tconst optionSource = _getValueFromOptionSource(source, value, exporting);\n\t\tif (optionSource) {\n\t\t\treturn optionSource;\n\t\t}\n\t} else {\n\t\toptionData = field.data.options.find(f => f.id === value);\n\n\t\tif (optionData) {\n\t\t\treturn toLocale(optionData.title);\n\t\t}\n\t\t// console.warn('no option found', { value, field });\n\t}\n\n\treturn value;\n}\n\nfunction _extractMultiSelectValue(field, value, exporting) {\n\tlet aggregate = [];\n\tfor (const item of value) {\n\t\taggregate.push(_extractSelectValue(field, item, exporting));\n\t}\n\n\treturn aggregate.join('; ');\n}\n\nfunction _extractTreeValue(field, value) {\n\tconst TREE_FALLBACK = 'category';\n\tconst treeType = field.data.treeType || TREE_FALLBACK;\n\n\tlet aggregate = [];\n\tconst treeData = [].concat(value);\n\n\tfor (const treeEntry of treeData) {\n\t\tconst treeValue = treeDisplay(treeType, treeEntry);\n\t\tif (treeValue === null || treeValue.trim() === '') {\n\t\t\tcontinue;\n\t\t}\n\n\t\taggregate.push(treeValue);\n\t}\n\n\treturn aggregate.join('; ');\n}\n\nfunction _parseNestedTableData(tableData, data) {\n\tlet parsedData = [];\n\tfor (const nestedTableObject of Object.values(data)) {\n\t\tfor (const inner of Object.values(nestedTableObject)) {\n\t\t\tparsedData = parsedData.concat(inner);\n\t\t}\n\t}\n\n\treturn parsedData.length ? parsedData : tableData;\n}\n\nfunction _extractTableColumnValue(field, data, isNestedTable, exporting) {\n\tlet wrappedTableValue = { textValue: '' };\n\n\tlet values = [];\n\tconst tableData = data.table ? data.table : [];\n\tlet parsedData = [];\n\n\t// nested table structure (base, additional, ...)\n\tif (isNestedTable && !field.data.preventObjectToArrayMapping) {\n\t\tparsedData = _parseNestedTableData(tableData, data);\n\t} else {\n\t\tparsedData = data;\n\n\t\tif (field.data.filter) {\n\t\t\tparsedData = parsedData.filter(f => {\n\t\t\t\treturn f[field.data.filter.column] === field.data.filter.value;\n\t\t\t});\n\t\t}\n\t}\n\tlet lookup = f => {\n\t\tconst lookupPath = field.data.lookupPath || field.data.path;\n\t\tif (f[lookupPath]) {\n\t\t\tconst value = _convertValue(field, toLocale(unwrapValue(f[lookupPath])), exporting);\n\t\t\tif (value !== null) {\n\t\t\t\tvalues.push(value);\n\t\t\t}\n\t\t}\n\t};\n\tif (Array.isArray(parsedData)) parsedData.forEach(lookup);\n\telse lookup(parsedData);\n\n\twrappedTableValue.textValue = values.join(', ');\n\treturn wrappedTableValue;\n}\n\nfunction _convertValue(field, value, exporting) {\n\tif (!field || !value) {\n\t\treturn null;\n\t}\n\n\tconst fieldType = field.data.type;\n\n\tif (fieldType === 'select') {\n\t\tif (Array.isArray(value)) {\n\t\t\treturn value.map(v => _extractSelectValue(field, v, exporting)).join(', ');\n\t\t}\n\t\treturn _extractSelectValue(field, value, exporting);\n\t} else if (fieldType === 'multiselect') {\n\t\treturn _extractMultiSelectValue(field, value, exporting);\n\t} else if (fieldType === 'treeselect' || fieldType === 'tree') {\n\t\treturn _extractTreeValue(field, value);\n\t} else if (fieldType === 'datefield') {\n\t\tif (value && typeof value === 'string') {\n\t\t\treturn toDateFormat(value);\n\t\t}\n\t} else if (fieldType === 'comment') {\n\t\tif (value && Array.isArray(value.comments)) {\n\t\t\tlet userField = {\n\t\t\t\tdata: {\n\t\t\t\t\toptionSource: 'users'\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn value.comments.reduce((c, v, i) => {\n\t\t\t\tlet m = v.text;\n\t\t\t\tif (m) {\n\t\t\t\t\tm = c + m;\n\t\t\t\t} else {\n\t\t\t\t\treturn c;\n\t\t\t\t}\n\t\t\t\tif (v.author) {\n\t\t\t\t\tlet user = _extractSelectValue(userField, v.author);\n\t\t\t\t\t// console.log('v.author', v.author, user);\n\t\t\t\t\tif (user) {\n\t\t\t\t\t\tm += ` - ${user}`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (v.ts) {\n\t\t\t\t\tlet d = toDateFormat(v.ts);\n\t\t\t\t\tm += ` (${d})`;\n\t\t\t\t}\n\t\t\t\tif (i < value.length) m += '; ';\n\t\t\t\treturn m;\n\t\t\t}, '');\n\t\t}\n\t}\n\n\treturn value;\n}\n\nfunction _extractFieldValue(fieldId, tableColumnId, tableRowId, product, listData, exporting) {\n\t// console.log('_extract', { fieldId, tableColumnId, tableRowId, product, listData, exporting });\n\tif (!listData) {\n\t\treturn null;\n\t}\n\n\tconst field = _getFieldById(fieldId);\n\tif (!field) {\n\t\treturn null;\n\t}\n\n\tif (field.data.fromRoot) {\n\t\treturn deepGet(product, [ field.data.path ]);\n\t}\n\n\tif (field.data.keyIsValue) {\n\t\tlet objectKeys = Object.keys(listData);\n\t\tif (tableRowId) {\n\t\t\tobjectKeys = objectKeys.filter(f => f === tableRowId);\n\t\t}\n\t\treturn _convertValue(field, objectKeys, exporting);\n\t}\n\n\tconst isTabularData = field.data.displayType === 'table' || field.data.displayType === 'special';\n\tconst isNestedTable = field.data.isNestedTable || Object.keys(field.data).length > 0;\n\n\tif (isTabularData && (listData.table || isNestedTable)) {\n\t\tif (tableRowId) {\n\t\t\t// extract data object value from the selected table row source\n\t\t\tconst dataObj = listData[tableRowId];\n\t\t\tif (!dataObj) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tlet val = dataObj[field.data.path];\n\t\t\tif (typeof val === 'object') {\n\t\t\t\tval = unwrapValue(val);\n\t\t\t}\n\n\t\t\treturn _convertValue(field, val, exporting);\n\t\t}\n\n\t\treturn _extractTableColumnValue(field, listData, isNestedTable, exporting);\n\t}\n\tif (field.data.useSourceAsKey) {\n\t\tlet data = listData[field.data.path];\n\t\tlet values = Object.keys(data);\n\t\tif (field.data.valueFilter) {\n\t\t\tvalues = values.filter(k => !!data[k]);\n\t\t}\n\t\treturn _convertValue(field, values, exporting);\n\t}\n\tconst key = field.data.path;\n\tlet valueInternal = listData[key];\n\tif (!field.data.preventNestedFieldMapping) {\n\t\tvalueInternal = unwrapValue(valueInternal);\n\t}\n\n\tconst value = _convertValue(field, valueInternal, exporting);\n\tif (tableColumnId) {\n\t\treturn _extractFieldValue(tableColumnId, null, tableRowId, product, value, exporting);\n\t}\n\n\treturn value;\n}\n\nfunction calculateOrderIds(company, product, listId, path) {\n\tlet definitions = company.data.orderIds || [];\n\tif (!definitions.length) return '';\n\tconst type = path.includes('yearly') ? 'yearly' : 'initial';\n\tlet filtered = definitions.filter(e => {\n\t\tif (e.list !== listId) return false;\n\t\tif (e.type !== type) return false;\n\t\treturn true;\n\t});\n\tlet highestYear = filtered.reduce((c, v) => v.year > c ? v.year : c, 0);\n\tlet res = filtered.filter(e => (e.year || 0) === highestYear);\n\tlet prodMatch = res.filter(e => e.product === product.id);\n\tif (prodMatch.length > 0) res = prodMatch;\n\telse res = res.filter(e => !e.product);\n\treturn res.map(e => e.value).join(', ');\n}\n\n/**\n * Resolves an external object and returns an given value from it.\n * Used to resolve the package columns.\n * @param product The product we need to operate on. The external object gets resolved from here\n * @param columnSet The columnset that contains information about which objects to resolve\n * @param source The option source we're operating on. The external object to operate on will be searched in here.\n * @param rootRowFilter The filter metadata which is used to define a context to find the foreign object ID in the given product.\n * Defined on the root level of a package column.\n * @param rootFilterValue The actual value we want to find in the array of objects returned by resolving the rootRowFilter. We can also provide an array as filter value to have afall-back mechanism\n * @param path The path we want to lookup in the external object\n * @param applyFilter Should a filter be applied to the external object? We could have an array of values here instead of an atomar value, so we need to find the actual value\n * @param listFilter Defines the filter that should be used to lookup a value in the external object\n * @param optionSource The source that should be used to resolve an text value assigned to an ID that could be found after applying the listFilter\n * @returns {string|null|*} The actual return value.\n * for linkedPaths the values of 'path' and 'sourceColumn' and targetColumn (representing the linked column ids) must be given\n */\nexport function getValueFromForeignObject(product, columnSet, source, rootRowFilter, rootFilterValue, path, applyFilter, listFilter, optionSource) {\n\t// console.log('getValueFromForeignObject', { product, columnSet, source, rootRowFilter, rootFilterValue, path, applyFilter, listFilter, optionSource });\n\tconst _isUsableFilter = function(filter) {\n\t\treturn filter && filter.path && filter.column && filter.values && Array.isArray(filter.values);\n\t};\n\n\tconst _getLinkedPath = function(row, listFilter, foreignObject, listId) {\n\t\tif (!listFilter.linkedPath.sourceColumn || !row[listFilter.linkedPath.sourceColumn]) return null;\n\t\tlet linkedFilter = {\n\t\t\tpath: listFilter.linkedPath.path,\n\t\t\tvalues: [ row[listFilter.linkedPath.sourceColumn] ],\n\t\t\tcolumn: listFilter.linkedPath.targetColumn,\n\t\t};\n\t\tif (!_isUsableFilter(linkedFilter)) return null;\n\t\treturn _applyFilter(linkedFilter, foreignObject, listId);\n\t};\n\n\tconst _applyFilter = function(listFilter, foreignObject, listId) {\n\t\tif (_isUsableFilter(listFilter)) {\n\t\t\t// apply filter by iterating over the child rows.\n\t\t\tconst splittedPath = listFilter.path.split('.');\n\t\t\tlet rowsToFilter;\n\t\t\tif (Array.isArray(foreignObject) && foreignObject.length > 0) {\n\t\t\t\trowsToFilter = deepGet(foreignObject[0], splittedPath);\n\t\t\t} else {\n\t\t\t\trowsToFilter = deepGet(foreignObject, splittedPath);\n\t\t\t}\n\t\t\tif (rowsToFilter && Array.isArray(rowsToFilter)) {\n\t\t\t\tconst columnToQuery = listFilter.column;\n\t\t\t\tif (columnToQuery) {\n\t\t\t\t\t// apply predicate\n\t\t\t\t\tlet rowsFound = [];\n\t\t\t\t\tif (listFilter.useContactPersonFilter) {\n\t\t\t\t\t\trowsToFilter = applyContactPersonFilter(rowsToFilter, listId, listFilter, product);\n\t\t\t\t\t}\n\t\t\t\t\tfor (const value of listFilter.values) {\n\t\t\t\t\t\tfor (let idx = 0; idx < rowsToFilter.length; ++idx) {\n\t\t\t\t\t\t\tconst row = rowsToFilter[idx];\n\t\t\t\t\t\t\tif (row[columnToQuery] === value || listFilter.useContactPersonFilter) {\n\t\t\t\t\t\t\t\tif (listId) {\n\t\t\t\t\t\t\t\t\tif (row.type === 'catalog' && row.catalogListId && row.catalogListId !== listId) continue;\n\t\t\t\t\t\t\t\t\tif (row.lists && row.lists.length && !row.lists.includes(listId)) continue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (listFilter.conditions) {\n\t\t\t\t\t\t\t\t\tlet allConditionsMet = true;\n\t\t\t\t\t\t\t\t\tfor (let [ key, value ] of Object.entries(listFilter.conditions)) {\n\t\t\t\t\t\t\t\t\t\tif (key in row && row[key] !== value) allConditionsMet = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (!allConditionsMet) continue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (listFilter.linkedPath) {\n\t\t\t\t\t\t\t\t\trowsFound.push(_getLinkedPath(row, listFilter, foreignObject, listId));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trowsFound.push(row);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (rowsFound.length) break;\n\t\t\t\t\t}\n\t\t\t\t\t// prioritise items with lists property set\n\t\t\t\t\tconst itemWithLists = rowsFound.find(item => item && item.lists && item.lists.length);\n\t\t\t\t\treturn itemWithLists ? itemWithLists : rowsFound.length ? rowsFound[0] : null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\t// try to lookup the external objects.\n\tconst foreignRows = Store.getters['product/getOptionsBySource'](source);\n\tif (!foreignRows) {\n\t\treturn '';\n\t}\n\n\tlet id;\n\tif (rootRowFilter && rootFilterValue) {\n\t\t// filter the product row for the actual id\n\t\tconst listId = columnSet.listId;\n\t\tconst filterableData = rootRowFilter.useIndex ? product.data.indexData[listId] : product.data.listData[listId];\n\t\tif (filterableData) {\n\t\t\trootRowFilter.values = [ rootFilterValue ];\n\t\t\tconst filterResult = _applyFilter(rootRowFilter, filterableData, listId);\n\n\t\t\tif (filterResult) {\n\t\t\t\tif (rootRowFilter.returnValue) {\n\t\t\t\t\tid = filterResult[rootRowFilter.returnValue];\n\t\t\t\t} else {\n\t\t\t\t\tid = filterResult;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}\n\n\tlet foreignObject;\n\tif (id) {\n\t\tforeignObject = foreignRows.find(f => f.id === id);\n\t} else {\n\t\tif (foreignRows.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tforeignObject = foreignRows[0];\n\t}\n\n\tif (!foreignObject) {\n\t\treturn '';\n\t}\n\n\tif (applyFilter && foreignObject) {\n\t\tconst filteredRow = _applyFilter(listFilter, [ foreignObject ], columnSet.listId);\n\t\tif (filteredRow) {\n\t\t\tforeignObject = filteredRow;\n\t\t}\n\t}\n\n\tconst extractedValue = path && path.includes('_orderIds')\n\t\t? calculateOrderIds(foreignObject, product, columnSet.listId, path)\n\t\t: deepGet(foreignObject, path.split('.'));\n\t// console.log('extracted', { columnSet, extractedValue });\n\n\tif (extractedValue) {\n\t\tif (optionSource) {\n\t\t\tconst baseData = _getValueFromOptionSource(optionSource, extractedValue);\n\t\t\tif (baseData) {\n\t\t\t\treturn baseData;\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(extractedValue)) {\n\t\t\treturn extractedValue.join(', ');\n\t\t}\n\t}\n\n\treturn extractedValue;\n}\n\nfunction applyContactPersonFilter(contactPersons, listId, filter, product) {\n\tlet filteredPersons = [];\n\tlet baseListId = Store.getters['list/baseDataList'].id;\n\tlet mainCategoryId = Store.getters['category/mainCategoryFromIds'](product.data.listData[baseListId]._categoryTree).id;\n\tlet getContactOfType = (persons, personType, listId, categoryId) => {\n\t\tlet personsOfType = contactPersons.filter(person => person.function === personType);\n\t\tif (listId) {\n\t\t\tif (categoryId) {\n\t\t\t\tlet personsOfcategoryList = personsOfType.filter(person => person.jurisdiction && person.jurisdiction.includes(categoryId) && person.lists && person.lists.includes(listId));\n\t\t\t\tif (personsOfcategoryList.length) {\n\t\t\t\t\treturn personsOfcategoryList;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet personsOfListNoCategory = personsOfType.filter(person => person.lists && person.lists.includes(listId) && (!person.jurisdiction || !person.jurisdiction.length));\n\t\t\t\tif (personsOfListNoCategory.length) {\n\t\t\t\t\treturn personsOfListNoCategory;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (categoryId) {\n\t\t\tlet personsOfCategoryNoLists = personsOfType.filter(person => person.jurisdiction && person.jurisdiction.includes(categoryId) && (!person.lists || !person.lists.length));\n\t\t\tif (personsOfCategoryNoLists.length) {\n\t\t\t\treturn personsOfCategoryNoLists;\n\t\t\t}\n\t\t}\n\t\tif (!listId && !categoryId) {\n\t\t\treturn personsOfType.filter(person => (!person.lists || !person.lists.length) && (!person.jurisdiction || !person.jurisdiction.length));\n\t\t}\n\t\treturn [];\n\t};\n\n\tif (Array.isArray(filter.values)) {\n\t\tif (filter.values[0] === CORRESPONDENCE_INVOICE) {\n\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_INVOICE, listId, mainCategoryId);\n\t\t\tif (!filteredPersons.length) {\n\t\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_INVOICE, listId);\n\t\t\t}\n\t\t\tif (!filteredPersons.length) {\n\t\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_MAIN);\n\t\t\t}\n\t\t\tif (!filteredPersons.length) {\n\t\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_NATIONAL, listId, mainCategoryId);\n\t\t\t}\n\t\t\tif (!filteredPersons.length) {\n\t\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_NATIONAL, listId);\n\t\t\t}\n\t\t} else if (filter.values[0] === CORRESPONDENCE_MAIN) {\n\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_NATIONAL, listId, mainCategoryId);\n\t\t\tif (!filteredPersons.length) {\n\t\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_NATIONAL, listId);\n\t\t\t}\n\t\t\tif (!filteredPersons.length) {\n\t\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_NATIONAL, null, mainCategoryId);\n\t\t\t}\n\t\t\tif (!filteredPersons.length) {\n\t\t\t\tfilteredPersons = getContactOfType(contactPersons, CORRESPONDENCE_MAIN);\n\n\t\t\t}\n\t\t}\n\t}\n\treturn filteredPersons;\n}\n\nexport function getProductColumnValue(product, customColumn, exporting) {\n\tconst unknown = { de_DE: '---' };\n\tconst currentList = Store.getters['list/byId'](customColumn.listId);\n\tconst fallbackLocale = currentList && currentList.data.fallbackLanguage ? currentList.data.fallbackLanguage : null;\n\tconst listIds = Object.keys(product.data.listData);\n\n\tif (!product || !product.data || !product.data.listData || listIds.length === 0 || !customColumn) {\n\t\treturn unknown;\n\t}\n\n\tlet listData = product.data.listData;\n\n\tconst list = listData[customColumn.listId];\n\tif (!list) {\n\t\treturn unknown;\n\t}\n\n\tlet value = _extractFieldValue(customColumn.fieldId, customColumn.tableColumnId, customColumn.tableRowId, product, list, exporting);\n\n\tif (customColumn.fieldId === '_components' && (!value || !unwrapValue(value))) {\n\t\tlet baseListId = Store.getters['list/baseDataList'].id;\n\t\tconst baseList = listData[baseListId];\n\t\tvalue = _extractFieldValue(customColumn.fieldId, customColumn.tableColumnId, customColumn.tableRowId, product, baseList, exporting);\n\t}\n\n\tif (!value) {\n\t\treturn unknown;\n\t}\n\n\treturn toLocale(value, null, fallbackLocale);\n}\n","import Store from '@/store/main.js';\nimport { pathToColumnSet } from './columnset';\nimport { SimpleFilter, CompanyFilter } from './structures';\nimport SearchFields from '@/assets/config/search/search-fields';\nimport { transliterate } from 'transliteration';\n\n// This table is used to map field types to the corresponding suffixes for property values that are wrapped into an JSON object.\n// example: checkbox fields wrap their checked value inside an booleanValue property, so the path gets converted from\n// data.listData.xyz.checkbox => data.listData.xyz.checkbox.booleanValue\nconst FIELD_VALUE_TYPE_MAPPING = {};\nFIELD_VALUE_TYPE_MAPPING['singleline-textfield'] = 'textValue';\nFIELD_VALUE_TYPE_MAPPING.textfield = 'textValue';\nFIELD_VALUE_TYPE_MAPPING.checkbox = 'booleanValue';\nFIELD_VALUE_TYPE_MAPPING.datefield = 'dateValue';\nFIELD_VALUE_TYPE_MAPPING.select = 'selectValue';\nFIELD_VALUE_TYPE_MAPPING.numberfield = 'numberValue';\nFIELD_VALUE_TYPE_MAPPING.comment = 'comments/text';\nFIELD_VALUE_TYPE_MAPPING.company = 'label';\nFIELD_VALUE_TYPE_MAPPING.multiselect = 'multiselectValue';\n// fallback mapping\nconst DEFAULT_VALUE_MAPPING = 'textValue';\n\nconst DYNAMIC_FIELD_TO_INDEX_MAPPING = {\n\t'basis-f1': '/indexfields/namesearch/{listId}',\n\t'companyIndexDistributor': '/data/indexData/{listId}/distributor',\n\t'companyIndexManufacturer': '/data/indexData/{listId}/manufacturer'\n};\nconst FIELD_EXTRA_PREP = {\n\t'basis-f1'(value) {\n\t\tvalue = transliterate(value.toLowerCase());\n\t\tlet titleWithSpaces = value.replace(/[^\\d\\w ]+/gu, '');\n\t\tlet titleNoSpaces = titleWithSpaces.replace(/\\s*/g, '');\n\t\treturn titleNoSpaces ? [ titleWithSpaces, titleNoSpaces ] : [ titleWithSpaces ];\n\t}\n};\n\nexport function constructSelectionFilter(baseFilter, productSelection) {\n\tif (productSelection.blacklistMode) {\n\t\tif (productSelection.items.length === 0) return baseFilter;\n\t\treturn constructBlacklistFilter(baseFilter, productSelection.items);\n\t} else {\n\t\tif (productSelection.items.length === 0) return baseFilter;\n\t\treturn constructWhitelistFilter(productSelection.items);\n\t}\n}\n\n// include selected objects, if we are in whitebox selection mode (e. g. the select all-checkbox wasn't selected)\nfunction constructWhitelistFilter(items) {\n\tlet filter = { $or: [] };\n\tfor (const id of items) {\n\t\tfilter.$or.push({\n\t\t\tcomparison: 'eq',\n\t\t\tfield: '/id',\n\t\t\tvalue: id\n\t\t});\n\t}\n\treturn filter;\n}\n\n// exclude object ids from blackbox selection mode (e. g. the select all-checkbox was selected)\n// creates an additional AND clause to an given filter\n// the function relies on the whitelist filter and just inverts the sub-filter returned over there\nfunction constructBlacklistFilter(subFilter, items) {\n\tlet totalFilter = { $and: [] };\n\tconst notFilter = { $not: {} };\n\tif (items.length > 0) {\n\t\tnotFilter.$not = constructWhitelistFilter(items);\n\t\ttotalFilter.$and.push(notFilter);\n\t}\n\tif (subFilter) {\n\t\ttotalFilter.$and.push(subFilter);\n\t}\n\treturn totalFilter;\n}\n\nfunction _appendNestedFieldMapping(field, path) {\n\t// preventNestedFieldMapping is used to control if the path suffix from FIELD_VALUE_TYPE_MAPPING should be appended.\n\t// if true, this is an nop.\n\tif (field.data.preventNestedFieldMapping) {\n\t\treturn path;\n\t}\n\n\tconst type = field.data.type.toLowerCase();\n\tif (type.includes('multitext')) {\n\t\treturn path;\n\t}\n\n\tlet mapping = FIELD_VALUE_TYPE_MAPPING[type];\n\treturn `${path}/${!mapping ? DEFAULT_VALUE_MAPPING : mapping}`;\n}\n\nfunction getComparisonMeta(node) {\n\tlet comparison = node.comparator === 'fuz' || node.comparator === 'contains' ? 'eq' : node.comparator;\n\tlet fuzzy = node.comparator === 'fuz';\n\tlet use = node.comparator === 'contains' ? 'ngram' : node.comparator === 'begins' ? 'keyword' : 'text';\n\treturn { comparison, fuzzy, use };\n}\n\nlet nd = new Date();\nlet now = nd.toJSON().substr(0, 10);\n\nexport function generateQueryFromSearchRoot({ search, inList, products, institution, accountId }) {\n\tconst baseList = Store.getters['list/baseDataList'];\n\n\tfunction _getAllLists() {\n\t\tconst availableLists = Store.getters['auth/user/roles/getAvailableLists'];\n\n\t\treturn inList\n\t\t\t? availableLists.filter(l => l.id === inList)\n\t\t\t: availableLists;\n\t}\n\n\tfunction _isIndexMappedField(field, listId) {\n\t\tconst mappingRaw = DYNAMIC_FIELD_TO_INDEX_MAPPING[field.data.path];\n\t\treturn {\n\t\t\tisIndexMapped: !!mappingRaw,\n\t\t\tmapping: mappingRaw ? mappingRaw.replace('{listId}', listId) : mappingRaw\n\t\t};\n\t}\n\n\tfunction _wrapResponsibleFilter(query) {\n\t\tif (!institution) {\n\t\t\treturn query;\n\t\t}\n\n\t\tlet wrap = { $and: [] };\n\n\t\tconst subQuery = { $or: [] };\n\n\t\tfor (const list of _getAllLists()) {\n\t\t\tconst basePath = `/data/listData/${list.id}/_responsible`;\n\t\t\tconst responsibilityQuery = { $and: [] };\n\t\t\tresponsibilityQuery.$and.push({\n\t\t\t\tfield: `${basePath}/institution`,\n\t\t\t\tcomparison: 'eq',\n\t\t\t\tvalue: institution\n\t\t\t});\n\n\t\t\tif (products === 'active' || products === 'inactive') {\n\t\t\t\tresponsibilityQuery.$and.push({\n\t\t\t\t\tfield: `/data/listData/${list.id}/_active`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: products === 'active'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (accountId) {\n\t\t\t\tresponsibilityQuery.$and.push({\n\t\t\t\t\tfield: `${basePath}/accountId`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: accountId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsubQuery.$or.push(responsibilityQuery);\n\t\t}\n\n\t\twrap.$and.push(query);\n\t\twrap.$and.push(subQuery);\n\n\t\treturn wrap;\n\t}\n\n\tfunction _isCompanyQuery(fieldId) {\n\t\treturn fieldId === '_companies';\n\t}\n\n\tfunction _addAdditionalSearchFilters(query) {\n\t\tconst filters = Store.getters['search/getAdditionalSearchFilters'];\n\t\tif (!filters || Object.keys(filters).length === 0) {\n\t\t\treturn query;\n\t\t}\n\n\t\tconst additionalQuery = { $and: [] };\n\t\tfor (const [path, data] of Object.entries(filters)) {\n\t\t\tif (!data) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!data.value && typeof data.value !== 'boolean') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst columnset = pathToColumnSet(path);\n\t\t\tif (!columnset) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tinList = columnset.listId ? columnset.listId : null;\n\n\t\t\t// resolve the field path to an entity id\n\t\t\tconst fieldByPath = Store.getters['columnset/fieldByPath'](columnset.fieldId);\n\t\t\tif (!fieldByPath) {\n\t\t\t\tconsole.warn('field by path not found', columnset.fieldId);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst isCompanyQuery = _isCompanyQuery(columnset.fieldId);\n\t\t\tlet node;\n\t\t\tif (isCompanyQuery) {\n\t\t\t\tnode = new CompanyFilter();\n\t\t\t\tnode.role = columnset.tableColumnId.replace('company', '').toLowerCase();\n\t\t\t} else {\n\t\t\t\tnode = new SimpleFilter();\n\t\t\t}\n\n\t\t\tnode.fieldId = fieldByPath.id;\n\t\t\tnode.tableColumnPath = columnset.tableColumnId;\n\t\t\tnode.tableRowId = columnset.tableRowId;\n\n\t\t\tif (fieldByPath.data.defaultComparator) {\n\t\t\t\tnode.comparator = fieldByPath.data.defaultComparator;\n\t\t\t} else if (data.comparator) {\n\t\t\t\tnode.comparator = data.comparator;\n\t\t\t} else {\n\t\t\t\tnode.comparator = 'contains';\n\t\t\t}\n\n\t\t\tnode.value = data.value;\n\n\t\t\tlet subQuery;\n\n\t\t\tif (isCompanyQuery) {\n\t\t\t\tsubQuery = _companyQuery(node);\n\t\t\t} else if (node.value && Array.isArray(node.value)) {\n\t\t\t\tsubQuery = { '$or': [] };\n\t\t\t\tfor (const field of node.value) {\n\t\t\t\t\tsubQuery.$or.push(_simpleQuery({\n\t\t\t\t\t\t...node,\n\t\t\t\t\t\tvalue: field\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsubQuery = _simpleQuery(node);\n\t\t\t}\n\n\t\t\tif (subQuery) {\n\t\t\t\tadditionalQuery.$and.push(subQuery);\n\t\t\t}\n\t\t}\n\n\t\tconst totalQuery = { $and: [] };\n\t\ttotalQuery.$and.push(query);\n\t\ttotalQuery.$and.push(additionalQuery);\n\n\t\treturn totalQuery;\n\t}\n\n\tfunction _wrapActiveFlag(query) {\n\t\tconst listSearch = { '$or': []};\n\t\tlet wrap = {\n\t\t\t'$and': []\n\t\t};\n\n\t\tif (products === 'active' || products === 'inactive') {\n\t\t\tfor (const list of _getAllLists()) {\n\t\t\t\tlistSearch.$or.push({\n\t\t\t\t\tfield: `/data/listData/${list.id}/_active`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: products === 'active'\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (inList) wrap.$and.push({\n\t\t\tfield: '/data/listData',\n\t\t\tcomparison: 'exists',\n\t\t\tvalue: inList\n\t\t});\n\t\twrap.$and.push(listSearch);\n\t\twrap.$and.push(query);\n\n\t\treturn wrap;\n\t}\n\n\tfunction _getFieldFromNode(node) {\n\t\tconst field = Store.getters['columnset/fieldById'](node.fieldId);\n\t\tif (!field) {\n\t\t\tconsole.error('field by id not found', node.fieldId);\n\t\t\treturn null;\n\t\t}\n\n\t\tlet tableColumn = null;\n\t\tlet actualField;\n\n\t\tif (node.tableColumnPath) {\n\t\t\ttableColumn = Store.getters['columnset/fieldByPath'](node.tableColumnPath);\n\t\t\tif (!tableColumn) {\n\t\t\t\tconsole.error('tableColumn by path not found', node.tableColumnPath);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tactualField = tableColumn;\n\t\t} else if (node.tableColumnId) {\n\t\t\ttableColumn = Store.getters['columnset/fieldById'](node.tableColumnId);\n\t\t\tif (!tableColumn) {\n\t\t\t\tconsole.error('tableColumn by id not found', node.tableColumnId);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tactualField = tableColumn;\n\t\t} else {\n\t\t\tactualField = field;\n\t\t}\n\n\t\treturn {\n\t\t\tfield: actualField,\n\t\t\ttableColumn\n\t\t};\n\t}\n\n\tfunction _parseValue(value, field) {\n\t\tif (field.data.path in FIELD_EXTRA_PREP) {\n\t\t\treturn FIELD_EXTRA_PREP[field.data.path](value);\n\t\t}\n\t\tif (!isNaN(parseFloat(value)) && isFinite(value)) {\n\t\t\treturn parseFloat(value);\n\t\t}\n\t\tif (typeof value === 'string') {\n\t\t\treturn value.trim();\n\t\t}\n\t\treturn value;\n\t}\n\n\tfunction _createMultiValueQuery(values, operator, query) {\n\t\tlet valueArr = values;\n\t\tif (typeof value === 'string') {\n\t\t\tvalueArr = valueArr.split(',');\n\t\t}\n\n\t\tlet result = {};\n\t\tconst key = `$${operator}`;\n\t\tresult[key] = [];\n\n\t\tfor (const value of valueArr) {\n\t\t\tlet q = JSON.parse(JSON.stringify(query));\n\t\t\tq.value = value;\n\n\t\t\tresult[key].push(q);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tfunction _pushSearchField(query, list, field, node, tableColumn, optionSource, preventAutoPath) {\n\t\tlet path;\n\t\tconst { isIndexMapped, mapping } = _isIndexMappedField(field, list.id);\n\n\t\t// global: fields which live on the /data level.\n\t\t// noPathPrefix: fields which live on the root scope\n\t\t// isIndexMapped: fields which live in the index\n\t\t// pathPrefix: fields that don't have any prefix to be prepended in the path, for example _companies\n\t\t// manualAppendListInPath: fields that require to have the list id followed after the path prefix, for example _companies\n\t\tif (field.data.global) {\n\t\t\tpath = '/data/';\n\t\t} else if (field.data.noPathPrefix) {\n\t\t\tpath = '/';\n\t\t} else if (isIndexMapped) {\n\t\t\tpath = mapping;\n\t\t} else if (!field.data.pathPrefix) {\n\t\t\tpath = `/data/listData/${list.id}/`;\n\t\t} else {\n\t\t\tpath = field.data.pathPrefix;\n\t\t\tif (field.data.manualAppendListInPath) {\n\t\t\t\tpath += `/${list.id}/`;\n\t\t\t}\n\t\t}\n\n\t\tlet actualField;\n\t\tlet value = _parseValue(node.value, field);\n\n\t\tif (tableColumn) {\n\t\t\tif (!field.data.pathPrefix) {\n\t\t\t\tpath += `${field.data.path}/`;\n\t\t\t}\n\n\t\t\t// sometimes tabular data is nested inside /table subpaths\n\t\t\tif (!tableColumn.data.usePlaceholder && !field.data.usePlaceholder) {\n\t\t\t\tpath += 'table/';\n\t\t\t} else if (optionSource) {\n\t\t\t\tpath += `${optionSource || ''}/`;\n\t\t\t}\n\n\t\t\tactualField = tableColumn;\n\t\t} else {\n\t\t\tactualField = field;\n\t\t}\n\n\t\t// required to use an single iteration loop instead of confusing branching later\n\t\t// value is the value to be searched for, multi-select values get splitted and translated into sub-queries\n\t\tif (actualField.data.type === 'multiselect' && typeof value === 'string') {\n\t\t\tvalue = value.split(',');\n\t\t} else if (!Array.isArray(value)) {\n\t\t\tvalue = [ value ];\n\t\t}\n\n\t\tif (!isIndexMapped) {\n\t\t\tif (path[path.length-1] !== '/') path += '/';\n\t\t\tpath += `${actualField.data.path}`;\n\t\t}\n\n\t\t// if necessary, add the /textValue, /dateValue, ... suffixes to the path\n\t\tpath = _appendNestedFieldMapping(actualField, path);\n\n\t\t// sometimes the select option value needs to be used as key in the path, for example for risk labels\n\t\tif (field.data.useSourceAsKey) {\n\t\t\tpath += `/${value}`;\n\t\t\t// for risk labels, this would be an boolean value. the search value gets replaced here!\n\t\t\tif (field.data.valueFilter) {\n\t\t\t\tvalue = field.data.valueFilter;\n\t\t\t}\n\t\t}\n\n\t\tlet comparator = node.comparator;\n\n\t\t// needed for the invoice flags\n\t\tif (field.data.forceExistsQuery) {\n\t\t\tcomparator = 'exists';\n\t\t}\n\t\tif (actualField.data.doesTableFieldExist) {\n\t\t\tlet pathParts = path.split('/');\n\t\t\tlet lastPart = pathParts.pop();\n\t\t\tlet rawQuery = { $and: [] };\n\t\t\tlet activePart = null;\n\t\t\tlet existsPart = {\n\t\t\t\tfield: pathParts.join('/'),\n\t\t\t\tvalue: lastPart,\n\t\t\t\tcomparison: 'exists'\n\t\t\t};\n\n\t\t\tif (value && value.length && (value[0] === true || value[0] === 'true')) {\n\t\t\t\trawQuery.$and.push(existsPart);\n\t\t\t} else {\n\t\t\t\trawQuery.$and.push({\n\t\t\t\t\t$not: existsPart\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (actualField.data.forceActiveFlag) {\n\t\t\t\tactivePart = {\n\t\t\t\t\tfield: `${pathParts.join('/')}/active/booleanValue`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: true\n\t\t\t\t};\n\t\t\t\trawQuery.$and.push(activePart);\n\t\t\t}\n\t\t\tquery.push(rawQuery);\n\t\t\treturn;\n\t\t}\n\n\t\t// in case of nested queries we need to reconstruct the full path, so preventAutoPath is only true if we have nested queries\n\t\tlet result = {\n\t\t\tfield: path,\n\t\t\tvalue: value[0],\n\t\t\t...getComparisonMeta({ comparator })\n\t\t};\n\n\t\tif (actualField.data.type === 'datefield') {\n\t\t\tresult.format = 'yyyy-MM-dd';\n\t\t} else if (actualField.data.type === 'multiselect') {\n\t\t\tresult = _createMultiValueQuery(value, 'or', result);\n\t\t} else if (Array.isArray(value[0])) {\n\t\t\tresult = _createMultiValueQuery(value[0], 'or', result);\n\t\t} else if (Array.isArray(value) && value.length > 1) {\n\t\t\tresult = _createMultiValueQuery(value, 'or', result);\n\t\t}\n\n\t\tquery.push(result);\n\t}\n\n\t// query that only searches for lists but doesn't append any other filters.\n\tfunction _nopQuery() {\n\t\tlet query = [];\n\n\t\tif (inList) {\n\t\t\tconst allLists = _getAllLists();\n\n\t\t\tfor (const list of allLists) {\n\t\t\t\tquery.push({\n\t\t\t\t\tfield: '/data/listData',\n\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\tvalue: list.id\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn { '$or': query };\n\t}\n\n\t// query for simple field filters\n\tfunction _simpleQuery(node) {\n\t\tconst field = Store.getters['columnset/fieldById'](node.fieldId);\n\t\tif (!field) return null;\n\t\tlet fieldData = _getFieldFromNode(node);\n\t\tif (!fieldData || !fieldData.field) return null;\n\t\tconst fieldForVis = fieldData.field;\n\t\tconst tableColumn = fieldData.tableColumn;\n\n\t\tconst allLists = _getAllLists();\n\t\tlet lists;\n\t\tif (fieldForVis.data.visibleInLists && fieldForVis.data.visibleInLists.length > 0) {\n\t\t\tlists = allLists.filter(l => fieldForVis.data.visibleInLists.includes(l.id));\n\t\t} else if (fieldForVis.data.global || fieldForVis.data.noPathPrefix) {\n\t\t\tlists = [ allLists[0] ];\n\t\t} else {\n\t\t\tlists = allLists;\n\t\t}\n\t\t// console.log('_simpleNode', { node, lists, fieldData, fieldForVis });\n\t\tif (lists.length === 0) return null;\n\n\t\t// generate options for sub-paths\n\t\tconst useOptionSources = !!fieldForVis.data.optionSourcesForPath;\n\t\tlet subOptions = [];\n\t\tif (node.tableRowId) {\n\t\t\tsubOptions = [node.tableRowId];\n\t\t} else if (useOptionSources) {\n\t\t\tfor (const optionSource of fieldForVis.data.optionSourcesForPath) {\n\t\t\t\tconst data = Store.getters['product/getOptionsBySource'](optionSource);\n\t\t\t\tif (!data) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsubOptions = subOptions.concat(data.map(f => f.value));\n\t\t\t}\n\t\t} else {\n\t\t\tsubOptions = [null];\n\t\t}\n\n\t\tlet query = [];\n\n\t\tif (field.data.nestedSearch || field.data.type === 'table' && !SearchFields.find(searchField => searchField.data && searchField.data.path === field.data.path)) {\n\t\t\tfor (const list of lists) {\n\t\t\t\t_pushSearchField(query, list, field, node, tableColumn);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const list of lists) {\n\t\t\t\tfor (const optionSource of subOptions) {\n\t\t\t\t\t_pushSearchField(query, list, field, node, tableColumn, optionSource);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { '$or': query };\n\t}\n\n\t// query that targets the approval history.\n\t// if a biostandardId was set in the node, use it, otherwise use all biostandards\n\tfunction _approvalQuery(node) {\n\t\tif (node.rangeType === 'initiated') return _approvalInitiatedQuery(node);\n\t\tlet query = [];\n\t\tconst lists = _getAllLists();\n\t\tlet biostandards = [];\n\t\tconst basePath = '/data/approvalHistory';\n\n\t\tif (node.biostandardId) {\n\t\t\tbiostandards.push(node.biostandardId);\n\t\t} else {\n\t\t\tconst allStandards = Store.getters['biostandard/all'];\n\t\t\tbiostandards = allStandards.map(f => f.id);\n\t\t}\n\n\t\tfor (const list of lists) {\n\t\t\tfor (const standard of biostandards) {\n\t\t\t\tlet nested = {\n\t\t\t\t\t'$nested': {\n\t\t\t\t\t\tpath: basePath,\n\t\t\t\t\t\tmatch: {\n\t\t\t\t\t\t\t'$and': []\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tnested.$nested.match.$and.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: `${basePath}/listId`,\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: list.id\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tnested.$nested.match.$and.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: `${basePath}/biostandardId`,\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: standard\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif (node.rangeType === 'complete') {\t//aktuell aktiv\n\t\t\t\t\t// find any element for the given list and standard which has no end date set\n\n\t\t\t\t\tnested.$nested.match.$and.push({\n\t\t\t\t\t\tfield: `${basePath}/begin`,\n\t\t\t\t\t\tcomparison: 'lte',\n\t\t\t\t\t\tvalue: now,\n\t\t\t\t\t\tformat: 'yyyy-MM-dd'\n\t\t\t\t\t});\n\t\t\t\t\tnested.$nested.match.$and.push({\n\t\t\t\t\t\tfield: `${basePath}/end`,\n\t\t\t\t\t\tcomparison: 'gte',\n\t\t\t\t\t\tvalue: now,\n\t\t\t\t\t\tformat: 'yyyy-MM-dd'\n\t\t\t\t\t});\n\t\t\t\t} else if (node.rangeType === 'partial_total') {\t//im Gesamtzeitraum\n\t\t\t\t\tif (node.startDate) {\n\t\t\t\t\t\tnested.$nested.match.$and.push(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: `${basePath}/begin`,\n\t\t\t\t\t\t\t\tcomparison: 'lte',\n\t\t\t\t\t\t\t\tvalue: node.startDate,\n\t\t\t\t\t\t\t\tformat: 'yyyy-MM-dd'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (node.endDate) {\n\t\t\t\t\t\tlet or = [{\n\t\t\t\t\t\t\tfield: `${basePath}/end`,\n\t\t\t\t\t\t\tcomparison: 'gte',\n\t\t\t\t\t\t\tvalue: node.endDate,\n\t\t\t\t\t\t\tformat: 'yyyy-MM-dd'\n\t\t\t\t\t\t}];\n\t\t\t\t\t\tif (node.startDate) {\n\t\t\t\t\t\t\tor.push({ $not: {\n\t\t\t\t\t\t\t\tfield: basePath,\n\t\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\t\tvalue: 'end'\n\t\t\t\t\t\t\t}});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnested.$nested.match.$and.push({ $or: or });\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnested.$nested.match.$and.push({ $not: {\n\t\t\t\t\t\t\tfield: basePath,\n\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\tvalue: 'end'\n\t\t\t\t\t\t}});\n\t\t\t\t\t}\n\t\t\t\t} else {\t//im Teilzeitraum\n\t\t\t\t\tif (node.endDate) {\n\t\t\t\t\t\tnested.$nested.match.$and.push(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: `${basePath}/begin`,\n\t\t\t\t\t\t\t\tcomparison: 'lte',\n\t\t\t\t\t\t\t\tvalue: node.endDate,\n\t\t\t\t\t\t\t\tformat: 'yyyy-MM-dd'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (node.startDate) {\n\t\t\t\t\t\tnested.$nested.match.$and.push({ $or: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: `${basePath}/end`,\n\t\t\t\t\t\t\t\tcomparison: 'gte',\n\t\t\t\t\t\t\t\tvalue: node.startDate,\n\t\t\t\t\t\t\t\tformat: 'yyyy-MM-dd'\n\t\t\t\t\t\t\t}, { $not: {\n\t\t\t\t\t\t\t\tfield: basePath,\n\t\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\t\tvalue: 'end'\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t]});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tquery.push(nested);\n\t\t\t}\n\t\t}\n\n\t\treturn { '$or': query };\n\t}\n\n\t// find any company with a given role in the index\n\t// if no role was given, just find the company in the listData array\n\tfunction _companyQuery(node) {\n\t\tlet query = [];\n\t\tconst lists = _getAllLists();\n\n\t\tif (node.role !== '') {\n\t\t\tconst basePath = '/data/indexData';\n\n\t\t\tfor (const list of lists) {\n\t\t\t\tconst path = `${basePath}/${list.id}`;\n\n\t\t\t\tquery.push({\n\t\t\t\t\tfield: `${path}/${node.role}/id`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: node.value\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconst basePath = '/data/listData';\n\t\t\tfor (const list of lists) {\n\t\t\t\tconst path = `${basePath}/${list.id}/_companies`;\n\n\t\t\t\tlet nested = {\n\t\t\t\t\t$nested: {\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tmatch: { $or: [] }\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tnested.$nested.match.$or.push({\n\t\t\t\t\tfield: `${path}/company`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: node.value\n\t\t\t\t});\n\n\t\t\t\tquery.push(nested);\n\t\t\t}\n\t\t}\n\n\t\treturn { '$or': query };\n\t}\n\n\t// query that targets _approval in lists\n\tfunction _approvalInitiatedQuery(node) {\n\t\tlet query = { '$or': [] };\n\t\tlet biostandards = [];\n\t\tconst lists = _getAllLists();\n\t\tconst basePath = '/data/listData';\n\n\t\tif (node.biostandardId) {\n\t\t\tbiostandards.push(node.biostandardId);\n\t\t} else {\n\t\t\tconst allStandards = Store.getters['biostandard/all'];\n\t\t\tbiostandards = allStandards.map(f => f.id);\n\t\t}\n\n\t\tfor (const list of lists) {\n\t\t\tlet subQueryBiostandard = { '$and': [] };\n\t\t\tfor (const standard of biostandards) {\n\t\t\t\tlet path = `${basePath}/${list.id}/_approval/${standard}`;\n\t\t\t\tconst isActive = [{\n\t\t\t\t\tfield: `${path}/active/booleanValue`,\n\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\tvalue: true\n\t\t\t\t}];\n\t\t\t\tconst approvalInitiated = [\n\t\t\t\t\t{\n\t\t\t\t\t\t'$or': [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'$and': [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfield: `${path}`,\n\t\t\t\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\t\t\t\tvalue: 'tmp_begin'\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfield: `${path}`,\n\t\t\t\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\t\t\t\tvalue: 'tmp_end'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t'$and': [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfield: `${path}`,\n\t\t\t\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\t\t\t\tvalue: 'begin'\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfield: `${path}`,\n\t\t\t\t\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\t\t\t\t\tvalue: 'end'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}, {\n\t\t\t\t\t\tfield: `${path}`,\n\t\t\t\t\t\tcomparison: 'exists',\n\t\t\t\t\t\tvalue: 'approvalInitiatorAccountId'\n\t\t\t\t\t}\n\t\t\t\t];\n\t\t\t\tconst notFinallyApproved = [{\n\t\t\t\t\t'$not': {\n\t\t\t\t\t\tfield: `${path}/hasEverBeenApproved`,\n\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\tvalue: true\n\t\t\t\t\t}\n\t\t\t\t}];\n\t\t\t\tsubQueryBiostandard.$and = subQueryBiostandard.$and.concat(isActive);\n\t\t\t\tsubQueryBiostandard.$and = subQueryBiostandard.$and.concat(approvalInitiated);\n\t\t\t\tsubQueryBiostandard.$and = subQueryBiostandard.$and.concat(notFinallyApproved);\n\t\t\t}\n\t\t\tquery.$or.push(subQueryBiostandard);\n\t\t}\n\t\treturn query;\n\t}\n\n\t// re-use an existing query\n\tfunction _externalQuery(node) {\n\t\tconst externalRootId = node.externalRoot;\n\t\tconst externalSearchRoot = Store.getters['search/byId'](externalRootId);\n\n\t\tif (!externalSearchRoot) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn generateQueryFromSearchRoot(externalSearchRoot.data);\n\t}\n\n\tfunction _nestedQuery(node) {\n\t\tlet nested = [];\n\t\tconst children = node.children || [];\n\t\tfor (const child of children) {\n\t\t\tconst childSearch = _internalGenerateQuery(child);\n\t\t\tif (childSearch !== null) {\n\t\t\t\tnested.push(childSearch);\n\t\t\t}\n\t\t}\n\n\t\tconst operator = `$${node.operator.toLowerCase()}`;\n\t\tlet obj = {};\n\t\tif (operator === '$not') {\n\t\t// imply AND\n\t\t\tnested = {\n\t\t\t\t'$and': nested\n\t\t\t};\n\t\t}\n\t\tobj[operator] = nested;\n\t\treturn obj;\n\t}\n\n\tfunction _tableRowQuery(node) {\n\t\tlet tableId = node.tableId;\n\t\tconst searchField = Store.getters['columnset/fieldById'](tableId);\n\n\t\tif (!searchField) {\n\t\t\treturn null;\n\t\t}\n\t\t// console.log('_tableRowQuery', { searchField, node });\n\t\tif (Object.hasOwn(searchField.data, 'nestedSearch') && searchField.data.nestedSearch === false) {\n\t\t\tlet children = node.children.map(_simpleQuery);\n\t\t\tlet operator = `$${node.operator.toLowerCase()}`;\n\t\t\treturn { [operator]: children };\n\t\t}\n\n\t\tconst allLists = _getAllLists();\n\n\t\tlet query = [];\n\n\t\tfor (const list of allLists) {\n\t\t\tlet nested = {\n\t\t\t\t'$nested': {\n\t\t\t\t\tmatch: {}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst basePath = searchField.data.pathPrefix || '/data/listData';\n\t\t\tnested.$nested.path = `${basePath}`;\n\t\t\t//for component index\n\t\t\tif (!searchField.data.listIdField) nested.$nested.path += `/${list.id}`;\n\n\t\t\tif (!searchField.data.preventAppendPath) {\n\t\t\t\tnested.$nested.path += `/${searchField.data.path}`;\n\t\t\t}\n\n\t\t\tif (!searchField.data.usePlaceholder) {\n\t\t\t\tnested.$nested.path += '/table';\n\t\t\t}\n\n\t\t\tconst operator = `$${node.operator.toLowerCase()}`;\n\t\t\tlet rows = [];\n\t\t\tnested.$nested.match[operator] = operator === '$not' ? { $and: rows } : rows;\n\n\t\t\tconst children = node.children || [];\n\t\t\tfor (const child of children) {\n\t\t\t\tconst fieldData = _getFieldFromNode(child);\n\t\t\t\tif (!fieldData) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t_pushSearchField(rows, list, searchField, child, fieldData.tableColumn, null, true);\n\n\t\t\t\tif (fieldData.tableColumn) {\n\t\t\t\t\tconst additionalFilter = fieldData.tableColumn.data.filter;\n\t\t\t\t\tif (additionalFilter) {\n\t\t\t\t\t\trows.push({\n\t\t\t\t\t\t\tfield: `${nested.$nested.path}/${additionalFilter.column}`,\n\t\t\t\t\t\t\tcomparison: 'eq',\n\t\t\t\t\t\t\tvalue: additionalFilter.value\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tquery.push(nested);\n\t\t}\n\n\t\treturn { '$or': query };\n\t}\n\n\tfunction _internalGenerateQuery(node) {\n\t\tif (!node || node._type === 'nop') {\n\t\t\treturn _nopQuery();\n\t\t} else if (node._type === 'simple') {\n\t\t\treturn _simpleQuery(node);\n\t\t} else if (node._type === 'external') {\n\t\t\treturn _externalQuery(node);\n\t\t} else if (node._type === 'approval') {\n\t\t\treturn _approvalQuery(node);\n\t\t} else if (node._type === 'tablerow') {\n\t\t\treturn _tableRowQuery(node);\n\t\t} else if (node._type === 'company') {\n\t\t\treturn _companyQuery(node);\n\t\t} else {\n\t\t\treturn _nestedQuery(node);\n\t\t}\n\t}\n\n\t// 1. generate main query\n\t// 2. apply active products filter (selectable for each search)\n\t// 3. find only products for some given institute and account (selectable for each search)\n\t// 4. add the ad-hoc table filters as separate AND query\n\tconsole.log('generate search', { search, inList, products, institution, accountId });\n\tconst res = _addAdditionalSearchFilters(_wrapResponsibleFilter(_wrapActiveFlag(_internalGenerateQuery(search))));\n\t//console.log(JSON.stringify(res, null, 2));\n\treturn res;\n}\n","import Store from '@/store/main';\nimport { isUuid as uuidValidate } from '../uuid';\n\nconst RESERVED_PATHS = ['rev', 'created', 'updated', 'data.isNationalPartner'];\n\n// used to translate field subpaths from indexData to listData\nconst INDEX_LISTDATA_MAPPING = {\n\t'name': 'basis-f1'\n};\n\nconst SORTABLE_PATHS = ['name', 'rev', 'created', 'updated', 'data.isNationalPartner', '_categoryTree', 'companyManufacturer', 'companyDistributor'];\n\n// used to translate dynamic fields (e. g. from search-fields.json) to their sortable representations\nconst FIELD_SEARCHPATH_TABLE = {\n\t'_categoryTree': 'category.label',\n\t'companyManufacturer': 'manufacturer.label',\n\t'companyDistributor': 'distributor.label',\n\t'name': 'nameSorting'\n};\n\n// used to append postfixes to given columns\nconst FIELD_POSTFIX = {\n\t// '_categoryTree': 'secondary'\n};\n\n// if the column is included here, we have an additional multi lang field\n// example _categoryTree: gets translated to category.label via FIELD_SEARCHPATH_TABLE\n// afterwards the constructed path gets a language code suffix via MULTILANG_TABLE\n// finally the field gets its final representation with FIELD_POSTFIX\n// _categoryTree => category.label => category.label.de_DE => category.label.de_DE.secondary\nconst MULTILANG_TABLE = ['_categoryTree'];\n\nfunction isDateField(fieldPath) {\n\tconst field = getActualField(fieldPath);\n\tif (field) {\n\t\tif (field.data.displayType === 'tab' && field.data.type.toLowerCase() === 'datefield') {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport function isFieldSortable(fieldPath) {\n\tif (!fieldPath) {\n\t\treturn false;\n\t}\n\n\tif (SORTABLE_PATHS.includes(fieldPath)) {\n\t\treturn true;\n\t}\n\n\t// date-fields (not in table) are sortable\n\treturn isDateField(fieldPath);\n}\n\nfunction isIndexField(fieldPath) {\n\tif (!fieldPath) {\n\t\treturn false;\n\t}\n\n\treturn !isDateField(fieldPath);\n}\n\n/**\n * Maps an index field id to the corresponding field id in the columnset field store, if possible\n * @param fieldId\n * @returns {*}\n */\nfunction mapColumnToListField(fieldId) {\n\tconst listField = INDEX_LISTDATA_MAPPING[fieldId];\n\tif (!listField) {\n\t\treturn fieldId;\n\t}\n\n\treturn listField;\n}\n\n/**\n * Maps an field path to its actual representation, if needed.\n * @param fieldId\n * @returns {*}\n */\nfunction mapColumnToTranslatedPath(fieldId) {\n\tconst translatedPath = FIELD_SEARCHPATH_TABLE[fieldId];\n\tif (!translatedPath) {\n\t\treturn fieldId;\n\t}\n\n\treturn translatedPath;\n}\n\nfunction mapFieldWithPostfix(fieldId) {\n\tconst postfix = FIELD_POSTFIX[fieldId];\n\tif (!postfix) {\n\t\treturn '';\n\t}\n\n\treturn `.${postfix}`;\n}\n\nfunction getActualField(fieldId, tableColumnId) {\n\tconst actualFieldId = mapColumnToListField(tableColumnId) || mapColumnToListField(fieldId);\n\treturn Store.getters['columnset/fieldByPath'](actualFieldId);\n}\n\nfunction isMultiLangField(fieldId, tableColumnId) {\n\tconst field = getActualField(fieldId, tableColumnId);\n\tif (!field) {\n\t\treturn false;\n\t}\n\n\treturn field.data.type.toLowerCase().includes('multitext') || MULTILANG_TABLE.includes(field.data.path);\n}\n\nfunction getCurrentLanguage() {\n\treturn Store.state.base.selectedUiLanguage;\n}\n\nfunction generateColumnPath(column) {\n\tif (RESERVED_PATHS.includes(column)) return column;\n\tconst [listId, fieldId, tableRowId, tableColumnId] = column.split('/');\n\tlet basePath = 'data.';\n\tlet fieldPath = basePath;\n\tlet multiLang;\n\tlet actualField = column;\n\tif (uuidValidate(listId, 4) && fieldId) {\n\t\tmultiLang = isMultiLangField(fieldId, tableColumnId);\n\t\tactualField = tableColumnId || fieldId;\n\t\tfieldPath += `_searchIndex_.${listId}`;\n\t} else {\n\t\tmultiLang = isMultiLangField(column);\n\t\tconst baseListId = Store.getters['list/baseDataList'].id;\n\t\tfieldPath += `_searchIndex_.${baseListId}`;\n\t}\n\tfieldPath += `.${mapColumnToTranslatedPath(actualField)}`;\n\tlet _searchIndex_ = isIndexField(actualField) ? 'indexData' : 'listData';\n\tfieldPath = fieldPath.replace('_searchIndex_', _searchIndex_);\n\tif (multiLang) {\n\t\tfieldPath += `.${getCurrentLanguage()}`;\n\t} else if (isDateField(actualField)) {\n\t\tfieldPath += '.dateValue';\n\t}\n\tfieldPath += mapFieldWithPostfix(actualField);\n\treturn fieldPath;\n}\n\n/**\n * Entry point. Constructs the actual sort path to be provided to the REST API\n * @param sorting Object with \"order\" \\in {'desc', 'asc'} and \"column\" \\in {fieldPaths}\n * @returns {[]|*[]} Returns an array of strings. Basically there are multiple sort paths possible but we just allow single sorting at the moment.\n */\nexport function generateSortFields(sorting) {\n\tif (!sorting || !sorting.order || !sorting.column) {\n\t\treturn [];\n\t}\n\n\tlet result = [];\n\n\tconst path = generateColumnPath(sorting.column);\n\tresult.push(`${path}:${sorting.order}`);\n\n\treturn result;\n}\n","import { v4 as uuid } from 'uuid';\nimport Store from '@/store/main';\nimport { toLocale, toDateFormat } from '@/plugins/filters';\nimport { i18n } from '@/main';\n\nclass BaseTreeNode {\n\tconstructor() {\n\t\tthis.id = uuid();\n\t}\n\n\tsetLabel(label) {\n\t\tthis.label = label;\n\t}\n\n\tsetDescription(description) {\n\t\tthis.description = description;\n\t}\n}\n\n/**\n * Node not containing any filter functionality.\n */\nexport class NopFilter extends BaseTreeNode {\n\tconstructor() {\n\t\tsuper();\n\t\tthis._type = 'nop';\n\t}\n}\n\nexport class SimpleFilter extends BaseTreeNode {\n\tconstructor() {\n\t\tsuper();\n\t\tthis._type = 'simple';\n\t\tthis.tab = 'main';\n\t\tthis.comparator = 'eq';\n\t\tthis.value = '';\n\t\t// fixedParentField: the parent is provided in-code, not by a tab selection or something else\n\t\tthis.fixedParentField = false;\n\n\t\t// this._initializeFields();\n\t}\n\n\t/**\n\t * Selects the first possible field and, if necessary, table column\n\t */\n\t_initializeFields() {\n\t\tconst fields = Store.getters['field/forTab'](this.tab);\n\n\t\tthis.tableRowId = '';\n\n\t\tif (fields.length > 0) {\n\t\t\tconst field = fields[0];\n\t\t\tif (this.tab === 'main') {\n\t\t\t\tconst nameField = Store.getters['field/byPath']('basis-f1');\n\t\t\t\tif (nameField) {\n\t\t\t\t\tthis.fieldId = nameField.id;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.fieldId = field.id;\n\t\t\t}\n\n\t\t\tif (field.data.type === 'table') {\n\t\t\t\tconst columns = Store.getters['field/byTable'](field.id);\n\n\t\t\t\tif (columns.length > 0) {\n\t\t\t\t\tconst column = columns[0];\n\t\t\t\t\tthis.tableColumnId = column.id;\n\t\t\t\t} else {\n\t\t\t\t\tthis.tableColumnId = '';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.fieldId = '';\n\t\t\tthis.tableColumnId = '';\n\t\t}\n\t}\n\n\tsetFieldId(fieldId) {\n\t\tthis.fieldId = fieldId;\n\t}\n\n\tsetTab(tab) {\n\t\tthis.tab = tab;\n\t}\n\n\tsetTableColumnId(tableColumnId) {\n\t\tthis.tableColumnId = tableColumnId;\n\t}\n\n\tsetComparator(comparator) {\n\t\tthis.comparator = comparator;\n\t}\n\n\tsetValue(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport class CombinedFilter extends BaseTreeNode {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.children = [];\n\t\tthis.operator = 'AND';\n\t\tthis._type = 'combined';\n\t}\n\n\tsetOperator(operator) {\n\t\tthis.operator = operator;\n\t}\n\n\taddChild(childNode) {\n\t\tthis.children.push(childNode);\n\t}\n\n\tstatic _findClosestParentNode(root, searchNode) {\n\t\tif (!root) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (root.children && root.children.length) {\n\t\t\tfor (const child of root.children) {\n\t\t\t\tif (child.id === searchNode.id) return root;\n\t\t\t\tif (child.children && child.children.length) {\n\t\t\t\t\tconst searchResult = this._findClosestParentNode(child, searchNode);\n\t\t\t\t\tif (searchResult) return searchResult;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t// Removes a node from the tree by finding its closest parent node.\n\tstatic removeNode(root, node) {\n\t\tconst closestParent = this._findClosestParentNode(root, node);\n\n\t\tif (!closestParent) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst index = closestParent.children.findIndex(f => f.id === node.id);\n\t\tclosestParent.children.splice(index, 1);\n\t}\n}\n\nexport class TableRowFilter extends CombinedFilter {\n\tconstructor() {\n\t\tsuper();\n\t\tthis._type = 'tablerow';\n\t\tthis.tableId = '';\n\n\t\tthis._initializeFields();\n\t}\n\n\t_initializeFields() {\n\t\tconst tables = Store.getters['field/byType']('table') || [];\n\t\tif (tables.length > 0) {\n\t\t\tthis.tableId = tables[0].id;\n\t\t}\n\t}\n}\n\nexport class ExternalFilter extends BaseTreeNode {\n\tconstructor() {\n\t\tsuper();\n\t\tthis._type = 'external';\n\t\tthis.externalRoot = '';\n\t}\n\n\tsetExternalRoot(externalRoot) {\n\t\tthis.externalRoot = externalRoot.id;\n\t}\n}\n\nexport class ApprovalFilter extends BaseTreeNode {\n\tconstructor() {\n\t\tsuper();\n\t\tthis._type = 'approval';\n\t\tthis.biostandardId = '';\n\t\tthis.rangeType = 'complete';\n\t\tthis.startDate = '';\n\t\tthis.endDate = '';\n\t}\n\n\tstatic _toString(node) {\n\t\tif (node._type !== 'approval') {\n\t\t\treturn 'UNKNOWN';\n\t\t}\n\n\t\tlet parts = [];\n\n\t\tif (node.biostandardId) {\n\t\t\tconst biostandard = Store.getters['biostandard/byId'](node.biostandardId);\n\t\t\tif (biostandard) {\n\t\t\t\tparts.push(`${i18n.t('product.common.standard')}: ${toLocale(biostandard.data.name)}`);\n\t\t\t}\n\t\t}\n\n\t\tswitch (node.rangeType) {\n\t\t\tcase 'complete': {\n\t\t\t\tpushTranslation('complete');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'initiated': {\n\t\t\t\tpushTranslation('initiated');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'partial_total': {\n\t\t\t\tpushTranslation('partial_total');\n\t\t\t\tpushDateStrings(node);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'partial_partial': {\n\t\t\t\tpushTranslation('partial_partial');\n\t\t\t\tpushDateStrings(node);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tpushTranslation('complete');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tfunction pushTranslation(type) {\n\t\t\tparts.push(i18n.t(`product.search.searchNode.dateRange.${type}`));\n\t\t}\n\t\tfunction pushDateStrings(node) {\n\t\t\tlet dateString = '';\n\t\t\tif (node.startDate) {\n\t\t\t\tdateString += `${i18n.t('product.search.searchNode.dateRange.start')} ${toDateFormat(node.startDate)}`;\n\t\t\t}\n\n\t\t\tif (node.endDate) {\n\t\t\t\tdateString += ` ${i18n.t('product.search.searchNode.dateRange.end')} ${toDateFormat(node.endDate)}`;\n\t\t\t}\n\n\t\t\tparts.push(dateString);\n\t\t}\n\n\t\treturn parts.join(', ');\n\t}\n}\n\nexport class CompanyFilter extends SimpleFilter {\n\tconstructor() {\n\t\tsuper();\n\t\tthis._type = 'company';\n\t\tthis.role = '';\n\t}\n\n\tstatic _toString(node) {\n\t}\n}\n","import { toLocale } from '@/plugins/filters';\n\nexport function mapObjectToSelectOption(field) {\n\treturn (obj) => {\n\t\treturn {\n\t\t\tvalue: obj.id,\n\t\t\ttext: toLocale(obj.data[field])\n\t\t};\n\t};\n}\n\nexport function getSelectListFromArray(array, titleField, useEmptyValue, emptyKey, emptyText) {\n\tlet data = array.map(mapObjectToSelectOption(titleField));\n\t/*data = data.sort((a, b) => {\n\t\treturn a.text > b.text ? 1 : -1;\n\t});*/\n\n\tif (useEmptyValue) {\n\t\tdata.unshift({\n\t\t\tvalue: emptyKey,\n\t\t\ttext: emptyText\n\t\t});\n\t}\n\n\treturn data;\n}\n\nexport function getDefaultSelectListFromArray(array, titleField, useEmptyValue) {\n\treturn getSelectListFromArray(array, titleField, useEmptyValue, null, '-');\n}\n","\nexport function isUuid(v) {\n\tif (!v || typeof v !== 'string') return false;\n\treturn v.match(/^[a-z0-9-]{36}$/);\n}\n","var map = {\n\t\"./af\": 20054,\n\t\"./af.js\": 20054,\n\t\"./ar\": 98650,\n\t\"./ar-dz\": 53137,\n\t\"./ar-dz.js\": 53137,\n\t\"./ar-kw\": 9825,\n\t\"./ar-kw.js\": 9825,\n\t\"./ar-ly\": 94800,\n\t\"./ar-ly.js\": 94800,\n\t\"./ar-ma\": 97521,\n\t\"./ar-ma.js\": 97521,\n\t\"./ar-ps\": 41854,\n\t\"./ar-ps.js\": 41854,\n\t\"./ar-sa\": 69747,\n\t\"./ar-sa.js\": 69747,\n\t\"./ar-tn\": 86093,\n\t\"./ar-tn.js\": 86093,\n\t\"./ar.js\": 98650,\n\t\"./az\": 33506,\n\t\"./az.js\": 33506,\n\t\"./be\": 71844,\n\t\"./be.js\": 71844,\n\t\"./bg\": 44238,\n\t\"./bg.js\": 44238,\n\t\"./bm\": 55452,\n\t\"./bm.js\": 55452,\n\t\"./bn\": 19877,\n\t\"./bn-bd\": 54728,\n\t\"./bn-bd.js\": 54728,\n\t\"./bn.js\": 19877,\n\t\"./bo\": 89158,\n\t\"./bo.js\": 89158,\n\t\"./br\": 73601,\n\t\"./br.js\": 73601,\n\t\"./bs\": 19698,\n\t\"./bs.js\": 19698,\n\t\"./ca\": 64225,\n\t\"./ca.js\": 64225,\n\t\"./cs\": 15247,\n\t\"./cs.js\": 15247,\n\t\"./cv\": 13508,\n\t\"./cv.js\": 13508,\n\t\"./cy\": 37065,\n\t\"./cy.js\": 37065,\n\t\"./da\": 13002,\n\t\"./da.js\": 13002,\n\t\"./de\": 97046,\n\t\"./de-at\": 62662,\n\t\"./de-at.js\": 62662,\n\t\"./de-ch\": 50640,\n\t\"./de-ch.js\": 50640,\n\t\"./de.js\": 97046,\n\t\"./dv\": 53155,\n\t\"./dv.js\": 53155,\n\t\"./el\": 19296,\n\t\"./el.js\": 19296,\n\t\"./en-au\": 79441,\n\t\"./en-au.js\": 79441,\n\t\"./en-ca\": 12659,\n\t\"./en-ca.js\": 12659,\n\t\"./en-gb\": 11106,\n\t\"./en-gb.js\": 11106,\n\t\"./en-ie\": 87625,\n\t\"./en-ie.js\": 87625,\n\t\"./en-il\": 17794,\n\t\"./en-il.js\": 17794,\n\t\"./en-in\": 45176,\n\t\"./en-in.js\": 45176,\n\t\"./en-nz\": 72379,\n\t\"./en-nz.js\": 72379,\n\t\"./en-sg\": 63625,\n\t\"./en-sg.js\": 63625,\n\t\"./eo\": 30297,\n\t\"./eo.js\": 30297,\n\t\"./es\": 653,\n\t\"./es-do\": 70763,\n\t\"./es-do.js\": 70763,\n\t\"./es-mx\": 47975,\n\t\"./es-mx.js\": 47975,\n\t\"./es-us\": 15082,\n\t\"./es-us.js\": 15082,\n\t\"./es.js\": 653,\n\t\"./et\": 8216,\n\t\"./et.js\": 8216,\n\t\"./eu\": 71375,\n\t\"./eu.js\": 71375,\n\t\"./fa\": 21132,\n\t\"./fa.js\": 21132,\n\t\"./fi\": 21460,\n\t\"./fi.js\": 21460,\n\t\"./fil\": 6074,\n\t\"./fil.js\": 6074,\n\t\"./fo\": 15602,\n\t\"./fo.js\": 15602,\n\t\"./fr\": 97957,\n\t\"./fr-ca\": 63786,\n\t\"./fr-ca.js\": 63786,\n\t\"./fr-ch\": 50273,\n\t\"./fr-ch.js\": 50273,\n\t\"./fr.js\": 97957,\n\t\"./fy\": 84100,\n\t\"./fy.js\": 84100,\n\t\"./ga\": 51205,\n\t\"./ga.js\": 51205,\n\t\"./gd\": 64730,\n\t\"./gd.js\": 64730,\n\t\"./gl\": 15938,\n\t\"./gl.js\": 15938,\n\t\"./gom-deva\": 12523,\n\t\"./gom-deva.js\": 12523,\n\t\"./gom-latn\": 89676,\n\t\"./gom-latn.js\": 89676,\n\t\"./gu\": 88697,\n\t\"./gu.js\": 88697,\n\t\"./he\": 9426,\n\t\"./he.js\": 9426,\n\t\"./hi\": 51830,\n\t\"./hi.js\": 51830,\n\t\"./hr\": 25611,\n\t\"./hr.js\": 25611,\n\t\"./hu\": 82178,\n\t\"./hu.js\": 82178,\n\t\"./hy-am\": 43117,\n\t\"./hy-am.js\": 43117,\n\t\"./id\": 79588,\n\t\"./id.js\": 79588,\n\t\"./is\": 30305,\n\t\"./is.js\": 30305,\n\t\"./it\": 45236,\n\t\"./it-ch\": 59854,\n\t\"./it-ch.js\": 59854,\n\t\"./it.js\": 45236,\n\t\"./ja\": 21296,\n\t\"./ja.js\": 21296,\n\t\"./jv\": 7669,\n\t\"./jv.js\": 7669,\n\t\"./ka\": 12729,\n\t\"./ka.js\": 12729,\n\t\"./kk\": 90911,\n\t\"./kk.js\": 90911,\n\t\"./km\": 36509,\n\t\"./km.js\": 36509,\n\t\"./kn\": 15092,\n\t\"./kn.js\": 15092,\n\t\"./ko\": 72091,\n\t\"./ko.js\": 72091,\n\t\"./ku\": 32709,\n\t\"./ku-kmr\": 69294,\n\t\"./ku-kmr.js\": 69294,\n\t\"./ku.js\": 32709,\n\t\"./ky\": 65329,\n\t\"./ky.js\": 65329,\n\t\"./lb\": 26255,\n\t\"./lb.js\": 26255,\n\t\"./lo\": 57084,\n\t\"./lo.js\": 57084,\n\t\"./lt\": 2013,\n\t\"./lt.js\": 2013,\n\t\"./lv\": 3419,\n\t\"./lv.js\": 3419,\n\t\"./me\": 84759,\n\t\"./me.js\": 84759,\n\t\"./mi\": 14331,\n\t\"./mi.js\": 14331,\n\t\"./mk\": 78237,\n\t\"./mk.js\": 78237,\n\t\"./ml\": 58888,\n\t\"./ml.js\": 58888,\n\t\"./mn\": 86706,\n\t\"./mn.js\": 86706,\n\t\"./mr\": 72518,\n\t\"./mr.js\": 72518,\n\t\"./ms\": 40261,\n\t\"./ms-my\": 87144,\n\t\"./ms-my.js\": 87144,\n\t\"./ms.js\": 40261,\n\t\"./mt\": 68048,\n\t\"./mt.js\": 68048,\n\t\"./my\": 42539,\n\t\"./my.js\": 42539,\n\t\"./nb\": 17005,\n\t\"./nb.js\": 17005,\n\t\"./ne\": 76152,\n\t\"./ne.js\": 76152,\n\t\"./nl\": 80999,\n\t\"./nl-be\": 42185,\n\t\"./nl-be.js\": 42185,\n\t\"./nl.js\": 80999,\n\t\"./nn\": 32329,\n\t\"./nn.js\": 32329,\n\t\"./oc-lnc\": 5673,\n\t\"./oc-lnc.js\": 5673,\n\t\"./pa-in\": 87820,\n\t\"./pa-in.js\": 87820,\n\t\"./pl\": 99265,\n\t\"./pl.js\": 99265,\n\t\"./pt\": 29577,\n\t\"./pt-br\": 9202,\n\t\"./pt-br.js\": 9202,\n\t\"./pt.js\": 29577,\n\t\"./ro\": 22710,\n\t\"./ro.js\": 22710,\n\t\"./ru\": 73924,\n\t\"./ru.js\": 73924,\n\t\"./sd\": 7406,\n\t\"./sd.js\": 7406,\n\t\"./se\": 68109,\n\t\"./se.js\": 68109,\n\t\"./si\": 67081,\n\t\"./si.js\": 67081,\n\t\"./sk\": 58279,\n\t\"./sk.js\": 58279,\n\t\"./sl\": 38598,\n\t\"./sl.js\": 38598,\n\t\"./sq\": 60065,\n\t\"./sq.js\": 60065,\n\t\"./sr\": 41320,\n\t\"./sr-cyrl\": 59591,\n\t\"./sr-cyrl.js\": 59591,\n\t\"./sr.js\": 41320,\n\t\"./ss\": 75935,\n\t\"./ss.js\": 75935,\n\t\"./sv\": 32468,\n\t\"./sv.js\": 32468,\n\t\"./sw\": 80411,\n\t\"./sw.js\": 80411,\n\t\"./ta\": 43354,\n\t\"./ta.js\": 43354,\n\t\"./te\": 69926,\n\t\"./te.js\": 69926,\n\t\"./tet\": 74424,\n\t\"./tet.js\": 74424,\n\t\"./tg\": 42108,\n\t\"./tg.js\": 42108,\n\t\"./th\": 98577,\n\t\"./th.js\": 98577,\n\t\"./tk\": 42232,\n\t\"./tk.js\": 42232,\n\t\"./tl-ph\": 1494,\n\t\"./tl-ph.js\": 1494,\n\t\"./tlh\": 57353,\n\t\"./tlh.js\": 57353,\n\t\"./tr\": 58871,\n\t\"./tr.js\": 58871,\n\t\"./tzl\": 38363,\n\t\"./tzl.js\": 38363,\n\t\"./tzm\": 81364,\n\t\"./tzm-latn\": 62268,\n\t\"./tzm-latn.js\": 62268,\n\t\"./tzm.js\": 81364,\n\t\"./ug-cn\": 87279,\n\t\"./ug-cn.js\": 87279,\n\t\"./uk\": 76869,\n\t\"./uk.js\": 76869,\n\t\"./ur\": 4926,\n\t\"./ur.js\": 4926,\n\t\"./uz\": 28150,\n\t\"./uz-latn\": 12670,\n\t\"./uz-latn.js\": 12670,\n\t\"./uz.js\": 28150,\n\t\"./vi\": 79940,\n\t\"./vi.js\": 79940,\n\t\"./x-pseudo\": 98888,\n\t\"./x-pseudo.js\": 98888,\n\t\"./yo\": 27893,\n\t\"./yo.js\": 27893,\n\t\"./zh-cn\": 87849,\n\t\"./zh-cn.js\": 87849,\n\t\"./zh-hk\": 71381,\n\t\"./zh-hk.js\": 71381,\n\t\"./zh-mo\": 96440,\n\t\"./zh-mo.js\": 96440,\n\t\"./zh-tw\": 69613,\n\t\"./zh-tw.js\": 69613\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 35358;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + ({\"806\":\"user\",\"842\":\"editorial\",\"884\":\"admin\"}[chunkId] || chunkId) + \".\" + {\"197\":\"b81fcf67\",\"676\":\"6e358735\",\"806\":\"59c85565\",\"842\":\"b47fd6fe\",\"884\":\"97c49927\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"css/\" + {\"806\":\"user\",\"842\":\"editorial\",\"884\":\"admin\"}[chunkId] + \".\" + {\"806\":\"d200559c\",\"842\":\"04fa4dae\",\"884\":\"9008b2dc\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"bml2:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/\";","if (typeof document === \"undefined\") return;\nvar createStylesheet = function(chunkId, fullhref, oldTag, resolve, reject) {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tif (__webpack_require__.nc) {\n\t\tlinkTag.nonce = __webpack_require__.nc;\n\t}\n\tvar onLinkComplete = function(event) {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && event.type;\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + errorType + \": \" + realHref + \")\");\n\t\t\terr.name = \"ChunkLoadError\";\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tif (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\n\tif (oldTag) {\n\t\toldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);\n\t} else {\n\t\tdocument.head.appendChild(linkTag);\n\t}\n\treturn linkTag;\n};\nvar findStylesheet = function(href, fullhref) {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = function(chunkId) {\n\treturn new Promise(function(resolve, reject) {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, null, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t524: 0\n};\n\n__webpack_require__.f.miniCss = function(chunkId, promises) {\n\tvar cssChunks = {\"806\":1,\"842\":1,\"884\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(function() {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, function(e) {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr\n\n// no prefetching\n\n// no preloaded","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t524: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkbml2\"] = self[\"webpackChunkbml2\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [504], function() { return __webpack_require__(37721); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["render","_vm","this","_c","_self","isMaintenance","staticClass","class","showSidebar","attrs","mainClass","loading","require","_e","style","display","_l","navGroups","group","key","_v","_s","navItems","item","index","path","name","$t","unreadCount","isDemo","productTitle","$route","subTitle","ref","on","$event","toggleSidebar","canGoBack","goBack","Date","getFullYear","lastError","line","slot","warnings","staticRenderFns","items","_b","n","remove","cls","close","title","directives","rawName","value","message","expression","pin","domProps","pinSign","props","required","type","String","default","data","pinned","timeToClose","computed","created","setTimeout","methods","$emit","component","counter","components","Message","maxItems","EventBus","$on","addItem","push","length","shift","indexOf","splice","model","show","callback","$$v","goToSso","$store","getters","dispatchedShow","$refs","expirationModal","dispatch","hide","toggle","open","loaded","languages","mainUiLang","languageCodes","languageTitle","overrideMultitextLanguages","fieldLangs","receiveMailsNotes","receiveMailsMessages","searchOptions","defaultProductFilter","columnsetOptions","defaultProductColumns","canSave","save","MultiSelect","state","base","token","mainUiLangSaved","get","selectedUiLanguage","set","v","commit","fieldLangsSaved","userLanguagesForMultiLangFields","receiveMailsNotesSaved","enabled","receiveMailsMessagesSaved","overrideMultitextLanguagesSaved","map","s","id","text","search","label","configuration","defaultProductColumnsSaved","account","userData","nv","obj","find","e","defaultProductFilterSaved","watch","join","slice","ifEmpty","code","updateUserData","overrideMultiLangFieldsWithListData","hideAccountSelect","accountName","hasMultipleAccounts","accounts","isDev","unregister","isLoggedIn","goToKeycloak","logout","filter","active","registrationOptionName","staticData","fullname","product","workingCopyHasChanges","dialog","$dialog","confirm","console","error","hasAccountSelected","query","process","mounted","unregisterAccount","url","window","location","href","Messages","TokenExpired","SettingsPanel","AccountSelect","LayoutMaintenance","groupedRoutes","backendUrl","isProductRoute","startsWith","actualTitle","toLocale","params","rev","changeDate","updated","toDateTimeFormat","responsibility","institution","result","user","accountDisplay","accountId","isAdmin","role","maintenanceMode","accountData","isFibl","deep","handler","changeTitle","err","warningKey","warningText","Object","entries","warningTranslation","includes","warningModal","ErrHandler","errorModal","favloader","log","beforeDestroy","$off","$router","go","page","body","hideSettingsPanel","settingsPanel","async","stripUnusedData","workingCopy","store","rebuildComponents","savedList","documentsToMove","allLists","lists","library","add","faSave","faWindowRestore","faSearch","faTimes","faPencilAlt","faPlus","faPlusCircle","faCircle","faCheckCircle","faTimesCircle","faTrashAlt","faCheckSquare","faSquareFull","faGlobe","faGlobeEurope","faUserCircle","faStar","faLock","faArrowCircleUp","faArrowCircleDown","faClock","faCalendar","faTrash","faCog","faFilter","faBars","faEye","Vue","FontAwesomeIcon","directive","el","binding","visibility","t","options","html","messageBody","handleSave","handleDismiss","handleCancel","mixins","DialogMixin","newListId","saveProduct","proceed","cancel","isValid","Store","Error","i18n","checkForMaintenance","getExtraLogData","ua","navigator","userAgent","lang","language","plat","platform","loc","sx","screen","width","sy","height","app","build","CommitSha","logError","init","config","errorHandler","warnHandler","warn","addEventListener","event","reason","onerror","source","lineno","colno","maintenance","exp","jwtDecode","now","setToken","keyCode","emit","de_DE","en_GB","fr_FR","sv_SE","stackTraceLimit","Infinity","languageStrings","assign","use","BootstrapVue","IconsPlugin","VueProgressBar","thickness","color","VueI18n","Vuelidate","Autocomplete","productionTip","locale","fallbackLocale","messages","bind","vnode","clickOutsideEvent","target","contains","context","document","unbind","removeEventListener","VIEW_NAME","VuejsDialog","view","loader","okText","cancelText","registerComponent","SaveDialog","router","h","App","$mount","tokenCheckHandler","alphanumericSort","a","b","toDate","dateString","moment","toTimeFormat","date","format","userTimeFormat","toDateFormat","fallbackLanguage","booleanDisplay","best","exports","exportLanguage","fallback","trim","toSortable","str","toLowerCase","replace","booleanValue","invoiceFlagDisplay","timeline","flag","returnDate","invoiceFlags","flagDisplay","entry","f","genericDisplay","baseData","actualEntry","x","categoryDisplay","category","categories","componentDisplay","hobbygardenDisplay","hobbygarden","treeDisplay","selectOptionDisplay","selectoptions","countryDisplay","country","countries","regionDisplay","region","regions","labelDisplay","labels","roleDisplay","roleEntry","companylist","roles","biostandardDisplay","biostandard","listDisplay","list","currentList","tab","val","formatter","Intl","NumberFormat","minimumFractionDigits","listAccountsForUser","getToken","switchAccount","payload","post","registerWithDomainByInvite","inviteId","registrationName","getAccountDetails","unregisterOtherAccount","ssoUser","getUserInfos","ids","userIds","updateAccount","loginToDomain","useAccount","p","createNewAccount","requiresConfirmation","updateExistingAccount","maxUsers","removeAccount","createAccountInvite","sendInvite","link","email","template","getCompanyById","sendPostRequest","_updateIndex","entityData","oldData","indexData","JSON","parse","stringify","mainAddress","addresses","owner","createCompany","entityclass","attributeset","createdEntity","updateProductsAfterMerge","companyIds","updateCompany","oldEntity","newData","changeset","patch","createPatch","deleteCompany","deletedEntity","searchCompanies","entityclassId","pagination","sort","getCompaniesByIds","CHUNK_SIZE","chunks","chunk","tempResult","getEntitiesById","concat","aggregateSearch","attributeFilter","endpoint","entityClassId","attributeSetId","entityClass","getEntityclassByExternalId","attributeSet","getAttributesetByExternalId","createHash","hash","crypto","subtle","digest","buf2hex","buffer","Uint8Array","toString","padStart","createDocument","fileContent","fileName","flags","encoder","TextEncoder","encodedFile","encode","attachmentResponse","hashedFile","documentConfig","documentEntity","attachment","base64EncodeFile","getDocument","getEntityById","sendGetRequest","defineProperty","base64DecodeFile","findIdentical","file","getDecodedAttachment","createDocumentFromFile","companyId","readFile","Promise","res","rej","r","FileReader","readAsDataURL","onload","getAttachment","createField","attributesetId","genericEntityCreate","getAllFields","updateField","oldEntry","genericEntityUpdate","deleteField","field","hasDuplicatePaths","pathFilter","idFilter","$not","$and","searchRequest","count","createFromProducts","invoiceData","invoice","updateInvoice","deleteSelection","sendSelection","findInvoicedSpecialItems","institutionId","markForUnindex","productId","listId","markAsPseudoSent","sleep","ms","resolve","waitForTicket","ticketNumber","waitingInterval","start","done","createInvoicePdf","createPrintReportPdf","standard","reportType","contactPerson","dateTime","ticket","createReregistrationPdf","biologicalGardeningListId","company","getReregistrationSummary","summary","cache","Map","clearProductCache","debug","size","clear","addToProductCache","loadProductWithCache","entity","has","loadProduct","attempt","oldSet","match","newEnt","saveProductWrap","withPatch","syncListData","listData","EventHub","newEntity","savedData","setNewDerivedProductData","derivedProduct","fieldByPath","getDefaultValue","_linked","keys","fieldName","fieldValue","doNotMergePaths","listOfPathsForDeepLinking","setDerivedProductId","derivedProductId","values","entryName","linkedEntry","resetNationalPartnerStatus","isNationalPartner","setListArchived","archived","_archived","searchProducts","sorting","listProductsForOwner","$or","comparison","limit","SERVICE","products","BmlCommon","ProductClass","fromStorage","countProducts","createProduct","deleteProduct","getProductTimeline","updatePresenceStatus","section","disablePresence","presentUsers","doNotCopyForNewList","doNotLinkInNewList","addList","baseListId","fieldsEmptyInList","newList","activatedOn","dateValue","toJSON","substr","activatedBy","emptyInLists","defaultValue","_components","additional","doNotUnlinkNewLists","unlinkNewComponents","baseListComponent","baseListSecrecy","secrecy","selectValue","unlinkedComponent","_id","baseList","forEach","k","moveList","targetField","groupBy","ecName","searchWindow","MAX_SEARCH_RESULTS","ecListPromise","getEntityclassList","extId","ec","externalId","getDomain","getEntityFromEav","supe","genericEntityDelete","getTimeline","entityId","_search","requestType","onlyIds","temp","_searchCursor","lastCursor","useCursor","cursor","searchCursorWithGenerator","idsOnly","ProductRepo","countEntries","updateEntity","ent","mode","dryrun","getPatch","getId","getRev","aggregateRun","aggregate","coalesceEc","Array","isArray","aggregates","ecr","createEntity","getEntityclass","getAttributeSet","toStorage","registerWithDomain","gotoLogin","currentToken","Router","basePath","routes","meta","permission","children","AcceptInvite","hideInNav","waitForRole","beforeEach","to","from","next","isAuthRoute","matched","some","then","isEditor","ROLE","Admin","Editor","removeAllListeners","afterEach","getParty","conversation","uid","MessageClass","getMeFilterBothSides","extra","getFilterForMe","party","storeOrgs","storeCompany","amFibl","org","wrap","traverse","layer","createCategory","parentId","disabled","mainCategoryKey","number","order","categoryData","parent","parseFloat","categoryConfig","createdCategoryEntity","updateCategory","oldCategory","deleteCategory","deletedCategoryEntity","getAllCategories","byKey","byId","byIds","categoryIds","mainCategoryFromIds","totalEntries","undefined","pathToRoot","pathToRootOrdered","idx","numberString","reverse","byParent","roots","all","byRoot","rootId","actions","create","child","delete","Set","childId","loadAll","update","mutations","setEcId","setAsId","addChild","removeChild","findIndex","addCategory","resetList","setList","namespaced","ENTITY_EXTERNAL_ID","categoryTexts","checkedBaseline","checkedRows","listFilter","description","standards","listTotalCount","getFilterByOption","option","getListFilter","getListAttributeFilter","rootState","rootGetters","fuzzy","orFilter","subCategory","categoryTextIds","getAll","ensureAttributesetEntityclassLoaded","SystemRepository","as","categoryTextId","newCategoryText","load","texts","categoryText","setFilterOption","addCategoryText","addUpdateCategoryText","updateCategoryText","deleteCategoryText","textIndex","setCategoryTexts","setListCount","oldTextIndex","restrictionTexts","totalCount","restriction","restrictionTextIds","restrictonTextsByCategories","categoryId","restrictionTextId","newRestrictionText","restrictionText","loadAllByCategories","loadByIds","addRestrictionText","addUpdateRestrictionText","updateRestrictionText","deleteRestrictionText","setRestrictionTexts","createBiostandard","updateBiostandard","oldBiostandard","updatedBiostandard","deleteBiostandard","deletedBiostandardEntity","getAllBiostandards","biostandards","toRoot","elements","traverseToRoot","current","dependency","isBaseApproval","baseApproval","sortedByPublicOrder","sorted","valueA","parseInt","publicOrder","valueB","sortedByName","localeCompare","getDependencyLine","addDep","bs","unshift","canBeApprovedWithDependencies","checkIn","checkIfCurrentlyApproved","bsId","_approval","approvalData","ApprovalWorkflowService","checkDateForApproval","loadedData","dependentOnApprovals","valid","reduce","c","old","setEntityClassId","setAttributeSetId","addBiostandard","l","addStandard","createChecklistEntry","getAllEntries","updateEntry","deleteEntry","allActive","Repo","addEntry","setEntries","createOption","getAllOptions","updateOption","types","SelectTypes","byType","byTypeSorted","idToLabel","allList","opt","requiredList","idFolderToLabel","addOption","setOptions","deleteOption","createCountry","getAllCountries","updateCountry","addCountry","resetCountries","deleteCountry","createList","getAllLists","updateList","pdfLogoOptions","PdfLogoTypes","root","baseDataList","isBasedata","getPdfLogoOptions","euList","oldList","setLoaded","resetLists","deleteList","createPermit","getAllPermits","updatePermit","deletePermit","permit","permits","forListAndCategory","mainCategories","addPermit","resetPermits","fields","FieldTypes","byPath","selectOptionById","forTab","displayType","displayKey","byTable","parentTableId","textValue","table","numberValue","multiselectValue","oldField","addField","setFields","optionSource","flat","INDEX_DATA_ITEMS","BOOL_FILTER","invoices","targetYear","sendDate","invoiceDate","periodDescription","customerNumber","invoiceNumber","isCancelled","isSent","showMarkedAsSent","creationModal","substring","standardEndDateFrom","standardEndDateTo","emailText","dryRun","ourSignId","selection","blacklistMode","sendDateComparator","invoiceDateComparator","invoicedInvoices","getCreationModalParamters","getCreationModalParamter","getComparator","comparator","getBoolFilter","invoicIds","getListFinalFilter","constructSelectionFilter","getSelectedItems","getBlacklistMode","getCheckedCount","productlist","productSearchCount","getInvoicedList","sum","companyName","companyAbbreviation","cancellationDate","unindex","invoiceId","responsible","InvoiceRepository","loadInvoicedInvoices","invoicedLists","companies","sums","invoicedList","invoiceCopy","deleteSelected","sendSelected","_","markSelectedAsPseudoSent","setComparator","addInvoice","addUpdateInvoice","setInvoices","setBlacklistMode","setSelectedItems","setCreationModalParamter","resetFilter","setInvoicedInvoices","updateInvoicedList","oldInvoice","createComponent","updateComponent","oldComponent","deleteComponent","getAllComponents","getLevel","actualDepth","traverseElements","depth","rootByMainCategory","mainCategoryMapping","CLASS_ID","addComponent","createEntry","_setEntityClassId","_setAttributeSetId","productSearchCache","companyCache","paginationStart","paginationLimit","searchCached","getDerivedProductId","getDerivedProduct","getBaseApproval","isCreatedByNationalPartner","isInitiatedByNationalPartner","isNationalPartnerInitial","getProductsByInstitutions","institutions","productsByInstitutions","_responsible","getSort","setDerivedProduct","full","oldBaseListData","parentField","parentData","emptyInList","currentRow","archiveList","_createCompanyCache","productListData","_companies","uniqueIds","sortObj","generateSortFields","getProductCount","ensureProductInCache","searchByName","excludedIds","allowedCategoryId","extraFilter","nameFilter","subFilter","exactMatches","exactMatchesIds","loadApplicableAsParent","productIdExcluded","queryNode","SimpleFilter","fieldId","generateQueryFromSearchRoot","loadById","productIds","loadReferencingProducts","institute","addForList","row","addYearToApprovalsInAllLists","baseListData","relevantLists","listResponsible","baseResponsible","sortedStandards","hasProcessed","currentAccountId","relevantList","listBase","relevantApprovals","approvalBase","allValid","pathPrefix","beginPathParts","split","endPathParts","updatedByPathParts","begin","deepGet","end","endDate","setFullYear","deepSet","_getDate","updatedProduct","moveDocumentsToTargetList","documentToMove","targetListId","onlyCopy","_documents","uploadTime","fileId","newBaseData","oldBaseData","otherListIds","_initComponents","_unlinkComponentsForType","oldComponentIds","comp","componentsAdded","newId","newSecrecy","otherListId","unlinkedComponentData","cleanDeletedComponents","baseCopy","existsInBaseList","addProduct","updateProductList","prod","resetProducts","setCount","setProductCache","addProductToSearchCache","setSort","setCompanyCache","setPagination","isNaN","setApprovalHistoryCache","approvalHistoryCache","loadedDocuments","toUpload","secrecyLevels","SECRECY_LEVELS","d","uploadDocuments","uploadDoc","doc","fileData","existingId","newFile","docs","loadDocument","addDocumentToUpload","resetUploadDocs","removeDocFromTemp","deleteDocument","documents","addToLoadedDocuments","checklists","VALID_KEYS","getValue","clid","cl","forSaving","fromEntries","updateValue","defaultStatusOption","status","until","comment","updatedBy","removeRow","addRow","SORT_FIELD_MAPPING","MULTI_LANG_FIELDS","_generateMultiLangSearchField","column","currentLanguage","generateSearchField","actualColumn","ENTITY_CLASS_ID","modules","checklist","Roles","searchCount","activePageNum","perPage","lastQuery","companyKept","companyDeleted","getSearch","getActivePageNum","getPerPage","getCompanyTitle","suffix","getById","paging","currentFilter","getCompanyCount","loadBatch","generator","filteredIds","reloadByIds","loadByNameOrCustomerNumber","findByCustomerNumber","addCompany","rows","resetCompanies","setSearch","setActivePageNum","setPerPage","setLastQuery","setCompanyKept","setCompanyDeleted","createLabel","getAllLabels","updateLabel","oldLabel","addLabel","resetLabels","deleteLabel","createSearch","stringifySearchValues","newSearch","restoreFromStorage","updateSearch","updatedSearch","deleteSearch","getAllSearches","savedSearches","node","childNode","lastSearch","adhocSearch","searches","activeSearch","searchFilter","additionalSearchFilters","getSearchFilter","getActiveSearch","getAdhocSearch","getAdditionalSearchFilters","getAdditionalSearchFilter","getVisible","getIsVisible","isTemporary","creator","isPublic","visibleForInstitutions","currentInstitutions","isInInstitution","_loadEntityClass","_loadAttributeSet","inList","oldSearch","addSearch","setAdhocSearch","setActiveSearch","setAdditionalSearchFilters","filters","setAdditionalSearchFilter","subPath","clearAdditionalSearchFilter","resetAdditionalSearchFilters","resetActiveSearch","setSearchFilter","setLastSearch","sortSearches","searchA","searchB","createColumnSet","updateColumnSet","deleteColumnSet","getAllColumnSets","BaseColumnsetStore","constructor","classId","columnsets","selectedColumnSet","availableFields","hasColumnSetSelected","getSelectedColumnSet","getAvailableFields","pathInternal","refinedResult","fieldById","fieldsByType","fieldsByParent","allFields","baseFields","additionalFields","translateFieldTitle","prefix","translationPrefix","concatFields","SearchFields","ExportConfigPackages","columnSet","newSet","addColumnSet","columnset","setSelectedColumnSet","resetSelectedColumnSet","setAvailableFields","sortColumnsetsByName","columnsetA","columnsetB","BML_DOMAIN","lastIndexOf","keycloak","Keycloak","KeycloakInfo","initPromise","refreshTimer","isInit","main","details","ssoToken","ssoRefreshToken","ssoRefreshTokenParsed","ssoParsed","keycloakAccountUrl","getCurrentToken","ssoUserId","sub","getIsExpired","isSsoTokenExpired","getValidTokenForAccount","getKeycloakAccountUrl","hasSsoLogin","currentAccountCompany","companyLink","currentAccountInstitution","instis","users","accountDetails","initApp","opts","idToken","refreshToken","onLoad","auth","updateToken","setInterval","authenticate","login","createAccountUrl","jwt","switchAccountAndLogin","existing","reload","switchToFirstAvailableAccount","available","refreshTokenAndLogin","refreshed","aud","expDate","setSsoToken","tokenParsed","refreshTokenParsed","setKeycloakAccountUrl","setAccountData","notes","needsLoading","backendParamKeys","filterKeys","extractInstitutionsFromProduct","getNotes","archiveMode","loadNotes","unread","relevantProducts","filteredLists","_notes","categorySelection","_category","categorySelectionEntities","note","read","getProductTitle","loadProducts","notesFilter","$nested","productsPerPage","resetNotes","setNotes","updateFilter","setPage","currentRole","RoleService","getRole","isCorePartner","currentAccount","allInstitutions","corePartner","isInInstitute","institutes","ci","canViewList","basicCanEditList","canEditList","responsibleData","isResponsibleForProduct","canViewProduct","canAccessList","isResponsibleForProductGiven","isResponsible","skipAccount","canApproveStandards","hasApprovalRight","isListReadonly","getAvailableLists","setRole","groups","currentRoutes","hasFittingRole","userRole","routeRole","Registered","doRouteFilter","route","getGroups","getRoutesByGroup","setRoutes","uniq","actualGroups","filteredRoutes","routeObj","getAccounts","getCurrentAccount","getCurrentAccountId","getUserInstitutionIds","userName","loadAccounts","isExpired","accountIds","loadAccountData","sendNotificationMailsNotes","sendNotificationMailsMessages","resetMultiLanguageFields","favoredSearches","hasChanged","notificationEmail","acceptInvite","updateUserEmail","ssoMail","resetAccounts","addAccount","accountsForAllUsers","registrationOptions","ACCOUNT_ENTITY_CLASS_ID","getAccountsForAllUsers","getAccountsForActiveUsers","getAccountById","getRegistrationOptions","getInviteLinkUrl","invite","origin","getInvites","invites","loadAccountsForAllUsers","accountList","orgs","resetAccountsForAllUsers","addAccountForAllUsers","account1","account2","fullname1","fullname2","setRegistrationOptions","createOrganisation","updateOrganisation","deleteOrganisation","getAllOrganisations","ATTRIBUTE_SET_ID","organisations","fiblUsers","organisation","byAccountId","institutionsByCurrentAccount","getFiblUsers","loadFiblUsers","ecaccount","SearchRepo","addOrganisation","setFiblUsers","admin","createConversation","getAllConversationsForUser","accountFilter","getSingleConversation","updateConversation","setArchived","conversations","allConversations","archivedConversations","nonArchivedConversations","conversationById","messagesByConversation","loadAllConversations","reloadConversation","addMessage","archive","addConversation","addSingleMessage","deleteConversation","listAso","roleOptions","Types","activeUntil","hasLinkedUsers","hasSubAccountFlags","activeSmaller","hasCustomerNumber","isChecked","sf","checkedAsIds","checkedCount","getAsoUsers","ensureAsoUsersLoaded","findAdminUsersForCompany","AccountRepo","setEntityclass","setAsoCache","setChecked","resetChecked","setListFilter","languageTitles","LanguageTitles","Languages","userDateFormat","back","getLanguageTitle","languageCode","getLanguagesForSelect","isInProduct","getMultitextLanguages","getFavoriteSearches","getLanguages","getBackUrl","setUiLanguage","setUserLangForFields","langs","setReceiveMailsNotes","setReceiveMailsMessages","setOverrideMultitextLanguages","updateFavoriteSearch","searchId","removeFavoriteSearch","setFavoredSearches","setBackLink","resetBackLink","setLoadingState","setIsMaintenance","setRoute","fullPath","FIBL_DE","loadConversation","contextKey","confirmationId","requestId","recipientOrg","loadedMessage","fromEntity","sendConversation","content","recipient","fiblorg","recipientCompany","fibluser","recipientUser","attachments","subject","defaultTableFilter","folder","productName","sender","debouncedLoadMessages","debounce","pageSize","totalResults","notifCount","allConvo","MessagingService","setCurrentParty","notification","getSubjectFromContext","setSubjectFromContext","institutionSelect","messageEc","companyLinks","conversationForRequest","currentRequestContext","notificationCount","unreadMessageCount","currentPage","tableFilter","loadedOnce","idFiblDE","getFiblDEId","getConversationId","meFilter","addOnBothSides","getCompanyLinks","getConversations","getUnreadMessageCount","getSorting","getNotificationCount","getTableFilter","getPageSize","getCurrentPage","getTotalResults","getName","getSpecificConversation","convo","resetFilters","loadConversations","loadUnreadMessageCount","saveConversation","transformErrorObject","firstTimeInit","loadCompanyLinks","links","buckets","aggregations","i","initNewConvo","contextId","fromData","newMessage","newAttachments","asDraft","getCurrentParty","draft","getCurrentPartyName","sent","MessageRepo","convoClass","getCopyOfConversation","setLastRead","lastmessagesent","lastReadMessages","newCount","initializeConversation","previous","setTableFilter","setUnreadMessageCount","setConversationForRequest","setCurrentRequestContext","isLoad","setCompanyLinks","setConversations","convos","setUnshiftConversations","setNotificationCount","setPageSize","setCurrentPage","setTotalResults","setSorting","setLastReadForConversation","setInListConversation","toEntity","setSpecificConversation","createDeferred","ret","reject","promise","maxProductsPerCall","idsWanted","idsWantedProduct","idsUnavailable","entities","promises","addRequiredEntity","debouncedLoad","SystemRepo","unavailable","debouncedLoadProduct","restIds","found","clearWantedProducts","keepIds","addId","addProductId","addEntities","clearIds","clearAllIds","clearEntities","addUnavailable","createPromise","setIdsWantedProduct","Vuex","persistence","createPersistedState","storage","localStorage","paths","plugins","categorytext","restrictiontext","exportset","batchtemplate","paiduser","messagecenter","related","strict","getTemplateByName","enqueueJob","templateId","flagId","getJobStatusById","jobId","SET_PRODUCT_FLAGS_TEMPLATE","REMOVE_PRODUCT_FLAGS_TEMPLATE","ALL_TEMPLATES","templates","jobStatus","templateByName","jobStatusByJobId","loadTemplates","templateName","setFlag","productSelection","job","jobResult","errors","updateJobStatus","response","jobEntity","setTemplates","setJobStatus","getDocuments","getOptionTitle","titleA","titleB","getDocumentsToMove","moveDocument","moveEntry","clearMoveDocuments","addToMovedDocuments","resetDocumentsToMove","Display","DisplayModule","categoryPath","usedCompanies","usedRestrictionTexts","PROPERTY_VALUE","PROPERTY_OVERRIDE","getAllProducts","currentProductId","getAllStandards","getDisplayFields","getFieldData","getPermitData","getComponentData","getBiostandardData","getApprovalData","getCategoryData","getRestrictionTextData","getCompanyBaseData","getCompanyData","getSelectedMainCategory","getPrintLanguage","getFallbackLanguage","getPrintStandard","getProductData","getDisplayValue","fieldKey","getHeaderValue","getValueFromField","sourceKey","property","getDynamicValues","mainCategory","override","editable","getPrintDataHTML","loadNecessaryCompanies","productData","uniqueCompanyIds","loadRestrictionTexts","approval","uniqueRestrictionTextIds","selectOptions","fieldData","approvals","companyData","companyBase","updateProductData","updateCompanyData","updateLanguage","updateStandard","updateProductIds","setUsedCompanies","setUsedRestrictionTexts","getRelevantApprovals","getApprovedApprovals","getApprovalDataWithParent","currentApprovalRows","baseApprovalRows","relevantBiostandards","isRestrictionEmpty","isEmpty","parentStandard","parentApproval","dep","isBaseCheckApproved","hasRelevantApprovals","createListingConfirmationPdf","pdf","createListingConfirmation","sendListingConfirmation","listingConfirmations","getListingConfirmations","confirmation","createConfirmation","listIds","Repository","updateConfirmationLanguage","oldConfirmation","newConfirmation","sendConfirmation","deleteConfirmation","getPdf","addConfirmation","oldIndex","updateConfirmation","getUnreadNoteCount","KEY_OPTIONSOURCE_MAPPING","KEY_GETTER_OPTIONS","replaceSpecials","getOptionsBySource","exporting","sourceValue","selectOpts","sel","getterValue","currentRoute","getSelectListFromArray","bioopts","bio","CompanyRoles","userOpts","user1","user2","name1","name2","checklistStatus","sources","parentRowId","checklistNOkStatus","src","okay","AddressTypes","getOptions","getField","sortByText","va","vb","isGrouped","hasGroupedOptions","grpLabel","grpId","grp","optionGroups","g","grpContainer","o","SECTION","getPresentUsers","clearPresenceStatus","setPresentUsers","ChangeEmitter","events","evt","listener","_getMatchRegex","origEvt","listeners","_getMatchingListeners","emitAll","parts","re","_matchingEvent","reg","RegExp","test","history","presence","listingconfirmation","componentUnlinkableFields","langSuffixMatch","sanitizeLinkPath","makeComponentIndex","isBase","_isBase","flatMerge","flatBase","flatten","flatList","flatCombined","unflatten","overwrite","pruneComponentIndex","componentMerge","mergeBase","mergedAdditional","listComponentIndex","listAdditionalIndex","baseComponentIndex","baseAdditionalIndex","mergeListAndBase","merged","initializeWorkingCopy","linked","out","subkey","fullKey","emitter","canLink","listHasCompaniesOnOpening","rootList","revNo","tabs","Tabs","fieldErrors","companySeeingRecipe","getLinked","def","extendSelection","workingData","flattened","persistedItem","traverseSelectionTree","flattenArray","arr","addChildren","ordered","element","getTotalSelection","getFieldDefinitions","selectedCategories","visibleInMainCategories","visibleInAnyCategory","overlap","visibleInLists","isFieldValid","isBaseList","getCurrentProductId","getWorkingCopy","getCurrentListId","getCurrentMainCategoryId","_categoryTree","cat","isListArchived","canLinkField","fieldPath","referenceTime","isLocalChecklist","clId","clEntry","modus","listRestrict","restricted","getCurrentPatch","getCompanyWhichSeeRecipe","responsibleOrg","relevantCompaniesId","listKeys","companyHasAccessToRecipe","wk","listSaveFlat","flatState","baseKey","isRemoteChecklist","testkey","listSave","companySet","ld","openProduct","switchList","listEntity","changeFieldValid","stored","registerFieldTest","setStatus","updateLinked","linkPath","baseContainer","currentListId","baseValue","traverseToData","w","noChange","noChangeInt","setFieldValid","updateLink","removeTableRow","validList","removeComponentRow","setLoadedList","changeCurrentList","changeCurrentProduct","setRevData","setCurrentRev","setModuleInitialized","setAllLists","setWorkingCopyHasChanges","resetFieldErrors","closeProduct","updateListCacheForApproal","currentKey","currentListData","setPatch","container","ii","checkEntry","currentCategory","showInTabs","categoryRestrict","getChecklistEntries","onlyOptionals","forCompany","isOptional","getChecklistApprovalStatus","checklistData","relevantProductChecklists","mandatory","baseChecklistData","uncheckedEntries","addProblem","checkData","rowData","distributor","distributorId","relevantCompanyChecklists","_checklist","DESTRUCTIBLE_FIELDS","keyMapping","searchPath","getter","multiGetter","singleGetter","maxColumnCount","displayValues","BATCH_SIZE","_insertArrayAt","array","arrayToInsert","prototype","apply","INVOICE_FIELDS","_getProductsWithFlag","invoiceFlag","finalFields","timelines","getColumn","columns","constructSheet","headers","sheet","rowObj","header","_unwrapPackage","isPackage","subColumns","_unwrapSinglePackageField","subField","parentKey","subFieldCopy","exportSource","foreignKeySource","currentSet","subFieldId","columnSetToPath","isPackageField","applyFilter","listRows","rootRowFilter","parentSet","pathToColumnSet","filterValue","packageFilter","_destructureRows","_cloneRow","_findDiffingSubtrees","treeData","fieldMapping","_getTreeStructure","objectData","_buildSubtrees","leafs","subtrees","leaf","currentSubtree","tree","rowResults","mergedData","subTrees","subTree","newRow","fieldCount","maxCount","subtreeEntry","displayIndex","displayValue","filterArchivedLists","getFields","getFinalFields","getFinalFieldsWithExpandedCategory","catField","newFields","copy","_loadProductsByInvoiceFlag","batches","_loadAndAddProduct","revision","batch","productsWithFlag","loadCount","loadExportHeader","colIdx","headersToExpand","parentPath","currentColumnSet","subColumn","currentField","invoiceField","replaceLineBreaksWithSeparator","loadExportRow","outputRevision","hasColumn","websiteKey","countAll","loadCache","loadLimit","productFilter","productGenerator","doneLoading","loadProductBatch","toRow","invoiceFlagDate","loadFallbackLanguage","listFallback","listFallbackLanguage","getValueFromForeignObject","substituteField","newField","overrideValue","currentSetIndex","getProductColumnValue","splitArray","separatedValues","reverseValues","maxColumns","maxHeaderLength","displayValuesCount","isSplit","splitRows","newRows","setTimelines","setFinalFields","setExportLanguage","expandHeaders","_getColumnTitle","baseIndex","baseField","newElements","j","PATH_FILTER","BASE_PATHS","unrollEntries","newPatches","op","parsePath","totalPath","f2","matchesPathFilter","aggregateHistory","aggregatedFields","getHistory","begins","includeBasePaths","regex","pathMatches","getTimelineEntryCount","getInvoiceFlagTimeStamp","invoiceFlagValue","revisionData","loadTimeline","refresh","_listId","_currentAccountId","_getPath","_basePath","_getRowValue","_updateField","setHours","getHours","_getDateObject","dateWrap","_getDateValue","dateStr","isActiveRow","getInitiator","_hasApprovalDateSet","temporary","hasTemporaryApprovalDateSet","hasApprovalDateSet","canInitiateApproval","isProductCreatedByNationalPartner","isApprovalInitiated","hasBeenFinallyApproved","initiator","isActiveAndApproved","canResetApprovalDate","canRemoveApprovalDate","canSetFinalApproval","initiatorAccountId","getApprovalStateText","initializeApproval","itemId","beginFinal","endFinal","approveFinally","updateApprovalDate","overrideApprovalDate","removeApprovalDate","isApproved","addYearToApproval","beginStr","endStr","setApprovalToOneYear","_defineProperty","external","toRemove","deepIterator","amount","reader","mimeType","decoded","dataUrlParts","atob","bits","charCodeAt","File","downloadDocument","URL","revokeObjectURL","createObjectURL","global","createElement","setAttribute","click","dataUriToBlob","dataURI","mime","encoding","ab","ArrayBuffer","ia","blob","Blob","downloadUpload","saveAs","pubUrl","VUE_APP_PUB_URL","VUE_APP_DISABLE_PRESENCE","VUE_APP_COMMIT_SHA","LogUrl","tmp","lines","reqId","vm","info","bus","Emitter","off","hasAnyKeyFilled","unknown","getFieldValue","valueObj","isFieldVisibleInList","getFieldByNode","tableColumnId","getFieldByPathOrTableColumnId","getTypeByField","useFilterType","filterType","getSourceOptionsForField","tableRowId","includeNull","useParentSelection","visitor","depthFirst","run","stack","ns","ensureValueInOptions","hasGroups","allOptValues","noG","LIST_EU","invoiceDetail","getInvoiceNumber","getProductName","confirmationDetail","getConfirmationDetail","requestDetail","getRequestDetail","copyEntity","productClass","getCompanyName","getProductNameFromRequestId","targetId","prodListData","reqProdName","convoToUpdate","MIN_SPINNER_DURATION_MS","duration","requestCounter","spinnerVisibleUntil","spinnerTimer","_refreshSpinner","_isRequestQueueEmpty","_isSpinnerExpired","_isSpinnerCleared","tryStartSpinner","tryStopSpinner","hideSpinner","clearInterval","backoffTimer","backoffInterval","request","surpressError","allowEmptyPayload","hideProgress","retries","Authorization","method","fetch","retry","ct","json","ok","emptyPayload","None","accountToRole","CORRESPONDENCE_MAIN","CORRESPONDENCE_NATIONAL","CORRESPONDENCE_INVOICE","separator","appendField","z","_getFieldById","_getTableRowsForField","rowSource","getTableRows","extractTableRowTitle","extractTableRowTitleByRowAndColumn","tableRows","unwrapValue","allowedAttributes","attribute","_getValueFromOptionSource","sourceData","_extractSelectValue","optionData","_extractMultiSelectValue","_extractTreeValue","TREE_FALLBACK","treeType","treeEntry","treeValue","_parseNestedTableData","tableData","parsedData","nestedTableObject","inner","_extractTableColumnValue","isNestedTable","wrappedTableValue","preventObjectToArrayMapping","lookup","lookupPath","_convertValue","fieldType","comments","userField","m","author","ts","_extractFieldValue","fromRoot","keyIsValue","objectKeys","isTabularData","dataObj","useSourceAsKey","valueFilter","valueInternal","preventNestedFieldMapping","calculateOrderIds","definitions","orderIds","filtered","highestYear","year","prodMatch","rootFilterValue","_isUsableFilter","_getLinkedPath","foreignObject","linkedPath","sourceColumn","linkedFilter","targetColumn","_applyFilter","splittedPath","rowsToFilter","columnToQuery","rowsFound","useContactPersonFilter","applyContactPersonFilter","catalogListId","conditions","allConditionsMet","itemWithLists","foreignRows","filterableData","useIndex","filterResult","returnValue","filteredRow","extractedValue","contactPersons","filteredPersons","mainCategoryId","getContactOfType","persons","personType","personsOfType","person","function","personsOfcategoryList","jurisdiction","personsOfListNoCategory","personsOfCategoryNoLists","customColumn","FIELD_VALUE_TYPE_MAPPING","DEFAULT_VALUE_MAPPING","DYNAMIC_FIELD_TO_INDEX_MAPPING","FIELD_EXTRA_PREP","transliterate","titleWithSpaces","titleNoSpaces","baseFilter","constructBlacklistFilter","constructWhitelistFilter","totalFilter","notFilter","_appendNestedFieldMapping","mapping","getComparisonMeta","nd","_getAllLists","availableLists","_isIndexMappedField","mappingRaw","isIndexMapped","_wrapResponsibleFilter","subQuery","responsibilityQuery","_isCompanyQuery","_addAdditionalSearchFilters","additionalQuery","isCompanyQuery","CompanyFilter","tableColumnPath","defaultComparator","_companyQuery","_simpleQuery","totalQuery","_wrapActiveFlag","listSearch","_getFieldFromNode","actualField","tableColumn","_parseValue","isFinite","_createMultiValueQuery","operator","valueArr","q","_pushSearchField","preventAutoPath","noPathPrefix","manualAppendListInPath","usePlaceholder","forceExistsQuery","doesTableFieldExist","pathParts","lastPart","pop","rawQuery","activePart","existsPart","forceActiveFlag","_nopQuery","fieldForVis","useOptionSources","optionSourcesForPath","subOptions","nestedSearch","searchField","_approvalQuery","rangeType","_approvalInitiatedQuery","biostandardId","allStandards","nested","startDate","or","subQueryBiostandard","isActive","approvalInitiated","notFinallyApproved","_externalQuery","externalRootId","externalRoot","externalSearchRoot","_nestedQuery","childSearch","_internalGenerateQuery","_tableRowQuery","tableId","hasOwn","listIdField","preventAppendPath","additionalFilter","_type","RESERVED_PATHS","INDEX_LISTDATA_MAPPING","SORTABLE_PATHS","FIELD_SEARCHPATH_TABLE","FIELD_POSTFIX","MULTILANG_TABLE","isDateField","getActualField","isFieldSortable","isIndexField","mapColumnToListField","listField","mapColumnToTranslatedPath","translatedPath","mapFieldWithPostfix","postfix","actualFieldId","isMultiLangField","getCurrentLanguage","generateColumnPath","multiLang","uuidValidate","_searchIndex_","BaseTreeNode","uuid","setLabel","setDescription","NopFilter","super","fixedParentField","_initializeFields","nameField","setFieldId","setTab","setTableColumnId","setValue","CombinedFilter","setOperator","_findClosestParentNode","searchNode","searchResult","removeNode","closestParent","TableRowFilter","tables","ExternalFilter","setExternalRoot","ApprovalFilter","_toString","pushTranslation","pushDateStrings","mapObjectToSelectOption","titleField","useEmptyValue","emptyKey","emptyText","getDefaultSelectListFromArray","isUuid","webpackContext","req","webpackContextResolve","__webpack_require__","module","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","call","deferred","O","chunkIds","fn","priority","notFulfilled","fulfilled","every","__esModule","definition","enumerable","chunkId","u","miniCssF","globalThis","Function","prop","hasOwnProperty","inProgress","dataWebpackPrefix","script","needAttach","scripts","getElementsByTagName","getAttribute","charset","timeout","nc","onScriptComplete","prev","clearTimeout","doneFns","parentNode","head","appendChild","Symbol","toStringTag","nmd","createStylesheet","fullhref","oldTag","linkTag","rel","nonce","onLinkComplete","errorType","realHref","insertBefore","nextSibling","findStylesheet","existingLinkTags","tag","dataHref","existingStyleTags","loadStylesheet","installedCssChunks","miniCss","cssChunks","installedChunks","installedChunkData","loadingEnded","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""}