UNPKG

@enablerr-ui/form

Version:

enablerr - the Next Enterprise Solution

2 lines (1 loc) 31.3 kB
System.register(["axios","@enablerr-ui/auth","@enablerr-ui/layout"],function(t){"use strict";var e,a,n,o;return{setters:[function(t){e=t.default},function(t){a=t.user},function(t){n=t.getGridHelp,o=t.getAttractions}],execute:function(){function s(){}function i(t,e){for(const a in e)t[a]=e[a];return t}function r(t){return t()}function c(){return Object.create(null)}function l(t){t.forEach(r)}function u(t){return"function"==typeof t}function d(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function p(t,...e){if(null==t)return s;const a=t.subscribe(...e);return a.unsubscribe?()=>a.unsubscribe():a}function h(t){let e;return p(t,t=>e=t)(),e}function g(t,e,a,n){if(t){const o=f(t,e,a,n);return t[0](o)}}function f(t,e,a,n){return t[1]&&n?i(a.ctx.slice(),t[1](n(e))):a.ctx}function m(t,e,a,n,o,s,i){const r=function(t,e,a,n){if(t[2]&&n){const o=t[2](n(a));if(void 0===e.dirty)return o;if("object"==typeof o){const t=[],a=Math.max(e.dirty.length,o.length);for(let n=0;n<a;n+=1)t[n]=e.dirty[n]|o[n];return t}return e.dirty|o}return e.dirty}(e,n,o,s);if(r){const o=f(e,a,n,i);t.p(o,r)}}function $(t,e){const a={};e=new Set(e);for(const n in t)e.has(n)||"$"===n[0]||(a[n]=t[n]);return a}function y(t,e){t.appendChild(e)}function w(t,e,a){t.insertBefore(e,a||null)}function x(t){t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function k(){return t="",document.createTextNode(t);var t}function b(t,e,a,n){return t.addEventListener(e,a,n),()=>t.removeEventListener(e,a,n)}function _(t,e,a){null==a?t.removeAttribute(e):t.getAttribute(e)!==a&&t.setAttribute(e,a)}let S;function T(t){S=t}function D(){if(!S)throw new Error("Function called outside component initialization");return S}function I(){const t=D();return(e,a)=>{const n=t.$$.callbacks[e];if(n){const o=function(t,e){const a=document.createEvent("CustomEvent");return a.initCustomEvent(t,!1,!1,e),a}(e,a);n.slice().forEach(e=>{e.call(t,o)})}}}const E=[],j=[],N=[],C=[],L=Promise.resolve();let P=!1;function M(t){N.push(t)}function A(t){C.push(t)}let O=!1;const F=new Set;function R(){if(!O){O=!0;do{for(let t=0;t<E.length;t+=1){const e=E[t];T(e),B(e.$$)}for(T(null),E.length=0;j.length;)j.pop()();for(let t=0;t<N.length;t+=1){const e=N[t];F.has(e)||(F.add(e),e())}N.length=0}while(E.length);for(;C.length;)C.pop()();P=!1,O=!1,F.clear()}}function B(t){if(null!==t.fragment){t.update(),l(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(M)}}const q=new Set;let V;function U(){V={r:0,c:[],p:V}}function W(){V.r||l(V.c),V=V.p}function z(t,e){t&&t.i&&(q.delete(t),t.i(e))}function H(t,e,a,n){if(t&&t.o){if(q.has(t))return;q.add(t),V&&V.c.push(()=>{q.delete(t),n&&(a&&t.d(1),n())}),t.o(e)}}function K(t,e){const a=e.token={};function n(t,n,o,s){if(e.token!==a)return;e.resolved=s;let i=e.ctx;void 0!==o&&(i=i.slice(),i[o]=s);const r=t&&(e.current=t)(i);let c=!1;e.block&&(e.blocks?e.blocks.forEach((t,a)=>{a!==n&&t&&(U(),H(t,1,1,()=>{e.blocks[a]===t&&(e.blocks[a]=null)}),W())}):e.block.d(1),r.c(),z(r,1),r.m(e.mount(),e.anchor),c=!0),e.block=r,e.blocks&&(e.blocks[n]=r),c&&R()}if((o=t)&&"object"==typeof o&&"function"==typeof o.then){const a=D();if(t.then(t=>{T(a),n(e.then,1,e.value,t),T(null)},t=>{if(T(a),n(e.catch,2,e.error,t),T(null),!e.hasCatch)throw t}),e.current!==e.pending)return n(e.pending,0),!0}else{if(e.current!==e.then)return n(e.then,1,e.value,t),!0;e.resolved=t}var o}function G(t,e,a){const n=e.slice(),{resolved:o}=t;t.current===t.then&&(n[t.value]=o),t.current===t.catch&&(n[t.error]=o),t.block.p(n,a)}const J="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Q(t,e){const a={},n={},o={$$scope:1};let s=t.length;for(;s--;){const i=t[s],r=e[s];if(r){for(const t in i)t in r||(n[t]=1);for(const t in r)o[t]||(a[t]=r[t],o[t]=1);t[s]=r}else for(const t in i)o[t]=1}for(const t in n)t in a||(a[t]=void 0);return a}function X(t){return"object"==typeof t&&null!==t?t:{}}function Y(t,e,a){const n=t.$$.props[e];void 0!==n&&(t.$$.bound[n]=a,a(t.$$.ctx[n]))}function Z(t){t&&t.c()}function tt(t,e,a,n){const{fragment:o,on_mount:s,on_destroy:i,after_update:c}=t.$$;o&&o.m(e,a),n||M(()=>{const e=s.map(r).filter(u);i?i.push(...e):l(e),t.$$.on_mount=[]}),c.forEach(M)}function et(t,e){const a=t.$$;null!==a.fragment&&(l(a.on_destroy),a.fragment&&a.fragment.d(e),a.on_destroy=a.fragment=null,a.ctx=[])}function at(t,e){-1===t.$$.dirty[0]&&(E.push(t),P||(P=!0,L.then(R)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function nt(t,e,a,n,o,i,r=[-1]){const u=S;T(t);const d=t.$$={fragment:null,ctx:null,props:i,update:s,not_equal:o,bound:c(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:e.context||[]),callbacks:c(),dirty:r,skip_bound:!1};let p=!1;if(d.ctx=a?a(t,e.props||{},(e,a,...n)=>{const s=n.length?n[0]:a;return d.ctx&&o(d.ctx[e],d.ctx[e]=s)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](s),p&&at(t,e)),a}):[],d.update(),p=!0,l(d.before_update),d.fragment=!!n&&n(d.ctx),e.target){if(e.hydrate){const t=function(t){return Array.from(t.childNodes)}(e.target);d.fragment&&d.fragment.l(t),t.forEach(x)}else d.fragment&&d.fragment.c();e.intro&&z(t.$$.fragment),tt(t,e.target,e.anchor,e.customElement),R()}T(u)}class ot{$destroy(){et(this,1),this.$destroy=s}$on(t,e){const a=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return a.push(e),()=>{const t=a.indexOf(e);-1!==t&&a.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function st(t){let e,a,n,o,s;const i=t[5].default,r=g(i,t,t[4],null);return{c(){e=v("span"),r&&r.c(),_(e,"class",a="pointer icon flex brd-radius-full brd-with-sm "+t[1]+" svelte-1jng2dw"),_(e,"title",t[0])},m(a,i){w(a,e,i),r&&r.m(e,null),n=!0,o||(s=b(e,"click",t[2]),o=!0)},p(t,[o]){r&&r.p&&(!n||16&o)&&m(r,i,t,t[4],o,null,null),(!n||2&o&&a!==(a="pointer icon flex brd-radius-full brd-with-sm "+t[1]+" svelte-1jng2dw"))&&_(e,"class",a),(!n||1&o)&&_(e,"title",t[0])},i(t){n||(z(r,t),n=!0)},o(t){H(r,t),n=!1},d(t){t&&x(e),r&&r.d(t),o=!1,s()}}}function it(t,e,a){let{$$slots:n={},$$scope:o}=e,{title:s}=e,{link:i="/"}=e,{color:r}=e;return t.$$set=t=>{"title"in t&&a(0,s=t.title),"link"in t&&a(3,i=t.link),"color"in t&&a(1,r=t.color),"$$scope"in t&&a(4,o=t.$$scope)},[s,r,()=>window.singleSpaNavigate(i),i,o,n]}const rt=[];function ct(t,e){return{subscribe:lt(t,e).subscribe}}function lt(t,e=s){let a;const n=[];function o(e){if(d(t,e)&&(t=e,a)){const e=!rt.length;for(let e=0;e<n.length;e+=1){const a=n[e];a[1](),rt.push(a,t)}if(e){for(let t=0;t<rt.length;t+=2)rt[t][0](rt[t+1]);rt.length=0}}}return{set:o,update:function(e){o(e(t))},subscribe:function(i,r=s){const c=[i,r];return n.push(c),1===n.length&&(a=e(o)||s),i(t),()=>{const t=n.indexOf(c);-1!==t&&n.splice(t,1),0===n.length&&(a(),a=null)}}}}function ut(t,e,a){const n=!Array.isArray(t),o=n?[t]:t,i=e.length<2;return ct(a,t=>{let a=!1;const r=[];let c=0,d=s;const h=()=>{if(c)return;d();const a=e(n?r[0]:r,t);i?t(a):d=u(a)?a:s},g=o.map((t,e)=>p(t,t=>{r[e]=t,c&=~(1<<e),a&&h()},()=>{c|=1<<e}));return a=!0,h(),function(){l(g),d()}})}const dt=()=>[{moduleId:"1111",position:"0"},{moduleId:"3333",position:""}],pt=()=>[{id:"Standard",activated:!0,days:["Mo","Tu","We","Th","Fr","Sa","Su"],moduleList:[{moduleId:"1111",position:"0"},{moduleId:"3333",position:""}]}],{loggedIn:ht}=a,gt=(t,e)=>{let a="";return t&&(a+=`/${t}`,e&&(a+=`/${e}`)),a},ft=async(t,e)=>{const a=gt(t,e);return(await axios.get("/api/comm/chat"+a)).data.filter(e=>t?e.event&&e.event._id===t:!e.event).filter(t=>e?t.task&&t.task._id===e:!t.task)},{loggedIn:mt}=a,$t=async(t,e)=>[],yt=t("notification",lt(!1)),wt=t("notifications_local",lt([])),xt=t("communication_notification",lt(!1)),vt=t("task_notification",lt(!1)),kt=t("approval_notification",lt(!1)),bt=t("attachment_notification",lt(!1)),_t=lt(!1),St=t("settings",lt({})),Tt=(t("currentRoles",lt()),lt(Date.now()+1e7)),Dt=ut(ct(Date.now(),function(t){const e=setInterval(()=>{t(Date.now())},6e4);return function(){clearInterval(e)}}),t=>t>h(Tt));Dt.subscribe(t=>{if(t)if((()=>{let t=jt.filter(t=>t._valid>Date.now());jt=t,wt.set(jt),yt.set(!0)})(),jt.length>0){const t=jt.reduce((t,e)=>t.__valid<e.__valid?t:e);Tt.set(t.__valid)}else Tt.set(Date.now()+1e7)});const It=[{type:"communication",desc:"Kommunikation",obj:xt},{type:"task",desc:"Aufgabe",obj:vt},{type:"approval",desc:"Visum",obj:kt},{type:"attachment",desc:"Dokument",obj:bt},{type:"workflow",desc:"Worfklow",obj:_t}],Et=(t,e=!1)=>{const a=h(St).setting,n=a?.notificationActivated,o=a?.typesOfNotification,s=It.find(e=>e.type===t.type);if(n&&o.find(t=>t===s?.desc)){const e=jt.filter(e=>e.id==t.id&&e.user==t.user);e.length>0?jt[jt.indexOf(e[0])]=t:(jt.unshift(t),t.__valid<Tt&&Tt.set(t.__valid)),wt.set(jt),yt.set(!1)}e&&s?.obj.set(t)};let jt=[];let Nt=[{id:"001",role:"Kundenmanager",user:"002"},{id:"002",role:"HR",user:"003"},{id:"003",role:"Projektleiter",user:"001"},{id:"004",role:"Software Developer",user:"001"},{id:"005",role:"Software Developer",user:"002"}];const Ct=[{id:1111,name:"TaskModule",text:"Alle Tasks",status:!1,6:n.item({x:0,y:0,w:4,h:5,customDragger:!0}),5:n.item({x:0,y:0,w:4,h:5,customDragger:!0}),4:n.item({x:0,y:0,w:3,h:5,customDragger:!0}),3:n.item({x:0,y:0,w:2,h:5,customDragger:!0}),2:n.item({x:0,y:0,w:1,h:5,customDragger:!0}),1:n.item({x:0,y:0,w:1,h:5,customDragger:!0})},{id:3333,name:"Chat Modul",text:"Chat",status:!1,6:n.item({x:4,y:0,w:1,h:5,customDragger:!0}),5:n.item({x:4,y:0,w:1,h:5,customDragger:!0}),4:n.item({x:3,y:0,w:1,h:5,customDragger:!0}),3:n.item({x:2,y:0,w:1,h:5,customDragger:!0}),2:n.item({x:1,y:0,w:1,h:5,customDragger:!0}),1:n.item({x:1,y:0,w:1,h:5,customDragger:!0})},{id:9999,name:"Neues Modul",text:"+",status:!1,6:n.item({x:4,y:0,w:1,h:2}),5:n.item({x:4,y:0,w:1,h:2}),4:n.item({x:3,y:0,w:1,h:2}),3:n.item({x:2,y:0,w:1,h:2}),2:n.item({x:1,y:0,w:1,h:2}),1:n.item({x:1,y:0,w:1,h:2})}],{cacheValidator:Lt,onLogout:Pt}=a;e.interceptors.request.use(t=>(t.headers.enablerr=window.location.hostname,t)),e.interceptors.response.use(t=>203===t.status?Promise.reject(t.data.error):t,t=>400===t.response?.status?(window.singleSpaNavigate("/error"),Promise.reject(t)):t);let Mt=new Map;const At=(t,e)=>(...a)=>{if("getSchema"===e&&a[1])return t(...a);const n=h(Lt),o=window.localStorage.getItem("enablerr-tenant");"invalid"===n.status&&(Mt=new Map,Lt.set({tenant:o,status:""}));const s=[].concat(o,e,a).join("-");let i=Mt.get(s);if(!i)try{i=t(...a),Mt.set(s,i)}catch(t){throw t}return i};var Ot={getSchema:At((t,e=!1)=>axios.get("/api/schema/"+t).then(t=>t.data).catch(e=>{throw`schema with id ${t} not found`}),"getSchema"),getSchemas:async()=>(await axios.get("/api/schema")).data,getSchemaByClass:At(async(t,e)=>e?(await axios.get(`/api/schemabyclass/${t}/${e}`)).data:(await axios.get(`/api/schemabyclass/${t}`)).data,"getSchemaByClass"),getEvents:At(()=>axios.get("/api/event").then(t=>t.data).catch(t=>{throw"Events not found"}),"getEvents"),getEvent:At(t=>axios.get("/api/event/"+t).then(t=>t.data).catch(e=>{throw`Event with id ${t} not found`}),"getEvent"),getDocById:(t,e)=>axios.post(`/api/read/${t}`,{_id:e}).then(t=>t.data[0]).catch(t=>{throw"doc not found"}),getTask:(t,e)=>axios.get(`/api/task/${t}:${e}?display=form`).then(t=>t.data).catch(t=>{throw"task not found"}),getTaskList:(t,e)=>axios.get(`/api/task/${t}:${e}?display=list`).then(t=>t.data).catch(t=>{}),getTasksList:(t,e=!1,a=!1)=>axios.get(`/api/tasks/${t}${e?"/byIdentity":""}${a?"/all":""}?display=list`).then(t=>t.data).catch(t=>{throw"list not found"}),getTasks:(t,e=!1)=>axios.get(`/api/tasks/${t}${e?"/byIdentity":""}?display=form`).then(t=>t.data).catch(t=>{throw"list not found"}),getTaskById:(t,e=!1)=>axios.post("/api/read/_task",{_id:t,_withStatus:e}).then(t=>t.data[0]).catch(t=>{}),getTaskByDocId:(t,e=!1)=>axios.post("/api/read/_task",{docId:t,_withStatus:e}).then(t=>t.data[0]).catch(t=>{}),getTaskqueue:(t=!1,e)=>axios.post("/api/taskqueue",{id:t,task:e}).then(t=>t.data).catch(t=>{throw"queue not found"}),getTaskqueueDocs:t=>axios.post("/api/taskqueue/docs",{eventName:t}).then(t=>t.data).catch(t=>{throw"docs not found"}),getOneAndOnly:(t,e)=>axios.post(`/api/read/${t}/oneOnly`,e).then(t=>t.data).catch(t=>!1),getReporting:()=>axios.get("/api/taskqueue/reporting").then(t=>t.data).catch(t=>{throw"queue not found"}),getWidgets:()=>axios.get("/api/taskqueue/widgets").then(t=>t.data).catch(t=>{throw"widgets not found"}),getWidgetSelection:t=>axios.get(`/api/task/widget/${t}`).then(t=>t.data).catch(t=>{throw"widget not found"}),createTaskByEventId:t=>axios.post("/api/workflow/task",{event:t}).then(t=>t.data).catch(t=>{}),saveData:async(t,e)=>(await axios.post(`/api/${t}`,e)).data,saveTemplate:async(t,e)=>(await axios.post(`/api/template/${t}`,e)).data,getPlanning:async(t,e,a)=>(await axios.get(`/api/planning/${t}/${e}/${a}`)).data,savePlanning:async(t,e)=>(await axios.post(`/api/planning/${t}`,e)).data,deletePlanning:async(t,e)=>(await axios.patch(`/api/planning/${t}`,e)).data,deleteTask:t=>axios.delete(`/api/_task/${t}`).then(t=>t.data).catch(t=>{}),deleteData:(t,e)=>axios.delete(`/api/task/${t}:${e}`).then(t=>t.data).catch(t=>{}),setTaskVisum:(t,e)=>axios.post(`/api/task/visum/${t}`,{visum:e}).then(t=>t.data).catch(t=>{}),deleteTaskVisum:(t,e)=>axios.delete(`/api/task/visum/${t}/${e}`).then(t=>t.data).catch(t=>{}),getTaskOptions:(t,e,a=!1)=>axios.get(`/api/task/${t}/${e}${a?"/recursive":""}`).then(t=>t.data).catch(t=>{throw"docs not found"}),getLastId:(t,e)=>axios.get(`/api/task/${t}/lastId/${e}`).then(t=>t.data).catch(t=>{throw"docs not found"}),getCumulatedSection:(t,e,a,n)=>axios.get(`/api/task/${t}/${fieldName}/section/${a}/${n}`).then(t=>t.data).catch(t=>{throw"internal error"}),getSection:(t,e,a,n=!1,o=!0)=>{const s={[e]:a,_unique:n};return o&&(s.status=o),axios.post("/api/read/"+t,s).then(t=>n?t.data.map(t=>({[n]:t})):t.data).catch(t=>{throw"internal error"})},getSectionView:(t,e,a=!1)=>(a&&(e._display="list"),e._noTask=!0,axios.post("/api/read/"+t,e).then(t=>t.data).catch(t=>{throw"internal error"})),getCountedSection:(t,e,a,n,o)=>axios.get(`/api/task/${t}/${e}/${a}/count/${n}/${o}`).then(t=>t.data).catch(t=>{throw"internal error"}),readTasksByAggregationId:(t,e=!1,a)=>axios.get(`/api/tasks/id/${t}${e?"/stop":"/"+a}`).then(t=>t.data).catch(t=>{throw"list not found"}),getTasksFiltered:(t,e)=>axios.post(`/api/tasks/${t}/filter`,e).then(t=>t.data).catch(t=>{throw"list not found"}),getTasksListStatus:(t,e)=>axios.get(`/api/tasks/${t}/status/${e}?display=list`).then(t=>t.data).catch(t=>{throw"list not found"}),getSolitaire:t=>axios.post("/api/read/"+t).then(t=>t.data).catch(t=>null),getTemplate:t=>axios.post("/api/read/_template",{_className:t}).then(t=>t.data[0]).catch(t=>{}),savePlugins:async(t,e)=>(await axios.post("/api/plugin",t,e)).data,savePlugin:async(t,e,a)=>(await axios.post(`/api/plugin/${t}`,{body:e,template:a})).data,deletePlugin:async t=>(await axios.delete(`/api/plugin/${t}`)).data,deletePluginAndData:()=>axios.delete("/api/plugin"),dataImport:async(t,e)=>(await axios.post("/api/plugin/import",t,e)).data,dataImportProgress:async t=>(await axios.get(`/api/plugin/import/${t}`)).data,dataExport:async t=>(await axios.post("/api/plugin/export",t)).data,dataExportProgress:async t=>(await axios.get(`/api/plugin/export/${t}`)).data,dataExportResult:async t=>(await axios.get(`/api/plugin/export/result/${t}`)).data,getAuthStatus:async t=>(await axios.post("/api/auth/status",{email:t})).data,getUserSettings:t=>t?axios.get("/api/user/"+t).then(t=>t.data):axios.get("/api/user").then(t=>t.data),saveUserSettings:t=>axios.post("/api/user",t).then(t=>t.data),saveDefaultSettings:async(t,e)=>{let a={schema:"http://json-schema.org/draft-04/schema#",id:e,email:t,firstName:"",lastName:"",jobDescription:"",role:[],setting:{showJobDescription:!1,dashboardLayout:[{id:"Standard",activated:!0,days:["Mo","Tu","We","Th","Fr","Sa","Su"],moduleList:[{moduleId:"1111",position:"0"},{moduleId:"3333",position:""}]}],notificationActivated:!0,showNotifications:!0,notificationToMail:!1,typesOfNotification:["Aufgabe","Visum","Dokument"]}};return axios.post("/api/user",a).then(t=>t.data)},authEnroll:async t=>(await axios.post("/api/auth/enroll",t)).data,authLogin:async(t,e,a,n)=>(await axios.post("/api/auth/login",{username:t,passcode:e,ticketId:a,currTenant:n})).data,authLogout:async()=>await axios.post("/api/auth/logout"),setTenant:async t=>axios.post("/api/auth/tenant",{id:t}).then(t=>t.data).catch(t=>({status:!1})),getAllChats:async()=>axios.get("/api/comm/chat").then(({data:t})=>t),getChat:ft,saveChat:async(t,e,a)=>{const{user:n}=h(ht);let o=await ft(t,e);o[0]||(a.sender=n);const s=o[0]?"patch":"post",i=gt(t,e);return await axios[s]("/api/comm/chat"+i,a),await ft(t,e)},deleteChat:async(t,e,a)=>{const{user:n}=h(ht);let o=await ft(t,e);o[0]||(a.sender=n),o[0];const s=gt(t,e);return await axios.delete("/api/comm/chat"+s+"/"+a.id),await ft(t,e)},getFeedback:$t,saveFeedback:async(t,e,a,n,o)=>{const s={};t&&(s.event={id:t}),e&&(s.task={id:e});let i=await $t();if(i[0]&&null!=o){let t=i.filter(t=>t._id===o);t={...t,...n};const{user:e}=h(mt);return a.sender=e,t[0].messages=(t[0].messages||[]).concat(a),console.log("has id",t[0].messages),(await axios.post("/api/commFeedback",t[0])).data.id}{i={...s},i={...i,...n};const{user:t}=h(mt);return a.sender=t,i.messages=(i.messages||[]).concat(a),console.log("new feedback",i),(await axios.post("/api/commFeedback",i)).data.id}},getUserReports:async t=>(await axios.get("/api/userreport/list/"+t)).data,getUserReport:async t=>(await axios.get("/api/userreport/"+t)).data,uploadUserReport:async(t,e)=>(await axios.post("/api/userreport/"+t,e)).data,deleteUserReport:async t=>(await axios.delete("/api/userreport/"+t)).data,getReport:async t=>(await axios.get(`/api/report/event/${t}`)).data,getReportData:async(t,e)=>(await axios.post(`/api/report/list/${t}/data`,e)).data,getReportDoc:async t=>(await axios.get(`/api/report/task/${t}`)).data,getDocData:async t=>(await axios.post(`/api/report/task/${t}/data`)).data,progressReport:async t=>(await axios.get(`/api/progress/report/${t}`)).data,createReport:async(t,e)=>(await axios.post(`/api/report/list/${t}`,e)).data,getService:(t,e,a)=>axios.post(`/api/service/${t}/${e}`,{data:a}).then(t=>t.data).catch(t=>[]),load:t=>axios.post("/api/neo4j",{taskId:t}).then(t=>t.data).catch(t=>{throw"workflows not loaded"}),processScript:async t=>(await axios.get(`/api/processScript//${t}`)).data,getMatrixItems:(t,e)=>axios.get(`/api/matrix/${t}/${e}`).then(t=>t.data).catch(t=>{throw"matrix not found"}),getDefaultModuleList:dt,getDefaultLayout:pt,getNotifications:t=>axios.get("/api/notification").then(async t=>{await new Promise(t=>setTimeout(t,2e3));for(let e of t.data)Et(e,!1);return jt}),getNotificationsLocal:t=>jt,saveNotification:Et,updateNotification:t=>{let e=jt.filter(e=>e.id==t.id&&e.user==t.user);e.length>0?(jt[jt.indexOf(e[0])]=t,wt.set(jt)):Et(t,!1)},getNotificationTypes:At(()=>axios.get("/api/notification/type").then(t=>t.data),"getNotificationTypes"),getRoles:t=>Nt.filter(e=>e.user===t),getModules:t=>Ct.filter(e=>t.includes(e.id)),getModuleName:t=>{const e=Ct.find(e=>e.id===Number(t));return e?e.name:"Unbekanntes Modul"},getAllModules:()=>Ct,createTicket:t=>axios.post("/api/ticket",t).then(t=>t.data).catch(t=>{}),getTickets:()=>axios.get("/api/ticket").then(t=>t.data).catch(t=>{throw"ticket not found"}),deleteTicket:t=>axios.delete(`/api/ticket/${t}`).then(t=>t.data).catch(t=>{}),getTicketByUser:t=>axios.get(`/api/ticket/${t}`).then(t=>t.data).catch(t=>{throw"ticket not found"})};const Ft=Intl.NumberFormat().formatToParts(1.1).find(({type:t})=>"decimal"===t).value||".",Rt=t=>"function"==typeof t,Bt=t=>t&&t.toString,qt=(t,...e)=>e.includes(t),Vt=t=>qt(t,void 0,null),Ut=t=>!Vt(t),Wt=(t=null,e,...a)=>{try{return e(...a)}catch{return t}},zt=t=>(e,...a)=>Wt(Wt("",t.toString),e,...a),Ht=(t,e=2,a=0,n=t.toString(),o=a.toString())=>o.repeat(e-n.length)+n,Kt=(t,e=window)=>({listen(a,n){e[`${a}EventListener`](t,n)},start(t){this.listen("add",t)},stop(t){this.listen("remove",t)}}),Gt=(...t)=>!t.map(({value:t,check:e,text:a})=>e(t)||Xt(console.error,a)).every(Boolean),Jt=t=>(e,a)=>(Promise.resolve(a).then(e),t),Qt=Jt(!0),Xt=Jt(!1);var Yt=Object.freeze({__proto__:null,decimalSeparator:Ft,isFunction:Rt,isStringable:Bt,isObjEmpty:(t={})=>!Object.keys(t).length,hasValue:qt,isNullish:Vt,isNotNullish:Ut,bestValue:(t,...e)=>e.concat(t).find(Ut),tryCatch:Wt,ensureStrValue:zt,padLeft:(...t)=>zt(t[0])(Ht,...t),showupElement:(t="",e=0,a=document.getElementById(t))=>a&&a.style&&(a.style.display="block",setTimeout(()=>a.style.display="none",e)),getListener:Kt,isMissing:Gt,go:Qt,stop:Xt});t("util",Yt);const Zt="single-spa:routing-event",te=Kt(Zt);function ee(t,{modulePath:e,update:a}){if(!1===a)return;if(Gt({value:a,check:Rt,text:"<update> should be a function (dataListener)"},{value:e,check:Bt,text:"<modulePath> should be a string (dataListener)"}))return;const n=e.toString()||"/",o=e=>{const o=e.currentTarget.location.pathname,[,s,...i]=o.split("/");n===(s||"/")&&t.dispatchEvent(new CustomEvent("data",{detail:{data:a(...i)}}))};return te.start(o),{destroy:()=>te.stop(o)}}const ae=()=>window.dispatchEvent(new CustomEvent(Zt)),ne=t=>({prop:4&t,tenant:8&t,user:8&t}),oe=t=>({prop:t[11],refresh:ae,tenant:t[3].tenant,user:t[3].user}),se=t=>({err:4&t,prop:4&t,tenant:8&t,user:8&t}),ie=t=>({err:t[12],prop:t[11],refresh:ae,tenant:t[3].tenant,user:t[3].user}),re=t=>({prop:4&t,tenant:8&t,user:8&t}),ce=t=>({prop:t[11],refresh:ae,tenant:t[3].tenant,user:t[3].user}),le=t=>({prop:4&t,tenant:8&t,user:8&t}),ue=t=>({prop:t[11],refresh:ae,tenant:t[3].tenant,user:t[3].user});function de(t){let e;const a=t[8].init,n=g(a,t,t[7],oe);return{c(){n&&n.c()},m(t,a){n&&n.m(t,a),e=!0},p(t,o){n&&n.p&&(!e||140&o)&&m(n,a,t,t[7],o,ne,oe)},i(t){e||(z(n,t),e=!0)},o(t){H(n,t),e=!1},d(t){n&&n.d(t)}}}function pe(t){let e,a,n,o={ctx:t,current:null,token:null,hasCatch:!0,pending:fe,then:ge,catch:he,value:11,error:12,blocks:[,,,]};return K(a=t[2],o),{c(){e=k(),o.block.c()},m(t,a){w(t,e,a),o.block.m(t,o.anchor=a),o.mount=()=>e.parentNode,o.anchor=e,n=!0},p(e,n){t=e,o.ctx=t,4&n&&a!==(a=t[2])&&K(a,o)||G(o,t,n)},i(t){n||(z(o.block),n=!0)},o(t){for(let t=0;t<3;t+=1){H(o.blocks[t])}n=!1},d(t){t&&x(e),o.block.d(t),o.token=null,o=null}}}function he(t){let e;const a=t[8].error,n=g(a,t,t[7],ie);return{c(){n&&n.c()},m(t,a){n&&n.m(t,a),e=!0},p(t,o){n&&n.p&&(!e||140&o)&&m(n,a,t,t[7],o,se,ie)},i(t){e||(z(n,t),e=!0)},o(t){H(n,t),e=!1},d(t){n&&n.d(t)}}}function ge(t){let e;const a=t[8].default,n=g(a,t,t[7],ce);return{c(){n&&n.c()},m(t,a){n&&n.m(t,a),e=!0},p(t,o){n&&n.p&&(!e||140&o)&&m(n,a,t,t[7],o,re,ce)},i(t){e||(z(n,t),e=!0)},o(t){H(n,t),e=!1},d(t){n&&n.d(t)}}}function fe(t){let e,a,n,o={ctx:t,current:null,token:null,hasCatch:!1,pending:ye,then:$e,catch:me,value:10,blocks:[,,,]};return K(a=t[5](t[1]),o),{c(){e=k(),o.block.c()},m(t,a){w(t,e,a),o.block.m(t,o.anchor=a),o.mount=()=>e.parentNode,o.anchor=e,n=!0},p(e,n){t=e,o.ctx=t,2&n&&a!==(a=t[5](t[1]))&&K(a,o)||G(o,t,n)},i(t){n||(z(o.block),n=!0)},o(t){for(let t=0;t<3;t+=1){H(o.blocks[t])}n=!1},d(t){t&&x(e),o.block.d(t),o.token=null,o=null}}}function me(t){return{c:s,m:s,p:s,i:s,o:s,d:s}}function $e(t){let e;const a=t[8].load,n=g(a,t,t[7],ue);return{c(){n&&n.c()},m(t,a){n&&n.m(t,a),e=!0},p(t,o){n&&n.p&&(!e||140&o)&&m(n,a,t,t[7],o,le,ue)},i(t){e||(z(n,t),e=!0)},o(t){H(n,t),e=!1},d(t){n&&n.d(t)}}}function ye(t){return{c:s,m:s,p:s,i:s,o:s,d:s}}function we(t){let e,a,n,o,i,r,c;const d=[pe,de],p=[];function h(t,e){return t[2]?0:1}return a=h(t),n=p[a]=d[a](t),{c(){e=v("section"),n.c(),_(e,"class","data")},m(n,l){var d;w(n,e,l),p[a].m(e,null),i=!0,r||(c=[(d=o=ee.call(null,e,t[0]),d&&u(d.destroy)?d.destroy:s),b(e,"data",t[9])],r=!0)},p(t,[s]){let i=a;a=h(t),a===i?p[a].p(t,s):(U(),H(p[i],1,1,()=>{p[i]=null}),W(),n=p[a],n?n.p(t,s):(n=p[a]=d[a](t),n.c()),z(n,1),n.m(e,null)),o&&u(o.update)&&1&s&&o.update.call(null,t[0])},i(t){i||(z(n),i=!0)},o(t){H(n),i=!1},d(t){t&&x(e),p[a].d(),r=!1,l(c)}}}function xe(t,e,n){let o,{$$slots:s={},$$scope:i}=e;const{loggedIn:r}=a;var c,l;c=r,l=t=>n(3,o=t),t.$$.on_destroy.push(p(c,l));let u,{options:d}=e,{update:h=!1}=e,{loadingDelay:g=250}=e;h&&(d={update:h,modulePath:window.location.pathname.split("/")[1]||"/"});return t.$$set=t=>{"options"in t&&n(0,d=t.options),"update"in t&&n(6,h=t.update),"loadingDelay"in t&&n(1,g=t.loadingDelay),"$$scope"in t&&n(7,i=t.$$scope)},[d,g,u,o,r,t=>new Promise(e=>setTimeout(e,t)),h,i,s,({detail:t})=>n(2,u=t.data)]}const{document:ve}=J;function ke(t){let e,a,n;const o=[{class:"full-width"},{inputClass:t[2]||t[5]},{multiline:!0},{style:t[1]},{readonly:t[6]},{id:t[3]},{placeholder:t[7]},{rows:t[4]},t[12]];function s(e){t[15](e)}let r={};for(let t=0;t<o.length;t+=1)r=i(r,o[t]);return void 0!==t[0]&&(r.value=t[0]),e=new t[9]({props:r}),j.push(()=>Y(e,"value",s)),e.$on("change",t[10]),e.$on("focus",t[11]),{c(){Z(e.$$.fragment)},m(t,a){tt(e,t,a),n=!0},p(t,n){const s=4350&n?Q(o,[o[0],36&n&&{inputClass:t[2]||t[5]},o[2],2&n&&{style:t[1]},64&n&&{readonly:t[6]},8&n&&{id:t[3]},128&n&&{placeholder:t[7]},16&n&&{rows:t[4]},4096&n&&X(t[12])]):{};!a&&1&n&&(a=!0,s.value=t[0],A(()=>a=!1)),e.$set(s)},i(t){n||(z(e.$$.fragment,t),n=!0)},o(t){H(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function be(t){let e,a,n;const o=[{class:"full-width"},{inputClass:t[2]||t[5]},{multiline:!0},{readonly:t[6]},{id:t[3]},{placeholder:t[7]},{rows:t[4]},t[12]];function s(e){t[14](e)}let r={};for(let t=0;t<o.length;t+=1)r=i(r,o[t]);return void 0!==t[0]&&(r.value=t[0]),e=new t[9]({props:r}),j.push(()=>Y(e,"value",s)),e.$on("change",t[10]),e.$on("focus",t[11]),{c(){Z(e.$$.fragment)},m(t,a){tt(e,t,a),n=!0},p(t,n){const s=4348&n?Q(o,[o[0],36&n&&{inputClass:t[2]||t[5]},o[2],64&n&&{readonly:t[6]},8&n&&{id:t[3]},128&n&&{placeholder:t[7]},16&n&&{rows:t[4]},4096&n&&X(t[12])]):{};!a&&1&n&&(a=!0,s.value=t[0],A(()=>a=!1)),e.$set(s)},i(t){n||(z(e.$$.fragment,t),n=!0)},o(t){H(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function _e(t){let e,a,n,o;const s=[be,ke],i=[];function r(t,e){return t[8]?0:1}return e=r(t),a=i[e]=s[e](t),{c(){a.c(),n=k()},m(t,a){i[e].m(t,a),w(t,n,a),o=!0},p(t,[o]){let c=e;e=r(t),e===c?i[e].p(t,o):(U(),H(i[c],1,1,()=>{i[c]=null}),W(),a=i[e],a?a.p(t,o):(a=i[e]=s[e](t),a.c()),z(a,1),a.m(n.parentNode,n))},i(t){o||(z(a),o=!0)},o(t){H(a),o=!1},d(t){i[e].d(t),t&&x(n)}}}function Se(t,e,a){const n=["noForm","id","value","style","rows","classId","readonly","overwrite","placeholder","standard"];let s=$(e,n);const r=I(),{TextField:c}=o;let{noForm:l=""}=e,{id:u}=e,{value:d}=e,{style:p=""}=e,{rows:h=3}=e,{classId:g}=e,{readonly:f}=e,{overwrite:m}=e,{placeholder:y=""}=e,{standard:w=!1}=e;p+=" padding-bottom: .5em;";const x=w?2:5*(h>1),v=()=>{const t=document.getElementById(u);if(!t)return;const{style:e,scrollHeight:a}=t;a&&(e.height=`${a+x}px`)};return t.$$set=t=>{e=i(i({},e),function(t){const e={};for(const a in t)"$"!==a[0]&&(e[a]=t[a]);return e}(t)),a(12,s=$(e,n)),"noForm"in t&&a(2,l=t.noForm),"id"in t&&a(3,u=t.id),"value"in t&&a(0,d=t.value),"style"in t&&a(1,p=t.style),"rows"in t&&a(4,h=t.rows),"classId"in t&&a(5,g=t.classId),"readonly"in t&&a(6,f=t.readonly),"overwrite"in t&&a(13,m=t.overwrite),"placeholder"in t&&a(7,y=t.placeholder),"standard"in t&&a(8,w=t.standard)},t.$$.update=()=>{8192&t.$$.dirty&&m&&(a(0,d=""),a(13,m=!1)),1&t.$$.dirty&&d&&setTimeout(v)},[d,p,l,u,h,g,f,y,w,c,({detail:{value:t}})=>r("blur",{value:t}),()=>r("onFocus"),s,m,function(t){d=t,a(0,d),a(13,m)},function(t){d=t,a(0,d),a(13,m)}]}class Te extends ot{constructor(t){var e;super(),ve.getElementById("svelte-146pyh5-style")||((e=v("style")).id="svelte-146pyh5-style",e.textContent="div.text-field.full-width textarea{resize:vertical}div.form-field:has(label + .help) div.text-field:has(textarea){margin-bottom:1em !important}",y(ve.head,e)),nt(this,t,Se,_e,d,{noForm:2,id:3,value:0,style:1,rows:4,classId:5,readonly:6,overwrite:13,placeholder:7,standard:8})}}function De(t){let e,a;return e=new Te({props:{style:"min-width: 25em; overflow-y: hidden; resize: none;",id:t[0],value:t[1]}}),{c(){Z(e.$$.fragment)},m(t,n){tt(e,t,n),a=!0},p(t,[a]){const n={};1&a&&(n.id=t[0]),2&a&&(n.value=t[1]),e.$set(n)},i(t){a||(z(e.$$.fragment,t),a=!0)},o(t){H(e.$$.fragment,t),a=!1},d(t){et(e,t)}}}function Ie(t,e,a){let{id:n}=e,{value:o}=e;return t.$$set=t=>{"id"in t&&a(0,n=t.id),"value"in t&&a(1,o=t.value)},[n,o]}class Ee extends ot{constructor(t){super(),nt(this,t,Ie,De,d,{id:0,value:1})}}function je(t){let e,a,n;function o(e){t[8](e)}let s={id:t[6]};return void 0!==t[3]&&(s.value=t[3]),e=new Ee({props:s}),j.push(()=>Y(e,"value",o)),{c(){Z(e.$$.fragment)},m(t,a){tt(e,t,a),n=!0},p(t,n){const o={};!a&&8&n&&(a=!0,o.value=t[3],A(()=>a=!1)),e.$set(o)},i(t){n||(z(e.$$.fragment,t),n=!0)},o(t){H(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function Ne(t){let e,a;return e=new t[5]({props:{title:t[2],closeCallback:t[7],$$slots:{default:[je]},$$scope:{ctx:t}}}),{c(){Z(e.$$.fragment)},m(t,n){tt(e,t,n),a=!0},p(t,a){const n={};4&a&&(n.title=t[2]),1032&a&&(n.$$scope={dirty:a,ctx:t}),e.$set(n)},i(t){a||(z(e.$$.fragment,t),a=!0)},o(t){H(e.$$.fragment,t),a=!1},d(t){et(e,t)}}}function Ce(t){let e,a;return e=new t[4]({props:{open:t[1],messages:t[0],$$slots:{default:[Ne]},$$scope:{ctx:t}}}),{c(){Z(e.$$.fragment)},m(t,n){tt(e,t,n),a=!0},p(t,[a]){const n={};2&a&&(n.open=t[1]),1&a&&(n.messages=t[0]),1036&a&&(n.$$scope={dirty:a,ctx:t}),e.$set(n)},i(t){a||(z(e.$$.fragment,t),a=!0)},o(t){H(e.$$.fragment,t),a=!1},d(t){et(e,t)}}}function Le(t,e,a){const n=I(),{Modal:s,Dialog:i}=o;let r,{title:c}=e,{messages:l=""}=e,{modalOpen:u=!1}=e;return t.$$set=t=>{"title"in t&&a(2,c=t.title),"messages"in t&&a(0,l=t.messages),"modalOpen"in t&&a(1,u=t.modalOpen)},t.$$.update=()=>{9&t.$$.dirty&&l&&(a(3,r=[].concat(l).join("\n")),r&&a(1,u=!0))},[l,u,c,r,s,i,"modalDialog",t=>{a(1,u=!1),a(3,r=""),a(0,l=""),n("change",u)},function(t){r=t,a(3,r),a(0,l)}]}t("version","0.2.132");const Pe=window.sessionStorage;Pe.clear();t("Storage",{getItem:t=>Pe.getItem(t),setItem:(t,e)=>Pe.setItem(t,e)});t("toasts",function(){const t=lt([]);function e(e,a,n="default"){a||(a=3e3),t.update(t=>t.length>3?t:t=[...t,{id:"_"+Math.random().toString(36).substring(2,9),type:n,msg:e,timeout:a}])}const a=ut(t,(e,a)=>{if(a(e),e&&e.length>0){const a=setTimeout(()=>{t.update(t=>(t.shift(),t))},e[0].timeout);return()=>{clearTimeout(a)}}}),{subscribe:n}=a;return{subscribe:n,send:e,default:(t,a)=>e(t,a,"default"),success:(t,a)=>e(t,a,"success"),failed:(t,a)=>e(t,a,"failed")}}()),t("LinkIcon",class extends ot{constructor(t){var e;super(),document.getElementById("svelte-1jng2dw-style")||((e=v("style")).id="svelte-1jng2dw-style",e.textContent=".red.svelte-1jng2dw{background-color:var(--m-color-red-light)}.blue.svelte-1jng2dw{background-color:var(--m-color-blue-light)}.green.svelte-1jng2dw{background-color:var(--m-color-green-light)}.icon.svelte-1jng2dw{max-height:1.2em}",y(document.head,e)),nt(this,t,it,st,d,{title:0,link:3,color:1})}}),t("Page",class extends ot{constructor(t){super(),nt(this,t,xe,we,d,{options:0,update:6,loadingDelay:1})}}),t("Request",Ot),t("TextArea",Te),t("ModalDialog",class extends ot{constructor(t){super(),nt(this,t,Le,Ce,d,{title:2,messages:0,modalOpen:1})}})}}});