@enablerr-ui/detail 0.2.208 → 0.2.210

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- System.register(["@enablerr-ui/form","@enablerr-ui/layout"],(function(e){"use strict";var t,n,o,s,r,i,l,a,c;return{setters:[function(e){t=e.Request,n=e.task_notification,o=e.TextArea,s=e.Storage,r=e.toasts,i=e.settings,l=e.currentRoles,a=e.Page},function(e){c=e.getAttractions}],execute:function(){e("version","0.2.208");const d=e("checkDate",((e,t)=>"string"!=typeof e||e.length<20||!(t=e.split(" · "))?e:t.map((e=>2===e.split("T").length&&3===e.split("T")[0].split("-").length?new Date(e).toLocaleDateString():e)).filter((e=>!!e)).join(" · "))),u=e=>{try{return new Date(e).toLocaleString()}catch{return e}},m=e=>e?"(ja)":"(nein)",f=(e,t)=>{const n={...t};return(e.display?.reduce(((t,o)=>{let[s,r]=o.split(".");if(e.list?.find((({name:e})=>e===s))&&r&&void 0!==n[s]){const e=`${s}_${r}`;n[e]=n[s][r],s=e}return t.find((e=>e===s))||t.push(s),t}),[]).map((e=>d(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":t[e.name]))).map((e=>e?.split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")};function p(){}function $(e){return e()}function g(){return Object.create(null)}function h(e){e.forEach($)}function v(e){return"function"==typeof e}function b(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function y(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return p;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function w(e){return null==e?"":e}function x(e,t){e.appendChild(t)}function k(e,t,n){e.insertBefore(t,n||null)}function I(e){e.parentNode.removeChild(e)}function F(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function _(e){return document.createElement(e)}function S(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function C(e){return document.createTextNode(e)}function E(){return C(" ")}function D(){return C("")}function N(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function O(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function j(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function z(e,t){e.value=null==t?"":t}function L(e,t,n,o){e.style.setProperty(t,n,o?"important":"")}function P(e,t,n){e.classList[n?"add":"remove"](t)}let T;function M(e){T=e}function B(){if(!T)throw new Error("Function called outside component initialization");return T}function A(e){B().$$.on_mount.push(e)}function q(){const e=B();return(t,n)=>{const o=e.$$.callbacks[t];if(o){const s=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);o.slice().forEach((t=>{t.call(e,s)}))}}}function W(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const H=[],R=[],Y=[],G=[],V=Promise.resolve();let J=!1;function U(e){Y.push(e)}function K(e){G.push(e)}let Q=!1;const X=new Set;function Z(){if(!Q){Q=!0;do{for(let e=0;e<H.length;e+=1){const t=H[e];M(t),ee(t.$$)}for(M(null),H.length=0;R.length;)R.pop()();for(let e=0;e<Y.length;e+=1){const t=Y[e];X.has(t)||(X.add(t),t())}Y.length=0}while(H.length);for(;G.length;)G.pop()();J=!1,Q=!1,X.clear()}}function ee(e){if(null!==e.fragment){e.update(),h(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(U)}}const te=new Set;let ne;function oe(){ne={r:0,c:[],p:ne}}function se(){ne.r||h(ne.c),ne=ne.p}function re(e,t){e&&e.i&&(te.delete(e),e.i(t))}function ie(e,t,n,o){if(e&&e.o){if(te.has(e))return;te.add(e),ne&&ne.c.push((()=>{te.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}}function le(e,t){const n=t.token={};function o(e,o,s,r){if(t.token!==n)return;t.resolved=r;let i=t.ctx;void 0!==s&&(i=i.slice(),i[s]=r);const l=e&&(t.current=e)(i);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==o&&e&&(oe(),ie(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),se())})):t.block.d(1),l.c(),re(l,1),l.m(t.mount(),t.anchor),a=!0),t.block=l,t.blocks&&(t.blocks[o]=l),a&&Z()}if((s=e)&&"object"==typeof s&&"function"==typeof s.then){const n=B();if(e.then((e=>{M(n),o(t.then,1,t.value,e),M(null)}),(e=>{if(M(n),o(t.catch,2,t.error,e),M(null),!t.hasCatch)throw e})),t.current!==t.pending)return o(t.pending,0),!0}else{if(t.current!==t.then)return o(t.then,1,t.value,e),!0;t.resolved=e}var s}function ae(e,t,n){const o=t.slice(),{resolved:s}=e;e.current===e.then&&(o[e.value]=s),e.current===e.catch&&(o[e.error]=s),e.block.p(o,n)}const ce="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function de(e,t,n){const o=e.$$.props[t];void 0!==o&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}function ue(e){e&&e.c()}function me(e,t,n,o){const{fragment:s,on_mount:r,on_destroy:i,after_update:l}=e.$$;s&&s.m(t,n),o||U((()=>{const t=r.map($).filter(v);i?i.push(...t):h(t),e.$$.on_mount=[]})),l.forEach(U)}function fe(e,t){const n=e.$$;null!==n.fragment&&(h(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function pe(e,t){-1===e.$$.dirty[0]&&(H.push(e),J||(J=!0,V.then(Z)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function $e(e,t,n,o,s,r,i=[-1]){const l=T;M(e);const a=e.$$={fragment:null,ctx:null,props:r,update:p,not_equal:s,bound:g(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:t.context||[]),callbacks:g(),dirty:i,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return a.ctx&&s(a.ctx[t],a.ctx[t]=r)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](r),c&&pe(e,t)),n})):[],a.update(),c=!0,h(a.before_update),a.fragment=!!o&&o(a.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);a.fragment&&a.fragment.l(e),e.forEach(I)}else a.fragment&&a.fragment.c();t.intro&&re(e.$$.fragment),me(e,t.target,t.anchor,t.customElement),Z()}M(l)}class ge{$destroy(){fe(this,1),this.$destroy=p}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function he(e){let t,n,o,s;return{c(){t=S("svg"),n=S("polyline"),o=S("path"),O(n,"points","9 10 4 15 9 20"),O(o,"d","M20 4v7a4 4 0 0 1-4 4H4"),O(t,"xmlns","http://www.w3.org/2000/svg"),O(t,"width",e[0]),O(t,"height",e[0]),O(t,"fill","none"),O(t,"viewBox","0 0 24 24"),O(t,"stroke","currentColor"),O(t,"stroke-width",e[1]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"class",s="feather feather-corner-down-left "+e[2])},m(e,s){k(e,t,s),x(t,n),x(t,o)},p(e,[n]){1&n&&O(t,"width",e[0]),1&n&&O(t,"height",e[0]),2&n&&O(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-corner-down-left "+e[2])&&O(t,"class",s)},i:p,o:p,d(e){e&&I(t)}}}function ve(e,t,n){let{size:o="100%"}=t,{strokeWidth:s=2}=t,{class:r=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,s=e.strokeWidth),"class"in e&&n(2,r=e.class)},[o,s,r]}class be extends ge{constructor(e){super(),$e(this,e,ve,he,b,{size:0,strokeWidth:1,class:2})}}function ye(e){let t,n,o,s,r;return{c(){t=S("svg"),n=S("path"),o=S("line"),s=S("line"),O(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),O(o,"x1","18"),O(o,"y1","9"),O(o,"x2","12"),O(o,"y2","15"),O(s,"x1","12"),O(s,"y1","9"),O(s,"x2","18"),O(s,"y2","15"),O(t,"xmlns","http://www.w3.org/2000/svg"),O(t,"width",e[0]),O(t,"height",e[0]),O(t,"fill","none"),O(t,"viewBox","0 0 24 24"),O(t,"stroke","currentColor"),O(t,"stroke-width",e[1]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"class",r="feather feather-delete "+e[2])},m(e,r){k(e,t,r),x(t,n),x(t,o),x(t,s)},p(e,[n]){1&n&&O(t,"width",e[0]),1&n&&O(t,"height",e[0]),2&n&&O(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-delete "+e[2])&&O(t,"class",r)},i:p,o:p,d(e){e&&I(t)}}}function we(e,t,n){let{size:o="100%"}=t,{strokeWidth:s=2}=t,{class:r=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,s=e.strokeWidth),"class"in e&&n(2,r=e.class)},[o,s,r]}class xe extends ge{constructor(e){super(),$e(this,e,we,ye,b,{size:0,strokeWidth:1,class:2})}}function ke(e){let t,n,o,s;return{c(){t=S("svg"),n=S("path"),o=S("path"),O(n,"d","M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"),O(o,"d","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"),O(t,"xmlns","http://www.w3.org/2000/svg"),O(t,"width",e[0]),O(t,"height",e[0]),O(t,"fill","none"),O(t,"viewBox","0 0 24 24"),O(t,"stroke","currentColor"),O(t,"stroke-width",e[1]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"class",s="feather feather-edit "+e[2])},m(e,s){k(e,t,s),x(t,n),x(t,o)},p(e,[n]){1&n&&O(t,"width",e[0]),1&n&&O(t,"height",e[0]),2&n&&O(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-edit "+e[2])&&O(t,"class",s)},i:p,o:p,d(e){e&&I(t)}}}function Ie(e,t,n){let{size:o="100%"}=t,{strokeWidth:s=2}=t,{class:r=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,s=e.strokeWidth),"class"in e&&n(2,r=e.class)},[o,s,r]}class Fe extends ge{constructor(e){super(),$e(this,e,Ie,ke,b,{size:0,strokeWidth:1,class:2})}}function _e(e){let t,n,o,s;return{c(){t=S("svg"),n=S("circle"),o=S("line"),O(n,"cx","11"),O(n,"cy","11"),O(n,"r","8"),O(o,"x1","21"),O(o,"y1","21"),O(o,"x2","16.65"),O(o,"y2","16.65"),O(t,"xmlns","http://www.w3.org/2000/svg"),O(t,"width",e[0]),O(t,"height",e[0]),O(t,"fill","none"),O(t,"viewBox","0 0 24 24"),O(t,"stroke","currentColor"),O(t,"stroke-width",e[1]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"class",s="feather feather-search "+e[2])},m(e,s){k(e,t,s),x(t,n),x(t,o)},p(e,[n]){1&n&&O(t,"width",e[0]),1&n&&O(t,"height",e[0]),2&n&&O(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-search "+e[2])&&O(t,"class",s)},i:p,o:p,d(e){e&&I(t)}}}function Se(e,t,n){let{size:o="100%"}=t,{strokeWidth:s=2}=t,{class:r=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,s=e.strokeWidth),"class"in e&&n(2,r=e.class)},[o,s,r]}class Ce extends ge{constructor(e){super(),$e(this,e,Se,_e,b,{size:0,strokeWidth:1,class:2})}}const{document:Ee}=ce;function De(e){e[19]=e[21].list,e[20]=e[21].items}function Ne(e,t,n){const o=e.slice();return o[22]=t[n],o}function Oe(e,t,n){const o=e.slice();return o[25]=t[n],o}function je(e,t,n){const o=e.slice();return o[25]=t[n],o}function ze(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function Le(e){let t,n,o,s,r,i;De(e);let l=e[19]?.length&&Pe(e),a=e[20]?.length&&Te(e),c=e[19]?.length&&Ae(e);return{c(){l&&l.c(),t=E(),n=_("div"),o=_("table"),a&&a.c(),s=E(),r=_("tbody"),c&&c.c(),O(o,"striped",""),O(o,"class","svelte-1c3ufb0"),O(n,"class","eList svelte-1c3ufb0")},m(e,d){l&&l.m(e,d),k(e,t,d),k(e,n,d),x(n,o),a&&a.m(o,null),x(o,s),x(o,r),c&&c.m(r,null),i=!0},p(e,n){De(e),e[19]?.length?l?(l.p(e,n),4&n&&re(l,1)):(l=Pe(e),l.c(),re(l,1),l.m(t.parentNode,t)):l&&(oe(),ie(l,1,1,(()=>{l=null})),se()),e[20]?.length?a?a.p(e,n):(a=Te(e),a.c(),a.m(o,s)):a&&(a.d(1),a=null),e[19]?.length?c?(c.p(e,n),4&n&&re(c,1)):(c=Ae(e),c.c(),re(c,1),c.m(r,null)):c&&(oe(),ie(c,1,1,(()=>{c=null})),se())},i(e){i||(re(l),re(c),i=!0)},o(e){ie(l),ie(c),i=!1},d(e){l&&l.d(e),e&&I(t),e&&I(n),a&&a.d(),c&&c.d()}}}function Pe(e){let t,n,o;return n=new e[5]({props:{value:""}}),n.$on("input",e[10]),{c(){t=C("Suchen: "),ue(n.$$.fragment)},m(e,s){k(e,t,s),me(n,e,s),o=!0},p:p,i(e){o||(re(n.$$.fragment,e),o=!0)},o(e){ie(n.$$.fragment,e),o=!1},d(e){e&&I(t),fe(n,e)}}}function Te(e){let t,n,o,s=e[0]&&Me(),r=e[20],i=[];for(let t=0;t<r.length;t+=1)i[t]=Be(je(e,r,t));return{c(){t=_("thead"),n=_("tr"),s&&s.c(),o=E();for(let e=0;e<i.length;e+=1)i[e].c();O(n,"class","svelte-1c3ufb0"),O(t,"class","svelte-1c3ufb0")},m(e,r){k(e,t,r),x(t,n),s&&s.m(n,null),x(n,o);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(e[0]?s||(s=Me(),s.c(),s.m(n,o)):s&&(s.d(1),s=null),260&t){let o;for(r=e[20],o=0;o<r.length;o+=1){const s=je(e,r,o);i[o]?i[o].p(s,t):(i[o]=Be(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&I(t),s&&s.d(),F(i,e)}}}function Me(e){let t;return{c(){t=_("th"),O(t,"class","svelte-1c3ufb0")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function Be(e){let t,n,o=e[25]?.designation+"";return{c(){t=_("th"),n=C(o),O(t,"class","svelte-1c3ufb0")},m(e,o){k(e,t,o),x(t,n)},p(e,t){4&t&&o!==(o=e[25]?.designation+"")&&j(n,o)},d(e){e&&I(t)}}}function Ae(e){let t,n,o=e[19],s=[];for(let t=0;t<o.length;t+=1)s[t]=Re(Ne(e,o,t));const r=e=>ie(s[e],1,1,(()=>{s[e]=null}));return{c(){for(let e=0;e<s.length;e+=1)s[e].c();t=D()},m(e,o){for(let t=0;t<s.length;t+=1)s[t].m(e,o);k(e,t,o),n=!0},p(e,n){if(3023&n){let i;for(o=e[19],i=0;i<o.length;i+=1){const r=Ne(e,o,i);s[i]?(s[i].p(r,n),re(s[i],1)):(s[i]=Re(r),s[i].c(),re(s[i],1),s[i].m(t.parentNode,t))}for(oe(),i=o.length;i<s.length;i+=1)r(i);se()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)re(s[e]);n=!0}},o(e){s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)ie(s[e]);n=!1},d(e){F(s,e),e&&I(t)}}}function qe(e){let t,n,o,s,r,i,l=e[0]&&We(e),a=e[20],c=[];for(let t=0;t<a.length;t+=1)c[t]=He(Oe(e,a,t));return{c(){t=_("tr"),l&&l.c(),n=E();for(let e=0;e<c.length;e+=1)c[e].c();o=E(),O(t,"class","pointer svelte-1c3ufb0"),P(t,"active",e[22]._id===e[1])},m(a,d){k(a,t,d),l&&l.m(t,null),x(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);x(t,o),s=!0,r||(i=N(t,"click",(function(){v(e[7](e[22]))&&e[7](e[22]).apply(this,arguments)})),r=!0)},p(s,r){if((e=s)[0]?l?(l.p(e,r),1&r&&re(l,1)):(l=We(e),l.c(),re(l,1),l.m(t,n)):l&&(oe(),ie(l,1,1,(()=>{l=null})),se()),324&r){let n;for(a=e[20],n=0;n<a.length;n+=1){const s=Oe(e,a,n);c[n]?c[n].p(s,r):(c[n]=He(s),c[n].c(),c[n].m(t,o))}for(;n<c.length;n+=1)c[n].d(1);c.length=a.length}262&r&&P(t,"active",e[22]._id===e[1])},i(e){s||(re(l),s=!0)},o(e){ie(l),s=!1},d(e){e&&I(t),l&&l.d(),F(c,e),r=!1,i()}}}function We(e){let t,n,o,s,r;return n=new Fe({props:{size:"18"}}),{c(){t=_("td"),ue(n.$$.fragment),O(t,"id","editRow"),O(t,"class","svelte-1c3ufb0")},m(i,l){var a;k(i,t,l),me(n,t,null),o=!0,s||(r=N(t,"click",(a=function(){v(e[9](e[22]))&&e[9](e[22]).apply(this,arguments)},function(e){return e.stopPropagation(),a.call(this,e)})),s=!0)},p(t,n){e=t},i(e){o||(re(n.$$.fragment,e),o=!0)},o(e){ie(n.$$.fragment,e),o=!1},d(e){e&&I(t),fe(n),s=!1,r()}}}function He(e){let t,n,o=e[6](e[22],e[25])+"";return{c(){t=_("td"),n=C(o),O(t,"class","svelte-1c3ufb0")},m(e,o){k(e,t,o),x(t,n)},p(e,t){4&t&&o!==(o=e[6](e[22],e[25])+"")&&j(n,o)},d(e){e&&I(t)}}}function Re(e){let t,n,o=e[11](e[22],e[20],e[3]),s=o&&qe(e);return{c(){s&&s.c(),t=D()},m(e,o){s&&s.m(e,o),k(e,t,o),n=!0},p(e,n){12&n&&(o=e[11](e[22],e[20],e[3])),o?s?(s.p(e,n),12&n&&re(s,1)):(s=qe(e),s.c(),re(s,1),s.m(t.parentNode,t)):s&&(oe(),ie(s,1,1,(()=>{s=null})),se())},i(e){n||(re(s),n=!0)},o(e){ie(s),n=!1},d(e){s&&s.d(e),e&&I(t)}}}function Ye(e){let t,n;return t=new e[4]({}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p:p,i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Ge(e){let t,n,o,s={ctx:e,current:null,token:null,hasCatch:!1,pending:Ye,then:Le,catch:ze,value:21,blocks:[,,,]};return le(n=e[2]&&e[8](),s),{c(){t=D(),s.block.c()},m(e,n){k(e,t,n),s.block.m(e,s.anchor=n),s.mount=()=>t.parentNode,s.anchor=t,o=!0},p(t,[o]){e=t,s.ctx=e,4&o&&n!==(n=e[2]&&e[8]())&&le(n,s)||ae(s,e,o)},i(e){o||(re(s.block),o=!0)},o(e){for(let e=0;e<3;e+=1){ie(s.blocks[e])}o=!1},d(e){e&&I(t),s.block.d(e),s.token=null,s=null}}}function Ve(e,o,s){const r=q(),{Loading:i,TextField:l}=c;let{className:a}=o,{rowId:u}=o,{filterForReady:m=!1}=o,{showEdit:f=!1}=o,{selectionFields:p=!1}=o,$=!0,g="";const h=(e,t)=>t&&d(e[`_${t.name}`]||e[t.name]||""),v=t.getSchemaByClass(a),b=async(e,t,n,o)=>{const{value:s,refClass:r}=o,[i,l]=n.split("."),a=await Kn(i,s);if(!a)return e;const c=a[l];return c?.length?c.map((n=>{let o=e?.find((e=>e._id===n[t]))||{};o={...o};for(const e in o)n[e]&&(o[e]=n[e]);for(const e in n)n[e]&&(o[e]=n[e]);return Jn(r+o._id.toString(),o),o})):e};A((()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"})})),n.subscribe((async e=>{if(!e)return;const t=await v;e.eventId===t.id&&(Qn(t.class,e.eventId),s(2,$=!s(2,$=!1)))}));return e.$$set=e=>{"className"in e&&s(12,a=e.className),"rowId"in e&&s(1,u=e.rowId),"filterForReady"in e&&s(13,m=e.filterForReady),"showEdit"in e&&s(0,f=e.showEdit),"selectionFields"in e&&s(14,p=e.selectionFields)},[f,u,$,g,i,l,h,e=>()=>r("choose",{row:e}),async()=>{const e=await v;let t=await Gn(e.class,e.id);const n=p&&p?.find((t=>e.class===t.refClass.split(":")[0]));if(n&&n.value){const[o,r]=n.refClass.split(":");e.class===o&&(t=await b(t,o,r,n)),s(0,f=!t)}!p&&m&&(t=((e,t)=>"Information"===t.state.task?e:e.filter((e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status)))(t,e));let o=[],r=e.display;return r&&r.length?r.map((n=>{const[s,r]=n.split(".");let i=e.list?.find((e=>e.name===s))?.item.find((e=>e.name===r));i&&(i={...i},i.name=`${s}_${r}`,t=t.map((e=>(e[s]&&(e[i.name]=e[s][r]),e)))),i||(i=e.items.find((e=>e.name===s))),o.find((e=>e?.name===s))||o.push(i)})):o=e.items,{list:t,items:o}},e=>t=>{r("edit",e)},({detail:{value:e}})=>{s(3,g=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(h(e,o)?.toLowerCase()?.includes(n))return!0;return!1},a,m,p]}class Je extends ge{constructor(e){var t;super(),Ee.getElementById("svelte-1c3ufb0-style")||((t=_("style")).id="svelte-1c3ufb0-style",t.textContent=".eList.svelte-1c3ufb0.svelte-1c3ufb0{min-height:12em;height:fit-content;max-height:65vh;overflow:auto}.eList.svelte-1c3ufb0 #editRow.svelte-1c3ufb0{width:1em}.eList.svelte-1c3ufb0 table.svelte-1c3ufb0{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important;margin-top:1em}.eList.svelte-1c3ufb0 table thead.svelte-1c3ufb0{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1c3ufb0 table tbody tr.svelte-1c3ufb0{height:2.3em}th.svelte-1c3ufb0.svelte-1c3ufb0,td.svelte-1c3ufb0.svelte-1c3ufb0{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-1c3ufb0.svelte-1c3ufb0:hover{background-color:#DAE1E5}tr.active.svelte-1c3ufb0.svelte-1c3ufb0{color:#326173;background-color:#fcebd5}",x(Ee.head,t)),$e(this,e,Ve,Ge,b,{className:12,rowId:1,filterForReady:13,showEdit:0,selectionFields:14})}}function Ue(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function Ke(e){let t,n,o=e[21]&&Qe(e);return{c(){o&&o.c(),t=D()},m(e,s){o&&o.m(e,s),k(e,t,s),n=!0},p(e,n){e[21]?o?(o.p(e,n),4&n&&re(o,1)):(o=Qe(e),o.c(),re(o,1),o.m(t.parentNode,t)):o&&(oe(),ie(o,1,1,(()=>{o=null})),se())},i(e){n||(re(o),n=!0)},o(e){ie(o),n=!1},d(e){o&&o.d(e),e&&I(t)}}}function Qe(e){let t,n;return t=new e[8]({props:{title:e[11],class:"eList "+(e[6]?"form":""),$$slots:{default:[nt]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};64&n&&(o.class="eList "+(e[6]?"form":"")),4194559&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Xe(e){let t,n;return t=new to({props:{schema:e[1],recID:e[0],readonly:e[7]}}),t.$on("choose",(function(){v(e[16](e[21]))&&e[16](e[21]).apply(this,arguments)})),t.$on("back",e[13]),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(n,o){e=n;const s={};2&o&&(s.schema=e[1]),1&o&&(s.recID=e[0]),128&o&&(s.readonly=e[7]),t.$set(s)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Ze(e){let t,n,o,s,r,i,l,a,c;return t=new e[9]({}),s=new e[10]({props:{outline:!0,$$slots:{default:[et]},$$scope:{ctx:e}}}),s.$on("click",e[14]),i=new e[10]({props:{filled:!0,$$slots:{default:[tt]},$$scope:{ctx:e}}}),i.$on("click",e[15]),a=new Je({props:{className:e[1].class,filterForReady:e[3],selectionFields:e[4],rowId:e[0],showEdit:e[5]}}),a.$on("edit",e[17]),a.$on("choose",e[18]),{c(){ue(t.$$.fragment),n=E(),o=_("div"),ue(s.$$.fragment),r=E(),ue(i.$$.fragment),l=E(),ue(a.$$.fragment),O(o,"class","form--buttons svelte-jb5mrh")},m(e,d){me(t,e,d),k(e,n,d),k(e,o,d),me(s,o,null),x(o,r),me(i,o,null),k(e,l,d),me(a,e,d),c=!0},p(e,t){const n={};4194304&t&&(n.$$scope={dirty:t,ctx:e}),s.$set(n);const o={};4194304&t&&(o.$$scope={dirty:t,ctx:e}),i.$set(o);const r={};2&t&&(r.className=e[1].class),8&t&&(r.filterForReady=e[3]),16&t&&(r.selectionFields=e[4]),1&t&&(r.rowId=e[0]),32&t&&(r.showEdit=e[5]),a.$set(r)},i(e){c||(re(t.$$.fragment,e),re(s.$$.fragment,e),re(i.$$.fragment,e),re(a.$$.fragment,e),c=!0)},o(e){ie(t.$$.fragment,e),ie(s.$$.fragment,e),ie(i.$$.fragment,e),ie(a.$$.fragment,e),c=!1},d(e){fe(t,e),e&&I(n),e&&I(o),fe(s),fe(i),e&&I(l),fe(a,e)}}}function et(e){let t;return{c(){t=C("Abbrechen")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function tt(e){let t;return{c(){t=C("Neu")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function nt(e){let t,n,o,s;const r=[Ze,Xe],i=[];function l(e,t){return e[21].length&&!e[6]?0:1}return t=l(e),n=i[t]=r[t](e),{c(){n.c(),o=D()},m(e,n){i[t].m(e,n),k(e,o,n),s=!0},p(e,s){let a=t;t=l(e),t===a?i[t].p(e,s):(oe(),ie(i[a],1,1,(()=>{i[a]=null})),se(),n=i[t],n?n.p(e,s):(n=i[t]=r[t](e),n.c()),re(n,1),n.m(o.parentNode,o))},i(e){s||(re(n),s=!0)},o(e){ie(n),s=!1},d(e){i[t].d(e),e&&I(o)}}}function ot(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function st(e){let t,n,o,s={ctx:e,current:null,token:null,hasCatch:!1,pending:ot,then:Ke,catch:Ue,value:21,blocks:[,,,]};return le(n=e[12](e[2]),s),{c(){t=D(),s.block.c()},m(e,n){k(e,t,n),s.block.m(e,s.anchor=n),s.mount=()=>t.parentNode,s.anchor=t,o=!0},p(t,[o]){e=t,s.ctx=e,4&o&&n!==(n=e[12](e[2]))&&le(n,s)||ae(s,e,o)},i(e){o||(re(s.block),o=!0)},o(e){for(let e=0;e<3;e+=1){ie(s.blocks[e])}o=!1},d(e){e&&I(t),s.block.d(e),s.token=null,s=null}}}function rt(e,t,n){const{Dialog:o,Divider:s,Button:r}=c,i=q();let{schema:l}=t,{recID:a}=t,{isOpening:d=!0}=t,{filterForReady:u=!1}=t,{selectionFields:m=!1}=t,{showEdit:f=!0}=t,p=l.identity.designation;l.class;let $,g=!1;return e.$$set=e=>{"schema"in e&&n(1,l=e.schema),"recID"in e&&n(0,a=e.recID),"isOpening"in e&&n(2,d=e.isOpening),"filterForReady"in e&&n(3,u=e.filterForReady),"selectionFields"in e&&n(4,m=e.selectionFields),"showEdit"in e&&n(5,f=e.showEdit)},[a,l,d,u,m,f,g,$,o,s,r,p,e=>e&&Gn(l.class,l.id),()=>{n(6,g=!1),a||i("back"),f||i("back")},()=>{n(6,g=!1),i("back")},()=>{n(0,a=!1),n(7,$=!1),n(6,g=!0)},e=>({detail:{row:e}})=>{let t=l.display;t&&t.length&&t.map((t=>{const[n,o]=t.split(".");let s=l.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));if(s){e[`${n}_${o}`]=e[n][o]}})),i("choose",{row:e})},({detail:e})=>{n(7,$=!!e._task.visum||"Closed"===e._task.status),n(0,a=e._docId),n(6,g=!0)},function(t){W(e,t)}]}class it extends ge{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=_("style")).id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",x(document.head,t)),$e(this,e,rt,st,b,{schema:1,recID:0,isOpening:2,filterForReady:3,selectionFields:4,showEdit:5})}}function lt(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function at(e){let t,n,s,r,i,l,a,c,d,u,m;n=new o({props:{class:"full-width",id:e[10],value:e[1],rows:"1",readonly:!0,disabled:e[2],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"}});let f=!e[2]&&ct(e),p=!e[2]&&dt(e);function $(t){e[19](t)}let g={class:"tModal",noClickaway:!0,$$slots:{default:[ut]},$$scope:{ctx:e}};return void 0!==e[8]&&(g.open=e[8]),d=new e[9]({props:g}),R.push((()=>de(d,"open",$))),{c(){t=_("div"),ue(n.$$.fragment),s=E(),f&&f.c(),r=E(),i=_("input"),a=E(),p&&p.c(),c=E(),ue(d.$$.fragment),O(i,"class",l=w(e[4]||e[5])+" svelte-axxims"),O(i,"id",e[3]),O(i,"name",e[3]),i.value=e[0],i.hidden=!0,L(t,"position","relative")},m(e,o){k(e,t,o),me(n,t,null),x(t,s),f&&f.m(t,null),x(t,r),x(t,i),x(t,a),p&&p.m(t,null),k(e,c,o),me(d,e,o),m=!0},p(e,o){const s={};2&o&&(s.value=e[1]),4&o&&(s.disabled=e[2]),n.$set(s),e[2]?f&&(oe(),ie(f,1,1,(()=>{f=null})),se()):f?(f.p(e,o),4&o&&re(f,1)):(f=ct(e),f.c(),re(f,1),f.m(t,r)),(!m||48&o&&l!==(l=w(e[4]||e[5])+" svelte-axxims"))&&O(i,"class",l),(!m||8&o)&&O(i,"id",e[3]),(!m||8&o)&&O(i,"name",e[3]),(!m||1&o&&i.value!==e[0])&&(i.value=e[0]),e[2]?p&&(oe(),ie(p,1,1,(()=>{p=null})),se()):p?(p.p(e,o),4&o&&re(p,1)):(p=dt(e),p.c(),re(p,1),p.m(t,null));const a={};16777665&o&&(a.$$scope={dirty:o,ctx:e}),!u&&256&o&&(u=!0,a.open=e[8],K((()=>u=!1))),d.$set(a)},i(e){m||(re(n.$$.fragment,e),re(f),re(p),re(d.$$.fragment,e),m=!0)},o(e){ie(n.$$.fragment,e),ie(f),ie(p),ie(d.$$.fragment,e),m=!1},d(e){e&&I(t),fe(n),f&&f.d(),p&&p.d(),e&&I(c),fe(d,e)}}}function ct(e){let t,n,o,s,r;return n=new Ce({props:{size:"18"}}),{c(){t=_("span"),ue(n.$$.fragment),O(t,"class","feather pointer svelte-axxims")},m(i,l){k(i,t,l),me(n,t,null),o=!0,s||(r=[N(t,"click",e[12]),N(t,"choose",e[13])],s=!0)},p:p,i(e){o||(re(n.$$.fragment,e),o=!0)},o(e){ie(n.$$.fragment,e),o=!1},d(e){e&&I(t),fe(n),s=!1,h(r)}}}function dt(e){let t,n,o,s,r;return n=new xe({props:{size:"18"}}),{c(){t=_("span"),ue(n.$$.fragment),O(t,"class","feather2 pointer svelte-axxims")},m(i,l){k(i,t,l),me(n,t,null),o=!0,s||(r=N(t,"click",e[15]),s=!0)},p:p,i(e){o||(re(n.$$.fragment,e),o=!0)},o(e){ie(n.$$.fragment,e),o=!1},d(e){e&&I(t),fe(n),s=!1,r()}}}function ut(e){let t,n;return t=new it({props:{schema:e[7],recID:e[0],isOpening:e[8],filterForReady:"true",selectionFields:e[6]}}),t.$on("choose",e[13]),t.$on("back",e[14]),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};128&n&&(o.schema=e[7]),1&n&&(o.recID=e[0]),256&n&&(o.isOpening=e[8]),64&n&&(o.selectionFields=e[6]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function mt(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function ft(e){let t,n,o={ctx:e,current:null,token:null,hasCatch:!1,pending:mt,then:at,catch:lt,value:23,blocks:[,,,]};return le(e[11](),o),{c(){t=D(),o.block.c()},m(e,s){k(e,t,s),o.block.m(e,o.anchor=s),o.mount=()=>t.parentNode,o.anchor=t,n=!0},p(t,[n]){ae(o,e=t,n)},i(e){n||(re(o.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ie(o.blocks[e])}n=!1},d(e){e&&I(t),o.block.d(e),o.token=null,o=null}}}function pt(e,n,o){const s=q(),{Modal:r}=c;let{id:i}=n,{item:l}=n,{value:a=""}=n,{desc:d=""}=n,{noForm:u=!1}=n,{classId:m}=n,{eventId:p}=n,{disabled:$}=n,{readonly:g}=n,{selectionFields:h}=n;const v="comment_"+i;let b,y=!1;$||=g;const w=()=>{o(8,y=!1)};return e.$$set=e=>{"id"in e&&o(3,i=e.id),"item"in e&&o(16,l=e.item),"value"in e&&o(0,a=e.value),"desc"in e&&o(1,d=e.desc),"noForm"in e&&o(4,u=e.noForm),"classId"in e&&o(5,m=e.classId),"eventId"in e&&o(17,p=e.eventId),"disabled"in e&&o(2,$=e.disabled),"readonly"in e&&o(18,g=e.readonly),"selectionFields"in e&&o(6,h=e.selectionFields)},e.$$.update=()=>{65665&e.$$.dirty&&a&&b&&Promise.resolve(Vn(l.refClass,b.id,a)).then((e=>{var t;(t=e)&&(o(1,d=f(b,t)),s("change",{value:a,description:d}),s("task",{row:t}))}))},[a,d,$,i,u,m,h,b,y,r,v,async()=>{if(o(7,b=await t.getSchemaByClass(l.refClass)),p&&a&&!$){(await t.getSchema(p)).input?.find((e=>e===l.refClass))&&o(2,$=!0)}return!0},function(){o(8,y=!0)},({detail:e})=>{o(0,a=e.row._id),w()},w,()=>{o(0,a=o(1,d="")),s("change",{value:a,description:d}),s("task",{row:{_task:{event:b.id,_id:!1}}})},l,p,g,function(e){y=e,o(8,y)}]}class $t extends ge{constructor(e){var t;super(),document.getElementById("svelte-axxims-style")||((t=_("style")).id="svelte-axxims-style",t.textContent=".feather.svelte-axxims{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-axxims{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:disabled{padding-left:0.625em !important}",x(document.head,t)),$e(this,e,pt,ft,b,{id:3,item:16,value:0,desc:1,noForm:4,classId:5,eventId:17,disabled:2,readonly:18,selectionFields:6})}}function gt(e){let t,n,o;return n=new e[6]({props:{lang:e[7].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[5],step:e[8],pattern:e[4],placeholder:e[9],readonly:e[10],disabled:e[3]}}),n.$on("change",e[11]),n.$on("focus",e[12]),{c(){t=_("div"),ue(n.$$.fragment),L(t,"position","relative"),L(t,"max-width","10em")},m(e,s){k(e,t,s),me(n,t,null),o=!0},p(e,[t]){const o={};6&t&&(o.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t&&(o.id=e[0]),1&t&&(o.name=e[0]),32&t&&(o.value=e[5]),16&t&&(o.pattern=e[4]),8&t&&(o.disabled=e[3]),n.$set(o)},i(e){o||(re(n.$$.fragment,e),o=!0)},o(e){ie(n.$$.fragment,e),o=!1},d(e){e&&I(t),fe(n)}}}function ht(e,t,n){let o;const r=q(),{TextField:i}=c;let{id:l}=t,{item:a}=t,{value:d}=t,{noForm:u=!1}=t,{classId:m}=t,{disabled:f}=t;const p=JSON.parse(s.getItem("Locale")),$=Number("1.1").toLocaleString(p.id).substring(1,2),{properties:g={}}=a;let{min:h,max:v,step:b,pattern:y,decimals:w=0,unit:x="",placeholder:k,hint:I,readonly:F,negative:_}=g;y||(y=w?`[0-9]+([${$}][0-9]{1,${w}})?`:"[0-9]*"),_&&(y="-?"+y);return e.$$set=e=>{"id"in e&&n(0,l=e.id),"item"in e&&n(13,a=e.item),"value"in e&&n(14,d=e.value),"noForm"in e&&n(1,u=e.noForm),"classId"in e&&n(2,m=e.classId),"disabled"in e&&n(3,f=e.disabled)},e.$$.update=()=>{16384&e.$$.dirty&&n(5,o=Number(d.toString().replace($,".")).toFixed(w).toString().replace(".",$))},[l,u,m,f,y,o,i,p,b,k,F,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{F||Number(d.toString().replace($,"."))||n(5,o="")},a,d]}class vt extends ge{constructor(e){super(),$e(this,e,ht,gt,b,{id:0,item:13,value:14,noForm:1,classId:2,disabled:3})}}function bt(e,t,n){const o=e.slice();return o[9]=t[n],o}function yt(e){let t,n,o,s=e[9]+"";return{c(){t=_("option"),n=C(s),t.__value=e[9],t.value=t.__value,t.selected=o=e[1]===e[9],O(t,"class","svelte-5xpzvo")},m(e,o){k(e,t,o),x(t,n)},p(e,n){2&n&&o!==(o=e[1]===e[9])&&(t.selected=o)},d(e){e&&I(t)}}}function wt(e){let t,n,o,s,r,i=e[4],l=[];for(let t=0;t<i.length;t+=1)l[t]=yt(bt(e,i,t));return{c(){t=_("select"),n=_("option");for(let e=0;e<l.length;e+=1)l[e].c();n.__value="",n.value=n.__value,O(n,"class","svelte-5xpzvo"),O(t,"class",o=w(e[2]||e[3])+" svelte-5xpzvo"),O(t,"id",e[0]),O(t,"name",e[0]),O(t,"readonly",e[5])},m(o,i){k(o,t,i),x(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);s||(r=N(t,"change",e[6]),s=!0)},p(e,[n]){if(18&n){let o;for(i=e[4],o=0;o<i.length;o+=1){const s=bt(e,i,o);l[o]?l[o].p(s,n):(l[o]=yt(s),l[o].c(),l[o].m(t,null))}for(;o<l.length;o+=1)l[o].d(1);l.length=i.length}12&n&&o!==(o=w(e[2]||e[3])+" svelte-5xpzvo")&&O(t,"class",o),1&n&&O(t,"id",e[0]),1&n&&O(t,"name",e[0])},i:p,o:p,d(e){e&&I(t),F(l,e),s=!1,r()}}}function xt(e,t,n){const o=q();let{id:s}=t,{item:r}=t,{value:i}=t,{noForm:l=!1}=t,{classId:a}=t;const{enum:c,readonly:d}=r.properties;return e.$$set=e=>{"id"in e&&n(0,s=e.id),"item"in e&&n(7,r=e.item),"value"in e&&n(1,i=e.value),"noForm"in e&&n(2,l=e.noForm),"classId"in e&&n(3,a=e.classId)},[s,i,l,a,c,d,e=>o("blur",{value:e.srcElement.value}),r]}class kt extends ge{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=_("style")).id="svelte-5xpzvo-style",t.textContent="select.svelte-5xpzvo.svelte-5xpzvo{padding:0 0.625em 0.0625em;box-sizing:border-box;width:100%;border:0 solid rgba(0, 0, 0, 0.42);border-bottom-width:0px;border-bottom-width:0.0625em;border-top-left-radius:0.375em;border-top-right-radius:0.375em;background-color:#f5f5f5;outline:none;font-size:1rem;font-weight:300;height:2.8em}select.svelte-5xpzvo.svelte-5xpzvo:focus{border:none;border-bottom:2px solid #4300b0}select[readonly].svelte-5xpzvo option.svelte-5xpzvo{display:none}",x(document.head,t)),$e(this,e,xt,wt,b,{id:0,item:7,value:1,noForm:2,classId:3})}}const It=/\d+/g,Ft=/%[HMSpPdmyY%]/g;function _t(e){let t;return{c(){t=C("Stunden")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function St(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[_t]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Ct(e){let t;return{c(){t=C("Minuten")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function Et(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[Ct]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Dt(e){let t;return{c(){t=C("Jetzt")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function Nt(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[Dt]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Ot(e){let t,n,o,s,r,i,l,a,c;return s=new e[5]({props:{value:e[0],closeOnSelection:!0}}),s.$on("change",e[8]),i=new e[6]({props:{value:e[0],$$slots:{"now-label":[Nt],"minutes-label":[Et],"hours-label":[St]},$$scope:{ctx:e}}}),i.$on("change",e[7]),{c(){t=_("input"),o=E(),ue(s.$$.fragment),r=E(),ue(i.$$.fragment),O(t,"type","string"),O(t,"class",n=e[2]||e[3]),O(t,"id",e[1]),O(t,"name",e[1]),t.hidden=!0},m(n,d){k(n,t,d),z(t,e[0]),k(n,o,d),me(s,n,d),k(n,r,d),me(i,n,d),l=!0,a||(c=N(t,"input",e[9]),a=!0)},p(e,[o]){(!l||12&o&&n!==(n=e[2]||e[3]))&&O(t,"class",n),(!l||2&o)&&O(t,"id",e[1]),(!l||2&o)&&O(t,"name",e[1]),1&o&&z(t,e[0]);const r={};1&o&&(r.value=e[0]),s.$set(r);const a={};1&o&&(a.value=e[0]),4096&o&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(e){l||(re(s.$$.fragment,e),re(i.$$.fragment,e),l=!0)},o(e){ie(s.$$.fragment,e),ie(i.$$.fragment,e),l=!1},d(e){e&&I(t),e&&I(o),fe(s,e),e&&I(r),fe(i,e),a=!1,c()}}}function jt(e,t,n){const o=q(),{Label:s,DatePicker:r,TimePicker:i}=c;let{value:l}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>o("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,l=e.value),"id"in e&&n(1,a=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[l,a,d,u,s,r,i,({detail:e})=>{var t,o;n(0,(t=e.value,o=l,l=null==t||null==o?t:(o.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),o))),m(l)},({detail:e})=>{var t,o;n(0,(t=e.value,o=l,l=null==t||null==o?t:(o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o))),m(l)},function(){l=this.value,n(0,l)}]}class zt extends ge{constructor(e){super(),$e(this,e,jt,Ot,b,{value:0,id:1,noForm:2,classId:3})}}function Lt(e){let t,n,o;return n=new e[6]({props:{type:"string",inputClass:e[2]?"":" "+e[3],id:e[0],name:e[0],value:e[1],pattern:Pt,placeholder:Tt,readonly:e[4],disabled:e[5]}}),n.$on("change",e[7]),{c(){t=_("div"),ue(n.$$.fragment),L(t,"max-width","4em")},m(e,s){k(e,t,s),me(n,t,null),o=!0},p(e,[t]){const o={};12&t&&(o.inputClass=e[2]?"":" "+e[3]),1&t&&(o.id=e[0]),1&t&&(o.name=e[0]),2&t&&(o.value=e[1]),16&t&&(o.readonly=e[4]),32&t&&(o.disabled=e[5]),n.$set(o)},i(e){o||(re(n.$$.fragment,e),o=!0)},o(e){ie(n.$$.fragment,e),o=!1},d(e){e&&I(t),fe(n)}}}const Pt="([01][0-9]|2[0-3]):([0-5][0-9])",Tt="";function Mt(e,t,n){const o=q(),{TextField:s}=c;let{id:r}=t,{item:i}=t,{value:l}=t,{noForm:a=!1}=t,{classId:d}=t,{readonly:u}=t,{disabled:m}=t;const f=e=>{if(!e)return"";const[t,n]=e.split(":");return 4===t.length?`${t.substr(0,2)}:${t.substring(2,4)}`:3===t.length?t.substring(0,2)>23?`0${t.substring(0,1)}:${t.substring(1,3)}`:`${t.substring(0,2)}:${t.substring(2,3)}0`:2===t.length?t>23?`0${t.substring(0,1)}:${t.substring(1,2)}0`:`${t}:${(n||"0").padStart(2,"0")}`:`0${t}:${(n||"0").padStart(2,"0")}`};return e.$$set=e=>{"id"in e&&n(0,r=e.id),"item"in e&&n(8,i=e.item),"value"in e&&n(1,l=e.value),"noForm"in e&&n(2,a=e.noForm),"classId"in e&&n(3,d=e.classId),"readonly"in e&&n(4,u=e.readonly),"disabled"in e&&n(5,m=e.disabled)},[r,l,a,d,u,m,s,({detail:e})=>{o("blur",{value:f(e.value)})},i]}class Bt extends ge{constructor(e){super(),$e(this,e,Mt,Lt,b,{id:0,item:8,value:1,noForm:2,classId:3,readonly:4,disabled:5})}}function At(e){let t,n;return t=new e[9]({props:{inputClass:e[1]||e[2],disabled:e[4],readonly:e[13],required:e[12],id:e[16],name:e[15],value:e[6]()}}),t.$on("change",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};6&n&&(o.inputClass=e[1]||e[2]),16&n&&(o.disabled=e[4]),64&n&&(o.value=e[6]()),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function qt(e){let t,n;return t=new e[9]({props:{inputClass:e[1]||e[2],disabled:e[4],readonly:e[13],required:e[12],type:"email",id:e[16],name:e[15],value:e[6]()}}),t.$on("change",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};6&n&&(o.inputClass=e[1]||e[2]),16&n&&(o.disabled=e[4]),64&n&&(o.value=e[6]()),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Wt(e){let t,n;return t=new Bt({props:{inputClass:e[1]||e[2],disabled:e[4],readonly:e[13],required:e[12],id:e[16],item:e[0],value:e[6]()}}),t.$on("blur",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};6&n&&(o.inputClass=e[1]||e[2]),16&n&&(o.disabled=e[4]),1&n&&(o.item=e[0]),64&n&&(o.value=e[6]()),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Ht(e){let t,n;return t=new zt({props:{classId:e[2],id:e[16],disabled:e[4],required:e[12],value:e[17](),noForm:e[1]}}),t.$on("change",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4&n&&(o.classId=e[2]),16&n&&(o.disabled=e[4]),2&n&&(o.noForm=e[1]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Rt(e){let t,n;return t=new e[11]({props:{inputClass:e[1]||e[2],required:e[12],disabled:e[4],id:e[16],name:e[15],value:e[17](),closeOnSelection:!0}}),t.$on("change",e[18](!0)),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};6&n&&(o.inputClass=e[1]||e[2]),16&n&&(o.disabled=e[4]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Yt(e){let t,n;return t=new e[10]({props:{inputClass:e[1]||e[2],disabled:e[4],readonly:e[13],required:e[12],id:e[16],name:e[15],value:e[6]()}}),t.$on("change",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};6&n&&(o.inputClass=e[1]||e[2]),16&n&&(o.disabled=e[4]),64&n&&(o.value=e[6]()),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Gt(e){let t,n;return t=new kt({props:{classId:e[2],disabled:e[4],required:e[12],id:e[16],item:e[0],value:e[6](),noForm:e[1]}}),t.$on("blur",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4&n&&(o.classId=e[2]),16&n&&(o.disabled=e[4]),1&n&&(o.item=e[0]),64&n&&(o.value=e[6]()),2&n&&(o.noForm=e[1]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Vt(e){let t,n;return t=new vt({props:{classId:e[2],disabled:e[4],required:e[12],readonly:e[13],id:e[16],item:e[0],value:e[6](),noForm:e[1]}}),t.$on("blur",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4&n&&(o.classId=e[2]),16&n&&(o.disabled=e[4]),1&n&&(o.item=e[0]),64&n&&(o.value=e[6]()),2&n&&(o.noForm=e[1]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Jt(e){let t,n;return t=new o({props:{classId:e[2],disabled:e[4],readonly:e[13],id:e[16],name:e[0].name,value:e[6](),noForm:e[1]}}),t.$on("blur",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4&n&&(o.classId=e[2]),16&n&&(o.disabled=e[4]),1&n&&(o.name=e[0].name),64&n&&(o.value=e[6]()),2&n&&(o.noForm=e[1]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Ut(e){let t,n;return t=new $t({props:{classId:e[2],eventId:e[3],disabled:e[4],readonly:e[13],id:e[16],item:e[0],desc:e[7],value:e[6](),noForm:e[1],selectionFields:e[5]}}),t.$on("task",e[23]),t.$on("change",e[18]()),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4&n&&(o.classId=e[2]),8&n&&(o.eventId=e[3]),16&n&&(o.disabled=e[4]),1&n&&(o.item=e[0]),128&n&&(o.desc=e[7]),64&n&&(o.value=e[6]()),2&n&&(o.noForm=e[1]),32&n&&(o.selectionFields=e[5]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Kt(e){let t,n,o,s;const r=[Ut,Jt,Vt,Gt,Yt,Rt,Ht,Wt,qt,At],i=[];function l(e,t){return"object"===e[0].type?0:"textarea"===e[0].type||e[0].properties&&"textarea"===e[0].properties.format?1:"number"===e[0].type?2:e[0].properties&&e[0].properties.enum?3:"boolean"===e[0].type?4:"date"===e[0].type?5:"datetime"===e[0].type?6:"time"===e[0].properties?.format?7:"email"===e[0].type?8:9}return t=l(e),n=i[t]=r[t](e),{c(){n.c(),o=D()},m(e,n){i[t].m(e,n),k(e,o,n),s=!0},p(e,s){let a=t;t=l(e),t===a?i[t].p(e,s):(oe(),ie(i[a],1,1,(()=>{i[a]=null})),se(),n=i[t],n?n.p(e,s):(n=i[t]=r[t](e),n.c()),re(n,1),n.m(o.parentNode,o))},i(e){s||(re(n),s=!0)},o(e){ie(n),s=!1},d(e){i[t].d(e),e&&I(o)}}}function Qt(e){let t,n;return t=new e[8]({props:{id:e[19](e[16]),class:e[14]&&"hidden",name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[Kt]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.name=e[0].designation),1&n&&(o.help=e[0].properties?.hint),268435711&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Xt(e,t,n){let o,s;const r=q(),{FormField:i,TextField:l,Switch:a,DatePicker:u,TimePicker:m}=c;let{praefix:f=""}=t,{item:p}=t,{listName:$=""}=t,{record:g}=t,{noForm:h=!1}=t,{classId:v}=t,{eventId:b}=t,{disabled:y}=t,{selectionFields:w}=t;const x=p.properties?.required,k=p.properties?.readonly,I=p.properties?.hidden;if("string"==typeof p.name){const[e,t]=p.name.split("_");t&&(p.name=t)}const F=($?$+".":"")+p.name,_=F+(""!==f?"-"+f:""),S=(e,t=F)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};return e.$$set=e=>{"praefix"in e&&n(21,f=e.praefix),"item"in e&&n(0,p=e.item),"listName"in e&&n(22,$=e.listName),"record"in e&&n(20,g=e.record),"noForm"in e&&n(1,h=e.noForm),"classId"in e&&n(2,v=e.classId),"eventId"in e&&n(3,b=e.eventId),"disabled"in e&&n(4,y=e.disabled),"selectionFields"in e&&n(5,w=e.selectionFields)},e.$$.update=()=>{1048576&e.$$.dirty&&n(6,o=(e=F)=>{let t=S(g);return void 0===t?"":t})},n(7,s=((e=F)=>{let t=g["_"+e];return t=d(t),void 0===t?"":t})()),[p,h,v,b,y,w,o,s,i,l,a,u,x,k,I,F,_,(e=F)=>{let t=S(g);return t?new Date(t):new Date},e=>({detail:t})=>{const o=t.value;n(20,g[F]=e?function(e,t){if(null==e)return null;let n=e.getHours();return/%p/i.test(t)&&(n%=12,0===n&&(n=12)),t.replace("%Y",e.getFullYear()).replace("%y",(e.getFullYear()%100).toString().padStart(2,"0")).replace("%m",(e.getMonth()+1).toString().padStart(2,"0")).replace("%d",e.getDate().toString().padStart(2,"0")).replace("%H",n.toString().padStart(2,"0")).replace("%M",e.getMinutes().toString().padStart(2,"0")).replace("%S",e.getSeconds().toString().padStart(2,"0")).replace("%p",e.getHours()<12?"am":"pm").replace("%P",e.getHours()<12?"AM":"PM").replace("%%","%")}(o,"%d.%m.%Y"):o,g);const s=Object.values(g).every((e=>!e))&&o;r("notify",{value:o,add:s,itemName:F,desc:t.description})},()=>"object"===p.type?"comment_"+_:_,g,f,$,function(t){W(e,t)}]}class Zt extends ge{constructor(e){var t;super(),document.getElementById("svelte-9h2mb5-style")||((t=_("style")).id="svelte-9h2mb5-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em}.field .switch{padding-top:0.75em}",x(document.head,t)),$e(this,e,Xt,Qt,b,{praefix:21,item:0,listName:22,record:20,noForm:1,classId:2,eventId:3,disabled:4,selectionFields:5})}}function en(e,t,n){const o=e.slice();return o[38]=t[n],o[40]=n,o}function tn(e,t,n){const o=e.slice();return o[47]=t[n],o}function nn(e,t,n){const o=e.slice();return o[42]=t[n].title,o[43]=t[n].toDelete,o[44]=t[n].icon,o}function on(e){let t,n,o;function s(t){e[23](t)}let r={item:e[15],disabled:!0};return void 0!==e[7]&&(r.value=e[7]),t=new vt({props:r}),R.push((()=>de(t,"value",s))),{c(){ue(t.$$.fragment)},m(e,n){me(t,e,n),o=!0},p(e,o){const s={};!n&&128&o[0]&&(n=!0,s.value=e[7],K((()=>n=!1))),t.$set(s)},i(e){o||(re(t.$$.fragment,e),o=!0)},o(e){ie(t.$$.fragment,e),o=!1},d(e){fe(t,e)}}}function sn(e){let t,n,o;function s(t){e[24](t)}let r={item:e[13],disabled:!0};return void 0!==e[6]&&(r.value=e[6]),t=new vt({props:r}),R.push((()=>de(t,"value",s))),{c(){ue(t.$$.fragment)},m(e,n){me(t,e,n),o=!0},p(e,o){const s={};!n&&64&o[0]&&(n=!0,s.value=e[6],K((()=>n=!1))),t.$set(s)},i(e){o||(re(t.$$.fragment,e),o=!0)},o(e){ie(t.$$.fragment,e),o=!1},d(e){fe(t,e)}}}function rn(e){let t,n;return t=new Zt({props:{praefix:e[40],item:e[47],eventId:e[2],record:e[38],noForm:$n,classId:e[1],disabled:e[3],selectionFields:e[16]}}),t.$on("notify",(function(){v(e[18](e[47],e[40]))&&e[18](e[47],e[40]).apply(this,arguments)})),t.$on("task",e[25]),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(n,o){e=n;const s={};1&o[0]&&(s.item=e[47]),4&o[0]&&(s.eventId=e[2]),16&o[0]&&(s.record=e[38]),2&o[0]&&(s.classId=e[1]),8&o[0]&&(s.disabled=e[3]),t.$set(s)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function ln(e){let t,n,o=e[0].item,s=[];for(let t=0;t<o.length;t+=1)s[t]=rn(tn(e,o,t));const r=e=>ie(s[e],1,1,(()=>{s[e]=null}));return{c(){for(let e=0;e<s.length;e+=1)s[e].c();t=E()},m(e,o){for(let t=0;t<s.length;t+=1)s[t].m(e,o);k(e,t,o),n=!0},p(e,n){if(327711&n[0]){let i;for(o=e[0].item,i=0;i<o.length;i+=1){const r=tn(e,o,i);s[i]?(s[i].p(r,n),re(s[i],1)):(s[i]=rn(r),s[i].c(),re(s[i],1),s[i].m(t.parentNode,t))}for(oe(),i=o.length;i<s.length;i+=1)r(i);se()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)re(s[e]);n=!0}},o(e){s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)ie(s[e]);n=!1},d(e){F(s,e),e&&I(t)}}}function an(e){let t,n,o=e[17](e[5],e[40])+"";return{c(){t=_("span"),n=C(o),O(t,"class","svelte-17omp3o"),P(t,"delete",e[38]._delete)},m(e,o){k(e,t,o),x(t,n)},p(e,s){32&s[0]&&o!==(o=e[17](e[5],e[40])+"")&&j(n,o),16&s[0]&&P(t,"delete",e[38]._delete)},d(e){e&&I(t)}}}function cn(e){let t,n,o;var s=e[44];return s&&(t=new s({props:{size:"20"}})),{c(){t&&ue(t.$$.fragment),n=D()},m(e,s){t&&me(t,e,s),k(e,n,s),o=!0},p(e,o){if(s!==(s=e[44])){if(t){oe();const e=t;ie(e.$$.fragment,1,0,(()=>{fe(e,1)})),se()}s?(t=new s({props:{size:"20"}}),ue(t.$$.fragment),re(t.$$.fragment,1),me(t,n.parentNode,n)):t=null}},i(e){o||(t&&re(t.$$.fragment,e),o=!0)},o(e){t&&ie(t.$$.fragment,e),o=!1},d(e){e&&I(n),t&&fe(t,e)}}}function dn(e){let t,n,o,s,r,i=!e[3]&&cn(e);return{c(){t=_("span"),i&&i.c(),O(t,"class","pointer icon svelte-17omp3o"),O(t,"title",e[42]),t.hidden=n=e[40]===e[4].length-1||!(e[38]._delete^e[43])},m(n,l){k(n,t,l),i&&i.m(t,null),o=!0,s||(r=N(t,"click",e[19](e[40])),s=!0)},p(s,r){(e=s)[3]?i&&(oe(),ie(i,1,1,(()=>{i=null})),se()):i?(i.p(e,r),8&r[0]&&re(i,1)):(i=cn(e),i.c(),re(i,1),i.m(t,null)),(!o||16&r[0]&&n!==(n=e[40]===e[4].length-1||!(e[38]._delete^e[43])))&&(t.hidden=n)},i(e){o||(re(i),o=!0)},o(e){ie(i),o=!1},d(e){e&&I(t),i&&i.d(),s=!1,r()}}}function un(e){let t,n,o,s,r;n=new e[9]({props:{$$slots:{default:[an]},$$scope:{ctx:e}}}),n.$on("click",(function(){v(e[41])&&e[41].apply(this,arguments)}));let i=[{title:"löschen",toDelete:!0,icon:xe},{title:"undo",toDelete:!1,icon:be}],l=[];for(let t=0;t<2;t+=1)l[t]=dn(nn(e,i,t));const a=e=>ie(l[e],1,1,(()=>{l[e]=null}));return{c(){t=_("div"),ue(n.$$.fragment),o=E();for(let e=0;e<2;e+=1)l[e].c();s=E(),O(t,"class","accordion svelte-17omp3o"),O(t,"slot","handle")},m(e,i){k(e,t,i),me(n,t,null),x(t,o);for(let e=0;e<2;e+=1)l[e].m(t,null);x(t,s),r=!0},p(o,r){e=o;const c={};if(48&r[0]|524288&r[1]&&(c.$$scope={dirty:r,ctx:e}),n.$set(c),524312&r[0]){let n;for(i=[{title:"löschen",toDelete:!0,icon:xe},{title:"undo",toDelete:!1,icon:be}],n=0;n<2;n+=1){const o=nn(e,i,n);l[n]?(l[n].p(o,r),re(l[n],1)):(l[n]=dn(o),l[n].c(),re(l[n],1),l[n].m(t,s))}for(oe(),n=2;n<2;n+=1)a(n);se()}},i(e){if(!r){re(n.$$.fragment,e);for(let e=0;e<2;e+=1)re(l[e]);r=!0}},o(e){ie(n.$$.fragment,e),l=l.filter(Boolean);for(let e=0;e<2;e+=1)ie(l[e]);r=!1},d(e){e&&I(t),fe(n),F(l,e)}}}function mn(e){let t,n;return t=new e[11]({props:{$$slots:{handle:[un,({toggle:e})=>({41:e}),({toggle:e})=>[0,e?1024:0]],default:[ln,({toggle:e})=>({41:e}),({toggle:e})=>[0,e?1024:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){v(e[37])&&e[37].apply(this,arguments)})),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(n,o){e=n;const s={};63&o[0]|525312&o[1]&&(s.$$scope={dirty:o,ctx:e}),t.$set(s)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function fn(e){let t,n,o=e[4],s=[];for(let t=0;t<o.length;t+=1)s[t]=mn(en(e,o,t));const r=e=>ie(s[e],1,1,(()=>{s[e]=null}));return{c(){for(let e=0;e<s.length;e+=1)s[e].c();t=D()},m(e,o){for(let t=0;t<s.length;t+=1)s[t].m(e,o);k(e,t,o),n=!0},p(e,n){if(983103&n[0]|1088&n[1]){let i;for(o=e[4],i=0;i<o.length;i+=1){const r=en(e,o,i);s[i]?(s[i].p(r,n),re(s[i],1)):(s[i]=mn(r),s[i].c(),re(s[i],1),s[i].m(t.parentNode,t))}for(oe(),i=o.length;i<s.length;i+=1)r(i);se()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)re(s[e]);n=!0}},o(e){s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)ie(s[e]);n=!1},d(e){F(s,e),e&&I(t)}}}function pn(e){let t,n,o,s,r,i=e[14]&&function(e){let t,n;return t=new e[8]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[on]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};128&n[0]|524288&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}(e),l=e[12]&&function(e){let t,n;return t=new e[8]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[sn]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};64&n[0]|524288&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}(e);return s=new e[10]({props:{$$slots:{default:[fn,({closeOtherPanels:e})=>({37:e}),({closeOtherPanels:e})=>[0,e?64:0]]},$$scope:{ctx:e}}}),{c(){t=_("div"),i&&i.c(),n=E(),l&&l.c(),o=E(),ue(s.$$.fragment),O(t,"class","formList")},m(e,a){k(e,t,a),i&&i.m(t,null),x(t,n),l&&l.m(t,null),x(t,o),me(s,t,null),r=!0},p(e,t){e[14]&&i.p(e,t),e[12]&&l.p(e,t);const n={};63&t[0]|524352&t[1]&&(n.$$scope={dirty:t,ctx:e}),s.$set(n)},i(e){r||(re(i),re(l),re(s.$$.fragment,e),r=!0)},o(e){ie(i),ie(l),ie(s.$$.fragment,e),r=!1},d(e){e&&I(t),i&&i.d(),l&&l.d(),fe(s)}}}const $n=!0;function gn(e,n,o){let s,r;const{FormField:i,TextField:l,Button:a,Accordion:f,AccordionSection:p}=c,$=q();let{list:g}=n,{schema:h}=n,{record:v}=n,{classId:b}=n,{eventId:y}=n,{disabled:w}=n;const x=h.find((e=>"price"===e.name&&!e.properties?.hidden)),k=x&&h.find((e=>"quantity"===e.name));let I=0;const F=h.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let _=0;const S={};let C,E,D=[];h.filter((e=>e.selection)).map((e=>D.push({refClass:e.selection,value:""})));const N=(e,t)=>{if(!t)return;const n=h.find((e=>e.name===t)),s=n.properties.value.formula,{operator:r,argument:i}=s,l=i.map((t=>C[e][t.refItem]));let a=0;"$add"===r&&(a=l.reduce(((e,t)=>e+ +t))),"$subtract"===r&&(a=l.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,o]=e.split(":");e=o?(+n+ +o/60).toFixed(2):+n;const[s,r]=t.split(":");return s?e-=r?(+s+ +r/60).toFixed(2):+s:0}))),o(4,C[e][t]=(a||0).toFixed(n.properties.decimals||0),C)};E=h.filter((e=>e.refClass)).reduce((async(e,n)=>{e=await e;const o=h.filter((e=>e.refItem===n.refClass));if(!o?.length)return e;t.getSchemaByClass(n.refClass);const s={refClass:n.refClass,items:[]};return o.forEach((e=>{s.items.push(e.name)})),e.push(s),e}),[]);const O=async(e,t,n)=>{const s=(await E).find((e=>e.refClass===t.refClass));if(!s)return;const{refClass:r,items:i}=s;return n?Promise.all(i.map((n=>{let s="";const{refInput:i}=t;if(i&&C[e]){const[t,n]=i.split(".");s=n?C[e][n]:v[t]}if(i&&!s||j(e,n)){const s=h.find((e=>e.refClass===r)),i=C[e][s.name];if(t.selection){const s=Un(t.selection+i.toString());if(s)return Promise.resolve(s).then((t=>o(4,C[e][n]=t[n],C)))}return Promise.resolve(Kn(s.refClass,i)).then((t=>o(4,C[e][n]=t[n],C)))}}))):Promise.resolve(i.map((t=>{o(4,C[e][t]="",C)})))},j=(e,t)=>{let n=C[e][t];return"number"===h.find((e=>e.name===t)).type&&(n=Number(n||0)),!n};return h.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=h.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))})),e.$$set=e=>{"list"in e&&o(0,g=e.list),"schema"in e&&o(20,h=e.schema),"record"in e&&o(21,v=e.record),"classId"in e&&o(1,b=e.classId),"eventId"in e&&o(2,y=e.eventId),"disabled"in e&&o(3,w=e.disabled)},e.$$.update=()=>{2097153&e.$$.dirty[0]&&v&&o(4,C=(v[g.name]||[]).concat({})),16&e.$$.dirty[0]&&o(5,s=C),49&e.$$.dirty[0]&&s&&((()=>{if(F)o(7,_=C?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(x)o(6,I=C?.reduce(((e,t)=>{if(t.price){const n=(k?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),$("save",{listName:g.name,value:C})),4194304&e.$$.dirty[0]&&(r=e=>S[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[g,b,y,w,C,s,I,_,i,a,f,p,x,{name:"amountValue",properties:{decimals:2}},F,{name:"hoursValue",properties:{decimals:2}},D,(e,t)=>{const n=e[t];return h.filter((e=>!e.properties?.hidden&&void 0!==n[e.name]&&"textarea"!==e.properties?.format)).map((e=>"object"===e.type?r(n[e.name]):"boolean"===e.type?m(n[e.name]):"date"===e.type?d(n[e.name]):"datetime"===e.type?u(n[e.name]):n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>({detail:n})=>{const{value:r,add:i,desc:l}=n;N(t,e._formulaActor);const a=D?.find((t=>t.refClass.split(":")[1].split(".")[0]===e.refClass));a&&(a.value=r),r&&C.length===t+1&&o(4,C=C.concat({})),l&&o(22,S[r]=l,S),O(t,e,r),o(5,s=C)},e=>()=>{o(4,C[e]._delete=!C[e]._delete,C)},h,v,S,function(e){_=e,o(7,_)},function(e){I=e,o(6,I)},function(t){W(e,t)}]}class hn extends ge{constructor(e){var t;super(),document.getElementById("svelte-17omp3o-style")||((t=_("style")).id="svelte-17omp3o-style",t.textContent=".accordion.svelte-17omp3o{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}span.pointer.svelte-17omp3o{padding-top:1em}span.delete.svelte-17omp3o{text-decoration:line-through}.icon.svelte-17omp3o{margin-right:-0.75em}.formList .formField_italic{font-style:italic}",x(document.head,t)),$e(this,e,gn,pn,b,{list:0,schema:20,record:21,classId:1,eventId:2,disabled:3},[-1,-1])}}function vn(e,t,n){const o=e.slice();return o[16]=t[n],o}function bn(e){let t,n;return t=new Zt({props:{classId:e[2],item:e[16],listName:e[1].name,eventId:e[3],record:e[0],disabled:e[4]}}),t.$on("notify",e[10]),t.$on("task",e[12]),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};4&n&&(o.classId=e[2]),2&n&&(o.item=e[16]),2&n&&(o.listName=e[1].name),8&n&&(o.eventId=e[3]),1&n&&(o.record=e[0]),16&n&&(o.disabled=e[4]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function yn(e){let t,n,o=e[1].item,s=[];for(let t=0;t<o.length;t+=1)s[t]=bn(vn(e,o,t));const r=e=>ie(s[e],1,1,(()=>{s[e]=null}));return{c(){for(let e=0;e<s.length;e+=1)s[e].c();t=D()},m(e,o){for(let t=0;t<s.length;t+=1)s[t].m(e,o);k(e,t,o),n=!0},p(e,n){if(1055&n){let i;for(o=e[1].item,i=0;i<o.length;i+=1){const r=vn(e,o,i);s[i]?(s[i].p(r,n),re(s[i],1)):(s[i]=bn(r),s[i].c(),re(s[i],1),s[i].m(t.parentNode,t))}for(oe(),i=o.length;i<s.length;i+=1)r(i);se()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)re(s[e]);n=!0}},o(e){s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)ie(s[e]);n=!1},d(e){F(s,e),e&&I(t)}}}function wn(e){let t,n,o=e[9](e[5])+"";return{c(){t=_("span"),n=C(o)},m(e,o){k(e,t,o),x(t,n)},p(e,t){32&t&&o!==(o=e[9](e[5])+"")&&j(n,o)},d(e){e&&I(t)}}}function xn(e){let t,n,o;return n=new e[6]({props:{$$slots:{default:[wn]},$$scope:{ctx:e}}}),n.$on("click",(function(){v(e[15])&&e[15].apply(this,arguments)})),{c(){t=_("div"),ue(n.$$.fragment),O(t,"class","accordion svelte-148ktt9"),O(t,"slot","handle")},m(e,s){k(e,t,s),me(n,t,null),o=!0},p(t,o){e=t;const s={};524320&o&&(s.$$scope={dirty:o,ctx:e}),n.$set(s)},i(e){o||(re(n.$$.fragment,e),o=!0)},o(e){ie(n.$$.fragment,e),o=!1},d(e){e&&I(t),fe(n)}}}function kn(e){let t,n;return t=new e[8]({props:{$$slots:{handle:[xn,({toggle:e})=>({15:e}),({toggle:e})=>e?32768:0],default:[yn,({toggle:e})=>({15:e}),({toggle:e})=>e?32768:0]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};557119&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function In(e){let t,n,o;return n=new e[7]({props:{$$slots:{default:[kn]},$$scope:{ctx:e}}}),{c(){t=_("div"),ue(n.$$.fragment),O(t,"class","formList")},m(e,s){k(e,t,s),me(n,t,null),o=!0},p(e,[t]){const o={};524351&t&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(re(n.$$.fragment,e),o=!0)},o(e){ie(n.$$.fragment,e),o=!1},d(e){e&&I(t),fe(n)}}}function Fn(e,t,n){const{Button:o,Accordion:s,AccordionSection:r}=c;let{list:i}=t,{schema:l}=t,{record:a}=t,{classId:f}=t,{eventId:p}=t,{disabled:$}=t;const g={};let h=a[i.name]||{};a[i.name]=h;const v=e=>g[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · ");return e.$$set=e=>{"list"in e&&n(1,i=e.list),"schema"in e&&n(11,l=e.schema),"record"in e&&n(0,a=e.record),"classId"in e&&n(2,f=e.classId),"eventId"in e&&n(3,p=e.eventId),"disabled"in e&&n(4,$=e.disabled)},[a,i,f,p,$,h,o,s,r,e=>l.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format)).map((t=>"object"===t.type?v(t.name):"boolean"===t.type?m(e[t.name]):"date"===t.type?d(e[t.name]):"datetime"===t.type?u(e[t.name]):e[t.name])).filter((e=>!!e)).join(" • ")||"+",({detail:e})=>{const[t,o]=e.itemName.split(".");if(!o)return;e.desc&&(g[o]=e.desc);const s=a[t];n(0,a[t]={...s,[o]:e.value},a),n(5,h=a[t])},l,function(t){W(e,t)}]}class _n extends ge{constructor(e){var t;super(),document.getElementById("svelte-148ktt9-style")||((t=_("style")).id="svelte-148ktt9-style",t.textContent=".accordion.svelte-148ktt9{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}",x(document.head,t)),$e(this,e,Fn,In,b,{list:1,schema:11,record:0,classId:2,eventId:3,disabled:4})}}const{Boolean:Sn,document:Cn}=ce;function En(e,t,n){const o=e.slice();return o[41]=t[n],o}function Dn(e,t,n){const o=e.slice();return o[44]=t[n],o}function Nn(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function On(e){let t,n,o=e[40]&&function(e){let t,n,o,s,r,i,l,a,c,d,u,m,f,p,$,g,h,v=e[0].items,b=[];for(let t=0;t<v.length;t+=1)b[t]=zn(Dn(e,v,t));const y=e=>ie(b[e],1,1,(()=>{b[e]=null}));let S=e[0].list&&Ln(e);return m=new e[5]({props:{outline:!0,$$slots:{default:[Bn]},$$scope:{ctx:e}}}),m.$on("click",e[11]),p=new e[5]({props:{disabled:e[2],form:e[6],filled:!0,type:"submit",$$slots:{default:[An]},$$scope:{ctx:e}}}),{c(){t=_("section"),n=_("form"),o=_("input"),r=E();for(let e=0;e<b.length;e+=1)b[e].c();i=E(),S&&S.c(),l=E(),a=_("div"),c=_("small"),c.textContent=`${Zn}`,d=E(),u=_("div"),ue(m.$$.fragment),f=E(),ue(p.$$.fragment),O(o,"class",w(e[6])+" svelte-rovpm0"),O(o,"name","_id"),O(o,"type","hidden"),o.value=s=e[1]._id||"",O(n,"class",w(e[7])+" svelte-rovpm0"),O(n,"id",e[6]),O(a,"class","comment svelte-rovpm0"),O(u,"class","form--buttons svelte-rovpm0"),O(t,"class",w(e[8])+" svelte-rovpm0")},m(s,v){k(s,t,v),x(t,n),x(n,o),x(n,r);for(let e=0;e<b.length;e+=1)b[e].m(n,null);var y;x(n,i),S&&S.m(n,null),x(t,l),x(t,a),x(a,c),x(t,d),x(t,u),me(m,u,null),x(u,f),me(p,u,null),$=!0,g||(h=N(n,"submit",(y=e[10],function(e){return e.preventDefault(),y.call(this,e)})),g=!0)},p(e,t){if((!$||2&t[0]&&s!==(s=e[1]._id||""))&&(o.value=s),4167&t[0]){let o;for(v=e[0].items,o=0;o<v.length;o+=1){const s=Dn(e,v,o);b[o]?(b[o].p(s,t),re(b[o],1)):(b[o]=zn(s),b[o].c(),re(b[o],1),b[o].m(n,i))}for(oe(),o=v.length;o<b.length;o+=1)y(o);se()}e[0].list?S?(S.p(e,t),1&t[0]&&re(S,1)):(S=Ln(e),S.c(),re(S,1),S.m(n,null)):S&&(oe(),ie(S,1,1,(()=>{S=null})),se());const r={};65536&t[1]&&(r.$$scope={dirty:t,ctx:e}),m.$set(r);const l={};4&t[0]&&(l.disabled=e[2]),65536&t[1]&&(l.$$scope={dirty:t,ctx:e}),p.$set(l)},i(e){if(!$){for(let e=0;e<v.length;e+=1)re(b[e]);re(S),re(m.$$.fragment,e),re(p.$$.fragment,e),$=!0}},o(e){b=b.filter(Sn);for(let e=0;e<b.length;e+=1)ie(b[e]);ie(S),ie(m.$$.fragment,e),ie(p.$$.fragment,e),$=!1},d(e){e&&I(t),F(b,e),S&&S.d(),fe(m),fe(p),g=!1,h()}}}(e);return{c(){o&&o.c(),t=D()},m(e,s){o&&o.m(e,s),k(e,t,s),n=!0},p(e,t){e[40]&&o.p(e,t)},i(e){n||(re(o),n=!0)},o(e){ie(o),n=!1},d(e){o&&o.d(e),e&&I(t)}}}function jn(e){let t,n;return t=new Zt({props:{classId:e[6],item:e[44],record:e[1],disabled:e[2],eventId:e[0].id}}),t.$on("task",e[12]),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};1&n[0]&&(o.item=e[44]),2&n[0]&&(o.record=e[1]),4&n[0]&&(o.disabled=e[2]),1&n[0]&&(o.eventId=e[0].id),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function zn(e){let t,n,o="list"!==e[44].type&&jn(e);return{c(){o&&o.c(),t=D()},m(e,s){o&&o.m(e,s),k(e,t,s),n=!0},p(e,n){"list"!==e[44].type?o?(o.p(e,n),1&n[0]&&re(o,1)):(o=jn(e),o.c(),re(o,1),o.m(t.parentNode,t)):o&&(oe(),ie(o,1,1,(()=>{o=null})),se())},i(e){n||(re(o),n=!0)},o(e){ie(o),n=!1},d(e){o&&o.d(e),e&&I(t)}}}function Ln(e){let t,n,o=e[0].list,s=[];for(let t=0;t<o.length;t+=1)s[t]=Mn(En(e,o,t));const r=e=>ie(s[e],1,1,(()=>{s[e]=null}));return{c(){for(let e=0;e<s.length;e+=1)s[e].c();t=D()},m(e,o){for(let t=0;t<s.length;t+=1)s[t].m(e,o);k(e,t,o),n=!0},p(e,n){if(8263&n[0]){let i;for(o=e[0].list,i=0;i<o.length;i+=1){const r=En(e,o,i);s[i]?(s[i].p(r,n),re(s[i],1)):(s[i]=Mn(r),s[i].c(),re(s[i],1),s[i].m(t.parentNode,t))}for(oe(),i=o.length;i<s.length;i+=1)r(i);se()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)re(s[e]);n=!0}},o(e){s=s.filter(Sn);for(let e=0;e<s.length;e+=1)ie(s[e]);n=!1},d(e){F(s,e),e&&I(t)}}}function Pn(e){let t,n;return t=new _n({props:{classId:e[6],list:e[41],eventId:e[0].id,schema:e[41].item,record:e[1],disabled:e[2]}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};1&n[0]&&(o.list=e[41]),1&n[0]&&(o.eventId=e[0].id),1&n[0]&&(o.schema=e[41].item),2&n[0]&&(o.record=e[1]),4&n[0]&&(o.disabled=e[2]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Tn(e){let t,n;return t=new hn({props:{classId:e[6],list:e[41],eventId:e[0].id,schema:e[41].item,record:e[1],disabled:e[2]}}),t.$on("save",e[13]),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,n){const o={};1&n[0]&&(o.list=e[41]),1&n[0]&&(o.eventId=e[0].id),1&n[0]&&(o.schema=e[41].item),2&n[0]&&(o.record=e[1]),4&n[0]&&(o.disabled=e[2]),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function Mn(e){let t,n,o,s,r,i;t=new e[4]({props:{text:e[41].designation}});const l=[Tn,Pn],a=[];function c(e,t){return"array"===e[41].type?0:1}return o=c(e),s=a[o]=l[o](e),{c(){ue(t.$$.fragment),n=E(),s.c(),r=D()},m(e,s){me(t,e,s),k(e,n,s),a[o].m(e,s),k(e,r,s),i=!0},p(e,n){const i={};1&n[0]&&(i.text=e[41].designation),t.$set(i);let d=o;o=c(e),o===d?a[o].p(e,n):(oe(),ie(a[d],1,1,(()=>{a[d]=null})),se(),s=a[o],s?s.p(e,n):(s=a[o]=l[o](e),s.c()),re(s,1),s.m(r.parentNode,r))},i(e){i||(re(t.$$.fragment,e),re(s),i=!0)},o(e){ie(t.$$.fragment,e),ie(s),i=!1},d(e){fe(t,e),e&&I(n),a[o].d(e),e&&I(r)}}}function Bn(e){let t;return{c(){t=C("Abbrechen")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function An(e){let t;return{c(){t=C("Speichern")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function qn(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function Wn(e){let t,n,o,s;Cn.title=t=e[3];let r={ctx:e,current:null,token:null,hasCatch:!1,pending:qn,then:On,catch:Nn,value:40,blocks:[,,,]};return le(e[9](),r),{c(){n=E(),o=D(),r.block.c()},m(e,t){k(e,n,t),k(e,o,t),r.block.m(e,r.anchor=t),r.mount=()=>o.parentNode,r.anchor=o,s=!0},p(n,o){e=n,(!s||8&o[0])&&t!==(t=e[3])&&(Cn.title=t),ae(r,e,o)},i(e){s||(re(r.block),s=!0)},o(e){for(let e=0;e<3;e+=1){ie(r.blocks[e])}s=!1},d(e){e&&I(n),e&&I(o),r.block.d(e),r.token=null,r=null}}}let Hn=new Map,Rn=new Map,Yn=new Map;const Gn=(e,n)=>{const o=n;return Hn.has(o)||Hn.set(o,t.getTasksList(n).then((({data:e})=>e))),Hn.get(o)},Vn=(e,n,o)=>Rn.get(o)||Gn(e,n).then((n=>n.find((({_id:e})=>e===o))||t.getTaskList(e,o))).then((e=>(Rn.set(o,e),e))),Jn=(e,t)=>{Yn.set(e,t)},Un=e=>Yn.get(e),Kn=(e,n)=>Yn.get(n)||t.getTask(e,n).then((e=>(Yn.set(n,e),e))),Qn=(e,n)=>{if(!Hn.get(n))return;const o=n;Hn.set(o,t.getTasksList(n).then((({data:e})=>e)))},Xn=()=>{Hn=new Map,Rn=new Map,Yn=new Map};let Zn="";function eo(e,o,a){let d,u,m,p;y(e,i,(e=>a(24,m=e))),y(e,l,(e=>a(25,p=e)));const{Divider:$,Button:g}=c,h=JSON.parse(s.getItem("Locale")),v=q();let b,w,{schema:x}=o,{recID:k}=o,{prevEventID:I=!1}=o,{prev:F=!1}=o,{taskId:_=!1}=o,{description:S=""}=o,{root:C=!1}=o,{readonly:E}=o,D={},N={},O="form-"+x.class+Math.floor(9e3*Math.random()+1e3).toString();const j=C?"fEmbedded":"fTask",z=C?"sEmbedded":"sTask",L=async()=>{if(!x.input)return;if(!x.input.length)return;if(x.input.length<2)return;const e=await t.getEvent(x.id),n=!e.input.class[0].name&&e.input.class[0].selection;if(!n)return;const o=e.input.class[1].name,s=e.input.class[1].destination?.split(".")[0];if(!o||!s)return;const r=x.list?.find((e=>e.name===o));if(!r)return;const i=await t.getSchemaByClass(n),l=(await t.getTasks(i.id)).data;if(!l?.length)return;const c=[];for(const e of l){const t={};for(const n of r.item)n.name===s?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);c.push(t)}c.length&&a(1,D[o]=c,D)},P=()=>{for(const e of x.items)e.properties?.value?.concatenation&&T(e)},T=async e=>{const t=e.properties.value.concatenation;let n="";for(const e of t)void 0!==e.constant&&(n+=e.constant),"year"===e.variable&&(n+=(new Date).getFullYear()),e.refItemNext&&(n+=await M(e.refItemNext));a(1,D[e.name]=n,D)},M=async e=>{const[n,o]=e.offset?.split(",")||[0,0],s=+e.base||0,r=+e.step||1;e.type;const i=e.refItem,l=await t.getLastId(x.class,i);if(!l?.length)return(s+r).toString().padStart(o,"0");return((+l[0][i]?.substring(n,n+o)||s)+r).toString().padStart(o,"0")},B=(e,t)=>{const n=t.name,o=e.find((e=>e.name===n));let s=t.value;if(s&&o&&o.type.startsWith("date"))try{return function(e,t,n){const o=Math.floor((new Date).getFullYear()/100);let s=!1;if(""===e)return null;const r=t.split(Ft);let i=0,l=0;const a=new Date(0);for(const c of r){if(!e.startsWith(c,i))return n;if(i+=c.length,i===e.length){if(l!==t.length)return n;break}if("%"!==t[l+c.length])break;if(l+=c.length+1,"%"===t[l]){if("%"!==e[i])return n;i++}else if("p"===t[l].toLowerCase()){const t=e.substr(i,2).toUpperCase();if("AM"===t)s=!1,a.getHours()>=12&&a.setHours(a.getHours()-12);else{if("PM"!==t)return n;s=!0,a.getHours()<12&&a.setHours(a.getHours()+12)}}else{It.lastIndex=i;const r=It.exec(e);if(null==r)return n;switch(t[l]){case"H":a.setHours(parseInt(r[0])+12*s);break;case"M":a.setMinutes(r[0]);break;case"S":a.setSeconds(r[0]);break;case"d":a.setDate(r[0]);break;case"m":a.setMonth(r[0]-1);break;case"y":a.setFullYear(100*o+parseInt(r[0]));break;case"Y":a.setFullYear(r[0])}i+=r[0].length}l++}return isNaN(a.valueOf())?n:a}(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if(o&&"boolean"===o.type&&(s=!!t.checked),o&&"number"===o.type){const e=Number("1.1").toLocaleString(h.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},W=()=>C?window.singleSpaNavigate("/"):v("back"),H=async(e,n)=>{if(x.input?.length>1){if(x.input[0]!==e)return;if(n){const o=await t.getTaskOptions(`${e}:${n}`,x.id);a(1,D={...D,...o})}else{const e=x.input.slice(1);for(const t of e)a(1,D[t]=[],D)}}};return n.subscribe((async e=>{if(!e)return;if(!Hn.get(e.eventId))return;const n=await t.getTaskList(x.class,e.taskId);((e,t,n)=>{if(!Hn.get(e))return;const o=t;Rn.set(o,n)})(e.eventId,e.taskId,n)})),A(Xn),e.$$set=e=>{"schema"in e&&a(0,x=e.schema),"recID"in e&&a(18,k=e.recID),"prevEventID"in e&&a(16,I=e.prevEventID),"prev"in e&&a(19,F=e.prev),"taskId"in e&&a(17,_=e.taskId),"description"in e&&a(14,S=e.description),"root"in e&&a(20,C=e.root),"readonly"in e&&a(15,E=e.readonly)},e.$$.update=()=>{32768&e.$$.dirty[0]&&a(2,d=E),6291457&e.$$.dirty[0]&&w&&b&&x.items.map((({name:e,type:t})=>{const n=b.items.find((t=>t.name===e));if(!n)return;if(t!==n.type)return;const o="_"+e;w[e]&&a(1,D[e]=w[e],D),w[o]&&a(1,D[o]=w[o],D)})),1064960&e.$$.dirty[0]&&a(3,u=C?S||"enablerr - Form":document.title)},[x,D,d,u,$,g,O,j,z,async()=>{if(k&&(a(1,D=await t.getTask(x.class,k)),a(14,S=f(x,D))),I){a(15,E=!1),a(21,b=await t.getSchema(I)),"string"==typeof F&&a(22,w=await t.getTask(b.class,F));const e=x.items.find((e=>e.refClass===b.class));a(1,D[e.name]=w._id,D)}const e=await t.getEvent(x.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some((e=>"Manual"===e.type))&&a(15,E=!0),m.role?.length&&x.authorization?.length){const e=x.authorization.some((e=>p?.find((t=>t===e.role&&"edit"===e.activity))));a(15,E||=!e)}return k||(P(),L()),!0},async()=>{k||a(2,d=!0);const e={};Array.from(document.querySelectorAll("form#"+O+" ."+O)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,o]=t.name.split("."),s=x.list.find((e=>e.name===n));e[t.name]=B(s.item,t)}else e[t.name]=B(x.items,t)})),x.list&&x.list.map((t=>{"array"===t.type&&N[t.name]&&(e[t.name]=N[t.name].reduce(((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce(((e,[n,o])=>("_delete"!==n&&(e[n]=B(t.item,{name:n,value:o,checked:o})),e)),{}))),[]))})),e._event=x.id,e._prevEventId=I,e._taskId=_;const{id:n,task:o,error:s}=await t.saveData(x.class,e);if(s?.text){const e=s.field?" in "+s.field+": "+s.value:"";return r.failed(`${s.text} ${e}`,3e3),void a(2,d=!1)}r.success("Die Daten wurden gespeichert.",2e3),e._id=n;const i=await t.getTaskList(x.class,n);v("choose",{row:i}),C&&!k?window.singleSpaNavigate(`/task/${x.id}/${o}/task`):W()},()=>I?window.history.back():W(),async({detail:{row:e}})=>{if(k)return;await(async()=>{for(const e of x.items)if(e.refItem&&D[e.refItem]){const n=await t.getTask(e.refItem,D[e.refItem]);n&&a(1,D[e.name]=n[e.name],D)}for(const e of x.list||[])if(e.refItem&&D[e.refItem]){const n=await t.getTask(e.refItem,D[e.refItem]),o=[];for(const t of n[e.name]){const n={};for(const o of e.item)t[o.name]&&(n[o.name]=t[o.name]);o.push(n)}a(1,D[e.name]=o,D)}})();const n=e._task.event,o=await t.getEvent(n),s=await t.getEvent(x.id);if(!s.output?.class?.length)return;const r=s.output.class[0]?.item.find((e=>e.name===o.output.class[0]?.name));(s.input?.class?.length&&s.input.class[0]?.name===o.output.class[0]?.name||r?.asInput)&&(a(21,b=await t.getSchema(n)),a(16,I=n),a(17,_=e._task._id),a(22,w=!!_&&await t.getTask(b.class,e._task.docId)),H(b.class,e?._task?.docId))},({detail:e})=>{N[e.listName]=e.value},S,E,I,_,k,F,C,b,w]}class to extends ge{constructor(e){var t;super(),Cn.getElementById("svelte-rovpm0-style")||((t=_("style")).id="svelte-rovpm0-style",t.textContent="form.disabled.svelte-rovpm0 input.svelte-rovpm0{background-color:red !important}.comment.svelte-rovpm0.svelte-rovpm0{color:green;margin-bottom:1em}form.svelte-rovpm0.svelte-rovpm0{min-width:25em}@media only screen and (min-width: 600px){form.svelte-rovpm0.svelte-rovpm0{min-width:30em}}.fEmbedded.svelte-rovpm0.svelte-rovpm0,.fTask.svelte-rovpm0.svelte-rovpm0{overflow-y:auto;overflow-x:hidden}.fEmbedded.svelte-rovpm0.svelte-rovpm0{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-rovpm0.svelte-rovpm0{height:fit-content;max-height:70vh}.sTask.svelte-rovpm0.svelte-rovpm0{height:95%;display:inline-grid}.sTask.svelte-rovpm0 .btn.svelte-rovpm0{display:initial !important}.form--buttons.svelte-rovpm0.svelte-rovpm0{display:flex;gap:1em;padding-bottom:0.5em}",x(Cn.head,t)),$e(this,e,eo,Wn,b,{schema:0,recID:18,prevEventID:16,prev:19,taskId:17,description:14,root:20,readonly:15},[-1,-1])}}function no(e){let t,n,o;function s(t){e[4](t)}let r={schema:e[5],recID:e[6]};return void 0!==e[0]&&(r.description=e[0]),t=new to({props:r}),R.push((()=>de(t,"description",s))),t.$on("back",e[2]),{c(){ue(t.$$.fragment)},m(e,n){me(t,e,n),o=!0},p(e,o){const s={};32&o&&(s.schema=e[5]),64&o&&(s.recID=e[6]),!n&&1&o&&(n=!0,s.description=e[0],K((()=>n=!1))),t.$set(s)},i(e){o||(re(t.$$.fragment,e),o=!0)},o(e){ie(t.$$.fragment,e),o=!1},d(e){fe(t,e)}}}function oo(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[no,({prop:{schema:e,recID:t,eventID:n}})=>({5:e,6:t,7:n}),({prop:e})=>(e?32:0)|(e?64:0)|(e?128:0)]},$$scope:{ctx:e}}}),{c(){ue(t.$$.fragment)},m(e,o){me(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.description=e[0]),353&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(re(t.$$.fragment,e),n=!0)},o(e){ie(t.$$.fragment,e),n=!1},d(e){fe(t,e)}}}function so(e,n,o){let s,{refresh:r}=n;return e.$$set=e=>{"refresh"in e&&o(3,r=e.refresh)},[s,(e,n)=>t.getSchema(e).then((t=>({schema:t,recID:n,eventID:e,title:t.identity.designation}))),e=>{},r,function(e){s=e,o(0,s)}]}function ro(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var io,lo,ao=(io=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){s(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!==r(e))throw new Error("single-spa-svelte requires a configuration object");var t=o(o({},i),e);if(!t.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:l.bind(null,t,n),mount:a.bind(null,t,n),unmount:c.bind(null,t,n),update:d.bind(null,t,n)}};var i={component:null,domElementGetter:null,props:{}};function l(e){return Promise.resolve()}function a(e,t,n){var s=Object.keys(i),r=Object.keys(e).reduce((function(t,n){return s.includes(n)||(t[n]=e[n]),t}),{});return Promise.resolve().then((function(){var s=function(e,t){return(t=t&&t.customProps?t.customProps:t).domElement?function(){return t.domElement}:t.domElementGetter?function(){return t.domElementGetter(t)}:e.domElementGetter?function(){return e.domElementGetter(t)}:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)}(e,n),i=s();t.instance=new e.component(o(o({},r),{},{target:i,props:Object.assign({},n,e.props)}))}))}function c(e,t){return Promise.resolve().then((function(){t.instance.$destroy?t.instance.$destroy():t.instance.destroy()}))}function d(e,t,n){return Promise.resolve().then((function(){t.instance.$set?t.instance.$set(n):t.instance.set(n)}))}},io(lo={exports:{}},lo.exports),lo.exports);const co=ro(ao)({component:class extends ge{constructor(e){super(),$e(this,e,so,oo,b,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:uo,mount:mo,unmount:fo}=co;e({bootstrap:uo,mount:mo,unmount:fo});e("Form",to),e("List",Je)}}}));
1
+ System.register(["@enablerr-ui/form","@enablerr-ui/layout"],(function(e){"use strict";var t,n,s,o,r,i,l,a,c;return{setters:[function(e){t=e.Request,n=e.task_notification,s=e.TextArea,o=e.Storage,r=e.toasts,i=e.settings,l=e.currentRoles,a=e.Page},function(e){c=e.getAttractions}],execute:function(){e("version","0.2.210");const d=e("checkDate",((e,t)=>"string"!=typeof e||e.length<20||!(t=e.split(" · "))?e:t.map((e=>2===e.split("T").length&&3===e.split("T")[0].split("-").length?new Date(e).toLocaleDateString():e)).filter((e=>!!e)).join(" · "))),u=e=>{try{return new Date(e).toLocaleString()}catch{return e}},m=e=>e?"(ja)":"(nein)",f=(e,t)=>{const n={...t};return(e.display?.reduce(((t,s)=>{let[o,r]=s.split(".");if(e.list?.find((({name:e})=>e===o))&&r&&void 0!==n[o]){const e=`${o}_${r}`;n[e]=n[o][r],o=e}return t.find((e=>e===o))||t.push(o),t}),[]).map((e=>d(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":t[e.name]))).map((e=>e?.split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")};function p(){}function $(e){return e()}function h(){return Object.create(null)}function g(e){e.forEach($)}function v(e){return"function"==typeof e}function b(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function y(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return p;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function w(e){return null==e?"":e}function x(e,t){e.appendChild(t)}function k(e,t,n){e.insertBefore(t,n||null)}function I(e){e.parentNode.removeChild(e)}function F(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function _(e){return document.createElement(e)}function S(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function E(e){return document.createTextNode(e)}function C(){return E(" ")}function D(){return E("")}function N(e,t,n,s){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n,s)}function O(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function j(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function z(e,t){e.value=null==t?"":t}function L(e,t,n,s){e.style.setProperty(t,n,s?"important":"")}function P(e,t,n){e.classList[n?"add":"remove"](t)}let T;function M(e){T=e}function B(){if(!T)throw new Error("Function called outside component initialization");return T}function q(e){B().$$.on_mount.push(e)}function A(){const e=B();return(t,n)=>{const s=e.$$.callbacks[t];if(s){const o=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);s.slice().forEach((t=>{t.call(e,o)}))}}}function W(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const H=[],R=[],Y=[],G=[],V=Promise.resolve();let J=!1;function U(){J||(J=!0,V.then(te))}function K(){return U(),V}function Q(e){Y.push(e)}function X(e){G.push(e)}let Z=!1;const ee=new Set;function te(){if(!Z){Z=!0;do{for(let e=0;e<H.length;e+=1){const t=H[e];M(t),ne(t.$$)}for(M(null),H.length=0;R.length;)R.pop()();for(let e=0;e<Y.length;e+=1){const t=Y[e];ee.has(t)||(ee.add(t),t())}Y.length=0}while(H.length);for(;G.length;)G.pop()();J=!1,Z=!1,ee.clear()}}function ne(e){if(null!==e.fragment){e.update(),g(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Q)}}const se=new Set;let oe;function re(){oe={r:0,c:[],p:oe}}function ie(){oe.r||g(oe.c),oe=oe.p}function le(e,t){e&&e.i&&(se.delete(e),e.i(t))}function ae(e,t,n,s){if(e&&e.o){if(se.has(e))return;se.add(e),oe&&oe.c.push((()=>{se.delete(e),s&&(n&&e.d(1),s())})),e.o(t)}}function ce(e,t){const n=t.token={};function s(e,s,o,r){if(t.token!==n)return;t.resolved=r;let i=t.ctx;void 0!==o&&(i=i.slice(),i[o]=r);const l=e&&(t.current=e)(i);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==s&&e&&(re(),ae(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),ie())})):t.block.d(1),l.c(),le(l,1),l.m(t.mount(),t.anchor),a=!0),t.block=l,t.blocks&&(t.blocks[s]=l),a&&te()}if((o=e)&&"object"==typeof o&&"function"==typeof o.then){const n=B();if(e.then((e=>{M(n),s(t.then,1,t.value,e),M(null)}),(e=>{if(M(n),s(t.catch,2,t.error,e),M(null),!t.hasCatch)throw e})),t.current!==t.pending)return s(t.pending,0),!0}else{if(t.current!==t.then)return s(t.then,1,t.value,e),!0;t.resolved=e}var o}function de(e,t,n){const s=t.slice(),{resolved:o}=e;e.current===e.then&&(s[e.value]=o),e.current===e.catch&&(s[e.error]=o),e.block.p(s,n)}const ue="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function me(e,t,n){const s=e.$$.props[t];void 0!==s&&(e.$$.bound[s]=n,n(e.$$.ctx[s]))}function fe(e){e&&e.c()}function pe(e,t,n,s){const{fragment:o,on_mount:r,on_destroy:i,after_update:l}=e.$$;o&&o.m(t,n),s||Q((()=>{const t=r.map($).filter(v);i?i.push(...t):g(t),e.$$.on_mount=[]})),l.forEach(Q)}function $e(e,t){const n=e.$$;null!==n.fragment&&(g(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function he(e,t,n,s,o,r,i=[-1]){const l=T;M(e);const a=e.$$={fragment:null,ctx:null,props:r,update:p,not_equal:o,bound:h(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:t.context||[]),callbacks:h(),dirty:i,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...s)=>{const r=s.length?s[0]:n;return a.ctx&&o(a.ctx[t],a.ctx[t]=r)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](r),c&&function(e,t){-1===e.$$.dirty[0]&&(H.push(e),U(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,g(a.before_update),a.fragment=!!s&&s(a.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);a.fragment&&a.fragment.l(e),e.forEach(I)}else a.fragment&&a.fragment.c();t.intro&&le(e.$$.fragment),pe(e,t.target,t.anchor,t.customElement),te()}M(l)}class ge{$destroy(){$e(this,1),this.$destroy=p}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function ve(e){let t,n,s,o;return{c(){t=S("svg"),n=S("polyline"),s=S("path"),O(n,"points","9 10 4 15 9 20"),O(s,"d","M20 4v7a4 4 0 0 1-4 4H4"),O(t,"xmlns","http://www.w3.org/2000/svg"),O(t,"width",e[0]),O(t,"height",e[0]),O(t,"fill","none"),O(t,"viewBox","0 0 24 24"),O(t,"stroke","currentColor"),O(t,"stroke-width",e[1]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"class",o="feather feather-corner-down-left "+e[2])},m(e,o){k(e,t,o),x(t,n),x(t,s)},p(e,[n]){1&n&&O(t,"width",e[0]),1&n&&O(t,"height",e[0]),2&n&&O(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-corner-down-left "+e[2])&&O(t,"class",o)},i:p,o:p,d(e){e&&I(t)}}}function be(e,t,n){let{size:s="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==s&&(s="x"===s.slice(-1)?s.slice(0,s.length-1)+"em":parseInt(s)+"px"),e.$$set=e=>{"size"in e&&n(0,s=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[s,o,r]}class ye extends ge{constructor(e){super(),he(this,e,be,ve,b,{size:0,strokeWidth:1,class:2})}}function we(e){let t,n,s,o,r;return{c(){t=S("svg"),n=S("path"),s=S("line"),o=S("line"),O(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),O(s,"x1","18"),O(s,"y1","9"),O(s,"x2","12"),O(s,"y2","15"),O(o,"x1","12"),O(o,"y1","9"),O(o,"x2","18"),O(o,"y2","15"),O(t,"xmlns","http://www.w3.org/2000/svg"),O(t,"width",e[0]),O(t,"height",e[0]),O(t,"fill","none"),O(t,"viewBox","0 0 24 24"),O(t,"stroke","currentColor"),O(t,"stroke-width",e[1]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"class",r="feather feather-delete "+e[2])},m(e,r){k(e,t,r),x(t,n),x(t,s),x(t,o)},p(e,[n]){1&n&&O(t,"width",e[0]),1&n&&O(t,"height",e[0]),2&n&&O(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-delete "+e[2])&&O(t,"class",r)},i:p,o:p,d(e){e&&I(t)}}}function xe(e,t,n){let{size:s="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==s&&(s="x"===s.slice(-1)?s.slice(0,s.length-1)+"em":parseInt(s)+"px"),e.$$set=e=>{"size"in e&&n(0,s=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[s,o,r]}class ke extends ge{constructor(e){super(),he(this,e,xe,we,b,{size:0,strokeWidth:1,class:2})}}function Ie(e){let t,n,s,o;return{c(){t=S("svg"),n=S("path"),s=S("path"),O(n,"d","M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"),O(s,"d","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"),O(t,"xmlns","http://www.w3.org/2000/svg"),O(t,"width",e[0]),O(t,"height",e[0]),O(t,"fill","none"),O(t,"viewBox","0 0 24 24"),O(t,"stroke","currentColor"),O(t,"stroke-width",e[1]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"class",o="feather feather-edit "+e[2])},m(e,o){k(e,t,o),x(t,n),x(t,s)},p(e,[n]){1&n&&O(t,"width",e[0]),1&n&&O(t,"height",e[0]),2&n&&O(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-edit "+e[2])&&O(t,"class",o)},i:p,o:p,d(e){e&&I(t)}}}function Fe(e,t,n){let{size:s="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==s&&(s="x"===s.slice(-1)?s.slice(0,s.length-1)+"em":parseInt(s)+"px"),e.$$set=e=>{"size"in e&&n(0,s=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[s,o,r]}class _e extends ge{constructor(e){super(),he(this,e,Fe,Ie,b,{size:0,strokeWidth:1,class:2})}}function Se(e){let t,n,s,o;return{c(){t=S("svg"),n=S("circle"),s=S("line"),O(n,"cx","11"),O(n,"cy","11"),O(n,"r","8"),O(s,"x1","21"),O(s,"y1","21"),O(s,"x2","16.65"),O(s,"y2","16.65"),O(t,"xmlns","http://www.w3.org/2000/svg"),O(t,"width",e[0]),O(t,"height",e[0]),O(t,"fill","none"),O(t,"viewBox","0 0 24 24"),O(t,"stroke","currentColor"),O(t,"stroke-width",e[1]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"class",o="feather feather-search "+e[2])},m(e,o){k(e,t,o),x(t,n),x(t,s)},p(e,[n]){1&n&&O(t,"width",e[0]),1&n&&O(t,"height",e[0]),2&n&&O(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-search "+e[2])&&O(t,"class",o)},i:p,o:p,d(e){e&&I(t)}}}function Ee(e,t,n){let{size:s="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==s&&(s="x"===s.slice(-1)?s.slice(0,s.length-1)+"em":parseInt(s)+"px"),e.$$set=e=>{"size"in e&&n(0,s=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[s,o,r]}class Ce extends ge{constructor(e){super(),he(this,e,Ee,Se,b,{size:0,strokeWidth:1,class:2})}}const{document:De}=ue;function Ne(e){e[19]=e[21].list,e[20]=e[21].items}function Oe(e,t,n){const s=e.slice();return s[22]=t[n],s}function je(e,t,n){const s=e.slice();return s[25]=t[n],s}function ze(e,t,n){const s=e.slice();return s[25]=t[n],s}function Le(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function Pe(e){let t,n,s,o,r,i;Ne(e);let l=e[19]?.length&&Te(e),a=e[20]?.length&&Me(e),c=e[19]?.length&&Ae(e);return{c(){l&&l.c(),t=C(),n=_("div"),s=_("table"),a&&a.c(),o=C(),r=_("tbody"),c&&c.c(),O(s,"striped",""),O(s,"class","svelte-1c3ufb0"),O(n,"class","eList svelte-1c3ufb0")},m(e,d){l&&l.m(e,d),k(e,t,d),k(e,n,d),x(n,s),a&&a.m(s,null),x(s,o),x(s,r),c&&c.m(r,null),i=!0},p(e,n){Ne(e),e[19]?.length?l?(l.p(e,n),4&n&&le(l,1)):(l=Te(e),l.c(),le(l,1),l.m(t.parentNode,t)):l&&(re(),ae(l,1,1,(()=>{l=null})),ie()),e[20]?.length?a?a.p(e,n):(a=Me(e),a.c(),a.m(s,o)):a&&(a.d(1),a=null),e[19]?.length?c?(c.p(e,n),4&n&&le(c,1)):(c=Ae(e),c.c(),le(c,1),c.m(r,null)):c&&(re(),ae(c,1,1,(()=>{c=null})),ie())},i(e){i||(le(l),le(c),i=!0)},o(e){ae(l),ae(c),i=!1},d(e){l&&l.d(e),e&&I(t),e&&I(n),a&&a.d(),c&&c.d()}}}function Te(e){let t,n,s;return n=new e[5]({props:{value:""}}),n.$on("input",e[10]),{c(){t=E("Suchen: "),fe(n.$$.fragment)},m(e,o){k(e,t,o),pe(n,e,o),s=!0},p:p,i(e){s||(le(n.$$.fragment,e),s=!0)},o(e){ae(n.$$.fragment,e),s=!1},d(e){e&&I(t),$e(n,e)}}}function Me(e){let t,n,s,o=e[0]&&Be(),r=e[20],i=[];for(let t=0;t<r.length;t+=1)i[t]=qe(ze(e,r,t));return{c(){t=_("thead"),n=_("tr"),o&&o.c(),s=C();for(let e=0;e<i.length;e+=1)i[e].c();O(n,"class","svelte-1c3ufb0"),O(t,"class","svelte-1c3ufb0")},m(e,r){k(e,t,r),x(t,n),o&&o.m(n,null),x(n,s);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(e[0]?o||(o=Be(),o.c(),o.m(n,s)):o&&(o.d(1),o=null),260&t){let s;for(r=e[20],s=0;s<r.length;s+=1){const o=ze(e,r,s);i[s]?i[s].p(o,t):(i[s]=qe(o),i[s].c(),i[s].m(n,null))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}},d(e){e&&I(t),o&&o.d(),F(i,e)}}}function Be(e){let t;return{c(){t=_("th"),O(t,"class","svelte-1c3ufb0")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function qe(e){let t,n,s=e[25]?.designation+"";return{c(){t=_("th"),n=E(s),O(t,"class","svelte-1c3ufb0")},m(e,s){k(e,t,s),x(t,n)},p(e,t){4&t&&s!==(s=e[25]?.designation+"")&&j(n,s)},d(e){e&&I(t)}}}function Ae(e){let t,n,s=e[19],o=[];for(let t=0;t<s.length;t+=1)o[t]=Ye(Oe(e,s,t));const r=e=>ae(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,s){for(let t=0;t<o.length;t+=1)o[t].m(e,s);k(e,t,s),n=!0},p(e,n){if(3023&n){let i;for(s=e[19],i=0;i<s.length;i+=1){const r=Oe(e,s,i);o[i]?(o[i].p(r,n),le(o[i],1)):(o[i]=Ye(r),o[i].c(),le(o[i],1),o[i].m(t.parentNode,t))}for(re(),i=s.length;i<o.length;i+=1)r(i);ie()}},i(e){if(!n){for(let e=0;e<s.length;e+=1)le(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ae(o[e]);n=!1},d(e){F(o,e),e&&I(t)}}}function We(e){let t,n,s,o,r,i,l=e[0]&&He(e),a=e[20],c=[];for(let t=0;t<a.length;t+=1)c[t]=Re(je(e,a,t));return{c(){t=_("tr"),l&&l.c(),n=C();for(let e=0;e<c.length;e+=1)c[e].c();s=C(),O(t,"class","pointer svelte-1c3ufb0"),P(t,"active",e[22]._id===e[1])},m(a,d){k(a,t,d),l&&l.m(t,null),x(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);x(t,s),o=!0,r||(i=N(t,"click",(function(){v(e[7](e[22]))&&e[7](e[22]).apply(this,arguments)})),r=!0)},p(o,r){if((e=o)[0]?l?(l.p(e,r),1&r&&le(l,1)):(l=He(e),l.c(),le(l,1),l.m(t,n)):l&&(re(),ae(l,1,1,(()=>{l=null})),ie()),324&r){let n;for(a=e[20],n=0;n<a.length;n+=1){const o=je(e,a,n);c[n]?c[n].p(o,r):(c[n]=Re(o),c[n].c(),c[n].m(t,s))}for(;n<c.length;n+=1)c[n].d(1);c.length=a.length}262&r&&P(t,"active",e[22]._id===e[1])},i(e){o||(le(l),o=!0)},o(e){ae(l),o=!1},d(e){e&&I(t),l&&l.d(),F(c,e),r=!1,i()}}}function He(e){let t,n,s,o,r;return n=new _e({props:{size:"18"}}),{c(){t=_("td"),fe(n.$$.fragment),O(t,"id","editRow"),O(t,"class","svelte-1c3ufb0")},m(i,l){var a;k(i,t,l),pe(n,t,null),s=!0,o||(r=N(t,"click",(a=function(){v(e[9](e[22]))&&e[9](e[22]).apply(this,arguments)},function(e){return e.stopPropagation(),a.call(this,e)})),o=!0)},p(t,n){e=t},i(e){s||(le(n.$$.fragment,e),s=!0)},o(e){ae(n.$$.fragment,e),s=!1},d(e){e&&I(t),$e(n),o=!1,r()}}}function Re(e){let t,n,s=e[6](e[22],e[25])+"";return{c(){t=_("td"),n=E(s),O(t,"class","svelte-1c3ufb0")},m(e,s){k(e,t,s),x(t,n)},p(e,t){4&t&&s!==(s=e[6](e[22],e[25])+"")&&j(n,s)},d(e){e&&I(t)}}}function Ye(e){let t,n,s=e[11](e[22],e[20],e[3]),o=s&&We(e);return{c(){o&&o.c(),t=D()},m(e,s){o&&o.m(e,s),k(e,t,s),n=!0},p(e,n){12&n&&(s=e[11](e[22],e[20],e[3])),s?o?(o.p(e,n),12&n&&le(o,1)):(o=We(e),o.c(),le(o,1),o.m(t.parentNode,t)):o&&(re(),ae(o,1,1,(()=>{o=null})),ie())},i(e){n||(le(o),n=!0)},o(e){ae(o),n=!1},d(e){o&&o.d(e),e&&I(t)}}}function Ge(e){let t,n;return t=new e[4]({}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p:p,i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Ve(e){let t,n,s,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Ge,then:Pe,catch:Le,value:21,blocks:[,,,]};return ce(n=e[2]&&e[8](),o),{c(){t=D(),o.block.c()},m(e,n){k(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,s=!0},p(t,[s]){e=t,o.ctx=e,4&s&&n!==(n=e[2]&&e[8]())&&ce(n,o)||de(o,e,s)},i(e){s||(le(o.block),s=!0)},o(e){for(let e=0;e<3;e+=1){ae(o.blocks[e])}s=!1},d(e){e&&I(t),o.block.d(e),o.token=null,o=null}}}function Je(e,s,o){const r=A(),{Loading:i,TextField:l}=c;let{className:a}=s,{rowId:u}=s,{filterForReady:m=!1}=s,{showEdit:f=!1}=s,{selectionFields:p=!1}=s,$=!0,h="";const g=(e,t)=>t&&d(e[`_${t.name}`]||e[t.name]||""),v=t.getSchemaByClass(a),b=async(e,t,n,s)=>{const{value:o,refClass:r}=s,[i,l]=n.split("."),a=await Zn(i,o);if(!a)return e;const c=a[l];return c?.length?c.map((n=>{let s=e?.find((e=>e._id===n[t]))||{};s={...s};for(const e in s)n[e]&&(s[e]=n[e]);for(const e in n)n[e]&&(s[e]=n[e]);return Qn(r+s._id.toString(),s),s})):e};q((()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"})})),n.subscribe((async e=>{if(!e)return;const t=await v;e.eventId===t.id&&(es(t.class,e.eventId),o(2,$=!o(2,$=!1)))}));return e.$$set=e=>{"className"in e&&o(12,a=e.className),"rowId"in e&&o(1,u=e.rowId),"filterForReady"in e&&o(13,m=e.filterForReady),"showEdit"in e&&o(0,f=e.showEdit),"selectionFields"in e&&o(14,p=e.selectionFields)},[f,u,$,h,i,l,g,e=>()=>r("choose",{row:e}),async()=>{const e=await v;let t=await Un(e.class,e.id);const n=p&&p?.find((t=>e.class===t.refClass.split(":")[0]));if(n&&n.value){const[s,r]=n.refClass.split(":");e.class===s&&(t=await b(t,s,r,n)),o(0,f=!t)}!p&&m&&(t=((e,t)=>"Information"===t.state.task?e:e.filter((e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status)))(t,e));let s=[],r=e.display;return r&&r.length?r.map((n=>{const[o,r]=n.split(".");let i=e.list?.find((e=>e.name===o))?.item.find((e=>e.name===r));i&&(i={...i},i.name=`${o}_${r}`,t=t.map((e=>(e[o]&&(e[i.name]=e[o][r]),e)))),i||(i=e.items.find((e=>e.name===o))),s.find((e=>e?.name===o))||s.push(i)})):s=e.items,{list:t,items:s}},e=>t=>{r("edit",e)},({detail:{value:e}})=>{o(3,h=e)},(e,t,n)=>{if(!n)return!0;for(const s of t)if(g(e,s)?.toLowerCase()?.includes(n))return!0;return!1},a,m,p]}class Ue extends ge{constructor(e){var t;super(),De.getElementById("svelte-1c3ufb0-style")||((t=_("style")).id="svelte-1c3ufb0-style",t.textContent=".eList.svelte-1c3ufb0.svelte-1c3ufb0{min-height:12em;height:fit-content;max-height:65vh;overflow:auto}.eList.svelte-1c3ufb0 #editRow.svelte-1c3ufb0{width:1em}.eList.svelte-1c3ufb0 table.svelte-1c3ufb0{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important;margin-top:1em}.eList.svelte-1c3ufb0 table thead.svelte-1c3ufb0{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1c3ufb0 table tbody tr.svelte-1c3ufb0{height:2.3em}th.svelte-1c3ufb0.svelte-1c3ufb0,td.svelte-1c3ufb0.svelte-1c3ufb0{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-1c3ufb0.svelte-1c3ufb0:hover{background-color:#DAE1E5}tr.active.svelte-1c3ufb0.svelte-1c3ufb0{color:#326173;background-color:#fcebd5}",x(De.head,t)),he(this,e,Je,Ve,b,{className:12,rowId:1,filterForReady:13,showEdit:0,selectionFields:14})}}function Ke(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function Qe(e){let t,n,s=e[21]&&Xe(e);return{c(){s&&s.c(),t=D()},m(e,o){s&&s.m(e,o),k(e,t,o),n=!0},p(e,n){e[21]?s?(s.p(e,n),4&n&&le(s,1)):(s=Xe(e),s.c(),le(s,1),s.m(t.parentNode,t)):s&&(re(),ae(s,1,1,(()=>{s=null})),ie())},i(e){n||(le(s),n=!0)},o(e){ae(s),n=!1},d(e){s&&s.d(e),e&&I(t)}}}function Xe(e){let t,n;return t=new e[8]({props:{title:e[11],class:"eList "+(e[6]?"form":""),$$slots:{default:[st]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};64&n&&(s.class="eList "+(e[6]?"form":"")),4194559&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Ze(e){let t,n;return t=new os({props:{schema:e[1],recID:e[0],readonly:e[7]}}),t.$on("choose",(function(){v(e[16](e[21]))&&e[16](e[21]).apply(this,arguments)})),t.$on("back",e[13]),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(n,s){e=n;const o={};2&s&&(o.schema=e[1]),1&s&&(o.recID=e[0]),128&s&&(o.readonly=e[7]),t.$set(o)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function et(e){let t,n,s,o,r,i,l,a,c;return t=new e[9]({}),o=new e[10]({props:{outline:!0,$$slots:{default:[tt]},$$scope:{ctx:e}}}),o.$on("click",e[14]),i=new e[10]({props:{filled:!0,$$slots:{default:[nt]},$$scope:{ctx:e}}}),i.$on("click",e[15]),a=new Ue({props:{className:e[1].class,filterForReady:e[3],selectionFields:e[4],rowId:e[0],showEdit:e[5]}}),a.$on("edit",e[17]),a.$on("choose",e[18]),{c(){fe(t.$$.fragment),n=C(),s=_("div"),fe(o.$$.fragment),r=C(),fe(i.$$.fragment),l=C(),fe(a.$$.fragment),O(s,"class","form--buttons svelte-jb5mrh")},m(e,d){pe(t,e,d),k(e,n,d),k(e,s,d),pe(o,s,null),x(s,r),pe(i,s,null),k(e,l,d),pe(a,e,d),c=!0},p(e,t){const n={};4194304&t&&(n.$$scope={dirty:t,ctx:e}),o.$set(n);const s={};4194304&t&&(s.$$scope={dirty:t,ctx:e}),i.$set(s);const r={};2&t&&(r.className=e[1].class),8&t&&(r.filterForReady=e[3]),16&t&&(r.selectionFields=e[4]),1&t&&(r.rowId=e[0]),32&t&&(r.showEdit=e[5]),a.$set(r)},i(e){c||(le(t.$$.fragment,e),le(o.$$.fragment,e),le(i.$$.fragment,e),le(a.$$.fragment,e),c=!0)},o(e){ae(t.$$.fragment,e),ae(o.$$.fragment,e),ae(i.$$.fragment,e),ae(a.$$.fragment,e),c=!1},d(e){$e(t,e),e&&I(n),e&&I(s),$e(o),$e(i),e&&I(l),$e(a,e)}}}function tt(e){let t;return{c(){t=E("Abbrechen")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function nt(e){let t;return{c(){t=E("Neu")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function st(e){let t,n,s,o;const r=[et,Ze],i=[];function l(e,t){return e[21].length&&!e[6]?0:1}return t=l(e),n=i[t]=r[t](e),{c(){n.c(),s=D()},m(e,n){i[t].m(e,n),k(e,s,n),o=!0},p(e,o){let a=t;t=l(e),t===a?i[t].p(e,o):(re(),ae(i[a],1,1,(()=>{i[a]=null})),ie(),n=i[t],n?n.p(e,o):(n=i[t]=r[t](e),n.c()),le(n,1),n.m(s.parentNode,s))},i(e){o||(le(n),o=!0)},o(e){ae(n),o=!1},d(e){i[t].d(e),e&&I(s)}}}function ot(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function rt(e){let t,n,s,o={ctx:e,current:null,token:null,hasCatch:!1,pending:ot,then:Qe,catch:Ke,value:21,blocks:[,,,]};return ce(n=e[12](e[2]),o),{c(){t=D(),o.block.c()},m(e,n){k(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,s=!0},p(t,[s]){e=t,o.ctx=e,4&s&&n!==(n=e[12](e[2]))&&ce(n,o)||de(o,e,s)},i(e){s||(le(o.block),s=!0)},o(e){for(let e=0;e<3;e+=1){ae(o.blocks[e])}s=!1},d(e){e&&I(t),o.block.d(e),o.token=null,o=null}}}function it(e,t,n){const{Dialog:s,Divider:o,Button:r}=c,i=A();let{schema:l}=t,{recID:a}=t,{isOpening:d=!0}=t,{filterForReady:u=!1}=t,{selectionFields:m=!1}=t,{showEdit:f=!0}=t,p=l.identity.designation;l.class;let $,h=!1;return e.$$set=e=>{"schema"in e&&n(1,l=e.schema),"recID"in e&&n(0,a=e.recID),"isOpening"in e&&n(2,d=e.isOpening),"filterForReady"in e&&n(3,u=e.filterForReady),"selectionFields"in e&&n(4,m=e.selectionFields),"showEdit"in e&&n(5,f=e.showEdit)},[a,l,d,u,m,f,h,$,s,o,r,p,e=>e&&Un(l.class,l.id),()=>{n(6,h=!1),a||i("back"),f||i("back")},()=>{n(6,h=!1),i("back")},()=>{n(0,a=!1),n(7,$=!1),n(6,h=!0)},e=>({detail:{row:e}})=>{let t=l.display;t&&t.length&&t.map((t=>{const[n,s]=t.split(".");let o=l.list?.find((e=>e.name===n))?.item.find((e=>e.name===s));if(o){e[`${n}_${s}`]=e[n][s]}})),i("choose",{row:e})},({detail:e})=>{n(7,$=!!e._task.visum||"Closed"===e._task.status),n(0,a=e._docId),n(6,h=!0)},function(t){W(e,t)}]}class lt extends ge{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=_("style")).id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",x(document.head,t)),he(this,e,it,rt,b,{schema:1,recID:0,isOpening:2,filterForReady:3,selectionFields:4,showEdit:5})}}function at(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function ct(e){let t,n,o,r,i,l,a,c,d,u,m;n=new s({props:{class:"full-width",id:e[10],value:e[1],rows:"1",readonly:!0,disabled:e[2],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"}});let f=!e[2]&&dt(e),p=!e[2]&&ut(e);function $(t){e[19](t)}let h={class:"tModal",noClickaway:!0,$$slots:{default:[mt]},$$scope:{ctx:e}};return void 0!==e[8]&&(h.open=e[8]),d=new e[9]({props:h}),R.push((()=>me(d,"open",$))),{c(){t=_("div"),fe(n.$$.fragment),o=C(),f&&f.c(),r=C(),i=_("input"),a=C(),p&&p.c(),c=C(),fe(d.$$.fragment),O(i,"class",l=w(e[4]||e[5])+" svelte-axxims"),O(i,"id",e[3]),O(i,"name",e[3]),i.value=e[0],i.hidden=!0,L(t,"position","relative")},m(e,s){k(e,t,s),pe(n,t,null),x(t,o),f&&f.m(t,null),x(t,r),x(t,i),x(t,a),p&&p.m(t,null),k(e,c,s),pe(d,e,s),m=!0},p(e,s){const o={};2&s&&(o.value=e[1]),4&s&&(o.disabled=e[2]),n.$set(o),e[2]?f&&(re(),ae(f,1,1,(()=>{f=null})),ie()):f?(f.p(e,s),4&s&&le(f,1)):(f=dt(e),f.c(),le(f,1),f.m(t,r)),(!m||48&s&&l!==(l=w(e[4]||e[5])+" svelte-axxims"))&&O(i,"class",l),(!m||8&s)&&O(i,"id",e[3]),(!m||8&s)&&O(i,"name",e[3]),(!m||1&s&&i.value!==e[0])&&(i.value=e[0]),e[2]?p&&(re(),ae(p,1,1,(()=>{p=null})),ie()):p?(p.p(e,s),4&s&&le(p,1)):(p=ut(e),p.c(),le(p,1),p.m(t,null));const a={};16777665&s&&(a.$$scope={dirty:s,ctx:e}),!u&&256&s&&(u=!0,a.open=e[8],X((()=>u=!1))),d.$set(a)},i(e){m||(le(n.$$.fragment,e),le(f),le(p),le(d.$$.fragment,e),m=!0)},o(e){ae(n.$$.fragment,e),ae(f),ae(p),ae(d.$$.fragment,e),m=!1},d(e){e&&I(t),$e(n),f&&f.d(),p&&p.d(),e&&I(c),$e(d,e)}}}function dt(e){let t,n,s,o,r;return n=new Ce({props:{size:"18"}}),{c(){t=_("span"),fe(n.$$.fragment),O(t,"class","feather pointer svelte-axxims")},m(i,l){k(i,t,l),pe(n,t,null),s=!0,o||(r=[N(t,"click",e[12]),N(t,"choose",e[13])],o=!0)},p:p,i(e){s||(le(n.$$.fragment,e),s=!0)},o(e){ae(n.$$.fragment,e),s=!1},d(e){e&&I(t),$e(n),o=!1,g(r)}}}function ut(e){let t,n,s,o,r;return n=new ke({props:{size:"18"}}),{c(){t=_("span"),fe(n.$$.fragment),O(t,"class","feather2 pointer svelte-axxims")},m(i,l){k(i,t,l),pe(n,t,null),s=!0,o||(r=N(t,"click",e[15]),o=!0)},p:p,i(e){s||(le(n.$$.fragment,e),s=!0)},o(e){ae(n.$$.fragment,e),s=!1},d(e){e&&I(t),$e(n),o=!1,r()}}}function mt(e){let t,n;return t=new lt({props:{schema:e[7],recID:e[0],isOpening:e[8],filterForReady:"true",selectionFields:e[6]}}),t.$on("choose",e[13]),t.$on("back",e[14]),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};128&n&&(s.schema=e[7]),1&n&&(s.recID=e[0]),256&n&&(s.isOpening=e[8]),64&n&&(s.selectionFields=e[6]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function ft(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function pt(e){let t,n,s={ctx:e,current:null,token:null,hasCatch:!1,pending:ft,then:ct,catch:at,value:23,blocks:[,,,]};return ce(e[11](),s),{c(){t=D(),s.block.c()},m(e,o){k(e,t,o),s.block.m(e,s.anchor=o),s.mount=()=>t.parentNode,s.anchor=t,n=!0},p(t,[n]){de(s,e=t,n)},i(e){n||(le(s.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ae(s.blocks[e])}n=!1},d(e){e&&I(t),s.block.d(e),s.token=null,s=null}}}function $t(e,n,s){const o=A(),{Modal:r}=c;let{id:i}=n,{item:l}=n,{value:a=""}=n,{desc:d=""}=n,{noForm:u=!1}=n,{classId:m}=n,{eventId:p}=n,{disabled:$}=n,{readonly:h}=n,{selectionFields:g}=n;const v="comment_"+i;let b,y=!1;$||=h;const w=()=>{s(8,y=!1)};return e.$$set=e=>{"id"in e&&s(3,i=e.id),"item"in e&&s(16,l=e.item),"value"in e&&s(0,a=e.value),"desc"in e&&s(1,d=e.desc),"noForm"in e&&s(4,u=e.noForm),"classId"in e&&s(5,m=e.classId),"eventId"in e&&s(17,p=e.eventId),"disabled"in e&&s(2,$=e.disabled),"readonly"in e&&s(18,h=e.readonly),"selectionFields"in e&&s(6,g=e.selectionFields)},e.$$.update=()=>{65665&e.$$.dirty&&a&&b&&Promise.resolve(Kn(l.refClass,b.id,a)).then((e=>{var t;(t=e)&&(s(1,d=f(b,t)),o("change",{value:a,description:d}),o("task",{row:t}))}))},[a,d,$,i,u,m,g,b,y,r,v,async()=>{if(s(7,b=await t.getSchemaByClass(l.refClass)),p&&a&&!$){(await t.getSchema(p)).input?.find((e=>e===l.refClass))&&s(2,$=!0)}return!0},function(){s(8,y=!0)},({detail:e})=>{s(0,a=e.row._id),w()},w,()=>{s(0,a=s(1,d="")),o("change",{value:a,description:d}),o("task",{row:{_task:{event:b.id,_id:!1}}})},l,p,h,function(e){y=e,s(8,y)}]}class ht extends ge{constructor(e){var t;super(),document.getElementById("svelte-axxims-style")||((t=_("style")).id="svelte-axxims-style",t.textContent=".feather.svelte-axxims{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-axxims{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:disabled{padding-left:0.625em !important}",x(document.head,t)),he(this,e,$t,pt,b,{id:3,item:16,value:0,desc:1,noForm:4,classId:5,eventId:17,disabled:2,readonly:18,selectionFields:6})}}function gt(e){let t,n,s;return n=new e[6]({props:{lang:e[7].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[5],step:e[8],pattern:e[4],placeholder:e[9],readonly:e[10],disabled:e[3]}}),n.$on("change",e[11]),n.$on("focus",e[12]),{c(){t=_("div"),fe(n.$$.fragment),L(t,"position","relative"),L(t,"max-width","10em")},m(e,o){k(e,t,o),pe(n,t,null),s=!0},p(e,[t]){const s={};6&t&&(s.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t&&(s.id=e[0]),1&t&&(s.name=e[0]),32&t&&(s.value=e[5]),16&t&&(s.pattern=e[4]),8&t&&(s.disabled=e[3]),n.$set(s)},i(e){s||(le(n.$$.fragment,e),s=!0)},o(e){ae(n.$$.fragment,e),s=!1},d(e){e&&I(t),$e(n)}}}function vt(e,t,n){let s;const r=A(),{TextField:i}=c;let{id:l}=t,{item:a}=t,{value:d}=t,{noForm:u=!1}=t,{classId:m}=t,{disabled:f}=t;const p=JSON.parse(o.getItem("Locale")),$=Number("1.1").toLocaleString(p.id).substring(1,2),{properties:h={}}=a;let{min:g,max:v,step:b,pattern:y,decimals:w=0,unit:x="",placeholder:k,hint:I,readonly:F,negative:_}=h;y||(y=w?`[0-9]+([${$}][0-9]{1,${w}})?`:"[0-9]*"),_&&(y="-?"+y);return e.$$set=e=>{"id"in e&&n(0,l=e.id),"item"in e&&n(13,a=e.item),"value"in e&&n(14,d=e.value),"noForm"in e&&n(1,u=e.noForm),"classId"in e&&n(2,m=e.classId),"disabled"in e&&n(3,f=e.disabled)},e.$$.update=()=>{16384&e.$$.dirty&&n(5,s=Number(d.toString().replace($,".")).toFixed(w).toString().replace(".",$))},[l,u,m,f,y,s,i,p,b,k,F,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{F||Number(d.toString().replace($,"."))||n(5,s="")},a,d]}class bt extends ge{constructor(e){super(),he(this,e,vt,gt,b,{id:0,item:13,value:14,noForm:1,classId:2,disabled:3})}}function yt(e,t,n){const s=e.slice();return s[9]=t[n],s}function wt(e){let t,n,s,o=e[9]+"";return{c(){t=_("option"),n=E(o),t.__value=e[9],t.value=t.__value,t.selected=s=e[1]===e[9],O(t,"class","svelte-5xpzvo")},m(e,s){k(e,t,s),x(t,n)},p(e,n){2&n&&s!==(s=e[1]===e[9])&&(t.selected=s)},d(e){e&&I(t)}}}function xt(e){let t,n,s,o,r,i=e[4],l=[];for(let t=0;t<i.length;t+=1)l[t]=wt(yt(e,i,t));return{c(){t=_("select"),n=_("option");for(let e=0;e<l.length;e+=1)l[e].c();n.__value="",n.value=n.__value,O(n,"class","svelte-5xpzvo"),O(t,"class",s=w(e[2]||e[3])+" svelte-5xpzvo"),O(t,"id",e[0]),O(t,"name",e[0]),O(t,"readonly",e[5])},m(s,i){k(s,t,i),x(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);o||(r=N(t,"change",e[6]),o=!0)},p(e,[n]){if(18&n){let s;for(i=e[4],s=0;s<i.length;s+=1){const o=yt(e,i,s);l[s]?l[s].p(o,n):(l[s]=wt(o),l[s].c(),l[s].m(t,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=i.length}12&n&&s!==(s=w(e[2]||e[3])+" svelte-5xpzvo")&&O(t,"class",s),1&n&&O(t,"id",e[0]),1&n&&O(t,"name",e[0])},i:p,o:p,d(e){e&&I(t),F(l,e),o=!1,r()}}}function kt(e,t,n){const s=A();let{id:o}=t,{item:r}=t,{value:i}=t,{noForm:l=!1}=t,{classId:a}=t;const{enum:c,readonly:d}=r.properties;return e.$$set=e=>{"id"in e&&n(0,o=e.id),"item"in e&&n(7,r=e.item),"value"in e&&n(1,i=e.value),"noForm"in e&&n(2,l=e.noForm),"classId"in e&&n(3,a=e.classId)},[o,i,l,a,c,d,e=>s("blur",{value:e.srcElement.value}),r]}class It extends ge{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=_("style")).id="svelte-5xpzvo-style",t.textContent="select.svelte-5xpzvo.svelte-5xpzvo{padding:0 0.625em 0.0625em;box-sizing:border-box;width:100%;border:0 solid rgba(0, 0, 0, 0.42);border-bottom-width:0px;border-bottom-width:0.0625em;border-top-left-radius:0.375em;border-top-right-radius:0.375em;background-color:#f5f5f5;outline:none;font-size:1rem;font-weight:300;height:2.8em}select.svelte-5xpzvo.svelte-5xpzvo:focus{border:none;border-bottom:2px solid #4300b0}select[readonly].svelte-5xpzvo option.svelte-5xpzvo{display:none}",x(document.head,t)),he(this,e,kt,xt,b,{id:0,item:7,value:1,noForm:2,classId:3})}}const Ft=/\d+/g,_t=/%[HMSpPdmyY%]/g;function St(e){let t;return{c(){t=E("Stunden")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function Et(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[St]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4096&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Ct(e){let t;return{c(){t=E("Minuten")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function Dt(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[Ct]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4096&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Nt(e){let t;return{c(){t=E("Jetzt")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function Ot(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[Nt]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4096&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function jt(e){let t,n,s,o,r,i,l,a,c;return o=new e[5]({props:{value:e[0],closeOnSelection:!0}}),o.$on("change",e[8]),i=new e[6]({props:{value:e[0],$$slots:{"now-label":[Ot],"minutes-label":[Dt],"hours-label":[Et]},$$scope:{ctx:e}}}),i.$on("change",e[7]),{c(){t=_("input"),s=C(),fe(o.$$.fragment),r=C(),fe(i.$$.fragment),O(t,"type","string"),O(t,"class",n=e[2]||e[3]),O(t,"id",e[1]),O(t,"name",e[1]),t.hidden=!0},m(n,d){k(n,t,d),z(t,e[0]),k(n,s,d),pe(o,n,d),k(n,r,d),pe(i,n,d),l=!0,a||(c=N(t,"input",e[9]),a=!0)},p(e,[s]){(!l||12&s&&n!==(n=e[2]||e[3]))&&O(t,"class",n),(!l||2&s)&&O(t,"id",e[1]),(!l||2&s)&&O(t,"name",e[1]),1&s&&z(t,e[0]);const r={};1&s&&(r.value=e[0]),o.$set(r);const a={};1&s&&(a.value=e[0]),4096&s&&(a.$$scope={dirty:s,ctx:e}),i.$set(a)},i(e){l||(le(o.$$.fragment,e),le(i.$$.fragment,e),l=!0)},o(e){ae(o.$$.fragment,e),ae(i.$$.fragment,e),l=!1},d(e){e&&I(t),e&&I(s),$e(o,e),e&&I(r),$e(i,e),a=!1,c()}}}function zt(e,t,n){const s=A(),{Label:o,DatePicker:r,TimePicker:i}=c;let{value:l}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>s("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,l=e.value),"id"in e&&n(1,a=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[l,a,d,u,o,r,i,({detail:e})=>{var t,s;n(0,(t=e.value,s=l,l=null==t||null==s?t:(s.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),s))),m(l)},({detail:e})=>{var t,s;n(0,(t=e.value,s=l,l=null==t||null==s?t:(s.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),s))),m(l)},function(){l=this.value,n(0,l)}]}class Lt extends ge{constructor(e){super(),he(this,e,zt,jt,b,{value:0,id:1,noForm:2,classId:3})}}function Pt(e){let t,n,s;return n=new e[6]({props:{type:"string",inputClass:e[2]?"":" "+e[3],id:e[0],name:e[0],value:e[1],pattern:Tt,placeholder:Mt,readonly:e[4],disabled:e[5]}}),n.$on("change",e[7]),{c(){t=_("div"),fe(n.$$.fragment),L(t,"max-width","4em")},m(e,o){k(e,t,o),pe(n,t,null),s=!0},p(e,[t]){const s={};12&t&&(s.inputClass=e[2]?"":" "+e[3]),1&t&&(s.id=e[0]),1&t&&(s.name=e[0]),2&t&&(s.value=e[1]),16&t&&(s.readonly=e[4]),32&t&&(s.disabled=e[5]),n.$set(s)},i(e){s||(le(n.$$.fragment,e),s=!0)},o(e){ae(n.$$.fragment,e),s=!1},d(e){e&&I(t),$e(n)}}}const Tt="([01][0-9]|2[0-3]):([0-5][0-9])",Mt="";function Bt(e,t,n){const s=A(),{TextField:o}=c;let{id:r}=t,{item:i}=t,{value:l}=t,{noForm:a=!1}=t,{classId:d}=t,{readonly:u}=t,{disabled:m}=t;const f=e=>{if(!e)return"";const[t,n]=e.split(":");return 4===t.length?`${t.substr(0,2)}:${t.substring(2,4)}`:3===t.length?t.substring(0,2)>23?`0${t.substring(0,1)}:${t.substring(1,3)}`:`${t.substring(0,2)}:${t.substring(2,3)}0`:2===t.length?t>23?`0${t.substring(0,1)}:${t.substring(1,2)}0`:`${t}:${(n||"0").padStart(2,"0")}`:`0${t}:${(n||"0").padStart(2,"0")}`};return e.$$set=e=>{"id"in e&&n(0,r=e.id),"item"in e&&n(8,i=e.item),"value"in e&&n(1,l=e.value),"noForm"in e&&n(2,a=e.noForm),"classId"in e&&n(3,d=e.classId),"readonly"in e&&n(4,u=e.readonly),"disabled"in e&&n(5,m=e.disabled)},[r,l,a,d,u,m,o,({detail:e})=>{s("blur",{value:f(e.value)})},i]}class qt extends ge{constructor(e){super(),he(this,e,Bt,Pt,b,{id:0,item:8,value:1,noForm:2,classId:3,readonly:4,disabled:5})}}function At(e){let t,n;return t=new e[9]({props:{inputClass:e[1]||e[2],disabled:e[4],readonly:e[13],required:e[12],id:e[16],name:e[15],value:e[6]()}}),t.$on("change",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};6&n&&(s.inputClass=e[1]||e[2]),16&n&&(s.disabled=e[4]),64&n&&(s.value=e[6]()),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Wt(e){let t,n;return t=new e[9]({props:{inputClass:e[1]||e[2],disabled:e[4],readonly:e[13],required:e[12],type:"email",id:e[16],name:e[15],value:e[6]()}}),t.$on("change",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};6&n&&(s.inputClass=e[1]||e[2]),16&n&&(s.disabled=e[4]),64&n&&(s.value=e[6]()),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Ht(e){let t,n;return t=new qt({props:{inputClass:e[1]||e[2],disabled:e[4],readonly:e[13],required:e[12],id:e[16],item:e[0],value:e[6]()}}),t.$on("blur",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};6&n&&(s.inputClass=e[1]||e[2]),16&n&&(s.disabled=e[4]),1&n&&(s.item=e[0]),64&n&&(s.value=e[6]()),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Rt(e){let t,n;return t=new Lt({props:{classId:e[2],id:e[16],disabled:e[4],required:e[12],value:e[17](),noForm:e[1]}}),t.$on("change",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4&n&&(s.classId=e[2]),16&n&&(s.disabled=e[4]),2&n&&(s.noForm=e[1]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Yt(e){let t,n;return t=new e[11]({props:{inputClass:e[1]||e[2],required:e[12],disabled:e[4],id:e[16],name:e[15],value:e[17](),closeOnSelection:!0}}),t.$on("change",e[18](!0)),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};6&n&&(s.inputClass=e[1]||e[2]),16&n&&(s.disabled=e[4]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Gt(e){let t,n;return t=new e[10]({props:{inputClass:e[1]||e[2],disabled:e[4],readonly:e[13],required:e[12],id:e[16],name:e[15],value:e[6]()}}),t.$on("change",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};6&n&&(s.inputClass=e[1]||e[2]),16&n&&(s.disabled=e[4]),64&n&&(s.value=e[6]()),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Vt(e){let t,n;return t=new It({props:{classId:e[2],disabled:e[4],required:e[12],id:e[16],item:e[0],value:e[6](),noForm:e[1]}}),t.$on("blur",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4&n&&(s.classId=e[2]),16&n&&(s.disabled=e[4]),1&n&&(s.item=e[0]),64&n&&(s.value=e[6]()),2&n&&(s.noForm=e[1]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Jt(e){let t,n;return t=new bt({props:{classId:e[2],disabled:e[4],required:e[12],readonly:e[13],id:e[16],item:e[0],value:e[6](),noForm:e[1]}}),t.$on("blur",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4&n&&(s.classId=e[2]),16&n&&(s.disabled=e[4]),1&n&&(s.item=e[0]),64&n&&(s.value=e[6]()),2&n&&(s.noForm=e[1]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Ut(e){let t,n;return t=new s({props:{classId:e[2],disabled:e[4],readonly:e[13],id:e[16],name:e[0].name,value:e[6](),noForm:e[1]}}),t.$on("blur",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4&n&&(s.classId=e[2]),16&n&&(s.disabled=e[4]),1&n&&(s.name=e[0].name),64&n&&(s.value=e[6]()),2&n&&(s.noForm=e[1]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Kt(e){let t,n;return t=new ht({props:{classId:e[2],eventId:e[3],disabled:e[4],readonly:e[13],id:e[16],item:e[0],desc:e[7],value:e[6](),noForm:e[1],selectionFields:e[5]}}),t.$on("task",e[23]),t.$on("change",e[18]()),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4&n&&(s.classId=e[2]),8&n&&(s.eventId=e[3]),16&n&&(s.disabled=e[4]),1&n&&(s.item=e[0]),128&n&&(s.desc=e[7]),64&n&&(s.value=e[6]()),2&n&&(s.noForm=e[1]),32&n&&(s.selectionFields=e[5]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Qt(e){let t,n,s,o;const r=[Kt,Ut,Jt,Vt,Gt,Yt,Rt,Ht,Wt,At],i=[];function l(e,t){return"object"===e[0].type?0:"textarea"===e[0].type||e[0].properties&&"textarea"===e[0].properties.format?1:"number"===e[0].type?2:e[0].properties&&e[0].properties.enum?3:"boolean"===e[0].type?4:"date"===e[0].type?5:"datetime"===e[0].type?6:"time"===e[0].properties?.format?7:"email"===e[0].type?8:9}return t=l(e),n=i[t]=r[t](e),{c(){n.c(),s=D()},m(e,n){i[t].m(e,n),k(e,s,n),o=!0},p(e,o){let a=t;t=l(e),t===a?i[t].p(e,o):(re(),ae(i[a],1,1,(()=>{i[a]=null})),ie(),n=i[t],n?n.p(e,o):(n=i[t]=r[t](e),n.c()),le(n,1),n.m(s.parentNode,s))},i(e){o||(le(n),o=!0)},o(e){ae(n),o=!1},d(e){i[t].d(e),e&&I(s)}}}function Xt(e){let t,n;return t=new e[8]({props:{id:e[19](e[16]),class:e[14]&&"hidden",name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[Qt]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,[n]){const s={};1&n&&(s.name=e[0].designation),1&n&&(s.help=e[0].properties?.hint),268435711&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Zt(e,t,n){let s,o;const r=A(),{FormField:i,TextField:l,Switch:a,DatePicker:u,TimePicker:m}=c;let{praefix:f=""}=t,{item:p}=t,{listName:$=""}=t,{record:h}=t,{noForm:g=!1}=t,{classId:v}=t,{eventId:b}=t,{disabled:y}=t,{selectionFields:w}=t;const x=p.properties?.required,k=p.properties?.readonly,I=p.properties?.hidden;if("string"==typeof p.name){const[e,t]=p.name.split("_");t&&(p.name=t)}const F=($?$+".":"")+p.name,_=F+(""!==f?"-"+f:""),S=(e,t=F)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};return e.$$set=e=>{"praefix"in e&&n(21,f=e.praefix),"item"in e&&n(0,p=e.item),"listName"in e&&n(22,$=e.listName),"record"in e&&n(20,h=e.record),"noForm"in e&&n(1,g=e.noForm),"classId"in e&&n(2,v=e.classId),"eventId"in e&&n(3,b=e.eventId),"disabled"in e&&n(4,y=e.disabled),"selectionFields"in e&&n(5,w=e.selectionFields)},e.$$.update=()=>{1048576&e.$$.dirty&&n(6,s=(e=F)=>{let t=S(h);return void 0===t?"":t})},n(7,o=((e=F)=>{let t=h["_"+e];return t=d(t),void 0===t?"":t})()),[p,g,v,b,y,w,s,o,i,l,a,u,x,k,I,F,_,(e=F)=>{let t=S(h);return t?new Date(t):new Date},e=>({detail:t})=>{const s=t.value;n(20,h[F]=e?function(e,t){if(null==e)return null;let n=e.getHours();return/%p/i.test(t)&&(n%=12,0===n&&(n=12)),t.replace("%Y",e.getFullYear()).replace("%y",(e.getFullYear()%100).toString().padStart(2,"0")).replace("%m",(e.getMonth()+1).toString().padStart(2,"0")).replace("%d",e.getDate().toString().padStart(2,"0")).replace("%H",n.toString().padStart(2,"0")).replace("%M",e.getMinutes().toString().padStart(2,"0")).replace("%S",e.getSeconds().toString().padStart(2,"0")).replace("%p",e.getHours()<12?"am":"pm").replace("%P",e.getHours()<12?"AM":"PM").replace("%%","%")}(s,"%d.%m.%Y"):s,h);const o=Object.values(h).every((e=>!e))&&s;r("notify",{value:s,add:o,itemName:F,desc:t.description})},()=>"object"===p.type?"comment_"+_:_,h,f,$,function(t){W(e,t)}]}class en extends ge{constructor(e){var t;super(),document.getElementById("svelte-9h2mb5-style")||((t=_("style")).id="svelte-9h2mb5-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em}.field .switch{padding-top:0.75em}",x(document.head,t)),he(this,e,Zt,Xt,b,{praefix:21,item:0,listName:22,record:20,noForm:1,classId:2,eventId:3,disabled:4,selectionFields:5})}}const{document:tn}=ue;function nn(e,t,n){const s=e.slice();return s[39]=t[n],s[41]=n,s}function sn(e,t,n){const s=e.slice();return s[48]=t[n],s}function on(e,t,n){const s=e.slice();return s[43]=t[n].title,s[44]=t[n].toDelete,s[45]=t[n].icon,s}function rn(e){let t,n,s;function o(t){e[24](t)}let r={item:e[15],disabled:!0};return void 0!==e[7]&&(r.value=e[7]),t=new bt({props:r}),R.push((()=>me(t,"value",o))),{c(){fe(t.$$.fragment)},m(e,n){pe(t,e,n),s=!0},p(e,s){const o={};!n&&128&s[0]&&(n=!0,o.value=e[7],X((()=>n=!1))),t.$set(o)},i(e){s||(le(t.$$.fragment,e),s=!0)},o(e){ae(t.$$.fragment,e),s=!1},d(e){$e(t,e)}}}function ln(e){let t,n,s;function o(t){e[25](t)}let r={item:e[13],disabled:!0};return void 0!==e[6]&&(r.value=e[6]),t=new bt({props:r}),R.push((()=>me(t,"value",o))),{c(){fe(t.$$.fragment)},m(e,n){pe(t,e,n),s=!0},p(e,s){const o={};!n&&64&s[0]&&(n=!0,o.value=e[6],X((()=>n=!1))),t.$set(o)},i(e){s||(le(t.$$.fragment,e),s=!0)},o(e){ae(t.$$.fragment,e),s=!1},d(e){$e(t,e)}}}function an(e){let t,n;return t=new en({props:{praefix:e[41],item:e[48],eventId:e[2],record:e[39],noForm:gn,classId:e[1],disabled:e[3],selectionFields:e[16]}}),t.$on("notify",(function(){v(e[18](e[48],e[41]))&&e[18](e[48],e[41]).apply(this,arguments)})),t.$on("task",e[26]),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(n,s){e=n;const o={};1&s[0]&&(o.item=e[48]),4&s[0]&&(o.eventId=e[2]),16&s[0]&&(o.record=e[39]),2&s[0]&&(o.classId=e[1]),8&s[0]&&(o.disabled=e[3]),t.$set(o)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function cn(e){let t,n,s,o,r=e[0].item,i=[];for(let t=0;t<r.length;t+=1)i[t]=an(sn(e,r,t));const l=e=>ae(i[e],1,1,(()=>{i[e]=null}));return{c(){t=_("div");for(let e=0;e<i.length;e+=1)i[e].c();s=C(),O(t,"id",n=`accordion-content-${e[1]}-${e[0].name}-${e[41]}`)},m(e,n){k(e,t,n);for(let e=0;e<i.length;e+=1)i[e].m(t,null);k(e,s,n),o=!0},p(e,s){if(327711&s[0]){let n;for(r=e[0].item,n=0;n<r.length;n+=1){const o=sn(e,r,n);i[n]?(i[n].p(o,s),le(i[n],1)):(i[n]=an(o),i[n].c(),le(i[n],1),i[n].m(t,null))}for(re(),n=r.length;n<i.length;n+=1)l(n);ie()}(!o||3&s[0]&&n!==(n=`accordion-content-${e[1]}-${e[0].name}-${e[41]}`))&&O(t,"id",n)},i(e){if(!o){for(let e=0;e<r.length;e+=1)le(i[e]);o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ae(i[e]);o=!1},d(e){e&&I(t),F(i,e),e&&I(s)}}}function dn(e){let t,n,s=e[17](e[5],e[41])+"";return{c(){t=_("span"),n=E(s),O(t,"class","svelte-1qryc5b"),P(t,"delete",e[39]._delete)},m(e,s){k(e,t,s),x(t,n)},p(e,o){32&o[0]&&s!==(s=e[17](e[5],e[41])+"")&&j(n,s),16&o[0]&&P(t,"delete",e[39]._delete)},d(e){e&&I(t)}}}function un(e){let t,n,s;var o=e[45];return o&&(t=new o({props:{size:"20"}})),{c(){t&&fe(t.$$.fragment),n=D()},m(e,o){t&&pe(t,e,o),k(e,n,o),s=!0},p(e,s){if(o!==(o=e[45])){if(t){re();const e=t;ae(e.$$.fragment,1,0,(()=>{$e(e,1)})),ie()}o?(t=new o({props:{size:"20"}}),fe(t.$$.fragment),le(t.$$.fragment,1),pe(t,n.parentNode,n)):t=null}},i(e){s||(t&&le(t.$$.fragment,e),s=!0)},o(e){t&&ae(t.$$.fragment,e),s=!1},d(e){e&&I(n),t&&$e(t,e)}}}function mn(e){let t,n,s,o,r,i=!e[3]&&un(e);return{c(){t=_("span"),i&&i.c(),O(t,"class","pointer icon svelte-1qryc5b"),O(t,"title",e[43]),t.hidden=n=e[41]===e[4].length-1||!(e[39]._delete^e[44])},m(n,l){k(n,t,l),i&&i.m(t,null),s=!0,o||(r=N(t,"click",e[20](e[41])),o=!0)},p(o,r){(e=o)[3]?i&&(re(),ae(i,1,1,(()=>{i=null})),ie()):i?(i.p(e,r),8&r[0]&&le(i,1)):(i=un(e),i.c(),le(i,1),i.m(t,null)),(!s||16&r[0]&&n!==(n=e[41]===e[4].length-1||!(e[39]._delete^e[44])))&&(t.hidden=n)},i(e){s||(le(i),s=!0)},o(e){ae(i),s=!1},d(e){e&&I(t),i&&i.d(),o=!1,r()}}}function fn(e){let t,n,s,o,r;n=new e[9]({props:{$$slots:{default:[dn]},$$scope:{ctx:e}}}),n.$on("click",(function(){v(e[19](e[42],e[41]))&&e[19](e[42],e[41]).apply(this,arguments)}));let i=[{title:"löschen",toDelete:!0,icon:ke},{title:"undo",toDelete:!1,icon:ye}],l=[];for(let t=0;t<2;t+=1)l[t]=mn(on(e,i,t));const a=e=>ae(l[e],1,1,(()=>{l[e]=null}));return{c(){t=_("div"),fe(n.$$.fragment),s=C();for(let e=0;e<2;e+=1)l[e].c();o=C(),O(t,"class","accordion svelte-1qryc5b"),O(t,"slot","handle")},m(e,i){k(e,t,i),pe(n,t,null),x(t,s);for(let e=0;e<2;e+=1)l[e].m(t,null);x(t,o),r=!0},p(s,r){e=s;const c={};if(48&r[0]|1048576&r[1]&&(c.$$scope={dirty:r,ctx:e}),n.$set(c),1048600&r[0]){let n;for(i=[{title:"löschen",toDelete:!0,icon:ke},{title:"undo",toDelete:!1,icon:ye}],n=0;n<2;n+=1){const s=on(e,i,n);l[n]?(l[n].p(s,r),le(l[n],1)):(l[n]=mn(s),l[n].c(),le(l[n],1),l[n].m(t,o))}for(re(),n=2;n<2;n+=1)a(n);ie()}},i(e){if(!r){le(n.$$.fragment,e);for(let e=0;e<2;e+=1)le(l[e]);r=!0}},o(e){ae(n.$$.fragment,e),l=l.filter(Boolean);for(let e=0;e<2;e+=1)ae(l[e]);r=!1},d(e){e&&I(t),$e(n),F(l,e)}}}function pn(e){let t,n;return t=new e[11]({props:{$$slots:{handle:[fn,({toggle:e})=>({42:e}),({toggle:e})=>[0,e?2048:0]],default:[cn,({toggle:e})=>({42:e}),({toggle:e})=>[0,e?2048:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){v(e[38])&&e[38].apply(this,arguments)})),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(n,s){e=n;const o={};63&s[0]|1050624&s[1]&&(o.$$scope={dirty:s,ctx:e}),t.$set(o)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function $n(e){let t,n,s=e[4],o=[];for(let t=0;t<s.length;t+=1)o[t]=pn(nn(e,s,t));const r=e=>ae(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,s){for(let t=0;t<o.length;t+=1)o[t].m(e,s);k(e,t,s),n=!0},p(e,n){if(2031679&n[0]|2176&n[1]){let i;for(s=e[4],i=0;i<s.length;i+=1){const r=nn(e,s,i);o[i]?(o[i].p(r,n),le(o[i],1)):(o[i]=pn(r),o[i].c(),le(o[i],1),o[i].m(t.parentNode,t))}for(re(),i=s.length;i<o.length;i+=1)r(i);ie()}},i(e){if(!n){for(let e=0;e<s.length;e+=1)le(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ae(o[e]);n=!1},d(e){F(o,e),e&&I(t)}}}function hn(e){let t,n,s,o,r,i=e[14]&&function(e){let t,n;return t=new e[8]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[rn]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};128&n[0]|1048576&n[1]&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}(e),l=e[12]&&function(e){let t,n;return t=new e[8]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[ln]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};64&n[0]|1048576&n[1]&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}(e);return o=new e[10]({props:{$$slots:{default:[$n,({closeOtherPanels:e})=>({38:e}),({closeOtherPanels:e})=>[0,e?128:0]]},$$scope:{ctx:e}}}),{c(){t=_("div"),i&&i.c(),n=C(),l&&l.c(),s=C(),fe(o.$$.fragment),O(t,"class","formList")},m(e,a){k(e,t,a),i&&i.m(t,null),x(t,n),l&&l.m(t,null),x(t,s),pe(o,t,null),r=!0},p(e,t){e[14]&&i.p(e,t),e[12]&&l.p(e,t);const n={};63&t[0]|1048704&t[1]&&(n.$$scope={dirty:t,ctx:e}),o.$set(n)},i(e){r||(le(i),le(l),le(o.$$.fragment,e),r=!0)},o(e){ae(i),ae(l),ae(o.$$.fragment,e),r=!1},d(e){e&&I(t),i&&i.d(),l&&l.d(),$e(o)}}}const gn=!0;function vn(e,n,s){let o,r;const{FormField:i,TextField:l,Button:a,Accordion:f,AccordionSection:p}=c,$=A();let{list:h}=n,{schema:g}=n,{record:v}=n,{classId:b}=n,{eventId:y}=n,{disabled:w}=n;const x=g.find((e=>"price"===e.name&&!e.properties?.hidden)),k=x&&g.find((e=>"quantity"===e.name));let I=0;const F=g.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let _=0;const S={};let E,C,D=[];g.filter((e=>e.selection)).map((e=>D.push({refClass:e.selection,value:""})));const N=(e,t)=>{if(!t)return;const n=g.find((e=>e.name===t)),o=n.properties.value.formula,{operator:r,argument:i}=o,l=i.map((t=>E[e][t.refItem]));let a=0;"$add"===r&&(a=l.reduce(((e,t)=>e+ +t))),"$subtract"===r&&(a=l.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,s]=e.split(":");e=s?(+n+ +s/60).toFixed(2):+n;const[o,r]=t.split(":");return o?e-=r?(+o+ +r/60).toFixed(2):+o:0}))),s(4,E[e][t]=(a||0).toFixed(n.properties.decimals||0),E)};C=g.filter((e=>e.refClass)).reduce((async(e,n)=>{e=await e;const s=g.filter((e=>e.refItem===n.refClass));if(!s?.length)return e;t.getSchemaByClass(n.refClass);const o={refClass:n.refClass,items:[]};return s.forEach((e=>{o.items.push(e.name)})),e.push(o),e}),[]);const O=async(e,t,n)=>{const o=(await C).find((e=>e.refClass===t.refClass));if(!o)return;const{refClass:r,items:i}=o;return n?Promise.all(i.map((n=>{let o="";const{refInput:i}=t;if(i&&E[e]){const[t,n]=i.split(".");o=n?E[e][n]:v[t]}if(i&&!o||j(e,n)){const o=g.find((e=>e.refClass===r)),i=E[e][o.name];if(t.selection){const o=Xn(t.selection+i.toString());if(o)return Promise.resolve(o).then((t=>s(4,E[e][n]=t[n],E)))}return Promise.resolve(Zn(o.refClass,i)).then((t=>s(4,E[e][n]=t[n],E)))}}))):Promise.resolve(i.map((t=>{s(4,E[e][t]="",E)})))},j=(e,t)=>{let n=E[e][t];return"number"===g.find((e=>e.name===t)).type&&(n=Number(n||0)),!n};return g.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=g.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))})),e.$$set=e=>{"list"in e&&s(0,h=e.list),"schema"in e&&s(21,g=e.schema),"record"in e&&s(22,v=e.record),"classId"in e&&s(1,b=e.classId),"eventId"in e&&s(2,y=e.eventId),"disabled"in e&&s(3,w=e.disabled)},e.$$.update=()=>{4194305&e.$$.dirty[0]&&v&&s(4,E=(v[h.name]||[]).concat({})),16&e.$$.dirty[0]&&s(5,o=E),49&e.$$.dirty[0]&&o&&((()=>{if(F)s(7,_=E?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(x)s(6,I=E?.reduce(((e,t)=>{if(t.price){const n=(k?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),$("save",{listName:h.name,value:E})),8388608&e.$$.dirty[0]&&(r=e=>S[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[h,b,y,w,E,o,I,_,i,a,f,p,x,{name:"amountValue",properties:{decimals:2}},F,{name:"hoursValue",properties:{decimals:2}},D,(e,t)=>{const n=e[t];return g.filter((e=>!e.properties?.hidden&&void 0!==n[e.name]&&"textarea"!==e.properties?.format)).map((e=>"object"===e.type?r(n[e.name]):"boolean"===e.type?m(n[e.name]):"date"===e.type?d(n[e.name]):"datetime"===e.type?u(n[e.name]):n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>({detail:n})=>{const{value:r,add:i,desc:l}=n;N(t,e._formulaActor);const a=D?.find((t=>t.refClass.split(":")[1].split(".")[0]===e.refClass));a&&(a.value=r),r&&E.length===t+1&&s(4,E=E.concat({})),l&&s(23,S[r]=l,S),O(t,e,r),s(5,o=E)},(e,t)=>n=>{e(n);const s=`#accordion-content-${b}-${h.name}-${t} div.form-field:last-child`,o=document.querySelector(s);K().then((()=>o.scrollIntoView({behavior:"smooth",block:"end"})))},e=>()=>{s(4,E[e]._delete=!E[e]._delete,E)},g,v,S,function(e){_=e,s(7,_)},function(e){I=e,s(6,I)},function(t){W(e,t)}]}class bn extends ge{constructor(e){var t;super(),tn.getElementById("svelte-1qryc5b-style")||((t=_("style")).id="svelte-1qryc5b-style",t.textContent=".accordion.svelte-1qryc5b{display:flex;overflow:hidden}.formList .accordion > .btn{display:inline-block;margin-bottom:1em;background-color:#F5F5F5}.sTask .formList .accordion .btn{width:95% !important}.sEmbedded .formList .accordion .btn{width:97%}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}span.pointer.svelte-1qryc5b{padding-top:1em}span.delete.svelte-1qryc5b{text-decoration:line-through}.icon.svelte-1qryc5b{margin-right:-0.75em}.formList .formField_italic{font-style:italic}",x(tn.head,t)),he(this,e,vn,hn,b,{list:0,schema:21,record:22,classId:1,eventId:2,disabled:3},[-1,-1])}}const{document:yn}=ue;function wn(e,t,n){const s=e.slice();return s[17]=t[n],s}function xn(e){let t,n;return t=new en({props:{classId:e[2],item:e[17],listName:e[1].name,eventId:e[3],record:e[0],disabled:e[4]}}),t.$on("notify",e[10]),t.$on("task",e[13]),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};4&n&&(s.classId=e[2]),2&n&&(s.item=e[17]),2&n&&(s.listName=e[1].name),8&n&&(s.eventId=e[3]),1&n&&(s.record=e[0]),16&n&&(s.disabled=e[4]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function kn(e){let t,n,s,o=e[1].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=xn(wn(e,o,t));const i=e=>ae(r[e],1,1,(()=>{r[e]=null}));return{c(){t=_("div");for(let e=0;e<r.length;e+=1)r[e].c();O(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){k(e,t,n);for(let e=0;e<r.length;e+=1)r[e].m(t,null);s=!0},p(e,l){if(1055&l){let n;for(o=e[1].item,n=0;n<o.length;n+=1){const s=wn(e,o,n);r[n]?(r[n].p(s,l),le(r[n],1)):(r[n]=xn(s),r[n].c(),le(r[n],1),r[n].m(t,null))}for(re(),n=o.length;n<r.length;n+=1)i(n);ie()}(!s||6&l&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&O(t,"id",n)},i(e){if(!s){for(let e=0;e<o.length;e+=1)le(r[e]);s=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)ae(r[e]);s=!1},d(e){e&&I(t),F(r,e)}}}function In(e){let t,n,s=e[9](e[5])+"";return{c(){t=_("span"),n=E(s)},m(e,s){k(e,t,s),x(t,n)},p(e,t){32&t&&s!==(s=e[9](e[5])+"")&&j(n,s)},d(e){e&&I(t)}}}function Fn(e){let t,n,s;return n=new e[6]({props:{$$slots:{default:[In]},$$scope:{ctx:e}}}),n.$on("click",(function(){v(e[11](e[16]))&&e[11](e[16]).apply(this,arguments)})),{c(){t=_("div"),fe(n.$$.fragment),O(t,"class","accordion svelte-148ktt9"),O(t,"slot","handle")},m(e,o){k(e,t,o),pe(n,t,null),s=!0},p(t,s){e=t;const o={};1048608&s&&(o.$$scope={dirty:s,ctx:e}),n.$set(o)},i(e){s||(le(n.$$.fragment,e),s=!0)},o(e){ae(n.$$.fragment,e),s=!1},d(e){e&&I(t),$e(n)}}}function _n(e){let t,n;return t=new e[8]({props:{$$slots:{handle:[Fn,({toggle:e})=>({16:e}),({toggle:e})=>e?65536:0],default:[kn,({toggle:e})=>({16:e}),({toggle:e})=>e?65536:0]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1114175&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Sn(e){let t,n,s;return n=new e[7]({props:{$$slots:{default:[_n]},$$scope:{ctx:e}}}),{c(){t=_("div"),fe(n.$$.fragment),O(t,"class","formList")},m(e,o){k(e,t,o),pe(n,t,null),s=!0},p(e,[t]){const s={};1048639&t&&(s.$$scope={dirty:t,ctx:e}),n.$set(s)},i(e){s||(le(n.$$.fragment,e),s=!0)},o(e){ae(n.$$.fragment,e),s=!1},d(e){e&&I(t),$e(n)}}}function En(e,t,n){const{Button:s,Accordion:o,AccordionSection:r}=c;let{list:i}=t,{schema:l}=t,{record:a}=t,{classId:f}=t,{eventId:p}=t,{disabled:$}=t;const h={};let g=a[i.name]||{};a[i.name]=g;const v=e=>h[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · ");return e.$$set=e=>{"list"in e&&n(1,i=e.list),"schema"in e&&n(12,l=e.schema),"record"in e&&n(0,a=e.record),"classId"in e&&n(2,f=e.classId),"eventId"in e&&n(3,p=e.eventId),"disabled"in e&&n(4,$=e.disabled)},[a,i,f,p,$,g,s,o,r,e=>l.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format)).map((t=>"object"===t.type?v(t.name):"boolean"===t.type?m(e[t.name]):"date"===t.type?d(e[t.name]):"datetime"===t.type?u(e[t.name]):e[t.name])).filter((e=>!!e)).join(" • ")||"+",({detail:e})=>{const[t,s]=e.itemName.split(".");if(!s)return;e.desc&&(h[s]=e.desc);const o=a[t];n(0,a[t]={...o,[s]:e.value},a),n(5,g=a[t])},e=>t=>{e(t);const n=`#accordion-content-${f}-${i.name} div.form-field:last-child`,s=document.querySelector(n);K().then((()=>s.scrollIntoView({behavior:"smooth",block:"end"})))},l,function(t){W(e,t)}]}class Cn extends ge{constructor(e){var t;super(),yn.getElementById("svelte-148ktt9-style")||((t=_("style")).id="svelte-148ktt9-style",t.textContent=".accordion.svelte-148ktt9{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}",x(yn.head,t)),he(this,e,En,Sn,b,{list:1,schema:12,record:0,classId:2,eventId:3,disabled:4})}}const{Boolean:Dn,document:Nn}=ue;function On(e,t,n){const s=e.slice();return s[41]=t[n],s}function jn(e,t,n){const s=e.slice();return s[44]=t[n],s}function zn(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function Ln(e){let t,n,s=e[40]&&function(e){let t,n,s,o,r,i,l,a,c,d,u,m,f,p,$,h,g,v=e[0].items,b=[];for(let t=0;t<v.length;t+=1)b[t]=Tn(jn(e,v,t));const y=e=>ae(b[e],1,1,(()=>{b[e]=null}));let S=e[0].list&&Mn(e);return m=new e[5]({props:{outline:!0,$$slots:{default:[Wn]},$$scope:{ctx:e}}}),m.$on("click",e[11]),p=new e[5]({props:{disabled:e[2],form:e[6],filled:!0,type:"submit",$$slots:{default:[Hn]},$$scope:{ctx:e}}}),{c(){t=_("section"),n=_("form"),s=_("input"),r=C();for(let e=0;e<b.length;e+=1)b[e].c();i=C(),S&&S.c(),l=C(),a=_("div"),c=_("small"),c.textContent=`${ns}`,d=C(),u=_("div"),fe(m.$$.fragment),f=C(),fe(p.$$.fragment),O(s,"class",w(e[6])+" svelte-1dh1s6w"),O(s,"name","_id"),O(s,"type","hidden"),s.value=o=e[1]._id||"",O(n,"class",w(e[7])+" svelte-1dh1s6w"),O(n,"id",e[6]),O(a,"class","comment svelte-1dh1s6w"),O(u,"class","form--buttons svelte-1dh1s6w"),O(t,"class",w(e[8])+" svelte-1dh1s6w")},m(o,v){k(o,t,v),x(t,n),x(n,s),x(n,r);for(let e=0;e<b.length;e+=1)b[e].m(n,null);var y;x(n,i),S&&S.m(n,null),x(t,l),x(t,a),x(a,c),x(t,d),x(t,u),pe(m,u,null),x(u,f),pe(p,u,null),$=!0,h||(g=N(n,"submit",(y=e[10],function(e){return e.preventDefault(),y.call(this,e)})),h=!0)},p(e,t){if((!$||2&t[0]&&o!==(o=e[1]._id||""))&&(s.value=o),4167&t[0]){let s;for(v=e[0].items,s=0;s<v.length;s+=1){const o=jn(e,v,s);b[s]?(b[s].p(o,t),le(b[s],1)):(b[s]=Tn(o),b[s].c(),le(b[s],1),b[s].m(n,i))}for(re(),s=v.length;s<b.length;s+=1)y(s);ie()}e[0].list?S?(S.p(e,t),1&t[0]&&le(S,1)):(S=Mn(e),S.c(),le(S,1),S.m(n,null)):S&&(re(),ae(S,1,1,(()=>{S=null})),ie());const r={};65536&t[1]&&(r.$$scope={dirty:t,ctx:e}),m.$set(r);const l={};4&t[0]&&(l.disabled=e[2]),65536&t[1]&&(l.$$scope={dirty:t,ctx:e}),p.$set(l)},i(e){if(!$){for(let e=0;e<v.length;e+=1)le(b[e]);le(S),le(m.$$.fragment,e),le(p.$$.fragment,e),$=!0}},o(e){b=b.filter(Dn);for(let e=0;e<b.length;e+=1)ae(b[e]);ae(S),ae(m.$$.fragment,e),ae(p.$$.fragment,e),$=!1},d(e){e&&I(t),F(b,e),S&&S.d(),$e(m),$e(p),h=!1,g()}}}(e);return{c(){s&&s.c(),t=D()},m(e,o){s&&s.m(e,o),k(e,t,o),n=!0},p(e,t){e[40]&&s.p(e,t)},i(e){n||(le(s),n=!0)},o(e){ae(s),n=!1},d(e){s&&s.d(e),e&&I(t)}}}function Pn(e){let t,n;return t=new en({props:{classId:e[6],item:e[44],record:e[1],disabled:e[2],eventId:e[0].id}}),t.$on("task",e[12]),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n[0]&&(s.item=e[44]),2&n[0]&&(s.record=e[1]),4&n[0]&&(s.disabled=e[2]),1&n[0]&&(s.eventId=e[0].id),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function Tn(e){let t,n,s="list"!==e[44].type&&Pn(e);return{c(){s&&s.c(),t=D()},m(e,o){s&&s.m(e,o),k(e,t,o),n=!0},p(e,n){"list"!==e[44].type?s?(s.p(e,n),1&n[0]&&le(s,1)):(s=Pn(e),s.c(),le(s,1),s.m(t.parentNode,t)):s&&(re(),ae(s,1,1,(()=>{s=null})),ie())},i(e){n||(le(s),n=!0)},o(e){ae(s),n=!1},d(e){s&&s.d(e),e&&I(t)}}}function Mn(e){let t,n,s=e[0].list,o=[];for(let t=0;t<s.length;t+=1)o[t]=An(On(e,s,t));const r=e=>ae(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,s){for(let t=0;t<o.length;t+=1)o[t].m(e,s);k(e,t,s),n=!0},p(e,n){if(8263&n[0]){let i;for(s=e[0].list,i=0;i<s.length;i+=1){const r=On(e,s,i);o[i]?(o[i].p(r,n),le(o[i],1)):(o[i]=An(r),o[i].c(),le(o[i],1),o[i].m(t.parentNode,t))}for(re(),i=s.length;i<o.length;i+=1)r(i);ie()}},i(e){if(!n){for(let e=0;e<s.length;e+=1)le(o[e]);n=!0}},o(e){o=o.filter(Dn);for(let e=0;e<o.length;e+=1)ae(o[e]);n=!1},d(e){F(o,e),e&&I(t)}}}function Bn(e){let t,n;return t=new Cn({props:{classId:e[6],list:e[41],eventId:e[0].id,schema:e[41].item,record:e[1],disabled:e[2]}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n[0]&&(s.list=e[41]),1&n[0]&&(s.eventId=e[0].id),1&n[0]&&(s.schema=e[41].item),2&n[0]&&(s.record=e[1]),4&n[0]&&(s.disabled=e[2]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function qn(e){let t,n;return t=new bn({props:{classId:e[6],list:e[41],eventId:e[0].id,schema:e[41].item,record:e[1],disabled:e[2]}}),t.$on("save",e[13]),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n[0]&&(s.list=e[41]),1&n[0]&&(s.eventId=e[0].id),1&n[0]&&(s.schema=e[41].item),2&n[0]&&(s.record=e[1]),4&n[0]&&(s.disabled=e[2]),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function An(e){let t,n,s,o,r,i;t=new e[4]({props:{text:e[41].designation}});const l=[qn,Bn],a=[];function c(e,t){return"array"===e[41].type?0:1}return s=c(e),o=a[s]=l[s](e),{c(){fe(t.$$.fragment),n=C(),o.c(),r=D()},m(e,o){pe(t,e,o),k(e,n,o),a[s].m(e,o),k(e,r,o),i=!0},p(e,n){const i={};1&n[0]&&(i.text=e[41].designation),t.$set(i);let d=s;s=c(e),s===d?a[s].p(e,n):(re(),ae(a[d],1,1,(()=>{a[d]=null})),ie(),o=a[s],o?o.p(e,n):(o=a[s]=l[s](e),o.c()),le(o,1),o.m(r.parentNode,r))},i(e){i||(le(t.$$.fragment,e),le(o),i=!0)},o(e){ae(t.$$.fragment,e),ae(o),i=!1},d(e){$e(t,e),e&&I(n),a[s].d(e),e&&I(r)}}}function Wn(e){let t;return{c(){t=E("Abbrechen")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function Hn(e){let t;return{c(){t=E("Speichern")},m(e,n){k(e,t,n)},d(e){e&&I(t)}}}function Rn(e){return{c:p,m:p,p:p,i:p,o:p,d:p}}function Yn(e){let t,n,s,o;Nn.title=t=e[3];let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Rn,then:Ln,catch:zn,value:40,blocks:[,,,]};return ce(e[9](),r),{c(){n=C(),s=D(),r.block.c()},m(e,t){k(e,n,t),k(e,s,t),r.block.m(e,r.anchor=t),r.mount=()=>s.parentNode,r.anchor=s,o=!0},p(n,s){e=n,(!o||8&s[0])&&t!==(t=e[3])&&(Nn.title=t),de(r,e,s)},i(e){o||(le(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){ae(r.blocks[e])}o=!1},d(e){e&&I(n),e&&I(s),r.block.d(e),r.token=null,r=null}}}let Gn=new Map,Vn=new Map,Jn=new Map;const Un=(e,n)=>{const s=n;return Gn.has(s)||Gn.set(s,t.getTasksList(n).then((({data:e})=>e))),Gn.get(s)},Kn=(e,n,s)=>Vn.get(s)||Un(e,n).then((n=>n.find((({_id:e})=>e===s))||t.getTaskList(e,s))).then((e=>(Vn.set(s,e),e))),Qn=(e,t)=>{Jn.set(e,t)},Xn=e=>Jn.get(e),Zn=(e,n)=>Jn.get(n)||t.getTask(e,n).then((e=>(Jn.set(n,e),e))),es=(e,n)=>{if(!Gn.get(n))return;const s=n;Gn.set(s,t.getTasksList(n).then((({data:e})=>e)))},ts=()=>{Gn=new Map,Vn=new Map,Jn=new Map};let ns="";function ss(e,s,a){let d,u,m,p;y(e,i,(e=>a(24,m=e))),y(e,l,(e=>a(25,p=e)));const{Divider:$,Button:h}=c,g=JSON.parse(o.getItem("Locale")),v=A();let b,w,{schema:x}=s,{recID:k}=s,{prevEventID:I=!1}=s,{prev:F=!1}=s,{taskId:_=!1}=s,{description:S=""}=s,{root:E=!1}=s,{readonly:C}=s,D={},N={},O="form-"+x.class+Math.floor(9e3*Math.random()+1e3).toString();const j=E?"fEmbedded":"fTask",z=E?"sEmbedded":"sTask",L=async()=>{if(!x.input)return;if(!x.input.length)return;if(x.input.length<2)return;const e=await t.getEvent(x.id),n=!e.input.class[0].name&&e.input.class[0].selection;if(!n)return;const s=e.input.class[1].name,o=e.input.class[1].destination?.split(".")[0];if(!s||!o)return;const r=x.list?.find((e=>e.name===s));if(!r)return;const i=await t.getSchemaByClass(n),l=(await t.getTasks(i.id)).data;if(!l?.length)return;const c=[];for(const e of l){const t={};for(const n of r.item)n.name===o?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);c.push(t)}c.length&&a(1,D[s]=c,D)},P=()=>{for(const e of x.items)e.properties?.value?.concatenation&&T(e)},T=async e=>{const t=e.properties.value.concatenation;let n="";for(const e of t)void 0!==e.constant&&(n+=e.constant),"year"===e.variable&&(n+=(new Date).getFullYear()),e.refItemNext&&(n+=await M(e.refItemNext));a(1,D[e.name]=n,D)},M=async e=>{const[n,s]=e.offset?.split(",")||[0,0],o=+e.base||0,r=+e.step||1;e.type;const i=e.refItem,l=await t.getLastId(x.class,i);if(!l?.length)return(o+r).toString().padStart(s,"0");return((+l[0][i]?.substring(n,n+s)||o)+r).toString().padStart(s,"0")},B=(e,t)=>{const n=t.name,s=e.find((e=>e.name===n));let o=t.value;if(o&&s&&s.type.startsWith("date"))try{return function(e,t,n){const s=Math.floor((new Date).getFullYear()/100);let o=!1;if(""===e)return null;const r=t.split(_t);let i=0,l=0;const a=new Date(0);for(const c of r){if(!e.startsWith(c,i))return n;if(i+=c.length,i===e.length){if(l!==t.length)return n;break}if("%"!==t[l+c.length])break;if(l+=c.length+1,"%"===t[l]){if("%"!==e[i])return n;i++}else if("p"===t[l].toLowerCase()){const t=e.substr(i,2).toUpperCase();if("AM"===t)o=!1,a.getHours()>=12&&a.setHours(a.getHours()-12);else{if("PM"!==t)return n;o=!0,a.getHours()<12&&a.setHours(a.getHours()+12)}}else{Ft.lastIndex=i;const r=Ft.exec(e);if(null==r)return n;switch(t[l]){case"H":a.setHours(parseInt(r[0])+12*o);break;case"M":a.setMinutes(r[0]);break;case"S":a.setSeconds(r[0]);break;case"d":a.setDate(r[0]);break;case"m":a.setMonth(r[0]-1);break;case"y":a.setFullYear(100*s+parseInt(r[0]));break;case"Y":a.setFullYear(r[0])}i+=r[0].length}l++}return isNaN(a.valueOf())?n:a}(o,"%d.%m.%Y").toISOString()}catch{return new Date(o).toISOString()}if(s&&"boolean"===s.type&&(o=!!t.checked),s&&"number"===s.type){const e=Number("1.1").toLocaleString(g.id).substring(1,2);try{o=Number(o.replace(e,".")).toString()}catch{}}return o},W=()=>E?window.singleSpaNavigate("/"):v("back"),H=async(e,n)=>{if(x.input?.length>1){if(x.input[0]!==e)return;if(n){const s=await t.getTaskOptions(`${e}:${n}`,x.id);a(1,D={...D,...s})}else{const e=x.input.slice(1);for(const t of e)a(1,D[t]=[],D)}}};return n.subscribe((async e=>{if(!e)return;if(!Gn.get(e.eventId))return;const n=await t.getTaskList(x.class,e.taskId);((e,t,n)=>{if(!Gn.get(e))return;const s=t;Vn.set(s,n)})(e.eventId,e.taskId,n)})),q(ts),e.$$set=e=>{"schema"in e&&a(0,x=e.schema),"recID"in e&&a(18,k=e.recID),"prevEventID"in e&&a(16,I=e.prevEventID),"prev"in e&&a(19,F=e.prev),"taskId"in e&&a(17,_=e.taskId),"description"in e&&a(14,S=e.description),"root"in e&&a(20,E=e.root),"readonly"in e&&a(15,C=e.readonly)},e.$$.update=()=>{32768&e.$$.dirty[0]&&a(2,d=C),6291457&e.$$.dirty[0]&&w&&b&&x.items.map((({name:e,type:t})=>{const n=b.items.find((t=>t.name===e));if(!n)return;if(t!==n.type)return;const s="_"+e;w[e]&&a(1,D[e]=w[e],D),w[s]&&a(1,D[s]=w[s],D)})),1064960&e.$$.dirty[0]&&a(3,u=E?S||"enablerr - Form":document.title)},[x,D,d,u,$,h,O,j,z,async()=>{if(k&&(a(1,D=await t.getTask(x.class,k)),a(14,S=f(x,D))),I){a(15,C=!1),a(21,b=await t.getSchema(I)),"string"==typeof F&&a(22,w=await t.getTask(b.class,F));const e=x.items.find((e=>e.refClass===b.class));a(1,D[e.name]=w._id,D)}const e=await t.getEvent(x.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some((e=>"Manual"===e.type))&&a(15,C=!0),m.role?.length&&x.authorization?.length){const e=x.authorization.some((e=>p?.find((t=>t===e.role&&"edit"===e.activity))));a(15,C||=!e)}return k||(P(),L()),!0},async()=>{k||a(2,d=!0);const e={};Array.from(document.querySelectorAll("form#"+O+" ."+O)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,s]=t.name.split("."),o=x.list.find((e=>e.name===n));e[t.name]=B(o.item,t)}else e[t.name]=B(x.items,t)})),x.list&&x.list.map((t=>{"array"===t.type&&N[t.name]&&(e[t.name]=N[t.name].reduce(((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce(((e,[n,s])=>("_delete"!==n&&(e[n]=B(t.item,{name:n,value:s,checked:s})),e)),{}))),[]))})),e._event=x.id,e._prevEventId=I,e._taskId=_;const{id:n,task:s,error:o}=await t.saveData(x.class,e);if(o?.text){const e=o.field?" in "+o.field+": "+o.value:"";return r.failed(`${o.text} ${e}`,3e3),void a(2,d=!1)}r.success("Die Daten wurden gespeichert.",2e3),e._id=n;const i=await t.getTaskList(x.class,n);v("choose",{row:i}),E&&!k?window.singleSpaNavigate(`/task/${x.id}/${s}/task`):W()},()=>I?window.history.back():W(),async({detail:{row:e}})=>{if(k)return;await(async()=>{for(const e of x.items)if(e.refItem&&D[e.refItem]){const n=await t.getTask(e.refItem,D[e.refItem]);n&&a(1,D[e.name]=n[e.name],D)}for(const e of x.list||[])if(e.refItem&&D[e.refItem]){const n=await t.getTask(e.refItem,D[e.refItem]),s=[];for(const t of n[e.name]){const n={};for(const s of e.item)t[s.name]&&(n[s.name]=t[s.name]);s.push(n)}a(1,D[e.name]=s,D)}})();const n=e._task.event,s=await t.getEvent(n),o=await t.getEvent(x.id);if(!o.output?.class?.length)return;const r=o.output.class[0]?.item.find((e=>e.name===s.output.class[0]?.name));(o.input?.class?.length&&o.input.class[0]?.name===s.output.class[0]?.name||r?.asInput)&&(a(21,b=await t.getSchema(n)),a(16,I=n),a(17,_=e._task._id),a(22,w=!!_&&await t.getTask(b.class,e._task.docId)),H(b.class,e?._task?.docId))},({detail:e})=>{N[e.listName]=e.value},S,C,I,_,k,F,E,b,w]}class os extends ge{constructor(e){var t;super(),Nn.getElementById("svelte-1dh1s6w-style")||((t=_("style")).id="svelte-1dh1s6w-style",t.textContent="form.disabled.svelte-1dh1s6w input.svelte-1dh1s6w{background-color:red !important}.comment.svelte-1dh1s6w.svelte-1dh1s6w{color:green;margin-bottom:1em}form.svelte-1dh1s6w.svelte-1dh1s6w{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1dh1s6w.svelte-1dh1s6w{min-width:30em}}.fEmbedded.svelte-1dh1s6w.svelte-1dh1s6w,.fTask.svelte-1dh1s6w.svelte-1dh1s6w{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1dh1s6w.svelte-1dh1s6w{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1dh1s6w.svelte-1dh1s6w{height:fit-content;max-height:70vh}.sTask.svelte-1dh1s6w.svelte-1dh1s6w{height:95%;display:inline-grid}.sTask.svelte-1dh1s6w .btn.svelte-1dh1s6w{display:initial !important}.form--buttons.svelte-1dh1s6w.svelte-1dh1s6w{display:flex;gap:1em;padding-bottom:0.5em}",x(Nn.head,t)),he(this,e,ss,Yn,b,{schema:0,recID:18,prevEventID:16,prev:19,taskId:17,description:14,root:20,readonly:15},[-1,-1])}}function rs(e){let t,n,s;function o(t){e[4](t)}let r={schema:e[5],recID:e[6]};return void 0!==e[0]&&(r.description=e[0]),t=new os({props:r}),R.push((()=>me(t,"description",o))),t.$on("back",e[2]),{c(){fe(t.$$.fragment)},m(e,n){pe(t,e,n),s=!0},p(e,s){const o={};32&s&&(o.schema=e[5]),64&s&&(o.recID=e[6]),!n&&1&s&&(n=!0,o.description=e[0],X((()=>n=!1))),t.$set(o)},i(e){s||(le(t.$$.fragment,e),s=!0)},o(e){ae(t.$$.fragment,e),s=!1},d(e){$e(t,e)}}}function is(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[rs,({prop:{schema:e,recID:t,eventID:n}})=>({5:e,6:t,7:n}),({prop:e})=>(e?32:0)|(e?64:0)|(e?128:0)]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,[n]){const s={};1&n&&(s.description=e[0]),353&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ae(t.$$.fragment,e),n=!1},d(e){$e(t,e)}}}function ls(e,n,s){let o,{refresh:r}=n;return e.$$set=e=>{"refresh"in e&&s(3,r=e.refresh)},[o,(e,n)=>t.getSchema(e).then((t=>({schema:t,recID:n,eventID:e,title:t.identity.designation}))),e=>{},r,function(e){o=e,s(0,o)}]}function as(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cs,ds,us=(cs=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function s(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?n(Object(s),!0).forEach((function(t){o(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!==r(e))throw new Error("single-spa-svelte requires a configuration object");var t=s(s({},i),e);if(!t.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:l.bind(null,t,n),mount:a.bind(null,t,n),unmount:c.bind(null,t,n),update:d.bind(null,t,n)}};var i={component:null,domElementGetter:null,props:{}};function l(e){return Promise.resolve()}function a(e,t,n){var o=Object.keys(i),r=Object.keys(e).reduce((function(t,n){return o.includes(n)||(t[n]=e[n]),t}),{});return Promise.resolve().then((function(){var o=function(e,t){return(t=t&&t.customProps?t.customProps:t).domElement?function(){return t.domElement}:t.domElementGetter?function(){return t.domElementGetter(t)}:e.domElementGetter?function(){return e.domElementGetter(t)}:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)}(e,n),i=o();t.instance=new e.component(s(s({},r),{},{target:i,props:Object.assign({},n,e.props)}))}))}function c(e,t){return Promise.resolve().then((function(){t.instance.$destroy?t.instance.$destroy():t.instance.destroy()}))}function d(e,t,n){return Promise.resolve().then((function(){t.instance.$set?t.instance.$set(n):t.instance.set(n)}))}},cs(ds={exports:{}},ds.exports),ds.exports);const ms=as(us)({component:class extends ge{constructor(e){super(),he(this,e,ls,is,b,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:fs,mount:ps,unmount:$s}=ms;e({bootstrap:fs,mount:ps,unmount:$s});e("Form",os),e("List",Ue)}}}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@enablerr-ui/detail",
3
3
  "description": "enablerr - the Next Enterprise Solution",
4
- "version": "0.2.208",
4
+ "version": "0.2.210",
5
5
  "os": [
6
6
  "darwin",
7
7
  "linux"